-
Notifications
You must be signed in to change notification settings - Fork 711
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
base: main
Are you sure you want to change the base?
GUACAMOLE-1085: Migrate frontend to angular #896
Conversation
… registers a new field type
…no information about the users last active date is known
Angular Components introduce new elements which interfere with the display: table CSS rule. The display: contents rule is used to ignore these elements inside the css table.
@leonard2901: when you are planning to release your guacamole-client-angular as a npm package? |
@suncase Thank you for you interest in the Angular client. As you can see in the description of the PR, there are still a few things I need to work on before this could possibly be merged. Unfortunately, I currently have less time for the project than I would have liked. So I can't tell you when this will be merged. That being said, I don't think the frontend of the Guacamole Client will be released as an npm package. |
This PR includes the current progress for the migration of the AngularJS frontend to Angular.
There is still a lot of work left to do, but I think now would be a good time to get some feedback on the code.
Overview
The new frontend consists of one Angular app and two Angular libraries:
guacamole-frontend
guacamole-frontend-lib
guacamole-frontend-ext-lib
The application and both libraries are included in the maven build.
TODOs:
index/services/iconService.js
manage/directives/connectionPermissionEditor.js
manage/controllers/manageSharingProfileController.js
projects/guacamole-frontend-lib/src/lib/types/Guacamole.ts
). They will be replaced by the package @types/guacamole-common-js once it is updated.The angular build creates a
3rdpartylicenses.txt
file, but I don't really know what to do with it.Any comments on this will be appreciated.
/guacamole/
Extensions
The biggest challenge in the migration was to build an extension system in Angular that was as flexible as the one in AngularJS.
apply-patches.service.ts
andstyle-loader.service.ts
in
projects/guacamole-frontend/src/app/index/services/
doc/guacamole-frontend-extension-example
for an example.projects/guacamole-frontend/src/moduleFederation/mf.manifest.json
) should be generated by the Java server in the futureImplementation notes
methods. Some of the more complex services are replaced by Angular services.
restrict: 'E'
,restrict: 'A'
.AuthenticationService.request()
)is replaced by a HTTP interceptor
(
auth/interceptor/authentication.interceptor.ts
).rest/services/requestService.js
) is replaced by a HTTP interceptor(
rest/interceptor/error-handling.interceptor.ts
).httpDefaults.js
) is replaced by an HTTPinterceptor (
index/config/default-headers.interceptor.ts
).InterceptorService
can be used.instead of the
@:
prefix. However, I change it to@:...:@
to prevent transcloco from removing parts of ICU messages (Bug(messageformat): Plural translation starting and ending with a variables fails jsverse/transloco#621).cypress
folder. The tests are not integrated in the build process, and I did notinclude a proper configuration file because of the various possible testing setups.
kept?
TunnelService~uploadToStream
TunnelService~downloadStream
UserCredentials.getLink
UserCredentialService~getLink
$parse
function of AngularJS I used the NPM package angular-expressionswhich is a copy of the AngularJS code as standalone module.
Running the code
For my setup the easiest way to run the code was to build the frontend with maven and use the war file in a docker-compose setup. Since the module federation config is hard coded for now there will be some errors when the example extension (
doc/guacamole-frontend-extension-example
) is not running (ng serve
) atlocalhost:4202
. If the extension is running, the content will be available at /extension-example.It is also possible to run the frontend using
ng serve
and benefit from live reloading with a way to work around the same origin policy (modify HTTP headers/proxy/disable web security). Therefore, the libraries need to be built manually:ng build guacamole-frontend-lib
andng build guacamole-frontend-ext-lib
. Additionally, the following code might be necessary to redirect the requests to the REST API:When using
ng serve
, the REST API from this branch should still be used.To run the Cypress test I used the following configuration to disable web security for Chrome: