Skip to content

Commit

Permalink
Merge pull request #3808 from mhenkens/feature/angular16_material_legacy
Browse files Browse the repository at this point in the history
Feature/angular16 material legacy
  • Loading branch information
SuperITMan authored Jun 4, 2024
2 parents 5ed7905 + a0d30bc commit a1fb423
Show file tree
Hide file tree
Showing 24 changed files with 9,831 additions and 7,268 deletions.
9,496 changes: 5,579 additions & 3,917 deletions package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@
"npm": ">=10.1.0"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^15.0.0",
"@angular-devkit/build-angular": "^15.2.10",
"@angular/animations": "^15.2.10",
"@angular/cdk": "^15.2.9",
"@angular/cli": "^15.2.10",
"@angular/common": "^15.2.10",
"@angular/compiler": "^15.2.10",
"@angular/compiler-cli": "^15.2.10",
"@angular/core": "^15.2.10",
"@angular/forms": "^15.2.10",
"@angular/material": "^15.2.9",
"@angular/material-moment-adapter": "^15.2.9",
"@angular/platform-browser": "^15.2.10",
"@angular/platform-browser-dynamic": "^15.2.10",
"@angular/router": "^15.2.10",
"@angular-builders/custom-webpack": "^16.0.0",
"@angular-devkit/build-angular": "^16.2.14",
"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.14",
"@angular/cli": "^16.2.14",
"@angular/common": "^16.2.12",
"@angular/compiler": "^16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@angular/core": "^16.2.12",
"@angular/forms": "^16.2.12",
"@angular/material": "^16.2.14",
"@angular/material-moment-adapter": "^16.2.14",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12",
"@angular/router": "^16.2.12",
"@angularclass/hmr": "^3.0.0",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@compodoc/compodoc": "1.1.19",
"@mdi/angular-material": "^4.0.96",
"@nationalbankbelgium/code-style": "^1.10.0",
"@nationalbankbelgium/eslint-config": "^15.0.0",
"@ng-idle/core": "^13.0.1",
"@ng-idle/keepalive": "^13.0.1",
"@ngrx/effects": "^15.4.0",
"@ngrx/store-devtools": "^15.4.0",
"@ngrx/store": "^15.4.0",
"@nationalbankbelgium/code-style": "^1.11.0",
"@nationalbankbelgium/eslint-config": "^16.0.0",
"@ng-idle/core": "^14.0.0",
"@ng-idle/keepalive": "^14.0.0",
"@ngrx/effects": "^16.3.0",
"@ngrx/store-devtools": "^16.3.0",
"@ngrx/store": "^16.3.0",
"@ngtools/json-schema": "^1.1.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/core": "^15.0.0",
"@npmcli/ci-detect": "^1.3.0",
"@release-it/conventional-changelog": "^8.0.1",
"@sqltools/formatter": "^1.2.3",
Expand All @@ -59,7 +59,7 @@
"@types/prismjs": "^1.16.3",
"@types/uuid": "^9.0.8",
"@types/webpack": "^5.28.0",
"@uirouter/angular": "^11.0.0",
"@uirouter/angular": "^12.0.0",
"@uirouter/core": "^6.0.8",
"@uirouter/rx": "~0.6.0",
"angular2-text-mask": "^9.0.0",
Expand Down Expand Up @@ -91,7 +91,7 @@
"lodash-es": "^4.17.21",
"moment": "^2.22.2",
"moment-locales-webpack-plugin": "^1.2.0",
"ng-packagr": "^15.2.2",
"ng-packagr": "^16.2.3",
"normalize.css": "^8.0.1",
"nouislider": "^14.6.3",
"prettier": "~3.1.1",
Expand All @@ -107,10 +107,10 @@
"text-mask-addons": "^3.8.0",
"text-mask-core": "^5.1.2",
"tslib": "^2.3.0",
"typescript": "~4.9.5",
"typescript": "~5.1.6",
"uuid": "^9.0.1",
"webpack-bundle-analyzer": "^4.10.1",
"zone.js": "~0.11.5"
"zone.js": "~0.13.3"
},
"scripts": {
"build": "bash ./build.sh",
Expand Down
14 changes: 7 additions & 7 deletions packages/stark-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"types": "typings/index.d.ts",
"dependencies": {
"@angular-builders/custom-webpack": "^15.0.0",
"@angular-devkit/build-angular": "^15.2.10",
"@angular-builders/custom-webpack": "^16.0.0",
"@angular-devkit/build-angular": "^16.2.14",
"@types/webpack": "^5.28.0",
"eslint-webpack-plugin": "^4.0.1",
"moment-locales-webpack-plugin": "^1.2.0",
Expand All @@ -31,11 +31,11 @@
"webpack-bundle-analyzer": "^4.10.1"
},
"peerDependencies": {
"@angular/cli": "^15.2.11",
"@angular/compiler": "^15.2.10",
"@angular/compiler-cli": "^15.2.10",
"@angular/platform-browser": "^15.2.10",
"@angular/platform-browser-dynamic": "^15.2.10"
"@angular/cli": "^16.2.14",
"@angular/compiler": "^16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12"
},
"scripts": {
"clean": "npx rimraf dist",
Expand Down
22 changes: 11 additions & 11 deletions packages/stark-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
},
"dependencies": {
"@angularclass/hmr": "^3.0.0",
"@ng-idle/core": "^13.0.1",
"@ng-idle/keepalive": "^13.0.1",
"@ngrx/effects": "^15.4.0",
"@ngrx/store": "^15.4.0",
"@ngrx/store-devtools": "^15.4.0",
"@ngx-translate/core": "^14.0.0",
"@ng-idle/core": "^14.0.0",
"@ng-idle/keepalive": "^14.0.0",
"@ngrx/effects": "^16.3.0",
"@ngrx/store": "^16.3.0",
"@ngrx/store-devtools": "^16.3.0",
"@ngx-translate/core": "^15.0.0",
"@types/lodash-es": "^4.17.4",
"@types/uuid": "^9.0.8",
"@uirouter/angular": "^11.0.0",
"@uirouter/angular": "^12.0.0",
"@uirouter/core": "^6.0.8",
"@uirouter/rx": "~0.6.0",
"cerialize": "^0.1.18",
Expand All @@ -40,10 +40,10 @@
"uuid": "^9.0.1"
},
"peerDependencies": {
"@angular/common": "^15.2.10",
"@angular/compiler": "^15.2.10",
"@angular/core": "^15.2.10",
"@angular/router": "^15.2.10"
"@angular/common": "^16.2.12",
"@angular/compiler": "^16.2.12",
"@angular/core": "^16.2.12",
"@angular/router": "^16.2.12"
},
"scripts": {
"clean": "npx rimraf dist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class StarkSettingsServiceImpl implements StarkSettingsService {
public initializeSettings(): void {
this.sessionService
.getCurrentUser()
.pipe(filter((user?: StarkUser): user is StarkUser => typeof user !== "undefined"))
.pipe(filter<StarkUser | undefined, StarkUser>((user?: StarkUser): user is StarkUser => typeof user !== "undefined"))
.subscribe((user: StarkUser) => {
let supportedLanguageIndex = -1;
const browserLanguage: string = navigator.language || navigator["userLanguage"] || "";
Expand Down
2 changes: 1 addition & 1 deletion packages/stark-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@nationalbankbelgium/code-style/tsconfig/4.9.x/ng15",
"extends": "@nationalbankbelgium/code-style/tsconfig/5.1.x/ng16",
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
Expand Down
2 changes: 1 addition & 1 deletion packages/stark-rbac/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@nationalbankbelgium/code-style/tsconfig/4.9.x/ng15",
"extends": "@nationalbankbelgium/code-style/tsconfig/5.1.x/ng16",
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
Expand Down
2 changes: 1 addition & 1 deletion packages/stark-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"npm": ">=8.19.1"
},
"dependencies": {
"@angular-devkit/build-angular": "^15.2.10",
"@angular-devkit/build-angular": "^16.2.14",
"@npmcli/ci-detect": "^1.3.0",
"@types/jasmine": "~5.1.4",
"@types/karma": "^6.3.8",
Expand Down
10 changes: 5 additions & 5 deletions packages/stark-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"npm": ">=10.1.0"
},
"dependencies": {
"@angular/material-moment-adapter": "^15.2.9",
"@angular/material-moment-adapter": "^16.2.14",
"@mdi/angular-material": "^4.0.96",
"@sqltools/formatter": "^1.2.3",
"@types/nouislider": "^9.0.10",
Expand All @@ -32,10 +32,10 @@
"text-mask-core": "^5.1.2"
},
"peerDependencies": {
"@angular/animations": "^15.2.10",
"@angular/cdk": "^15.2.9",
"@angular/forms": "^15.2.10",
"@angular/material": "^15.2.9",
"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.14",
"@angular/forms": "^16.2.12",
"@angular/material": "^16.2.14",
"@nationalbankbelgium/stark-core": "0.0.0-PLACEHOLDER-VERSION"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { MatIconModule } from "@angular/material/icon";
import { MatIconTestingModule } from "@angular/material/icon/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserDynamicTestingModule } from "@angular/platform-browser-dynamic/testing";
import { OverlayContainer } from "@angular/cdk/overlay";
import { ESCAPE } from "@angular/cdk/keycodes";
import { TranslateModule } from "@ngx-translate/core";
Expand Down Expand Up @@ -74,13 +73,7 @@ describe("AlertDialogComponent", () => {
declarations: [TestHostComponent, StarkAlertDialogComponent],
imports: [CommonModule, NoopAnimationsModule, MatDialogModule, MatIconModule, MatIconTestingModule, TranslateModule.forRoot()],
providers: []
})
.overrideModule(BrowserDynamicTestingModule, {
// FIXME review after https://github.com/angular/angular/issues/10760
// add entryComponent to TestingModule (suggested in https://github.com/angular/angular/issues/10760#issuecomment-250522300)
set: { entryComponents: [StarkAlertDialogComponent] }
})
.compileComponents()));
}).compileComponents()));

beforeEach(inject(
[MatDialog, OverlayContainer, ComponentFactoryResolver],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
MatLegacyDialogRef as MatDialogRef
} from "@angular/material/legacy-dialog";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserDynamicTestingModule } from "@angular/platform-browser-dynamic/testing";
import { OverlayContainer } from "@angular/cdk/overlay";
import { ESCAPE } from "@angular/cdk/keycodes";
import { TranslateModule } from "@ngx-translate/core";
Expand Down Expand Up @@ -76,13 +75,7 @@ describe("ConfirmDialogComponent", () => {
declarations: [TestHostComponent, StarkConfirmDialogComponent],
imports: [CommonModule, NoopAnimationsModule, MatDialogModule, TranslateModule.forRoot()],
providers: []
})
.overrideModule(BrowserDynamicTestingModule, {
// FIXME review after https://github.com/angular/angular/issues/10760
// add entryComponent to TestingModule (suggested in https://github.com/angular/angular/issues/10760#issuecomment-250522300)
set: { entryComponents: [StarkConfirmDialogComponent] }
})
.compileComponents()));
}).compileComponents()));

beforeEach(inject(
[MatDialog, OverlayContainer, ComponentFactoryResolver],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "@angular/material/legacy-dialog";
import { MatLegacyInputModule as MatInputModule } from "@angular/material/legacy-input";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserDynamicTestingModule } from "@angular/platform-browser-dynamic/testing";
import { OverlayContainer } from "@angular/cdk/overlay";
import { ESCAPE } from "@angular/cdk/keycodes";
import { TranslateModule } from "@ngx-translate/core";
Expand Down Expand Up @@ -81,13 +80,7 @@ describe("PromptDialogComponent", () => {
declarations: [TestHostComponent, StarkPromptDialogComponent],
imports: [CommonModule, ReactiveFormsModule, NoopAnimationsModule, MatInputModule, MatDialogModule, TranslateModule.forRoot()],
providers: []
})
.overrideModule(BrowserDynamicTestingModule, {
// FIXME review after https://github.com/angular/angular/issues/10760
// add entryComponent to TestingModule (suggested in https://github.com/angular/angular/issues/10760#issuecomment-250522300)
set: { entryComponents: [StarkPromptDialogComponent] }
})
.compileComponents()));
}).compileComponents()));

beforeEach(inject(
[MatDialog, OverlayContainer, ComponentFactoryResolver],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,14 @@ describe("EmailMaskDirective", () => {
changeInputValue(inputElement, "");
fixture.detectChanges();
expect(hostComponent.formControl.value).toBe("");
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);

mockValueChangeObserver.next.calls.reset();
changeInputValue(inputElement, "my-email@", eventType);
fixture.detectChanges();

expect(hostComponent.formControl.value).toBe("my-email@ .");
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);
expect(mockValueChangeObserver.error).not.toHaveBeenCalled();
expect(mockValueChangeObserver.complete).not.toHaveBeenCalled();
}
Expand All @@ -280,8 +278,7 @@ describe("EmailMaskDirective", () => {
changeInputValue(inputElement, "");
fixture.detectChanges();
expect(hostComponent.formControl.value).toBe("");
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);

mockValueChangeObserver.next.calls.reset();
changeInputValue(inputElement, "my-email@", eventType);
Expand All @@ -304,8 +301,7 @@ describe("EmailMaskDirective", () => {
fixture.detectChanges();

expect(hostComponent.formControl.value).toBe("");
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);
expect(mockValueChangeObserver.error).not.toHaveBeenCalled();
expect(mockValueChangeObserver.complete).not.toHaveBeenCalled();
}
Expand All @@ -316,8 +312,7 @@ describe("EmailMaskDirective", () => {
fixture.detectChanges();

expect(hostComponent.formControl.value).toBe("my-email@ .");
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);

mockValueChangeObserver.next.calls.reset();
hostComponent.emailMaskConfig = undefined;
Expand All @@ -329,8 +324,7 @@ describe("EmailMaskDirective", () => {
fixture.detectChanges();

expect(hostComponent.formControl.value).toBe("my-email@ ."); // the mask is enabled by default
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);

mockValueChangeObserver.next.calls.reset();
hostComponent.emailMaskConfig = ""; // use case when the directive is used with no inputs: <input type='text' [formControl]='formControl' starkEmailMask>
Expand All @@ -342,8 +336,7 @@ describe("EmailMaskDirective", () => {
fixture.detectChanges();

expect(hostComponent.formControl.value).toBe("my-email@ ."); // the mask is enabled by default
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);

mockValueChangeObserver.next.calls.reset();
hostComponent.emailMaskConfig = false;
Expand All @@ -355,8 +348,7 @@ describe("EmailMaskDirective", () => {
fixture.detectChanges();

expect(hostComponent.formControl.value).toBe("what@@.ever@."); // no mask at all
// FIXME Check why it is called twice instead of once
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(2);
expect(mockValueChangeObserver.next).toHaveBeenCalledTimes(1);
expect(mockValueChangeObserver.error).not.toHaveBeenCalled();
expect(mockValueChangeObserver.complete).not.toHaveBeenCalled();
});
Expand Down
Loading

0 comments on commit a1fb423

Please sign in to comment.