From 548e5c4faea55cd8d6ec56738dd65f5a6e7f8bb4 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 1 Mar 2022 15:45:25 +0000 Subject: [PATCH] Angular 13 upgrade --- .gitignore | 1 + angular.json | 12 - demo-shell/src/custom-style-dev.scss | 2 +- demo-shell/src/custom-style.scss | 2 +- demo-shell/src/polyfills.ts | 3 - demo-shell/src/test.ts | 4 +- lib/cli/tsconfig.lib.prod.json | 2 +- lib/content-services/ng-package.json | 18 +- .../components/search-control.component.scss | 2 +- .../search-filter-chips.component.scss | 2 +- .../search-form/search-form.component.scss | 2 +- lib/content-services/src/test.ts | 4 +- lib/content-services/tsconfig.lib.prod.json | 2 +- .../card-view-textitem.component.html | 6 +- .../context-menu-overlay.service.ts | 47 +- .../datatable/datatable.component.scss | 2 +- .../tooltip-card/tooltip-card.component.scss | 2 +- .../multiline-text/multiline-text.widget.html | 2 +- .../sidebar-action-menu.component.scss | 2 +- .../sidenav-layout.component.scss | 2 +- lib/core/ng-package.json | 14 +- lib/core/pagination/pagination.component.scss | 2 +- lib/core/styles/_index.scss | 2 +- lib/core/styles/_theming.scss | 2 +- lib/core/styles/_typography.scss | 2 +- lib/core/styles/prebuilt/adf-blue-orange.scss | 2 +- lib/core/styles/prebuilt/adf-blue-purple.scss | 2 +- lib/core/styles/prebuilt/adf-cyan-orange.scss | 2 +- lib/core/styles/prebuilt/adf-cyan-purple.scss | 2 +- .../styles/prebuilt/adf-green-orange.scss | 2 +- .../styles/prebuilt/adf-green-purple.scss | 2 +- lib/core/styles/prebuilt/adf-indigo-pink.scss | 2 +- .../styles/prebuilt/adf-pink-bluegrey.scss | 2 +- .../styles/prebuilt/adf-purple-green.scss | 2 +- lib/core/test.ts | 4 +- lib/core/tsconfig.lib.prod.json | 2 +- lib/extensions/ng-package.json | 5 +- lib/extensions/src/test.ts | 4 +- lib/extensions/tsconfig.lib.prod.json | 2 +- lib/insights/ng-package.json | 10 +- lib/insights/src/test.ts | 4 +- lib/insights/tsconfig.lib.prod.json | 2 +- lib/process-services-cloud/ng-package.json | 17 +- lib/process-services-cloud/src/test.ts | 4 +- .../tsconfig.lib.prod.json | 2 +- lib/process-services/ng-package.json | 11 +- lib/process-services/src/test.ts | 4 +- lib/process-services/tsconfig.lib.prod.json | 2 +- lib/testing/ng-package.json | 11 +- lib/testing/shared/package.json | 5 +- lib/testing/tsconfig.lib.prod.json | 2 +- package-lock.json | 5083 ++++++----------- package.json | 35 +- 53 files changed, 1914 insertions(+), 3454 deletions(-) diff --git a/.gitignore b/.gitignore index e95c71a25d..c9d213c5f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.angular/cache *.log node_modules bundles diff --git a/angular.json b/angular.json index 1463a8ba81..75f855025e 100644 --- a/angular.json +++ b/angular.json @@ -388,18 +388,6 @@ "protractorConfig": "./e2e/protractor.conf.js", "devServerTarget": "lib-e2e-test:serve" } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "./e2e/tsconfig.e2e.json" - ], - "exclude": [ - "**/lib/**/*", - "**/node_modules/**/*" - ] - } } } }, diff --git a/demo-shell/src/custom-style-dev.scss b/demo-shell/src/custom-style-dev.scss index 332c9c8a54..c35d1e11ef 100644 --- a/demo-shell/src/custom-style-dev.scss +++ b/demo-shell/src/custom-style-dev.scss @@ -1,4 +1,4 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; @import '../../lib/core/styles/index'; @include mat.core($alfresco-typography); diff --git a/demo-shell/src/custom-style.scss b/demo-shell/src/custom-style.scss index 33bcdb4932..c7cc6f98fd 100644 --- a/demo-shell/src/custom-style.scss +++ b/demo-shell/src/custom-style.scss @@ -1,4 +1,4 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; @import '~@alfresco/adf-core/theming'; @include mat.core($alfresco-typography); diff --git a/demo-shell/src/polyfills.ts b/demo-shell/src/polyfills.ts index 844ef4e2fe..b31c92476c 100644 --- a/demo-shell/src/polyfills.ts +++ b/demo-shell/src/polyfills.ts @@ -35,9 +35,6 @@ * BROWSER POLYFILLS */ -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - /*************************************************************************************************** * Zone JS is required by Angular itself. */ diff --git a/demo-shell/src/test.ts b/demo-shell/src/test.ts index 8a6db358ce..b4f5f1fe3b 100644 --- a/demo-shell/src/test.ts +++ b/demo-shell/src/test.ts @@ -29,7 +29,9 @@ declare const require: any; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); diff --git a/lib/cli/tsconfig.lib.prod.json b/lib/cli/tsconfig.lib.prod.json index 04c0e66277..2a2faa884c 100644 --- a/lib/cli/tsconfig.lib.prod.json +++ b/lib/cli/tsconfig.lib.prod.json @@ -4,6 +4,6 @@ "declarationMap": false }, "angularCompilerOptions": { - "enableIvy": false + "compilationMode": "partial" } } diff --git a/lib/content-services/ng-package.json b/lib/content-services/ng-package.json index 902dd18567..75ad7aa8bc 100644 --- a/lib/content-services/ng-package.json +++ b/lib/content-services/ng-package.json @@ -8,22 +8,6 @@ ], "lib": { "entryFile": "src/public-api.ts", - "flatModuleFile": "adf-content-services", - "umdModuleIds": { - "@alfresco/js-api": "@alfresco/js-api", - "@angular/platform-browser/animations": "@angular/platform-browser/animations", - "@angular/material": "@angular/material", - "@mat-datetimepicker/core": "@mat-datetimepicker/core", - "@mat-datetimepicker/moment": "@mat-datetimepicker/moment", - "@angular/flex-layout": "@angular/flex-layout", - "@alfresco/adf-core": "@alfresco/adf-core", - "@angular/animations": "@angular/animations", - "@angular/cdk/platform": "@angular/cdk/platform", - "@angular/material/core": "@angular/material/core", - "moment": "moment", - "moment-es6": "moment-es6", - "moment/src/moment": "moment/src/moment", - "@ngx-translate/core": "@ngx-translate/core" - } + "flatModuleFile": "adf-content-services" } } diff --git a/lib/content-services/src/lib/search/components/search-control.component.scss b/lib/content-services/src/lib/search/components/search-control.component.scss index a7db0d06cb..a3115a577e 100644 --- a/lib/content-services/src/lib/search/components/search-control.component.scss +++ b/lib/content-services/src/lib/search/components/search-control.component.scss @@ -1,4 +1,4 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; $mat-menu-overlay-min-width: 112px !default; // 56 * 2 $mat-menu-overlay-max-width: 280px !default; // 56 * 5 diff --git a/lib/content-services/src/lib/search/components/search-filter-chips/search-filter-chips.component.scss b/lib/content-services/src/lib/search/components/search-filter-chips/search-filter-chips.component.scss index 64f606d825..95231da64d 100644 --- a/lib/content-services/src/lib/search/components/search-filter-chips/search-filter-chips.component.scss +++ b/lib/content-services/src/lib/search/components/search-filter-chips/search-filter-chips.component.scss @@ -1,4 +1,4 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; .adf-search-filter-chip { &.mat-chip { diff --git a/lib/content-services/src/lib/search/components/search-form/search-form.component.scss b/lib/content-services/src/lib/search/components/search-form/search-form.component.scss index be84e53e0a..32a6efea66 100644 --- a/lib/content-services/src/lib/search/components/search-form/search-form.component.scss +++ b/lib/content-services/src/lib/search/components/search-form/search-form.component.scss @@ -1,4 +1,4 @@ -@use '~@angular/material' as mat; +@use '@angular/material' as mat; .adf-search-form { &.mat-button { diff --git a/lib/content-services/src/test.ts b/lib/content-services/src/test.ts index e4aa0579e8..f65cd98c51 100644 --- a/lib/content-services/src/test.ts +++ b/lib/content-services/src/test.ts @@ -28,7 +28,9 @@ declare const require: any; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} ); declare const pdfjsLib: any; diff --git a/lib/content-services/tsconfig.lib.prod.json b/lib/content-services/tsconfig.lib.prod.json index 04c0e66277..2a2faa884c 100644 --- a/lib/content-services/tsconfig.lib.prod.json +++ b/lib/content-services/tsconfig.lib.prod.json @@ -4,6 +4,6 @@ "declarationMap": false }, "angularCompilerOptions": { - "enableIvy": false + "compilationMode": "partial" } } diff --git a/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.html b/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.html index b85643b022..137de56463 100644 --- a/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.html +++ b/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.html @@ -21,9 +21,9 @@ [attr.data-automation-id]="'card-textitem-value-' + property.key">