Skip to content

chore(webapp): update to Angular 20 and PrimeNG 20 #1448

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

allan2
Copy link
Contributor

@allan2 allan2 commented Jul 31, 2025

This updates all deps in the webapp.

  • Sass imports are refactored to @use due to @import deprecation in dart-sass. Namespaces are explicitly set, .e.g., variables.$borderRadius
  • Angular components are all standalone
  • PrimeNG components are replaced with v20 versions using the migration guide
    • Defer, TriStateCheckbox, and VirtualScroller have no replacements but are unused, so they are removed
  • all other deps are updated to latest
  • TypeScript kept at 5.8.2 instead of 5.9 for Angular 20 compatibility
  • control flow switched to @if and @for

I did not re-alphabetize imports so it is easier for reviewers to see which components were replaced.

Copy link

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

@allan2
Copy link
Contributor Author

allan2 commented Jul 31, 2025

This supersedes #1447, which does not build due to issues with the Angular dependency.

FYI my formatter broke the alignment of attributes where it was previously like this:

<p-slider [(ngModel)]="slider.value"
          (onSlideEnd)="slider.onChange($event.value)"
          [min]="slider.min"
          [max]="slider.max"
          [step]="slider.step"></p-slider>

@CBenoit
Copy link
Member

CBenoit commented Aug 1, 2025

FYI my formatter broke the alignment of attributes where it was previously like this:

<p-slider [(ngModel)]="slider.value"
          (onSlideEnd)="slider.onChange($event.value)"
          [min]="slider.min"
          [max]="slider.max"
          [step]="slider.step"></p-slider>

I think this is fine?

Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates all deps in the webapp.

  • Sass imports are refactored to @use due to @import deprecation in dart-sass. Namespaces are explicitly set, .i.e., variables.$borderRadius

  • Angular components are all standalone

  • PrimeNG components are replaced with v20 versions using the migration guide

  • Defer, TriStateCheckbox, and VirtualScroller have no replacements but are unused, so they are removed

  • all other deps are updated to latest

  • TypeScript kept at 5.8.2 instead of 5.9 for Angular 20 compatibility

Thank you for the methodical and well-documented migration.
Have you tested the login form functionality specifically, given the p-messages deprecation?

Areas to check (and marked with a TODO comment):

  • login.component.html: The p-checkbox had a bound label. The label attribute has been deprecated so the formatting may have changed when we add the label separately

  • session-toolbar.component.html: p-messages is deprecated and replaced with p-message in the login-form-message

Is it something you will look into, or we should ask help to Irving and Krista?

There are still warnings for the ngIf control flow syntax. Full conversion to the new @if syntax can be done after this PR. I did not re-alphabetize imports so it is easier for reviewers to see which components were replaced.

Sounds good.
Did you also check if there were any runtime warnings or errors in the console after this upgrade?

allan2 added 7 commits August 1, 2025 08:14
With the switch to standalone compoennts, `AppModule` is no longer
needed.
I did not want to import `CommonModule` in every component to retain
`*ngIf` usage.
This is in the PrimeNG setup guide.
The login form only ever displays a single message, as the message list
is cleared.
This changes the interface from a list to a singular object. The
frontend is updated as well.

The served webapp now displays the initial message properly, i.e.,
"Login to Continue".
The client form is capable of displaying multiple error messages.
A loop is added with the new `Message` component to display them all.

The styling has not been visually checked.
@allan2
Copy link
Contributor Author

allan2 commented Aug 1, 2025

After my latest commits, there are no build warnings or errors.
The browser console displays no warnings up to the login page. I did not hook it up with the backend to check further.

Login form message are fixed (15f76ee).

Places to check for styling:

  • session toolbar checkbox
    • p-checkbox label is deprecated so I added a label element as per docs; styling may have changed
  • tab view component
    • TabView is deprecated. I have not checked the styling of the replacement Tabs (cc820ac)
  • client form messages
    • multiple messages are displayed, styling not checked (f1aa1fd)

If someone has a working Gateway config and can check, that would be great. Otherwise, I will set it up next week.

(click)="onToggleMenuGroupList($event)"
(mouseover)="onMenuGroupMouseOver()"
(mouseleave)="onMenuGroupMouseLeave()">
@if (hasHeader) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! This @if syntax is amazing!

Copy link
Contributor

@irvingoujAtDevolution irvingoujAtDevolution left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

Copy link
Contributor

@kristahouse kristahouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. That's a lot of changes! Great progress with v 20! Well done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants