Skip to content

Commit 1c6cf99

Browse files
authored
build(angular): upgrade to angular 20 with primeng v20 (#206)
* build(angular): upgrade to angular 20 and fix ssr authentication LFXV2-900 ## Angular 20 Upgrade Changes - Updated @angular/ssr to 20.3.13 - Migrated from provideServerRouting to provideServerRendering(withRoutes()) - Updated @angular/forms peer dependency in shared package to ^20.3.15 - Updated component imports to use provideAnimationsAsync ## SSR Authentication Fix - Changed Express middleware default SSR auth from 'optional' to 'required' - Simplified auth guard to trust Express middleware during SSR - Express now redirects unauthenticated users before Angular SSR runs - Prevents protected content from being visible during SSR ## Files Changed - apps/lfx-one/src/server/middleware/auth.middleware.ts - apps/lfx-one/src/app/shared/guards/auth.guard.ts - apps/lfx-one/src/app/app.config.server.ts - apps/lfx-one/package.json - packages/shared/package.json Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <[email protected]> * build(deps): upgrade primeng to v20 with component api updates LFXV2-900 - Upgrade primeng from ^19.1.4 to ^20.4.0 - Migrate @primeng/themes to @primeuix/themes (^2.0.2) - Update @linuxfoundation/lfx-ui-core to ^0.1.0 - Remove deprecated properties (badgeClass, transition options) - Update severity mappings (primary -> contrast for messages) - Adjust component templates for PrimeNG v20 API changes - Fix tag severity mapping for compatibility Signed-off-by: Asitha de Silva <[email protected]> * refactor(angular): replace CommonModule with specific imports Remove CommonModule imports and replace with specific directives and pipes (NgClass, DatePipe, TitleCasePipe) as required by each component. This follows Angular 19+ best practices for standalone components with built-in control flow syntax (@if, @for, @switch). 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <[email protected]> --------- Signed-off-by: Asitha de Silva <[email protected]>
1 parent 52ded8f commit 1c6cf99

File tree

164 files changed

+2862
-2382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+2862
-2382
lines changed

apps/lfx-one/angular.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,6 @@
162162
},
163163
"extract-i18n": {
164164
"builder": "@angular-devkit/build-angular:extract-i18n"
165-
},
166-
"test": {
167-
"builder": "@angular-devkit/build-angular:karma",
168-
"options": {
169-
"polyfills": ["zone.js", "zone.js/testing"],
170-
"tsConfig": "tsconfig.spec.json",
171-
"inlineStyleLanguage": "scss",
172-
"assets": [
173-
{
174-
"glob": "**/*",
175-
"input": "public"
176-
}
177-
],
178-
"styles": ["src/styles.scss"],
179-
"scripts": []
180-
}
181165
}
182166
}
183167
}

apps/lfx-one/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@
2323
},
2424
"private": true,
2525
"dependencies": {
26-
"@angular/animations": "^19.2.14",
27-
"@angular/cdk": "^19.2.19",
28-
"@angular/common": "^19.2.14",
29-
"@angular/compiler": "^19.2.14",
30-
"@angular/core": "^19.2.14",
31-
"@angular/forms": "^19.2.14",
32-
"@angular/platform-browser": "^19.2.14",
33-
"@angular/platform-browser-dynamic": "^19.2.14",
34-
"@angular/platform-server": "^19.2.14",
35-
"@angular/router": "^19.2.14",
36-
"@angular/ssr": "^19.2.15",
26+
"@angular/animations": "^20.3.15",
27+
"@angular/cdk": "^20.2.14",
28+
"@angular/common": "^20.3.15",
29+
"@angular/compiler": "^20.3.15",
30+
"@angular/core": "^20.3.15",
31+
"@angular/forms": "^20.3.15",
32+
"@angular/platform-browser": "^20.3.15",
33+
"@angular/platform-browser-dynamic": "^20.3.15",
34+
"@angular/platform-server": "^20.3.15",
35+
"@angular/router": "^20.3.15",
36+
"@angular/ssr": "^20.3.13",
3737
"@fullcalendar/angular": "^6.1.19",
3838
"@fullcalendar/core": "^6.1.19",
3939
"@fullcalendar/daygrid": "^6.1.19",
4040
"@fullcalendar/timegrid": "^6.1.19",
4141
"@lfx-one/shared": "workspace:*",
42-
"@linuxfoundation/lfx-ui-core": "^0.0.21",
42+
"@linuxfoundation/lfx-ui-core": "^0.1.0",
4343
"@openfeature/core": "^1.9.1",
4444
"@openfeature/launchdarkly-client-provider": "^0.3.3",
4545
"@openfeature/web-sdk": "^1.7.1",
46-
"@primeng/themes": "^19.1.4",
46+
"@primeuix/themes": "^2.0.2",
4747
"compression": "^1.8.1",
4848
"dotenv": "^17.2.1",
4949
"express": "^4.18.2",
@@ -52,18 +52,18 @@
5252
"nats": "^2.29.3",
5353
"ngx-cookie-service-ssr": "^19.1.2",
5454
"pino-http": "^10.5.0",
55-
"primeng": "^19.1.4",
55+
"primeng": "^20.4.0",
5656
"rxjs": "~7.8.2",
5757
"snowflake-sdk": "^2.3.1",
5858
"tslib": "^2.8.1"
5959
},
6060
"devDependencies": {
61-
"@angular-devkit/build-angular": "^19.2.15",
61+
"@angular-devkit/build-angular": "^20.3.8",
6262
"@angular-eslint/eslint-plugin": "^19.8.1",
6363
"@angular-eslint/eslint-plugin-template": "^19.8.1",
6464
"@angular-eslint/template-parser": "^19.8.1",
65-
"@angular/cli": "^19.2.15",
66-
"@angular/compiler-cli": "^19.2.14",
65+
"@angular/cli": "^20.3.13",
66+
"@angular/compiler-cli": "^20.3.15",
6767
"@eslint/compat": "^1.3.2",
6868
"@eslint/eslintrc": "^3.3.1",
6969
"@eslint/js": "^9.33.0",
@@ -88,6 +88,6 @@
8888
"prettier-plugin-tailwindcss": "^0.6.14",
8989
"tailwindcss": "^3.4.17",
9090
"tailwindcss-primeui": "^0.6.1",
91-
"typescript": "~5.7.2"
91+
"typescript": "~5.9.3"
9292
}
9393
}

apps/lfx-one/src/app/app.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { CommonModule } from '@angular/common';
54
import { Component, inject, makeStateKey, REQUEST_CONTEXT, TransferState } from '@angular/core';
65
import { RouterOutlet } from '@angular/router';
76
import { AuthContext } from '@lfx-one/shared/interfaces';
@@ -15,7 +14,7 @@ import { UserService } from './shared/services/user.service';
1514

1615
@Component({
1716
selector: 'lfx-root',
18-
imports: [RouterOutlet, CommonModule, ToastModule],
17+
imports: [RouterOutlet, ToastModule],
1918
templateUrl: './app.component.html',
2019
styleUrl: './app.component.scss',
2120
})

apps/lfx-one/src/app/app.config.server.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
// SPDX-License-Identifier: MIT
33

44
import { ApplicationConfig, mergeApplicationConfig } from '@angular/core';
5-
import { provideServerRendering } from '@angular/platform-server';
6-
import { provideServerRouting } from '@angular/ssr';
5+
import { provideServerRendering, withRoutes } from '@angular/ssr';
76

87
import { appConfig } from './app.config';
98
import { serverRoutes } from './app.routes.server';
109

1110
const serverConfig: ApplicationConfig = {
12-
providers: [provideServerRendering(), provideServerRouting(serverRoutes)],
11+
providers: [provideServerRendering(withRoutes(serverRoutes))],
1312
};
1413

1514
export const config = mergeApplicationConfig(appConfig, serverConfig);

apps/lfx-one/src/app/app.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// SPDX-License-Identifier: MIT
33

44
import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/http';
5-
import { ApplicationConfig, provideExperimentalZonelessChangeDetection } from '@angular/core';
5+
import { ApplicationConfig, provideZonelessChangeDetection } from '@angular/core';
66
import { provideClientHydration, withEventReplay, withHttpTransferCacheOptions, withIncrementalHydration } from '@angular/platform-browser';
77
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
88
import { provideRouter, withInMemoryScrolling, withPreloading } from '@angular/router';
99
import { lfxPreset } from '@linuxfoundation/lfx-ui-core';
10-
import { definePreset } from '@primeng/themes';
11-
import Aura from '@primeng/themes/aura';
10+
import { definePreset } from '@primeuix/themes';
11+
import Aura from '@primeuix/themes/aura';
1212
import { authenticationInterceptor } from '@shared/interceptors/authentication.interceptor';
1313
import { ConfirmationService, MessageService } from 'primeng/api';
1414
import { providePrimeNG } from 'primeng/config';
@@ -23,12 +23,12 @@ const customPreset = definePreset(Aura, {
2323
semantic: lfxPreset.semantic,
2424
components: {
2525
...lfxPreset.component,
26-
},
26+
} as any,
2727
});
2828

2929
export const appConfig: ApplicationConfig = {
3030
providers: [
31-
provideExperimentalZonelessChangeDetection(),
31+
provideZonelessChangeDetection(),
3232
provideRouter(routes, withPreloading(CustomPreloadingStrategy), withInMemoryScrolling({ scrollPositionRestoration: 'top' })),
3333
provideClientHydration(withEventReplay(), withIncrementalHydration(), withHttpTransferCacheOptions({ includeHeaders: ['Authorization'] })),
3434
provideHttpClient(withFetch(), withInterceptors([authenticationInterceptor])),

apps/lfx-one/src/app/layouts/main-layout/main-layout.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { CommonModule } from '@angular/common';
54
import { Component, computed, CUSTOM_ELEMENTS_SCHEMA, inject } from '@angular/core';
65
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
76
import { NavigationEnd, Router, RouterModule } from '@angular/router';
@@ -17,8 +16,7 @@ import { filter } from 'rxjs';
1716

1817
@Component({
1918
selector: 'lfx-main-layout',
20-
standalone: true,
21-
imports: [CommonModule, RouterModule, SidebarComponent, DrawerModule],
19+
imports: [RouterModule, SidebarComponent, DrawerModule],
2220
templateUrl: './main-layout.component.html',
2321
styleUrl: './main-layout.component.scss',
2422
schemas: [CUSTOM_ELEMENTS_SCHEMA],

apps/lfx-one/src/app/layouts/project-layout/project-layout.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { CommonModule } from '@angular/common';
54
import { Component, computed, inject, input, Signal, signal } from '@angular/core';
65
import { toSignal } from '@angular/core/rxjs-interop';
76
import { ActivatedRoute, RouterModule } from '@angular/router';
@@ -14,8 +13,7 @@ import { of, switchMap } from 'rxjs';
1413

1514
@Component({
1615
selector: 'lfx-project-layout',
17-
standalone: true,
18-
imports: [CommonModule, RouterModule, HeaderComponent, ChipModule],
16+
imports: [RouterModule, HeaderComponent, ChipModule],
1917
templateUrl: './project-layout.component.html',
2018
styleUrl: './project-layout.component.scss',
2119
})

apps/lfx-one/src/app/modules/committees/committee-dashboard/committee-dashboard.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h1>{{ committeeLabelPlural }}</h1>
1919
<lfx-button
2020
[label]="'Create ' + committeeLabel"
2121
icon="fa-light fa-users mr-1"
22-
severity="primary"
22+
severity="info"
2323
size="small"
2424
(onClick)="openCreateDialog()"
2525
data-testid="committee-new-cta">

apps/lfx-one/src/app/modules/committees/committee-dashboard/committee-dashboard.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { CommonModule } from '@angular/common';
54
import { Component, computed, inject, signal, Signal, WritableSignal } from '@angular/core';
65
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
76
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
@@ -22,8 +21,7 @@ import { CommitteeTableComponent } from '../components/committee-table/committee
2221

2322
@Component({
2423
selector: 'lfx-committee-dashboard',
25-
standalone: true,
26-
imports: [CommonModule, ReactiveFormsModule, InputTextComponent, SelectComponent, ButtonComponent, CommitteeTableComponent],
24+
imports: [ReactiveFormsModule, InputTextComponent, SelectComponent, ButtonComponent, CommitteeTableComponent],
2725
templateUrl: './committee-dashboard.component.html',
2826
styleUrl: './committee-dashboard.component.scss',
2927
})

apps/lfx-one/src/app/modules/committees/committee-manage/committee-manage.component.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ <h1 data-testid="committee-manage-title">
8888
label="Previous"
8989
icon="fa-light fa-arrow-left"
9090
severity="secondary"
91-
[outlined]="true"
9291
size="small"
9392
[disabled]="isFirstStep()"
9493
(onClick)="previousStep()"
@@ -104,7 +103,6 @@ <h1 data-testid="committee-manage-title">
104103
<lfx-button
105104
[label]="isLastStep() ? 'Skip For Now' : 'Cancel'"
106105
severity="secondary"
107-
[outlined]="true"
108106
size="small"
109107
(onClick)="onCancel()"
110108
data-testid="committee-manage-cancel-btn">

0 commit comments

Comments
 (0)