Commit 7bb6fc94 authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

feat: [DLCM-1774] migrate to angular 12

parent f3682eba
......@@ -26,7 +26,6 @@
"iso3166-2-db",
"lodash"
],
"aot": true,
"outputPath": "dist/DLCM-Frontend",
"index": "src/index.html",
"main": "src/main.ts",
......@@ -64,7 +63,13 @@
"node_modules/blobjs/Blob.min.js",
"node_modules/streamsaver/StreamSaver.js"
],
"showCircularDependencies": false
"showCircularDependencies": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
......@@ -151,7 +156,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
......
This diff is collapsed.
......@@ -6,6 +6,7 @@
},
"scripts": {
"ng": "ng",
"postinstall": "patch-package",
"sync-version": "sync-pom-version",
"serve": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --port 4200",
"start": "npm run prepare && npm run generate-models && npm run serve",
......@@ -17,7 +18,7 @@
"start:noapigenerate": "npm run prepare && npm run serve",
"start:standalone": "npm run prepare && npm run generate-models && npm run serve -- -c standalone",
"start:standalone:no-watch": "npm run prepare && npm run generate-models && npm run serve -- -c standalone --watch=false",
"build": "npm run prepare && ng build --aot=true --prod=true --source-map=false",
"build": "npm run prepare && ng build --aot=true --configuration production=true --source-map=false",
"test": "npm run prepare && ng test --no-progress --code-coverage",
"test:ci": "npm run prepare && ng test --code-coverage --watch=false --no-progress --browsers=ChromeNoSandboxHeadless",
"cypress": "concurrently \"npm run start\" \"npm run cypress-open\"",
......@@ -40,7 +41,7 @@
"generate-models": "(rm src/app/generated-api -fr || echo generated-api directory is absent) && set env JAVA_OPTS='-Dmodels -DsupportingFiles' && openapi-generator generate -i src/assets/openapi/DLCM-APIs.json -g typescript-angular -o src/app/generated-api --additional-properties=\"ngVersion=7.2.0,providedInRoot=true,modelSuffix=,modelFileSuffix=.partial.model,fileNaming=kebab-case,prependFormOrBodyParameters=true,modelPropertyNaming=original\" --skip-validate-spec && npm run clean-after-models-generation",
"clean-after-models-generation": "cd src/app/generated-api && rm -fr .openapi-generator .gitignore .openapi-generator-ignore git_push.sh api api.module.ts configuration.ts encoder.ts index.ts variables.ts README.md && cp ../../assets/files-to-copy/README-open-api-txt-to-copy.txt README.txt",
"build:sourcemaps": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --sourceMap --base-href /",
"build:sourcemaps-prod": "npm run build:sourcemaps -- --prod",
"build:sourcemaps-prod": "npm run build:sourcemaps -- --configuration production",
"build:sourcemaps-prod-local": "npm run build:sourcemaps -- -c production-local",
"serve:prod": "cd dist/DLCM-Frontend && ws --spa index.html --rewrite \"/api/rss -> https://www.unige.ch/feed/rss\" -p 4200",
"simulate-prod-local": "rm -fr dist && cd ../Solidify-Frontend/ && npm run build && cp -fr dist/solidify-frontend ../AoU-Portal/node_modules && cd ../DLCM-Portal/ && npm run build:sourcemaps-prod-local && npm run serve:prod",
......@@ -48,21 +49,21 @@
"build-solidify": "rm -rf ./node_modules/Solidify-Frontend && cd ../Solidify-Frontend && npm run build && cp -fr dist/solidify-frontend ../DLCM-Portal/node_modules"
},
"dependencies": {
"@angular/animations": "11.2.14",
"@angular/cdk": "11.2.13",
"@angular/common": "11.2.14",
"@angular/compiler": "11.2.14",
"@angular/core": "11.2.14",
"@angular/forms": "11.2.14",
"@angular/material": "11.2.13",
"@angular/material-moment-adapter": "11.2.13",
"@angular/platform-browser": "11.2.14",
"@angular/platform-browser-dynamic": "11.2.14",
"@angular/router": "11.2.14",
"@angular/service-worker": "11.2.14",
"@fortawesome/angular-fontawesome": "0.7.0",
"@fortawesome/fontawesome-svg-core": "1.2.30",
"@fortawesome/free-solid-svg-icons": "5.14.0",
"@angular/animations": "12.2.6",
"@angular/cdk": "12.2.6",
"@angular/common": "12.2.6",
"@angular/compiler": "12.2.6",
"@angular/core": "12.2.6",
"@angular/forms": "12.2.6",
"@angular/material": "12.2.6",
"@angular/material-moment-adapter": "12.2.6",
"@angular/platform-browser": "12.2.6",
"@angular/platform-browser-dynamic": "12.2.6",
"@angular/router": "12.2.6",
"@angular/service-worker": "12.2.6",
"@fortawesome/angular-fontawesome": "0.9.0",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@ngx-formly/core": "5.9.3",
"@ngx-formly/material": "5.9.3",
"@ngx-formly/schematics": "5.9.3",
......@@ -89,24 +90,27 @@
"ngx-doc-viewer": "1.2.3",
"ngx-highlightjs": "4.1.1",
"ngx-image-cropper": "3.2.1",
"ngx-tour-core": "4.2.0",
"ngx-ui-tour-core": "7.0.1",
"ngx-ui-tour-md-menu": "7.0.1",
"ngx-xml2json": "1.0.2",
"normalize.css": "8.0.1",
"patch-package": "6.2.2",
"rxjs": "6.6.0",
"solidify-frontend": "2.0.0",
"streamsaver": "2.0.4",
"sync-pom-version-to-package": "1.5.0",
"ts-key-enum": "2.0.3",
"tslib": "2.0.0",
"tslib": "2.3.1",
"videojs-wavesurfer": "3.2.0",
"wavesurfer.js": "4.0.1",
"web-streams-polyfill": "3.0.0",
"zone.js": "0.10.3"
"zone.js": "0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.1102.14",
"@angular/cli": "11.2.14",
"@angular/compiler-cli": "11.2.14",
"@angular/language-service": "11.2.14",
"@angular-devkit/build-angular": "12.1.4",
"@angular/cli": "12.2.6",
"@angular/compiler-cli": "12.2.6",
"@angular/language-service": "12.2.6",
"@biesbjerg/ngx-translate-extract": "3.0.2",
"@cypress/webpack-preprocessor": "5.4.2",
"@ngxs/devtools-plugin": "3.7.2",
......@@ -132,7 +136,7 @@
"ts-loader": "8.0.1",
"ts-node": "8.10.2",
"tslint": "6.1.2",
"typescript": "4.1.6",
"typescript": "4.3.5",
"webpack": "4.44.0"
}
}
......@@ -25,7 +25,7 @@ import {SessionStorageEnum} from "@shared/enums/session-storage.enum";
import {TourEnum} from "@shared/enums/tour.enum";
import {GoogleAnalyticsService} from "@shared/services/google-analytics.service";
import {PermissionUtil} from "@shared/utils/permission.util";
import {TourService} from "ngx-tour-md-menu";
import {TourService} from "ngx-ui-tour-md-menu";
import {
combineLatest,
Observable,
......
......@@ -80,7 +80,7 @@ import {
import {
TourMatMenuModule,
TourService,
} from "ngx-tour-md-menu";
} from "ngx-ui-tour-md-menu";
import {
AppConfigService,
CustomMatPaginatorIntlService,
......
......@@ -10,7 +10,7 @@ import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {RoutesEnum} from "@shared/enums/routes.enum";
import {StepTourSectionNameEnum} from "@shared/enums/step-tour-section-name.enum";
import {AppTourService} from "@shared/services/app-tour.service";
import {INgxmStepOption} from "ngx-tour-md-menu/lib/step-option.interface";
import {IStepOption} from "ngx-ui-tour-md-menu";
import {MARK_AS_TRANSLATABLE} from "solidify-frontend";
@Component({
......@@ -71,6 +71,6 @@ export class GuidedTourMenuPresentational extends SharedAbstractPresentational {
interface Menu {
titleToTranslate: string;
stepTourSectionName: StepTourSectionNameEnum;
extraOptions?: INgxmStepOption | undefined;
extraOptions?: IStepOption | undefined;
navigationEnd?: string;
}
import {isNullOrUndefined} from "solidify-frontend";
export class InMemoryStorage implements Storage {
private storage: Map<string, string>;
private storage: Map<string, string> = new Map<string, string>();
constructor() {
this.storage = new Map<string, string>();
}
readonly length: number = isNullOrUndefined(this.storage) ? 0 : this.storage.size;
......
......@@ -14,8 +14,10 @@ import {
import {StepTourSectionNameEnum} from "@shared/enums/step-tour-section-name.enum";
import {TourRouteIdEnum} from "@shared/enums/tour-route-id.enum";
import {TourEnum} from "@shared/enums/tour.enum";
import {TourService} from "ngx-tour-md-menu";
import {INgxmStepOption} from "ngx-tour-md-menu/lib/step-option.interface";
import {
IStepOption,
TourService,
} from "ngx-ui-tour-md-menu";
import {
AbstractAppTourService,
DefaultSolidifyEnvironment,
......@@ -39,7 +41,7 @@ export class AppTourService extends AbstractAppTourService {
}
}
const mainTourSteps: INgxmStepOption[] = [
const mainTourSteps: IStepOption[] = [
{
anchorId: TourEnum.mainMenuOrder,
content: MARK_AS_TRANSLATABLE("tour.main.menuArchiveOrders.content"),
......@@ -59,7 +61,7 @@ const mainTourSteps: INgxmStepOption[] = [
},
];
const depositListTourSteps: INgxmStepOption[] = [
const depositListTourSteps: IStepOption[] = [
{
anchorId: TourEnum.commonContent,
title: LabelTranslateEnum.deposit,
......@@ -80,7 +82,7 @@ const depositListTourSteps: INgxmStepOption[] = [
},
];
const depositMetadataTourSteps: INgxmStepOption[] = [
const depositMetadataTourSteps: IStepOption[] = [
{
anchorId: TourEnum.depositDetail,
content: MARK_AS_TRANSLATABLE("tour.deposit.metadata.intro.content"),
......@@ -92,7 +94,7 @@ const depositMetadataTourSteps: INgxmStepOption[] = [
},
];
const depositDataTourSteps: INgxmStepOption[] = [
const depositDataTourSteps: IStepOption[] = [
{
anchorId: TourEnum.depositDataUpload,
content: MARK_AS_TRANSLATABLE("tour.deposit.data.upload.content"),
......@@ -104,7 +106,7 @@ const depositDataTourSteps: INgxmStepOption[] = [
},
];
const preservationSpaceTourSteps: INgxmStepOption[] = [
const preservationSpaceTourSteps: IStepOption[] = [
{
anchorId: TourEnum.preservationSpaceTabs,
title: LabelTranslateEnum.preservationSpace,
......@@ -113,7 +115,7 @@ const preservationSpaceTourSteps: INgxmStepOption[] = [
},
];
const preservationSpaceOrgUnitTourSteps: INgxmStepOption[] = [
const preservationSpaceOrgUnitTourSteps: IStepOption[] = [
{
anchorId: TourEnum.preservationSpaceOrgUnitTab,
title: LabelTranslateEnum.organizationalUnit,
......@@ -130,7 +132,7 @@ const preservationSpaceOrgUnitTourSteps: INgxmStepOption[] = [
},
];
const homeSearchTourSteps: INgxmStepOption[] = [
const homeSearchTourSteps: IStepOption[] = [
{
anchorId: TourEnum.commonContent,
title: LabelTranslateEnum.search,
......
......@@ -92,7 +92,7 @@ import {SharedRoleState} from "@shared/stores/role/shared-role.state";
import {SharedUserState} from "@shared/stores/user/shared-user.state";
import {HighlightModule} from "ngx-highlightjs";
import {ImageCropperModule} from "ngx-image-cropper";
import {TourMatMenuModule} from "ngx-tour-md-menu";
import {TourMatMenuModule} from "ngx-ui-tour-md-menu";
import {
FilePreviewModule,
SolidifyFrontendModule,
......
......@@ -249,4 +249,4 @@ export const defaultEnvironment: DlcmEnvironment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
......@@ -31,6 +31,6 @@ export const environment: DlcmEnvironment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
// export const ENVIRONMENT: InjectionToken<any> = new InjectionToken("environment");
......@@ -55,7 +55,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import "zone.js/dist/zone"; // Included with Angular CLI.
import "zone.js"; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
@use '~@angular/material' as mat;
@import "themes/yareta-theme";
$basic-theme: $yareta-theme;
// Load basic theme
@include angular-material-theme($basic-theme);
@include mat.all-component-themes($basic-theme);
@include material-label;
// Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '~@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$primary: mat-palette($mat-light-blue, 800);
$accent: mat-palette($mat-deep-purple, 300, A100, A400);
$primary: mat.define-palette(mat.$light-blue-palette, 800);
$accent: mat.define-palette(mat.$deep-purple-palette, 300, A100, A400);
// The warn palette is optional (defaults to red).
$warn: mat-palette($mat-red);
$warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes).
$dlcm-theme: mat-light-theme(
$dlcm-theme: mat.define-light-theme(
$primary,
$accent,
$warn
);
body[theme=dlcm] {
@include angular-material-theme($dlcm-theme);
@include mat.all-component-themes($dlcm-theme);
@include material-label;
--primary-color: #{map-get($primary, 800)};
--primary-color-lighter: #028dd6;
......
// Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '~@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$olos-red-chart: #ff3333;
......@@ -40,21 +41,21 @@ $olos-red: (
)
);
$primary: mat-palette($olos-red, 900);
$accent: mat-palette($olos-red, 800, 200, 700);
$primary: mat.define-palette($olos-red, 900);
$accent: mat.define-palette($olos-red, 800, 200, 700);
// The warn palette is optional (defaults to red).
$warn: mat-palette($mat-red);
$warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes).
$olos-theme: mat-light-theme(
$olos-theme: mat.define-light-theme(
$primary,
$accent,
$warn
);
body[theme=olos] {
@include angular-material-theme($olos-theme);
@include mat.all-component-themes($olos-theme);
@include material-label;
--primary-color: #{map-get($olos-red, 900)};
--primary-color-lighter: #{map-get($olos-red, 700)};
......
// Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '~@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$primary: mat-palette($mat-light-blue, 800);
$accent: mat-palette($mat-deep-purple, 300, A100, A400);
$primary: mat.define-palette(mat.$light-blue-palette, 800);
$accent: mat.define-palette(mat.$deep-purple-palette, 300, A100, A400);
// The warn palette is optional (defaults to red).
$warn: mat-palette($mat-red);
$warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes).
$vertical-theme: mat-light-theme(
$vertical-theme: mat.define-light-theme(
$primary,
$accent,
$warn
);
body[theme=vertical] {
@include angular-material-theme($vertical-theme);
@include mat.all-component-themes($vertical-theme);
@include material-label;
--primary-color: #{map-get($primary, 800)};
--primary-color-lighter: #028dd6;
......
// Define the palettes for your theme using the Material Design palettes available in palette.scss
@use '~@angular/material' as mat;
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
......@@ -77,14 +78,14 @@ $mat-yareta-accent: (
);
$primary: mat-palette($mat-yareta-primary, 950);
$accent: mat-palette($mat-yareta-accent, A100, A100, A100);
$primary: mat.define-palette($mat-yareta-primary, 950);
$accent: mat.define-palette($mat-yareta-accent, A100, A100, A100);
// The warn palette is optional (defaults to red).
$warn: mat-palette($mat-red);
$warn: mat.define-palette(mat.$red-palette);
// Create the theme object (a Sass map containing all of the palettes).
$yareta-theme: mat-light-theme(
$yareta-theme: mat.define-light-theme(
$primary,
$accent,
$warn
......@@ -94,7 +95,7 @@ $yareta-theme: mat-light-theme(
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
body[theme=yareta] {
@include angular-material-theme($yareta-theme);
@include mat.all-component-themes($yareta-theme);
@include material-label;
--primary-color: #{map-get($mat-yareta-primary, 950)};
--primary-color-lighter: #{map-get($mat-yareta-primary, 800)};
......
......@@ -5,7 +5,7 @@ import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting,
} from "@angular/platform-browser-dynamic/testing";
import "zone.js/dist/zone-testing";
import "zone.js/testing";
declare const require: any;
......
......@@ -12,7 +12,6 @@
"declaration": false,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
......
......@@ -42,7 +42,6 @@
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"importHelpers": true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment