Skip to content

Commit 8177a80

Browse files
committed
Revert "OHID-330 Angular 19 (#689)"
This reverts commit 0585d96.
1 parent 0585d96 commit 8177a80

198 files changed

Lines changed: 3521 additions & 3578 deletions

File tree

Some content is hidden

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

workspace/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,3 @@ Thumbs.db
4545
.nx/
4646
.nx/cache
4747
.nx/workspace-data
48-
.cursor/rules/nx-rules.mdc
49-
.github/instructions/nx.instructions.md

workspace/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ To build, run, and open a local in memory development server which will run at `
6262
nx serve APP_NAME
6363
```
6464

65-
other way of running using yarn is
66-
65+
other way of running using yarn is
6766
```bash
6867
yarn nx serve pidp
6968
```
@@ -76,12 +75,10 @@ To build the project and have the build artifacts stored in the `dist/` director
7675
nx build APP_NAME
7776
```
7877

79-
other way of building using yarn is
80-
78+
other way of building using yarn is
8179
```bash
8280
yarn nx build pidp
8381
```
84-
8582
### Running Unit Tests
8683

8784
Execute the unit tests via [Jest](https://jestjs.io) by typing:
@@ -137,8 +134,8 @@ nx g @nx/angular:lib LIB_NAME
137134
### Components Structure
138135

139136
In the workspace folder the app folder contains the applications. Every application has it's own folder.
140-
pidp is the folder for the pidp application. The folder for components is pidp->src->app->features.
141-
features folder has nested folders like access, admin, auth, faq ... which determine the side menu options in the home page of the application.
137+
pidp is the folder for the pidp application. The folder for components is pidp->src->app->features.
138+
features folder has nested folders like access, admin, auth, faq ... which determine the side menu options in the home page of the application.
142139
main.ts is the application entry file. in this file the keycloak configuration is fetched.
143140
app.routing.ts has top level routing. which internally uses the shell routing.
144141
shell-routing.ts has routing for different sections like profile, training, faq and history...

workspace/apps/pidp/.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
"ignoreRestSiblings": false,
4747
"argsIgnorePattern": "_"
4848
}
49-
],
50-
"@angular-eslint/prefer-standalone": "off"
49+
]
5150
}
5251
},
5352
{

workspace/apps/pidp/jest.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export default {
1717
},
1818
],
1919
},
20-
transformIgnorePatterns: ['node_modules/(?!(.*.mjs$|keycloak.js))'],
20+
transformIgnorePatterns: [
21+
'node_modules/(?!.*\\.mjs$|swiper|ssr-window|dom7)',
22+
],
2123
snapshotSerializers: [
2224
'jest-preset-angular/build/serializers/no-ng-attributes',
2325
'jest-preset-angular/build/serializers/ng-snapshot',

workspace/apps/pidp/project.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"projectType": "application",
55
"sourceRoot": "apps/pidp/src",
66
"prefix": "app",
7-
"tags": ["scope:pidp", "type:app"],
87
"targets": {
98
"build": {
109
"executor": "@angular-devkit/build-angular:browser",
@@ -75,8 +74,7 @@
7574
"options": {
7675
"port": 4200,
7776
"proxyConfig": "apps/pidp/proxy.conf.json"
78-
},
79-
"continuous": true
77+
}
8078
},
8179
"extract-i18n": {
8280
"executor": "@angular-devkit/build-angular:extract-i18n",
@@ -94,5 +92,6 @@
9492
"jestConfig": "apps/pidp/jest.config.ts"
9593
}
9694
}
97-
}
95+
},
96+
"tags": ["scope:pidp", "type:app"]
9897
}

workspace/apps/pidp/src/app/app-routing.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Routes } from '@angular/router';
22

3-
import { AccessRoutes } from './features/access/access.routes';
43
import { ShellRoutes } from './features/shell/shell.routes';
4+
import { AccessRoutes } from './features/access/access.routes';
55

66
export const routes: Routes = [
77
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<div id="app" class="app">
1+
<div class="app" id="app">
22
<router-outlet></router-outlet>
33
</div>

workspace/apps/pidp/src/app/app.component.spec.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { TestBed } from '@angular/core/testing';
33
import { Title } from '@angular/platform-browser';
4-
import {
5-
ActivatedRoute,
6-
Data,
7-
NavigationEnd,
8-
RouterModule,
9-
Scroll,
10-
} from '@angular/router';
4+
import { ActivatedRoute, Data, NavigationEnd, Scroll } from '@angular/router';
5+
import { RouterTestingModule } from '@angular/router/testing';
116

127
import { Observable, of } from 'rxjs';
138

@@ -45,7 +40,7 @@ describe('AppComponent', () => {
4540
};
4641

4742
TestBed.configureTestingModule({
48-
imports: [RouterModule.forRoot([])],
43+
imports: [RouterTestingModule],
4944
providers: [
5045
AppComponent,
5146
{

workspace/apps/pidp/src/app/app.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { UtilsService } from '@core/services/utils.service';
3030
selector: 'app-root',
3131
templateUrl: './app.component.html',
3232
styleUrls: ['./app.component.scss'],
33+
standalone: true,
3334
imports: [RouterOutlet],
3435
})
3536
export class AppComponent implements OnInit, AfterViewInit, OnDestroy {

workspace/apps/pidp/src/app/core/core.ts

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
12
import {
2-
provideHttpClient,
3-
withInterceptors,
4-
withInterceptorsFromDi,
5-
} from '@angular/common/http';
6-
import {
3+
ENVIRONMENT_INITIALIZER,
74
EnvironmentProviders,
85
InjectionToken,
96
Provider,
107
inject,
11-
provideEnvironmentInitializer,
12-
provideZoneChangeDetection,
138
} from '@angular/core';
149
import { provideAnimations } from '@angular/platform-browser/animations';
1510
import {
@@ -19,18 +14,12 @@ import {
1914
withRouterConfig,
2015
} from '@angular/router';
2116

22-
import {
23-
INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG,
24-
IncludeBearerTokenCondition,
25-
createInterceptorCondition,
26-
includeBearerTokenInterceptor,
27-
} from 'keycloak-angular';
2817
import { provideEnvironmentNgxMask } from 'ngx-mask';
2918

3019
import { provideHttpInterceptors } from '@bcgov/shared/data-access';
3120
import { provideMaterialConfig, provideNgxProgressBar } from '@bcgov/shared/ui';
3221

33-
import { provideKeycloakAngular } from '@app/modules/keycloak/keycloak.config';
22+
import { provideKeycloak } from '@app/modules/keycloak/keycloak';
3423

3524
export interface CoreOptions {
3625
routes: Routes;
@@ -39,30 +28,18 @@ export interface CoreOptions {
3928
// create unique injection token for the guard
4029
export const CORE_GUARD = new InjectionToken<string>('CORE_GUARD');
4130

42-
const bearerTokenCondition =
43-
createInterceptorCondition<IncludeBearerTokenCondition>({
44-
urlPattern: /^(.+)?$/i,
45-
});
46-
4731
export function provideCore(
4832
options: CoreOptions,
4933
): (Provider | EnvironmentProviders)[] {
5034
return [
51-
provideKeycloakAngular(),
52-
provideZoneChangeDetection({ eventCoalescing: true }),
5335
{ provide: CORE_GUARD, useValue: 'CORE_GUARD' },
54-
{
55-
provide: INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG,
56-
useValue: [bearerTokenCondition],
57-
},
5836
provideAnimations(),
5937
provideNgxProgressBar(),
6038
provideMaterialConfig(),
6139
provideEnvironmentNgxMask(),
6240
provideHttpClient(
6341
// DI-based interceptors must be explicitly enabled.
6442
withInterceptorsFromDi(),
65-
withInterceptors([includeBearerTokenInterceptor]),
6643
),
6744
provideHttpInterceptors(),
6845
provideRouter(
@@ -79,11 +56,12 @@ export function provideCore(
7956
// disabled debug tracing
8057
// withDebugTracing()
8158
),
59+
provideKeycloak(),
8260
// order matters
8361
// (especially when accessing some of the above defined providers)
8462
// init has to be last
8563
{
86-
provide: provideEnvironmentInitializer,
64+
provide: ENVIRONMENT_INITIALIZER,
8765
multi: true,
8866
useValue(): void {
8967
const coreGuard = inject(CORE_GUARD, {

0 commit comments

Comments
 (0)