@eui/tools 6.2.33 → 6.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.version.properties +1 -1
- package/CHANGELOG.md +19 -0
- package/package.json +1 -1
- package/scripts/csdr/cli/constants.js +43 -0
- package/scripts/csdr/cli/package-build-backend.js +70 -0
- package/scripts/csdr/cli/package-build-frontend.js +300 -0
- package/scripts/csdr/cli/package-prompt.js +123 -0
- package/scripts/csdr/cli/package.js +21 -438
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui15/src/app/eui-components.ts +3 -3
- package/scripts/csdr/cli/skeletons/virtual-remote/15.x/angular-config.json +8 -0
- package/scripts/csdr/cli/skeletons/virtual-remote/15.x/dependencies.json +20 -0
- package/scripts/csdr/config/config-utils.js +1 -0
- package/scripts/csdr/config/global.js +0 -170
- package/scripts/csdr/config/packages.js +3 -3
- package/scripts/csdr/config/register.js +166 -0
- package/scripts/csdr/init/remotes.js +4 -2
- package/scripts/index.js +5 -0
- package/scripts/utils/build/package/element.js +7 -4
- package/scripts/utils/pre-build/injection/routes-replacement.js +22 -2
- package/scripts/csdr/cli/skeletons/package/frontend/assets/i18n/en.json +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend/assets/i18n/fr.json +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend/gitignore_TO_REPLACE +0 -46
- package/scripts/csdr/cli/skeletons/package/frontend/karma.conf.js +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend/ng-package.json +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend/package.json +0 -4
- package/scripts/csdr/cli/skeletons/package/frontend/src/index.ts +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/components/cmp1/cmp1.component.html +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/components/cmp1/cmp1.component.spec.ts.TO_REPLACE +0 -25
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/components/cmp1/cmp1.component.ts +0 -14
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/core/module.service.spec.ts.TO_REPLACE +0 -12
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/core/module.service.ts +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/module.module.ts +0 -14
- package/scripts/csdr/cli/skeletons/package/frontend/src/test.ts.TO_REPLACE +0 -22
- package/scripts/csdr/cli/skeletons/package/frontend/tsconfig.lib.json +0 -32
- package/scripts/csdr/cli/skeletons/package/frontend/tsconfig.spec.json +0 -17
- package/scripts/csdr/cli/skeletons/package/frontend/tslint.json +0 -17
- package/scripts/csdr/cli/skeletons/package/frontend-eui14/dependencies-composite.json +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +0 -76
- package/scripts/csdr/cli/skeletons/package/frontend-remote/browserslist +0 -10
- package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-base.json +0 -2
- package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/gitignore_TO_REPLACE +0 -64
- package/scripts/csdr/cli/skeletons/package/frontend-remote/karma.conf.js +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/package.json_TO_REPLACE +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +0 -6
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +0 -84
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +0 -167
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/reducers/custom-route-serializer.ts +0 -28
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/reducers/index.ts +0 -42
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +0 -54
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/.gitkeep +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/index.ts +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/modules.ts +0 -12
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/environments/environment.prod.ts +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/environments/environment.ts +0 -15
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/favicon.ico +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +0 -10
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/main.ts +0 -12
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/polyfills.ts +0 -86
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/test.ts.TO_REPLACE +0 -20
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +0 -20
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.spec.json +0 -18
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tslint-remote.json +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tslint.json +0 -17
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/angular.json +0 -84
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/dependencies-composite.json +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/src/app/eui-components.ts +0 -9
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.build.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./out-tsc/lib",
|
|
5
|
-
"target": "es2015",
|
|
6
|
-
"module": "es2015",
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"inlineSources": true,
|
|
11
|
-
"emitDecoratorMetadata": true,
|
|
12
|
-
"experimentalDecorators": true,
|
|
13
|
-
"importHelpers": true,
|
|
14
|
-
"types": [],
|
|
15
|
-
"lib": [
|
|
16
|
-
"dom",
|
|
17
|
-
"es2018"
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"angularCompilerOptions": {
|
|
21
|
-
"annotateForClosureCompiler": true,
|
|
22
|
-
"skipTemplateCodegen": true,
|
|
23
|
-
"strictMetadataEmit": true,
|
|
24
|
-
"fullTemplateTypeCheck": true,
|
|
25
|
-
"strictInjectionParameters": true,
|
|
26
|
-
"enableResourceInlining": true
|
|
27
|
-
},
|
|
28
|
-
"exclude": [
|
|
29
|
-
"src/test.ts",
|
|
30
|
-
"**/*.spec.ts"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tslint.json",
|
|
3
|
-
"rules": {
|
|
4
|
-
"directive-selector": [
|
|
5
|
-
true,
|
|
6
|
-
"attribute",
|
|
7
|
-
"@module.scope.string@",
|
|
8
|
-
"camelCase"
|
|
9
|
-
],
|
|
10
|
-
"component-selector": [
|
|
11
|
-
true,
|
|
12
|
-
"element",
|
|
13
|
-
"@module.scope.string@",
|
|
14
|
-
"kebab-case"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"newProjectRoot": "apps",
|
|
5
|
-
"projects": {
|
|
6
|
-
"@module.full.name@": {
|
|
7
|
-
"root": ".",
|
|
8
|
-
"sourceRoot": "src",
|
|
9
|
-
"projectType": "application",
|
|
10
|
-
"prefix": "app",
|
|
11
|
-
"schematics": {},
|
|
12
|
-
"architect": {
|
|
13
|
-
"build": {
|
|
14
|
-
"builder": "ngx-build-plus:build",
|
|
15
|
-
"options": {
|
|
16
|
-
"outputPath": "dist",
|
|
17
|
-
"index": "src/index.html",
|
|
18
|
-
"main": "src/main.ts",
|
|
19
|
-
"polyfills": "src/polyfills.ts",
|
|
20
|
-
"tsConfig": "tsconfig.app.json",
|
|
21
|
-
"scripts": [
|
|
22
|
-
"./node_modules/@webcomponents/custom-elements/src/native-shim.js"
|
|
23
|
-
],
|
|
24
|
-
"assets": [
|
|
25
|
-
"src/assets"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"configurations": {
|
|
29
|
-
"production": {
|
|
30
|
-
"fileReplacements": [
|
|
31
|
-
{
|
|
32
|
-
"replace": "src/environments/environment.ts",
|
|
33
|
-
"with": "src/environments/environment.prod.ts"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"optimization": true,
|
|
37
|
-
"outputHashing": "all",
|
|
38
|
-
"sourceMap": false,
|
|
39
|
-
"extractCss": true,
|
|
40
|
-
"namedChunks": false,
|
|
41
|
-
"aot": true,
|
|
42
|
-
"extractLicenses": true,
|
|
43
|
-
"vendorChunk": false,
|
|
44
|
-
"buildOptimizer": false
|
|
45
|
-
},
|
|
46
|
-
"serve-dist": {
|
|
47
|
-
"outputPath": "serve-dist",
|
|
48
|
-
"wath": true
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"serve": {
|
|
53
|
-
"builder": "./node_modules/@angular-devkit/build-angular:dev-server",
|
|
54
|
-
"options": {
|
|
55
|
-
"browserTarget": "@module.full.name@:build:serve-dist"
|
|
56
|
-
},
|
|
57
|
-
"configurations": {
|
|
58
|
-
"production": {
|
|
59
|
-
"browserTarget": "@module.full.name@:build:production"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"test": {
|
|
64
|
-
"builder": "./node_modules/@angular-devkit/build-angular:karma",
|
|
65
|
-
"options": {
|
|
66
|
-
"main": "src/test.ts",
|
|
67
|
-
"polyfills": "src/polyfills.ts",
|
|
68
|
-
"tsConfig": "tsconfig.spec.json",
|
|
69
|
-
"karmaConfig": "karma.conf.js",
|
|
70
|
-
"scripts": []
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
|
|
2
|
-
# For additional information regarding the format and rule options, please see:
|
|
3
|
-
# https://github.com/browserslist/browserslist#queries
|
|
4
|
-
# For IE 9-11 support, please uncomment the last line of the file and adjust as needed
|
|
5
|
-
> 0.5%
|
|
6
|
-
last 2 versions
|
|
7
|
-
Firefox ESR
|
|
8
|
-
not dead
|
|
9
|
-
IE 9-11
|
|
10
|
-
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# compiled output
|
|
4
|
-
**/node_modules
|
|
5
|
-
**/target
|
|
6
|
-
**/build
|
|
7
|
-
**/dist
|
|
8
|
-
**/out-tsc
|
|
9
|
-
**/tmp
|
|
10
|
-
**/tests/reports
|
|
11
|
-
**/coverage
|
|
12
|
-
/src/assets/i18n-compiled/*
|
|
13
|
-
|
|
14
|
-
# IDEs and editors
|
|
15
|
-
/.idea
|
|
16
|
-
.project
|
|
17
|
-
.classpath
|
|
18
|
-
.c9/
|
|
19
|
-
*.launch
|
|
20
|
-
.settings/
|
|
21
|
-
*.sublime-workspace
|
|
22
|
-
|
|
23
|
-
# IDE - VSCode
|
|
24
|
-
.vscode/*
|
|
25
|
-
!.vscode/settings.json
|
|
26
|
-
!.vscode/tasks.json
|
|
27
|
-
!.vscode/launch.json
|
|
28
|
-
!.vscode/extensions.json
|
|
29
|
-
|
|
30
|
-
# misc
|
|
31
|
-
/.sass-cache
|
|
32
|
-
/connect.lock
|
|
33
|
-
/coverage
|
|
34
|
-
/libpeerconnection.log
|
|
35
|
-
npm-debug.log
|
|
36
|
-
testem.log
|
|
37
|
-
/typings
|
|
38
|
-
yarn-error.log
|
|
39
|
-
yarn.lock
|
|
40
|
-
|
|
41
|
-
# e2e
|
|
42
|
-
/e2e/*.js
|
|
43
|
-
/e2e/*.map
|
|
44
|
-
|
|
45
|
-
# System Files
|
|
46
|
-
.DS_Store
|
|
47
|
-
Thumbs.db
|
|
48
|
-
|
|
49
|
-
# Sub repositories
|
|
50
|
-
/apps
|
|
51
|
-
/packages
|
|
52
|
-
|
|
53
|
-
# temp exclude
|
|
54
|
-
package-lock.json
|
|
55
|
-
|
|
56
|
-
/.env
|
|
57
|
-
/.meta
|
|
58
|
-
/.euirc.json
|
|
59
|
-
/tsconfig.json
|
|
60
|
-
/tsconfig.build.json
|
|
61
|
-
/.ci-settings.xml
|
|
62
|
-
**/_trash
|
|
63
|
-
|
|
64
|
-
**/test/reports/
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, Inject } from '@angular/core';
|
|
2
|
-
import { Location } from '@angular/common';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
|
|
5
|
-
import { take, retry } from 'rxjs/operators';
|
|
6
|
-
|
|
7
|
-
import { CONFIG_TOKEN, I18nService, I18nLoadStatus } from '@eui/core';
|
|
8
|
-
import { appConfig } from '../config/index';
|
|
9
|
-
|
|
10
|
-
enum ElementStatus {
|
|
11
|
-
Loading = 'loading',
|
|
12
|
-
Loaded = 'loaded',
|
|
13
|
-
Error = 'error',
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@Component({
|
|
17
|
-
template: `
|
|
18
|
-
<ux-block-content *ngIf="moduleStatus === ElementStatus.Loading" [isBlocked]="true">
|
|
19
|
-
<div style="height: 100%"></div>
|
|
20
|
-
</ux-block-content>
|
|
21
|
-
<ng-container *ngIf="moduleStatus === ElementStatus.Loaded">
|
|
22
|
-
<router-outlet></router-outlet>
|
|
23
|
-
</ng-container>
|
|
24
|
-
<ng-container *ngIf="moduleStatus === ElementStatus.Error">
|
|
25
|
-
<div class="error-container">
|
|
26
|
-
<div>
|
|
27
|
-
<h1>Translations for this module failed to load.</h1>
|
|
28
|
-
<p>Do you want to try again?</p>
|
|
29
|
-
<ux-button (click)="loadTranslations()">{{ 'global.RELOAD' | translate }}</ux-button>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</ng-container>
|
|
33
|
-
`,
|
|
34
|
-
styles: [`
|
|
35
|
-
.error-container {
|
|
36
|
-
width: 50vw;
|
|
37
|
-
height: 50vh;
|
|
38
|
-
position: absolute;
|
|
39
|
-
top: 50%;
|
|
40
|
-
left: 50%;
|
|
41
|
-
transform: translate(-50%, -50%);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.error-container div {
|
|
45
|
-
text-align: center
|
|
46
|
-
}
|
|
47
|
-
`],
|
|
48
|
-
})
|
|
49
|
-
export class ModuleComponent implements OnInit {
|
|
50
|
-
ElementStatus = ElementStatus;
|
|
51
|
-
moduleStatus: ElementStatus;
|
|
52
|
-
|
|
53
|
-
constructor(private router: Router,
|
|
54
|
-
private location: Location,
|
|
55
|
-
@Inject(CONFIG_TOKEN) public config: any,
|
|
56
|
-
private i18nService: I18nService) {
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public ngOnInit() {
|
|
60
|
-
this.router.navigateByUrl(this.location.path(true));
|
|
61
|
-
this.loadTranslations();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private loadTranslations() {
|
|
65
|
-
this.setStatus(ElementStatus.Loading);
|
|
66
|
-
this.i18nService.lazyLoad({ i18nFolders: appConfig.global.i18nResources })
|
|
67
|
-
.pipe(take(1), retry(1))
|
|
68
|
-
.subscribe((loadStatus: I18nLoadStatus) => {
|
|
69
|
-
if (!loadStatus.success) {
|
|
70
|
-
this.setStatus(ElementStatus.Error);
|
|
71
|
-
console.error(`[ELEMENT: ${appConfig.global.elementName}] `, loadStatus.error);
|
|
72
|
-
} else {
|
|
73
|
-
this.setStatus(ElementStatus.Loaded);
|
|
74
|
-
}
|
|
75
|
-
}, (error) => {
|
|
76
|
-
this.setStatus(ElementStatus.Error);
|
|
77
|
-
console.error(`[ELEMENT: ${appConfig.global.elementName}] `, error);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
private setStatus(status: ElementStatus) {
|
|
82
|
-
this.moduleStatus = status;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { NgModule, Injector, NgZone } from '@angular/core';
|
|
2
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
3
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
|
-
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
5
|
-
import { createCustomElement } from '@angular/elements';
|
|
6
|
-
|
|
7
|
-
import { StoreModule } from '@ngrx/store';
|
|
8
|
-
import { EffectsModule } from '@ngrx/effects';
|
|
9
|
-
import { StoreRouterConnectingModule } from '@ngrx/router-store';
|
|
10
|
-
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
11
|
-
|
|
12
|
-
import { TranslateModule, TranslateService, TranslateStore } from '@ngx-translate/core';
|
|
13
|
-
|
|
14
|
-
// CSDR CORE - Babel defs & core reducers
|
|
15
|
-
import {
|
|
16
|
-
CachePreventionInterceptor,
|
|
17
|
-
CONFIG_TOKEN,
|
|
18
|
-
CorsSecurityInterceptor,
|
|
19
|
-
CsrfPreventionInterceptor,
|
|
20
|
-
EuLoginSessionTimeoutHandlingInterceptor,
|
|
21
|
-
HttpService,
|
|
22
|
-
I18nService,
|
|
23
|
-
LocalStorageService,
|
|
24
|
-
LogService,
|
|
25
|
-
OpenidConnectInterceptor,
|
|
26
|
-
OpenIdConnectService,
|
|
27
|
-
StorageService,
|
|
28
|
-
StoreService,
|
|
29
|
-
UserService,
|
|
30
|
-
UxAllModule,
|
|
31
|
-
UxAppShellService,
|
|
32
|
-
UxBreadcrumbsService,
|
|
33
|
-
UxDomService,
|
|
34
|
-
UxErrorFeedbackService,
|
|
35
|
-
UxService,
|
|
36
|
-
} from '@eui/core';
|
|
37
|
-
import { LanguageInterceptor, PushNotificationsService, BreadcrumbsService } from '@csdr/core';
|
|
38
|
-
// TODO[REMOTE-SETUP] uncomment if zipkin is used
|
|
39
|
-
// import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
|
|
40
|
-
|
|
41
|
-
import { TOKEN, reducerProvider, metaReducers } from './reducers/index';
|
|
42
|
-
import { CustomSerializer } from './reducers/custom-route-serializer';
|
|
43
|
-
|
|
44
|
-
import { environment } from '../environments/environment';
|
|
45
|
-
|
|
46
|
-
// TODO[REMOTE-SETUP] - import from wrapped package
|
|
47
|
-
// import { TaskMgrCommonModule } from '@cc/task-manager';
|
|
48
|
-
import { ELEMENT_ROUTER_TOKEN, PushNotificationMapping, UxServiceMapping } from '@csdr/integration';
|
|
49
|
-
import { RoutingModule } from './routing.module';
|
|
50
|
-
|
|
51
|
-
import { ModuleComponent } from './module.component';
|
|
52
|
-
import { appConfig } from '../config';
|
|
53
|
-
|
|
54
|
-
export function openidConnectInterceptorFactory(config) {
|
|
55
|
-
return new OpenidConnectInterceptor();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@NgModule({
|
|
59
|
-
imports: [
|
|
60
|
-
BrowserModule,
|
|
61
|
-
BrowserAnimationsModule,
|
|
62
|
-
HttpClientModule,
|
|
63
|
-
StoreRouterConnectingModule.forRoot({ stateKey: 'router', serializer: CustomSerializer }),
|
|
64
|
-
StoreModule.forRoot(TOKEN, { metaReducers }),
|
|
65
|
-
EffectsModule.forRoot([]),
|
|
66
|
-
StoreDevtoolsModule.instrument({ name: appConfig.global.storeName, maxAge: 150, logOnly: environment.production }),
|
|
67
|
-
TranslateModule,
|
|
68
|
-
|
|
69
|
-
UxAllModule,
|
|
70
|
-
// TODO import from package
|
|
71
|
-
// TaskMgrCommonModule,
|
|
72
|
-
RoutingModule,
|
|
73
|
-
],
|
|
74
|
-
declarations: [
|
|
75
|
-
ModuleComponent,
|
|
76
|
-
],
|
|
77
|
-
entryComponents: [
|
|
78
|
-
ModuleComponent,
|
|
79
|
-
],
|
|
80
|
-
providers: [
|
|
81
|
-
reducerProvider,
|
|
82
|
-
{
|
|
83
|
-
provide: HTTP_INTERCEPTORS,
|
|
84
|
-
useClass: LanguageInterceptor,
|
|
85
|
-
deps: [CONFIG_TOKEN, StorageService],
|
|
86
|
-
multi: true,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
provide: HTTP_INTERCEPTORS,
|
|
90
|
-
useClass: CorsSecurityInterceptor,
|
|
91
|
-
multi: true,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
provide: HTTP_INTERCEPTORS,
|
|
95
|
-
useClass: EuLoginSessionTimeoutHandlingInterceptor,
|
|
96
|
-
multi: true,
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
provide: HTTP_INTERCEPTORS,
|
|
100
|
-
useClass: CsrfPreventionInterceptor,
|
|
101
|
-
multi: true,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
provide: HTTP_INTERCEPTORS,
|
|
105
|
-
useClass: CachePreventionInterceptor,
|
|
106
|
-
multi: true,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
provide: HTTP_INTERCEPTORS,
|
|
110
|
-
useFactory: openidConnectInterceptorFactory,
|
|
111
|
-
deps: [CONFIG_TOKEN],
|
|
112
|
-
multi: true,
|
|
113
|
-
},
|
|
114
|
-
// TODO[REMOTE-SETUP] uncomment if zipkin is used
|
|
115
|
-
// {
|
|
116
|
-
// provide: HTTP_INTERCEPTORS,
|
|
117
|
-
// useClass: ZipkinHttpInterceptor,
|
|
118
|
-
// deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
|
|
119
|
-
// multi: true,
|
|
120
|
-
// },
|
|
121
|
-
{ provide: CONFIG_TOKEN, useFactory: () => window['PROVIDERS']['CONFIG_TOKEN'], deps: [] },
|
|
122
|
-
{
|
|
123
|
-
provide: UxService,
|
|
124
|
-
useFactory: () => new UxServiceMapping(window['PROVIDERS']['ngZone'], window['PROVIDERS']['UxService']),
|
|
125
|
-
deps: [],
|
|
126
|
-
},
|
|
127
|
-
{ provide: UxDomService, useFactory: () => window['PROVIDERS']['UxDomService'], deps: [] },
|
|
128
|
-
{ provide: UxErrorFeedbackService, useFactory: () => window['PROVIDERS']['UxErrorFeedbackService'], deps: [] },
|
|
129
|
-
{ provide: LocalStorageService, useFactory: () => window['PROVIDERS']['LocalStorageService'], deps: [] },
|
|
130
|
-
{ provide: StorageService, useFactory: () => window['PROVIDERS']['StorageService'], deps: [] },
|
|
131
|
-
{ provide: LogService, useFactory: () => window['PROVIDERS']['LogService'], deps: [] },
|
|
132
|
-
{ provide: UserService, useFactory: () => window['PROVIDERS']['UserService'], deps: [] },
|
|
133
|
-
{ provide: I18nService, useFactory: () => window['PROVIDERS']['I18nService'], deps: [] },
|
|
134
|
-
// ...window['PROVIDERS']['TranslateProviders'], todo: Is it necessary? Spread Op makes the build failing
|
|
135
|
-
{ provide: TranslateService, useFactory: () => window['PROVIDERS']['TranslateService'], deps: [] },
|
|
136
|
-
{ provide: TranslateStore, useFactory: () => window['PROVIDERS']['TranslateStore'], deps: [] },
|
|
137
|
-
{ provide: StoreService, useFactory: () => window['PROVIDERS']['StoreService'], deps: [] },
|
|
138
|
-
{ provide: UxBreadcrumbsService, useFactory: () => window['PROVIDERS']['UxBreadcrumbsService'], deps: [] },
|
|
139
|
-
{ provide: OpenIdConnectService, useFactory: () => window['PROVIDERS']['OpenIdConnectService'], deps: [] },
|
|
140
|
-
{ provide: HttpService, useFactory: () => window['PROVIDERS']['HttpService'], deps: [] },
|
|
141
|
-
{ provide: UxAppShellService, useFactory: () => window['PROVIDERS']['UxAppShellService'], deps: [] },
|
|
142
|
-
{
|
|
143
|
-
provide: PushNotificationsService,
|
|
144
|
-
useFactory: (zone: NgZone) => new PushNotificationMapping(zone, window['PROVIDERS']['PushNotificationsService']),
|
|
145
|
-
deps: [NgZone],
|
|
146
|
-
},
|
|
147
|
-
{ provide: BreadcrumbsService, useFactory: () => window['PROVIDERS']['BreadcrumbsService'], deps: [] },
|
|
148
|
-
{ provide: ELEMENT_ROUTER_TOKEN, useFactory: () => window['PROVIDERS']['ELEMENT_ROUTER_TOKEN'], deps: [] },
|
|
149
|
-
// TODO[REMOTE-SETUP] uncomment if zipkin is used
|
|
150
|
-
// { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
|
|
151
|
-
// { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
|
|
152
|
-
],
|
|
153
|
-
})
|
|
154
|
-
export class AppModule {
|
|
155
|
-
|
|
156
|
-
constructor(private injector: Injector) {
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
ngDoBootstrap() {
|
|
160
|
-
const elementSampleEui = createCustomElement(ModuleComponent, { injector: this.injector });
|
|
161
|
-
try {
|
|
162
|
-
customElements.define(appConfig.global.elementName, elementSampleEui);
|
|
163
|
-
} catch (e) {
|
|
164
|
-
console.log(e);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Params, RouterStateSnapshot } from '@angular/router';
|
|
2
|
-
import { RouterStateSerializer } from '@ngrx/router-store';
|
|
3
|
-
|
|
4
|
-
export interface RouterStateUrl {
|
|
5
|
-
url: string;
|
|
6
|
-
params: Params;
|
|
7
|
-
queryParams: Params;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class CustomSerializer implements RouterStateSerializer<RouterStateUrl> {
|
|
11
|
-
serialize(routerState: RouterStateSnapshot): RouterStateUrl {
|
|
12
|
-
let route = routerState.root;
|
|
13
|
-
|
|
14
|
-
while (route.firstChild) {
|
|
15
|
-
route = route.firstChild;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
url,
|
|
20
|
-
root: { queryParams },
|
|
21
|
-
} = routerState;
|
|
22
|
-
const { params } = route;
|
|
23
|
-
|
|
24
|
-
// Only return an object including the URL, params and query params
|
|
25
|
-
// instead of the entire snapshot
|
|
26
|
-
return { url, params, queryParams };
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store';
|
|
3
|
-
import * as fromRouter from '@ngrx/router-store';
|
|
4
|
-
import { storeFreeze } from 'ngrx-store-freeze';
|
|
5
|
-
import { reducers as coreReducers, CoreState, localStorageSync } from '@eui/core';
|
|
6
|
-
|
|
7
|
-
import { environment } from '../../environments/environment';
|
|
8
|
-
|
|
9
|
-
export interface AppState extends CoreState {
|
|
10
|
-
router: fromRouter.RouterReducerState<any>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// -----------------
|
|
14
|
-
// ------------ AOT
|
|
15
|
-
export const TOKEN = new InjectionToken<any>('AppReducers');
|
|
16
|
-
|
|
17
|
-
export function getReducers(): ActionReducerMap<AppState, any> {
|
|
18
|
-
return {
|
|
19
|
-
router: fromRouter.routerReducer,
|
|
20
|
-
...coreReducers,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const reducerProvider = [
|
|
25
|
-
{ provide: TOKEN, useFactory: getReducers },
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
// console.log all actions
|
|
29
|
-
export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
|
|
30
|
-
return (state, action) => {
|
|
31
|
-
const result = reducer(state, action);
|
|
32
|
-
console.groupCollapsed(action.type);
|
|
33
|
-
console.log('prev state', state);
|
|
34
|
-
console.log('action', action);
|
|
35
|
-
console.log('next state', result);
|
|
36
|
-
console.groupEnd();
|
|
37
|
-
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const metaReducers: MetaReducer<AppState>[] = !environment.production ? [logger, localStorageSync, storeFreeze] : [localStorageSync];
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { NgModule, NgZone, Inject } from '@angular/core';
|
|
2
|
-
import { RouterModule, Routes, Router, NavigationStart } from '@angular/router';
|
|
3
|
-
import { Subscription } from 'rxjs';
|
|
4
|
-
import { filter, distinctUntilChanged } from 'rxjs/operators';
|
|
5
|
-
|
|
6
|
-
import { CCRoute, ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration';
|
|
7
|
-
|
|
8
|
-
// TODO[REMOTE-SETUP] adapt to wrapped package import
|
|
9
|
-
// import { routes } from '@cc/task-manager';
|
|
10
|
-
import { appConfig } from '../config/index';
|
|
11
|
-
import { ModuleComponent } from './module.component';
|
|
12
|
-
|
|
13
|
-
const prefixedRoutes: Routes = [
|
|
14
|
-
{
|
|
15
|
-
path: appConfig.global.baseUrl,
|
|
16
|
-
// TODO[REMOTE-SETUP] adapt to wrapped package import
|
|
17
|
-
// children: routes,
|
|
18
|
-
},
|
|
19
|
-
{ path: '**', component: ModuleComponent },
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
// @dynamic
|
|
23
|
-
@NgModule({
|
|
24
|
-
imports: [
|
|
25
|
-
RouterModule.forRoot(prefixedRoutes),
|
|
26
|
-
],
|
|
27
|
-
exports: [
|
|
28
|
-
RouterModule,
|
|
29
|
-
],
|
|
30
|
-
})
|
|
31
|
-
export class RoutingModule {
|
|
32
|
-
private routes: CCRoute[] = prefixedRoutes.map(route => route as CCRoute);
|
|
33
|
-
|
|
34
|
-
private navigationStartSubscription: Subscription;
|
|
35
|
-
|
|
36
|
-
constructor(private router: Router,
|
|
37
|
-
private ngZone: NgZone,
|
|
38
|
-
@Inject(ELEMENT_ROUTER_TOKEN) private routerService: IRouterService) {
|
|
39
|
-
|
|
40
|
-
this.routerService.registerSubRouter(appConfig.global.baseUrl, (url: string) => {
|
|
41
|
-
this.ngZone.run(() => router.navigateByUrl(url));
|
|
42
|
-
}, this.routes);
|
|
43
|
-
|
|
44
|
-
this.navigationStartSubscription = this.router
|
|
45
|
-
.events
|
|
46
|
-
.pipe(
|
|
47
|
-
filter(event => event instanceof NavigationStart),
|
|
48
|
-
distinctUntilChanged((prev, curr) => prev['url'] === curr['url']),
|
|
49
|
-
)
|
|
50
|
-
.subscribe(data => {
|
|
51
|
-
this.routerService.subrouterEvent(appConfig.global.baseUrl, data);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
File without changes
|