Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1085: Migrate frontend to angular #896

Draft
wants to merge 80 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
19b730e
GUACAMOLE-1085: Remove AngularJS frontend
leonard2901 Jun 20, 2023
9a05d35
GUACAMOLE-1085: Add Angular frontend to src/main/guacamole-frontend
leonard2901 Jun 20, 2023
f58e79b
GUACAMOLE-1085: Update Angular to v16.1
leonard2901 Jun 20, 2023
912407c
GUACAMOLE-1085: Add Angular library guacamole-fronted-lib
leonard2901 Jun 20, 2023
1deaf90
GUACAMOLE-1085: Add Angular library guacamole-fronted-ext-lib
leonard2901 Jun 20, 2023
c9f1b7d
GUACAMOLE-1085: Include Angular projects in maven build
leonard2901 Jun 21, 2023
08481c1
GUACAMOLE-1085: Add the frontend-lib as a dependency to the frontend
leonard2901 Jun 21, 2023
e53049b
GUACAMOLE-1085: fix: the event service now handles subscribers correctly
leonard2901 Jun 22, 2023
5486271
GUACAMOLE-1085: Switch to Firefox for karma tests, remove empty test …
leonard2901 Jun 22, 2023
8b1ff1a
GUACAMOLE-1085: Add Cypress e2e tests for the frontend
leonard2901 Jun 22, 2023
ae22c9f
GUACAMOLE-1085: fix: reset password field after login failed
leonard2901 Jun 22, 2023
e04a30c
GUACAMOLE-1085: Add ESLint to the frontend project
leonard2901 Jun 22, 2023
d64df77
GUACAMOLE-1085: Fix some linter errors
leonard2901 Jun 22, 2023
904706e
GUACAMOLE-1085: Add Module Federation to app
leonard2901 Jun 22, 2023
2ea40e1
GUACAMOLE-1085: Move the form field service to the extension library
leonard2901 Jun 22, 2023
08c6963
GUACAMOLE-1085: Add the extension library as a dependency to the fron…
leonard2901 Jun 22, 2023
ecf222c
GUACAMOLE-1085: Add an example for an extension which adds routes and…
leonard2901 Jun 22, 2023
3f76c8d
GUACAMOLE-1085: Move the lib and ext-lib to the frontend workspace
leonard2901 Jun 23, 2023
25c4d96
GUACAMOLE-1085: Prefer event emitter rather than functions as inputs
leonard2901 Jun 23, 2023
eb7d86d
GUACAMOLE-1085: Fix client resizing and drop behaviour
leonard2901 Jun 23, 2023
f252afc
GUACAMOLE-1085: Set Angular version to 16.1.1
leonard2901 Jun 25, 2023
e953281
GUACAMOLE-1085: Add missing documentation
leonard2901 Jun 25, 2023
32b79ae
GUACAMOLE-1085: Migrate the guacGroupListFilter directive
leonard2901 Jun 26, 2023
4a95a01
GUACAMOLE-1085: Set the page title on the initial page load
leonard2901 Jun 27, 2023
249b634
GUACAMOLE-1085: Set the CSS body class on the initial page load
leonard2901 Jun 28, 2023
75caa9a
GUACAMOLE-1085: Refresh the session view after stopping sessions
leonard2901 Jun 28, 2023
41a68c8
GUACAMOLE-1085: Ensure new pages always start with clear keyboard state
leonard2901 Jun 28, 2023
a3a24bb
GUACAMOLE-1085: Migrate more components
leonard2901 Jun 28, 2023
8837e11
GUACAMOLE-1085: Fix sorting in data tables
leonard2901 Jun 29, 2023
105d16b
GUACAMOLE-1085: Fix some broken tests
leonard2901 Jun 29, 2023
bf3d74f
GUACAMOLE-1085: Complete extension loading via module federation
leonard2901 Jun 29, 2023
3c733b0
GUACAMOLE-1085: Clean up some TODOs
leonard2901 Jun 29, 2023
ba9f371
GUACAMOLE-1085: Rename form component inputs
leonard2901 Jun 29, 2023
7c1b4ee
GUACAMOLE-1085: Move canonicalize function to translation service
leonard2901 Jun 29, 2023
495d038
GUACAMOLE-1085: Migrate connection history player
leonard2901 Jun 30, 2023
12fed9e
GUACAMOLE-1085: Prefer single quotes and 'const'
leonard2901 Jun 30, 2023
18bd669
GUACAMOLE-1085: Use "@:...:@" to reference another translation file
leonard2901 Jun 30, 2023
9454450
GUACAMOLE-1085: Edit README files
leonard2901 Jun 30, 2023
cb3fde9
GUACAMOLE-1085: Exclude Angular build directories from RAT checks
leonard2901 Jun 30, 2023
082f0fb
GUACAMOLE-1085: Add dependency for jquery
leonard2901 Feb 6, 2024
3fd58af
GUACAMOLE-1085: Migrate IconService
leonard2901 Feb 6, 2024
c42933a
GUACAMOLE-1085: Show an empty cell in the user settings component if …
leonard2901 Feb 6, 2024
bb8acd6
GUACAMOLE-1085: Update JSDoc
leonard2901 Feb 19, 2024
c9a3476
GUACAMOLE-1085: Migrate ConnectionPermissionEditor Component
leonard2901 Feb 19, 2024
a11fa6d
GUACAMOLE-1085: Fix login form placeholder text
leonard2901 Feb 19, 2024
0274988
GUACAMOLE-1085: Fix IdentifierSetEditor Component
leonard2901 Feb 19, 2024
171ce5d
GUACAMOLE-1085: Add TODOs for missing JSDoc
leonard2901 Feb 21, 2024
4330d85
GUACAMOLE-1085: Fix Typo
leonard2901 Feb 21, 2024
7f18a7a
GUACAMOLE-1085: Fix in MangeConnection Component
leonard2901 Feb 21, 2024
5152456
GUACAMOLE-1085: Fix MangeConnectionGroup Component
leonard2901 Feb 21, 2024
b9b6f18
GUACAMOLE-1085: Migrate ManageSharingProfile Component
leonard2901 Feb 21, 2024
0d551ba
GUACAMOLE-1085: Fix form field alignment
leonard2901 Feb 21, 2024
866179e
GUACAMOLE-1085: Update user menu styles
leonard2901 Feb 22, 2024
8eca0e8
GUACAMOLE-1085: Reorder routes
leonard2901 Apr 12, 2024
2d13974
GUACAMOLE-1085: Add fallback route
leonard2901 Apr 12, 2024
17508a0
GUACAMOLE-1085: Migrate GuacDropDirective
leonard2901 Apr 12, 2024
158de95
GUACAMOLE-1085: Migrate connection import
leonard2901 Apr 15, 2024
7988955
GUACAMOLE-1085: Update .ratignore
leonard2901 Apr 17, 2024
b7f9a99
GUACAMOLE-1085: Update licence text
leonard2901 Apr 17, 2024
93a8a05
GUACAMOLE-1085: Update package-lock.json
leonard2901 Apr 17, 2024
314afef
GUACAMOLE-1085: Use TypeScript types form DefinitelyTyped for guacamo…
leonard2901 Apr 18, 2024
86f5c95
GUACAMOLE-1085: Organize imports
leonard2901 Apr 18, 2024
0774515
GUACAMOLE-1085: Reformat TypeScript code
leonard2901 Apr 18, 2024
855b6ce
GUACAMOLE-1085: Reformat HTML
leonard2901 Apr 18, 2024
a7c5f22
GUACAMOLE-1085: Fix missing inputs in connection form after changing …
leonard2901 Apr 18, 2024
8e2f8de
GUACAMOLE-1085: Migrate orderBy pipe
leonard2901 Apr 19, 2024
a028219
GUACAMOLE-1085: Fix types, import guacamole-common-js, migrate Angula…
leonard2901 Jan 7, 2025
96abe36
GUACAMOLE-1085: Clean up clipboard service
leonard2901 Jan 10, 2025
46f1c7f
GUACAMOLE-1085: Load styles with build info query param
leonard2901 Jan 10, 2025
c6f1044
GUACAMOLE-1085: Remove cypress and cypress tests cases
leonard2901 Jan 10, 2025
ea753c8
GUACAMOLE-1085: Migrate changes from main branch
leonard2901 Jan 13, 2025
7b80c28
GUACAMOLE-1085: use global window object insted of DI
leonard2901 Jan 14, 2025
ca75218
GUACAMOLE-1085: Update licence info
leonard2901 Jan 14, 2025
d02b700
GUACAMOLE-1085: Code cleanup/reformat
leonard2901 Jan 14, 2025
51b3cc3
GUACAMOLE-1085: Integrate angular tests in maven build
leonard2901 Jan 14, 2025
5e05a58
GUACAMOLE-1085: Copy guacamole-common-js to frontend
leonard2901 Jan 14, 2025
4148cf5
GUACAMOLE-1085: Remove notes about caching HTTP requests
leonard2901 Jan 15, 2025
fc021b2
GUACAMOLE-1085: Update to Angular 19, switch from module to native fe…
Jan 15, 2025
c40e82f
GUACAMOLE-1085: Remove more AngularJS Code
leonard2901 Jan 27, 2025
c637976
GUACAMOLE-1085: Migrate changes from main branch
leonard2901 Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
*~
target/

# IntelliJ IDEA
.idea

# MacOS
.DS_Store
42 changes: 42 additions & 0 deletions doc/guacamole-frontend-extension-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
47 changes: 47 additions & 0 deletions doc/guacamole-frontend-extension-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Frontend Extension Example

Adds global css styles, new routes (/guacamole/guacamole-angular-example and /guacamole/guacamole-angular-example/about)
and button below the "Logout" user menu.

[//]: # (TODO: Update for native federation)
## Setup

This project was generated with [Angular CLI](https://github.com/angular/angular-cli)
version 16.1.1 using the following steps:

```bash
# Create a new minimal Angular project
ng new guacamole-frontend-extension-example \
--minimal \
--prefix guac \
--routing \
--skip-tests \
--skip-install \
--standalone \
--view-encapsulation None

# ... manually set the version of @angular dependencies to "16.1.1" in the package.json

cd guacamole-frontend-extension-example

npm install

# Add support for module federation
ng add @angular-architects/module-federation --project guacamole-frontend-extension-example --type remote --port 4202

# Add the frontend extension library
npm install ..\..\guacamole\src\main\guacamole-frontend\dist\guacamole-frontend-ext-lib

```

Add `"src/app/extension.config.ts"` to `tsconfig.app.json` `files` array.


## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4202/`. The application will automatically reload if you change any of the source files.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
To package the artifacts for guacamole run `node ./package-extension.js`.
142 changes: 142 additions & 0 deletions doc/guacamole-frontend-extension-example/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"guacamole-frontend-extension-example": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"skipTests": true,
"standalone": true
},
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true,
"standalone": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:interceptor": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true,
"standalone": true
},
"@schematics/angular:resolver": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "guac",
"architect": {
"build": {
"builder": "@angular-architects/native-federation:build",
"options": {},
"configurations": {
"production": {
"target": "guacamole-frontend-extension-example:esbuild:production"
},
"development": {
"target": "guacamole-frontend-extension-example:esbuild:development",
"dev": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-architects/native-federation:build",
"options": {
"target": "guacamole-frontend-extension-example:serve-original:development",
"rebuildDelay": 0,
"dev": true,
"port": 0
}
},
"extract-i18n": {
"builder": "ngx-build-plus:extract-i18n",
"options": {
"browserTarget": "guacamole-frontend-extension-example:build",
"extraWebpackConfig": "webpack.config.js"
}
},
"esbuild": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": {
"base": "dist/guacamole-frontend-extension-example",
"browser": ""
},
"index": "src/index.html",
"polyfills": [
"zone.js",
"es-module-shims"
],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "*.html",
"input": "src/html",
"output": "html"
}
],
"styles": [
"src/styles.css"
],
"scripts": [],
"browser": "src/main.ts"
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve-original": {
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "guacamole-frontend-extension-example:esbuild:production"
},
"development": {
"buildTarget": "guacamole-frontend-extension-example:esbuild:development"
}
},
"defaultConfiguration": "development",
"options": {
"port": 4202
}
}
}
}
}
}
27 changes: 27 additions & 0 deletions doc/guacamole-frontend-extension-example/federation.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { withNativeFederation, shareAll } = require('@angular-architects/native-federation/config');

module.exports = withNativeFederation({

name: 'guacamole-frontend-extension-example',

exposes: {
'bootsrapExtension': './src/app/extension.config.ts',
'AboutExtensionButtonComponent': './src/app/components/about-extension-button.component.ts'
},

shared: {
...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto' }),
},

// Packages that should not be shared or are not needed at runtime
skip: [
'rxjs/ajax',
'rxjs/fetch',
'rxjs/testing',
'rxjs/webSocket'
]

// Please read our FAQ about sharing libs:
// https://shorturl.at/jmzH0

});
Loading
Loading