@eui/tools 4.15.9 → 4.15.13
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 +41 -0
- package/bin/eui-scripts.js +6 -2
- package/bin/scripts/build-package-sub.js +20 -0
- package/bin/scripts/version.js +12 -0
- package/global.test.js +3 -3
- package/package.json +12 -16
- package/sandbox.js +3 -2
- package/scripts/csdr/cli/app.js +30 -3
- package/scripts/csdr/cli/package.js +41 -5
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/shared/shared.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/index.html +22 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/en.json +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/fr.json +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/gitignore_TO_REPLACE +46 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/karma.conf.js +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/ng-package.json +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/package.json +4 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/index.ts +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/lib/module.ts +11 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/test.ts.TO_REPLACE +21 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.lib.json +32 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.spec.json +17 -0
- package/scripts/csdr/cli/skeletons/package/frontend-eui10/tslint.json +17 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +3 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +6 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +62 -28
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +33 -33
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +22 -10
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +8 -5
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +1 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +3 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/angular.json +90 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/browserslist +10 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-base.json +2 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite.json +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/gitignore_TO_REPLACE +64 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/karma.conf.js +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/package.json_TO_REPLACE +8 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/dummy.scss +3 -0
- package/scripts/csdr/cli/skeletons/package/{frontend-remote/src/app/dummy.spec.ts.TO_REPLACE → frontend-remote-eui10/src/app/dummy.spec.ts} +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.component.ts +71 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +165 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/custom-route-serializer.ts +28 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/index.ts +42 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +51 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/assets/.gitkeep +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/global.ts +31 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/index.ts +20 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/modules.ts +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.prod.ts +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.ts +15 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/favicon.ico +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/index.html +10 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/main.ts +12 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/polyfills.ts +86 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/test.ts.TO_REPLACE +20 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.app.json +20 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.spec.json +18 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint-remote.json +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint.json +17 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/webpack.extra.js +15 -0
- package/scripts/csdr/config/angular.js +213 -3
- package/scripts/csdr/config/global.js +16 -0
- package/scripts/csdr/init/resources/yarn-eui13.lock +15857 -0
- package/scripts/csdr/install/common.js +26 -8
- package/scripts/csdr/jira/jira-utils.js +168 -168
- package/scripts/csdr/jira/update.js +150 -150
- package/scripts/csdr/metadata/app-envs.js +34 -33
- package/scripts/csdr/metadata/app-history.js +62 -61
- package/scripts/csdr/metadata/common.js +44 -41
- package/scripts/csdr/metadata/package-history.js +0 -1
- package/scripts/csdr/release/app/release-app.js +3 -0
- package/scripts/csdr/release/package/release-package.js +4 -0
- package/scripts/csdr/release/package/remote.js +3 -3
- package/scripts/csdr/release/package/ui.js +3 -3
- package/scripts/csdr/sync/sync-utils.js +6 -2
- package/scripts/utils/build/package/angular.js +4 -4
- package/scripts/utils/build/package/build-package-utils.js +50 -1
- package/scripts/utils/build/package/styles.js +100 -7
- package/scripts/utils/confluence-utils.js +126 -126
- package/scripts/utils/index.js +2 -2
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
- package/scripts/utils/pre-build/injection/skeletons.js +6 -2
- package/scripts/utils/pre-build/projects.js +5 -1
- package/scripts/utils/tools.js +30 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/webpack.extra.js +0 -7
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export const GLOBAL = {
|
|
2
|
-
|
|
3
|
-
baseUrl: '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
/* URL that needs to be used in the appRouting of the MWP */
|
|
3
|
+
baseUrl: '@module.name@',
|
|
4
|
+
/* the path/s where translation resources will be loaded */
|
|
5
|
+
i18nResources: ['elements/@module.full.name@/bundles/assets/i18n-compiled'],
|
|
6
|
+
/* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
|
|
7
|
+
elementName: '@module.scope@-@module.name@-v7',
|
|
8
|
+
/* in case you are using NgRx give it a unique name (mostly for debugging) */
|
|
9
|
+
storeName: '@module.scope@ @module.name@',
|
|
7
10
|
};
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
"deployUrl": "/mwp/assets/elements/@module.full.name@/bundles/",
|
|
17
|
+
"outputPath": "dist",
|
|
18
|
+
"index": "src/index.html",
|
|
19
|
+
"main": "src/main.ts",
|
|
20
|
+
"polyfills": "src/polyfills.ts",
|
|
21
|
+
"tsConfig": "tsconfig.app.json",
|
|
22
|
+
"scripts": [
|
|
23
|
+
"./node_modules/@webcomponents/custom-elements/src/native-shim.js"
|
|
24
|
+
],
|
|
25
|
+
"assets": [
|
|
26
|
+
"src/assets"
|
|
27
|
+
],
|
|
28
|
+
"styles": [
|
|
29
|
+
"./node_modules/@eui/styles/dist/styles/eui-primeng.css",
|
|
30
|
+
"./node_modules/@eui/styles/dist/styles/eui.css",
|
|
31
|
+
"./node_modules/@eui/styles/dist/styles/eui-next.css",
|
|
32
|
+
"./node_modules/@eui/styles/dist/styles/eui-components.css",
|
|
33
|
+
"./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css",
|
|
34
|
+
"./node_modules/@eui/styles/dist/assets/fonts/font-awesome/font-awesome.min.css",
|
|
35
|
+
"./node_modules/@eui/styles/dist/assets/fonts/flag-icons/css/flag-icon.min.css"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"configurations": {
|
|
39
|
+
"production": {
|
|
40
|
+
"fileReplacements": [
|
|
41
|
+
{
|
|
42
|
+
"replace": "src/environments/environment.ts",
|
|
43
|
+
"with": "src/environments/environment.prod.ts"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"optimization": true,
|
|
47
|
+
"outputHashing": "all",
|
|
48
|
+
"sourceMap": false,
|
|
49
|
+
"extractCss": true,
|
|
50
|
+
"namedChunks": false,
|
|
51
|
+
"aot": true,
|
|
52
|
+
"extractLicenses": true,
|
|
53
|
+
"vendorChunk": false,
|
|
54
|
+
"buildOptimizer": true
|
|
55
|
+
},
|
|
56
|
+
"serve-dist": {
|
|
57
|
+
"outputPath": "serve-dist",
|
|
58
|
+
"wath": true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"serve": {
|
|
63
|
+
"builder": "./node_modules/@angular-devkit/build-angular:dev-server",
|
|
64
|
+
"options": {
|
|
65
|
+
"deployUrl": "/assets/elements/@module.full.name@/bundles/",
|
|
66
|
+
"browserTarget": "@module.full.name@:build:serve-dist"
|
|
67
|
+
},
|
|
68
|
+
"configurations": {
|
|
69
|
+
"production": {
|
|
70
|
+
"browserTarget": "@module.full.name@:build:production"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"test": {
|
|
75
|
+
"builder": "./node_modules/@angular-devkit/build-angular:karma",
|
|
76
|
+
"options": {
|
|
77
|
+
"main": "src/test.ts",
|
|
78
|
+
"polyfills": "src/polyfills.ts",
|
|
79
|
+
"tsConfig": "tsconfig.spec.json",
|
|
80
|
+
"karmaConfig": "karma.conf.js",
|
|
81
|
+
"scripts": []
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"cli": {
|
|
88
|
+
"analytics": false
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
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/
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Component, OnInit, Inject } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration';
|
|
5
|
+
|
|
6
|
+
import { CONFIG_TOKEN, I18nService, UxAppShellService } from '@eui/core';
|
|
7
|
+
|
|
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
|
+
<ng-container *ngIf="moduleStatus === ElementStatus.Loaded">
|
|
19
|
+
<router-outlet></router-outlet>
|
|
20
|
+
</ng-container>
|
|
21
|
+
`,
|
|
22
|
+
styles: [`
|
|
23
|
+
.error-container {
|
|
24
|
+
width: 50vw;
|
|
25
|
+
height: 50vh;
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 50%;
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translate(-50%, -50%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.error-container div {
|
|
33
|
+
text-align: center
|
|
34
|
+
}
|
|
35
|
+
`],
|
|
36
|
+
})
|
|
37
|
+
export class ModuleComponent implements OnInit {
|
|
38
|
+
ElementStatus = ElementStatus;
|
|
39
|
+
moduleStatus: ElementStatus;
|
|
40
|
+
|
|
41
|
+
constructor(private router: Router,
|
|
42
|
+
@Inject(ELEMENT_ROUTER_TOKEN) private routerService: IRouterService,
|
|
43
|
+
@Inject(CONFIG_TOKEN) public config: any,
|
|
44
|
+
private i18nService: I18nService,
|
|
45
|
+
private uxAppShellService: UxAppShellService) {
|
|
46
|
+
console.log(this.uxAppShellService.isGrowlSticky);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public ngOnInit() {
|
|
50
|
+
this.router.navigate([this.routerService.getUrl()], { replaceUrl: true });
|
|
51
|
+
this.loadTranslations();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private loadTranslations() {
|
|
55
|
+
this.setStatus(ElementStatus.Loading);
|
|
56
|
+
this.i18nService
|
|
57
|
+
.init({ activeLang: 'en' })
|
|
58
|
+
.subscribe(s => {
|
|
59
|
+
// TODO: timeout is needed for right
|
|
60
|
+
// top select element items which
|
|
61
|
+
// are not translated.
|
|
62
|
+
//
|
|
63
|
+
// eUI init method needs to be checked
|
|
64
|
+
setTimeout(() => this.setStatus(ElementStatus.Loaded), 500);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private setStatus(status: ElementStatus) {
|
|
69
|
+
this.moduleStatus = status;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { NgModule, Injector, NgZone, PLATFORM_ID } from '@angular/core';
|
|
2
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
3
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
|
+
import { APP_BASE_HREF } from '@angular/common';
|
|
5
|
+
import { Router } from '@angular/router';
|
|
6
|
+
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
7
|
+
import { createCustomElement } from '@angular/elements';
|
|
8
|
+
|
|
9
|
+
import { StoreModule } from '@ngrx/store';
|
|
10
|
+
import { EffectsModule } from '@ngrx/effects';
|
|
11
|
+
import { StoreRouterConnectingModule } from '@ngrx/router-store';
|
|
12
|
+
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
13
|
+
|
|
14
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
15
|
+
|
|
16
|
+
// CSDR CORE - Babel defs & core reducers
|
|
17
|
+
import {
|
|
18
|
+
CachePreventionInterceptor,
|
|
19
|
+
CONFIG_TOKEN,
|
|
20
|
+
CoreModule,
|
|
21
|
+
CorsSecurityInterceptor,
|
|
22
|
+
CsrfPreventionInterceptor,
|
|
23
|
+
EUI_CONFIG_TOKEN,
|
|
24
|
+
EuLoginSessionTimeoutHandlingInterceptor,
|
|
25
|
+
I18nService,
|
|
26
|
+
OpenIdConnectInterceptor,
|
|
27
|
+
StoreService,
|
|
28
|
+
translateConfig,
|
|
29
|
+
UserService,
|
|
30
|
+
UxAppShellService,
|
|
31
|
+
} from '@eui/core';
|
|
32
|
+
import { PushNotificationsService } from '@csdr/core';
|
|
33
|
+
import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
|
|
34
|
+
|
|
35
|
+
import { TOKEN, reducerProvider, metaReducers } from './reducers/index';
|
|
36
|
+
import { CustomSerializer } from './reducers/custom-route-serializer';
|
|
37
|
+
|
|
38
|
+
import { environment } from '../environments/environment';
|
|
39
|
+
import { appConfig } from '../config';
|
|
40
|
+
|
|
41
|
+
// import { TaskMgrCommonModule } from '@cc/task-manager'; // TODO adapt to central package import
|
|
42
|
+
import {
|
|
43
|
+
ELEMENT_ROUTER_TOKEN,
|
|
44
|
+
PushNotificationMapping,
|
|
45
|
+
USER_SERVICE_HOST_TOKEN,
|
|
46
|
+
UserMapping,
|
|
47
|
+
UX_SERVICE_HOST_TOKEN,
|
|
48
|
+
UxAppShellServiceMapping,
|
|
49
|
+
} from '@csdr/integration';
|
|
50
|
+
import { RoutingModule } from './routing.module';
|
|
51
|
+
|
|
52
|
+
import { ModuleComponent } from './module.component';
|
|
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.forRoot(translateConfig),
|
|
68
|
+
|
|
69
|
+
CoreModule.forRoot(),
|
|
70
|
+
|
|
71
|
+
// TaskMgrCommonModule, // TODO adapt to central package import
|
|
72
|
+
RoutingModule,
|
|
73
|
+
],
|
|
74
|
+
declarations: [
|
|
75
|
+
ModuleComponent,
|
|
76
|
+
],
|
|
77
|
+
entryComponents: [
|
|
78
|
+
ModuleComponent,
|
|
79
|
+
],
|
|
80
|
+
providers: [
|
|
81
|
+
{ provide: APP_BASE_HREF, useValue: `/${appConfig.global.baseUrl}` },
|
|
82
|
+
reducerProvider,
|
|
83
|
+
{
|
|
84
|
+
provide: EUI_CONFIG_TOKEN,
|
|
85
|
+
useValue: { appConfig, environment },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
provide: HTTP_INTERCEPTORS,
|
|
89
|
+
useClass: CorsSecurityInterceptor,
|
|
90
|
+
multi: true,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
provide: HTTP_INTERCEPTORS,
|
|
94
|
+
useClass: EuLoginSessionTimeoutHandlingInterceptor,
|
|
95
|
+
multi: true,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
provide: HTTP_INTERCEPTORS,
|
|
99
|
+
useClass: CsrfPreventionInterceptor,
|
|
100
|
+
multi: true,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
provide: HTTP_INTERCEPTORS,
|
|
104
|
+
useClass: CachePreventionInterceptor,
|
|
105
|
+
multi: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
provide: HTTP_INTERCEPTORS,
|
|
109
|
+
useFactory: openidConnectInterceptorFactory,
|
|
110
|
+
deps: [CONFIG_TOKEN],
|
|
111
|
+
multi: true,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
provide: HTTP_INTERCEPTORS,
|
|
115
|
+
useClass: ZipkinHttpInterceptor,
|
|
116
|
+
deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
|
|
117
|
+
multi: true,
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
// used in the el-mappers
|
|
121
|
+
{ provide: USER_SERVICE_HOST_TOKEN, useFactory: () => window['PROVIDERS']['UserService'] },
|
|
122
|
+
{ provide: UX_SERVICE_HOST_TOKEN, useFactory: () => window['PROVIDERS']['UxService'] },
|
|
123
|
+
|
|
124
|
+
{
|
|
125
|
+
provide: PushNotificationsService,
|
|
126
|
+
useFactory: (zone: NgZone) => new PushNotificationMapping(zone, window['PROVIDERS']['PushNotificationsService']),
|
|
127
|
+
deps: [NgZone],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
provide: UserService,
|
|
131
|
+
useFactory: (storeService: StoreService, hostUserService: any) => new UserMapping(storeService, hostUserService),
|
|
132
|
+
deps: [StoreService, USER_SERVICE_HOST_TOKEN],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
provide: UxAppShellService,
|
|
136
|
+
useFactory: (
|
|
137
|
+
config: any,
|
|
138
|
+
http: HttpClient,
|
|
139
|
+
platformId: any,
|
|
140
|
+
router: Router,
|
|
141
|
+
storeService: StoreService,
|
|
142
|
+
iI18nService: I18nService,
|
|
143
|
+
hostUserService: any) => new UxAppShellServiceMapping(
|
|
144
|
+
config, http, platformId, router, storeService, iI18nService, hostUserService),
|
|
145
|
+
deps: [CONFIG_TOKEN, HttpClient, PLATFORM_ID, Router, StoreService, I18nService, UX_SERVICE_HOST_TOKEN],
|
|
146
|
+
},
|
|
147
|
+
{ provide: ELEMENT_ROUTER_TOKEN, useFactory: () => window['PROVIDERS']['ELEMENT_ROUTER_TOKEN'], deps: [] },
|
|
148
|
+
{ provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
|
|
149
|
+
{ provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
|
|
150
|
+
],
|
|
151
|
+
})
|
|
152
|
+
export class AppModule {
|
|
153
|
+
|
|
154
|
+
constructor(private injector: Injector) {
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
ngDoBootstrap() {
|
|
158
|
+
const elementSampleEui = createCustomElement(ModuleComponent, { injector: this.injector });
|
|
159
|
+
try {
|
|
160
|
+
customElements.define(appConfig.global.elementName, elementSampleEui);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
console.log(e);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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];
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
// import { routes } from '@cc/task-manager'; // TODO adapt to central package import
|
|
9
|
+
import { appConfig } from '../config/index';
|
|
10
|
+
import { ModuleComponent } from './module.component';
|
|
11
|
+
|
|
12
|
+
const prefixedRoutes: Routes = [
|
|
13
|
+
{
|
|
14
|
+
path: appConfig.global.baseUrl,
|
|
15
|
+
// children: routes, // TODO adapt to central package routes
|
|
16
|
+
},
|
|
17
|
+
{ path: '**', component: ModuleComponent },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
// @dynamic
|
|
21
|
+
@NgModule({
|
|
22
|
+
imports: [
|
|
23
|
+
RouterModule.forRoot(prefixedRoutes),
|
|
24
|
+
],
|
|
25
|
+
exports: [
|
|
26
|
+
RouterModule,
|
|
27
|
+
],
|
|
28
|
+
})
|
|
29
|
+
export class RoutingModule {
|
|
30
|
+
private routes: CCRoute[] = prefixedRoutes.map(route => route as CCRoute);
|
|
31
|
+
|
|
32
|
+
private navigationStartSubscription: Subscription;
|
|
33
|
+
|
|
34
|
+
constructor(private router: Router,
|
|
35
|
+
private ngZone: NgZone,
|
|
36
|
+
@Inject(ELEMENT_ROUTER_TOKEN) private routerService: IRouterService) {
|
|
37
|
+
|
|
38
|
+
this.routerService.registerSubRouter(appConfig.global.baseUrl, (url: string) => {
|
|
39
|
+
this.ngZone.run(() => router.navigateByUrl(url));
|
|
40
|
+
}, this.routes);
|
|
41
|
+
|
|
42
|
+
this.navigationStartSubscription = this.router.events
|
|
43
|
+
.pipe(
|
|
44
|
+
filter(event => event instanceof NavigationStart),
|
|
45
|
+
distinctUntilChanged((prev, curr) => prev['url'] === curr['url']),
|
|
46
|
+
)
|
|
47
|
+
.subscribe((data: NavigationStart) => {
|
|
48
|
+
this.routerService.subrouterEvent(appConfig.global.baseUrl, data);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GlobalConfig, I18nConfig } from '@eui/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internationalization Configuration
|
|
5
|
+
*/
|
|
6
|
+
const i18nConfig: I18nConfig = {
|
|
7
|
+
i18nLoader: {
|
|
8
|
+
i18nFolders: ['elements/@module.full.name@/bundles/assets/i18n-compiled'],
|
|
9
|
+
i18nResources: [{
|
|
10
|
+
prefix: 'assets/i18n-eui/',
|
|
11
|
+
suffix: '.json',
|
|
12
|
+
}],
|
|
13
|
+
},
|
|
14
|
+
i18nService: {
|
|
15
|
+
languages: ['en', 'fr'],
|
|
16
|
+
defaultLanguage: 'en',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Global Configuration
|
|
22
|
+
*/
|
|
23
|
+
export const GLOBAL: GlobalConfig = {
|
|
24
|
+
/* URL that needs to be used in the appRouting of the MWP */
|
|
25
|
+
baseUrl: '@module.name@-v10',
|
|
26
|
+
/* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
|
|
27
|
+
elementName: '@module.scope@-@module.name@-v10',
|
|
28
|
+
/* in case you are using NgRx give it a unique name (mostly for debugging) */
|
|
29
|
+
storeName: '@module.scope@ @module.name@',
|
|
30
|
+
i18n: i18nConfig,
|
|
31
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GLOBAL } from './global';
|
|
2
|
+
import { MODULES } from './modules';
|
|
3
|
+
import { EuiAppConfig, LogLevel, ConsoleAppender, LogConfig } from '@eui/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Log Configuration
|
|
7
|
+
*/
|
|
8
|
+
const logConfig: LogConfig = {
|
|
9
|
+
logLevel: LogLevel.ALL,
|
|
10
|
+
logAppenders: [{
|
|
11
|
+
type: ConsoleAppender,
|
|
12
|
+
prefixFormat: '[{level}]',
|
|
13
|
+
}],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const appConfig: EuiAppConfig = {
|
|
17
|
+
global: GLOBAL,
|
|
18
|
+
modules: MODULES,
|
|
19
|
+
log: logConfig,
|
|
20
|
+
};
|