Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
26f6c03
correct type after deprecation
Paahn Jun 4, 2025
80d3977
Revert "correct type after deprecation"
Paahn Jun 4, 2025
3d8774a
angular 19
Paahn Jun 4, 2025
70fe60b
correct type after deprecation
Paahn Jun 4, 2025
3eced95
all components, services, directives, pipes are standalone by default
Paahn Jun 4, 2025
8555b8a
replace deprecated APP_INITIALIZER
Paahn Jun 4, 2025
d2c9583
turn off prefer standalone linting as its now default
Paahn Jun 4, 2025
e7f3a9d
Replace usage of getJestProjects with getJestProjectsAsync
Paahn Jun 4, 2025
9299837
tags and continuous=true
Paahn Jun 4, 2025
52305d3
mat change
Paahn Jun 4, 2025
3ee98f2
update gitignore
Paahn Jun 4, 2025
85eb342
update fontawesome
Paahn Jun 5, 2025
a997247
update keycloak libs
Paahn Jun 5, 2025
b4a3f5d
init keycloak library in bundler
Paahn Jun 5, 2025
5e0b517
unused
Paahn Jun 5, 2025
9ed1645
Fixes Dart scss warnings
Jun 6, 2025
72195b0
Revert "Fixes Dart scss warnings"
Paahn Jun 9, 2025
8f62d4a
downgrade sass to supress warnings
Paahn Jun 9, 2025
af9df13
package updates
Paahn Jun 9, 2025
f9ed170
linting
Paahn Jun 9, 2025
40b3ba5
deprecated test setup
Paahn Jun 10, 2025
0c9df46
es2022 to use bundler for moduleResolution
Paahn Jun 10, 2025
3703c7c
test class
Paahn Jun 10, 2025
765f005
new keycloak options type
Paahn Jun 11, 2025
0bc3b59
routerTestingModule deprecation
Paahn Jun 11, 2025
1c98ee6
tests pass
Paahn Jun 11, 2025
b6a0248
init new keycloak
Paahn Jun 13, 2025
b6fa0b8
migrate to using new keycloak
Paahn Jun 13, 2025
dadf32f
use env vars
Paahn Jun 13, 2025
68b7e2f
fix tests from keycloak deprecation
Paahn Jun 13, 2025
839abe1
sonarcloud comments
Paahn Jun 13, 2025
94b4a57
edit regex to not match empty string
Paahn Jun 13, 2025
f2cb1ca
Merge branch 'develop' into feature/OHID-330-angular-19
Paahn Jun 19, 2025
9200c82
compiler changed for tests
Paahn Jun 19, 2025
4e49c69
include
Paahn Jun 23, 2025
e0f70b4
edit path
Paahn Jun 23, 2025
5e75585
add bundler in spite of extending base
Paahn Jun 23, 2025
e3bb55e
add Bundler to compilerOptions
rshourou Jun 23, 2025
f3c18fd
Merge remote-tracking branch 'origin/feature/OHID-330-angular-19' int…
Paahn Jun 23, 2025
f50313c
remove dupl
Paahn Jun 23, 2025
e0e09fa
add types to package.json
rshourou Jun 23, 2025
4321e8e
add lib to tests tsconfig
Paahn Jun 23, 2025
60f3ec8
Merge remote-tracking branch 'origin/feature/OHID-330-angular-19' int…
Paahn Jun 23, 2025
3e2bbbb
types
Paahn Jun 23, 2025
fc19b17
remove types def
Paahn Jun 23, 2025
6e5df42
downgrade minor version of keycloakjs
Paahn Jun 24, 2025
785f56b
downgradex2
Paahn Jun 24, 2025
988cdba
test
Paahn Jun 24, 2025
81e856c
downgradex3
Paahn Jun 24, 2025
4461267
x4
Paahn Jun 24, 2025
0f224d9
downgrade to keycloak-js 25
Paahn Jun 24, 2025
0485267
move null checking
Paahn Jun 27, 2025
59dc75c
rename
Paahn Jul 2, 2025
1365f60
test session expiry
Paahn Jul 3, 2025
93495a0
session expiry 5 min
Paahn Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions workspace/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ Thumbs.db
.nx/
.nx/cache
.nx/workspace-data
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
3 changes: 2 additions & 1 deletion workspace/apps/pidp/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"ignoreRestSiblings": false,
"argsIgnorePattern": "_"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions workspace/apps/pidp/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export default {
},
],
},
transformIgnorePatterns: [
'node_modules/(?!.*\\.mjs$|swiper|ssr-window|dom7)',
],
transformIgnorePatterns: ['node_modules/(?!(.*.mjs$|keycloak.js))'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
Expand Down
7 changes: 4 additions & 3 deletions workspace/apps/pidp/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"projectType": "application",
"sourceRoot": "apps/pidp/src",
"prefix": "app",
"tags": ["scope:pidp", "type:app"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
Expand Down Expand Up @@ -74,7 +75,8 @@
"options": {
"port": 4200,
"proxyConfig": "apps/pidp/proxy.conf.json"
}
},
"continuous": true
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
Expand All @@ -92,6 +94,5 @@
"jestConfig": "apps/pidp/jest.config.ts"
}
}
},
"tags": ["scope:pidp", "type:app"]
}
}
11 changes: 8 additions & 3 deletions workspace/apps/pidp/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { TestBed } from '@angular/core/testing';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Data, NavigationEnd, Scroll } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import {
ActivatedRoute,
Data,
NavigationEnd,
RouterModule,
Scroll,
} from '@angular/router';

import { Observable, of } from 'rxjs';

Expand Down Expand Up @@ -40,7 +45,7 @@ describe('AppComponent', () => {
};

TestBed.configureTestingModule({
imports: [RouterTestingModule],
imports: [RouterModule.forRoot([])],
providers: [
AppComponent,
{
Expand Down
9 changes: 4 additions & 5 deletions workspace/apps/pidp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ import { SnowplowService } from '@core/services/snowplow.service';
import { UtilsService } from '@core/services/utils.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RouterOutlet],
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
imports: [RouterOutlet]
})
export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
private readonly destroy$ = new Subject<void>();
Expand Down
32 changes: 27 additions & 5 deletions workspace/apps/pidp/src/app/core/core.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import {
ENVIRONMENT_INITIALIZER,
provideHttpClient,
withInterceptors,
withInterceptorsFromDi,
} from '@angular/common/http';
import {
EnvironmentProviders,
InjectionToken,
Provider,
inject,
provideEnvironmentInitializer,
provideZoneChangeDetection,
} from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import {
Expand All @@ -14,12 +19,18 @@ import {
withRouterConfig,
} from '@angular/router';

import {
INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG,
IncludeBearerTokenCondition,
createInterceptorCondition,
includeBearerTokenInterceptor,
} from 'keycloak-angular';
import { provideEnvironmentNgxMask } from 'ngx-mask';

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

import { provideKeycloak } from '@app/modules/keycloak/keycloak';
import { provideKeycloakAngular } from '@app/modules/keycloak/keycloak.config';

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

const bearerTokenCondition =
createInterceptorCondition<IncludeBearerTokenCondition>({
urlPattern: /^(.+)?$/i,
});

export function provideCore(
options: CoreOptions,
): (Provider | EnvironmentProviders)[] {
return [
provideKeycloakAngular(),
provideZoneChangeDetection({ eventCoalescing: true }),
{ provide: CORE_GUARD, useValue: 'CORE_GUARD' },
{
provide: INCLUDE_BEARER_TOKEN_INTERCEPTOR_CONFIG,
useValue: [bearerTokenCondition],
},
provideAnimations(),
provideNgxProgressBar(),
provideMaterialConfig(),
provideEnvironmentNgxMask(),
provideHttpClient(
// DI-based interceptors must be explicitly enabled.
withInterceptorsFromDi(),
withInterceptors([includeBearerTokenInterceptor]),
),
provideHttpInterceptors(),
provideRouter(
Expand All @@ -56,12 +79,11 @@ export function provideCore(
// disabled debug tracing
// withDebugTracing()
),
provideKeycloak(),
// order matters
// (especially when accessing some of the above defined providers)
// init has to be last
{
provide: ENVIRONMENT_INITIALIZER,
provide: provideEnvironmentInitializer,
multi: true,
useValue(): void {
const coreGuard = inject(CORE_GUARD, {
Expand Down
8 changes: 4 additions & 4 deletions workspace/apps/pidp/src/app/core/party/party.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
ActivatedRouteSnapshot,
ResolveFn,
Router,
RouterModule,
RouterStateSnapshot,
} from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';

import { Observable } from 'rxjs';

import { randNumber } from '@ngneat/falso';
import { Spy, createSpyFromClass, provideAutoSpy } from 'jest-auto-spies';
import { KeycloakService } from 'keycloak-angular';
import Keycloak from 'keycloak-js';

import { APP_CONFIG, APP_DI_CONFIG } from '@app/app.config';
import { AuthRoutes } from '@app/features/auth/auth.routes';
Expand All @@ -39,7 +39,7 @@ describe('partyResolver', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
imports: [RouterModule.forRoot([])],
providers: [
{
provide: APP_CONFIG,
Expand All @@ -56,7 +56,7 @@ describe('partyResolver', () => {
provideAutoSpy(LoggerService),
provideAutoSpy(DocumentService),
provideAutoSpy(Router),
provideAutoSpy(KeycloakService),
provideAutoSpy(Keycloak),
provideAutoSpy(ActivatedRouteSnapshot),
provideAutoSpy(RouterStateSnapshot),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { TestBed } from '@angular/core/testing';
import { CommonDataService } from './common-data.service';
import { RouterModule } from '@angular/router';

import { RouterTestingModule } from '@angular/router/testing';
import { CommonDataService } from './common-data.service';

describe('CommonDataService', () => {
let service: CommonDataService;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
providers: [
CommonDataService,
],
imports: [RouterModule.forRoot([])],
providers: [CommonDataService],
});

service = TestBed.inject(CommonDataService);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { RouterModule } from '@angular/router';

import { RouteStateService } from './route-state.service';

describe('RouteStateService', () => {
beforeEach(() =>
TestBed.configureTestingModule({
imports: [RouterTestingModule],
imports: [RouterModule.forRoot([])],
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ import {
} from '@bcgov/shared/ui';

@Component({
selector: 'app-access-request-card',
standalone: true,
imports: [
CommonModule,
FaIconComponent,
InjectViewportCssClassDirective,
TextButtonDirective,
NgClass,
],
templateUrl: './access-request-card.component.html',
styleUrl: './access-request-card.component.scss',
selector: 'app-access-request-card',
imports: [
CommonModule,
FaIconComponent,
InjectViewportCssClassDirective,
TextButtonDirective,
NgClass,
],
templateUrl: './access-request-card.component.html',
styleUrl: './access-request-card.component.scss'
})
export class AccessRequestCardComponent {
@Input() public icon: IconProp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Component } from '@angular/core';
import { AlertComponent, AlertContentDirective } from '@bcgov/shared/ui';

@Component({
selector: 'app-enrolment-error',
template: `
selector: 'app-enrolment-error',
template: `
<ui-alert
type="info"
icon="error_outline"
Expand All @@ -15,8 +15,7 @@ import { AlertComponent, AlertContentDirective } from '@bcgov/shared/ui';
</ng-container>
</ui-alert>
`,
styles: [],
standalone: true,
imports: [AlertComponent, AlertContentDirective],
styles: [],
imports: [AlertComponent, AlertContentDirective]
})
export class EnrolmentErrorComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { provideAutoSpy } from 'jest-auto-spies';
import { KeycloakService } from 'keycloak-angular';
import Keycloak from 'keycloak-js';

import { APP_CONFIG, APP_DI_CONFIG } from '@app/app.config';

Expand All @@ -23,7 +23,7 @@ describe('PortalCardComponent', () => {
useValue: APP_DI_CONFIG,
},
provideAutoSpy(HttpClient),
provideAutoSpy(KeycloakService),
provideAutoSpy(Keycloak),
],
});
component = TestBed.inject(AccessRequestsPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ import { Constants } from '@app/shared/constants';
import { AccessRequestCardComponent } from '../../components/access-request-card/access-request-card.component';

@Component({
selector: 'app-access-request-page',
templateUrl: './access-requests.page.html',
styleUrls: ['./access-requests.page.scss'],
standalone: true,
imports: [
BreadcrumbComponent,
FaIconComponent,
InjectViewportCssClassDirective,
MatButtonModule,
NgIf,
AccessRequestCardComponent,
NgFor,
],
selector: 'app-access-request-page',
templateUrl: './access-requests.page.html',
styleUrls: ['./access-requests.page.scss'],
imports: [
BreadcrumbComponent,
FaIconComponent,
InjectViewportCssClassDirective,
MatButtonModule,
NgIf,
AccessRequestCardComponent,
NgFor,
]
})
export class AccessRequestsPage implements OnInit, OnDestroy {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { randNumber, randTextRange } from '@ngneat/falso';
import { NavigationService } from '@pidp/presentation';
import { Spy, createSpyFromClass, provideAutoSpy } from 'jest-auto-spies';
import { KeycloakService } from 'keycloak-angular';
import Keycloak from 'keycloak-js';

import { APP_CONFIG, APP_DI_CONFIG } from '@app/app.config';
import { PartyService } from '@app/core/party/party.service';
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('BcProviderApplicationPage', () => {
},
provideAutoSpy(HttpClient),
provideAutoSpy(FormUtilsService),
provideAutoSpy(KeycloakService),
provideAutoSpy(Keycloak),
provideAutoSpy(NavigationService),
provideAutoSpy(Router),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ import { BcProviderApplicationResource } from './bc-provider-application-resourc
selector: 'app-bc-provider-application',
templateUrl: './bc-provider-application.page.html',
styleUrls: ['./bc-provider-application.page.scss'],
standalone: true,
imports: [
AsyncPipe,
BreadcrumbComponent,
Expand Down
Loading
Loading