@eui/tools 4.15.8 → 4.15.12

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.
Files changed (117) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +41 -0
  3. package/bin/eui-scripts.js +2 -0
  4. package/bin/scripts/build-package-sub.js +20 -0
  5. package/global.test.js +3 -3
  6. package/package.json +12 -16
  7. package/sandbox.js +3 -2
  8. package/scripts/csdr/cli/app.js +30 -3
  9. package/scripts/csdr/cli/package.js +41 -5
  10. package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
  11. package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
  12. package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
  13. package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
  14. package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
  15. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
  16. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
  17. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
  18. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
  19. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
  20. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
  21. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
  22. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
  23. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/shared/shared.module.ts +15 -0
  24. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
  25. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
  26. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/index.html +22 -0
  27. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/en.json +3 -0
  28. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/fr.json +3 -0
  29. package/scripts/csdr/cli/skeletons/package/frontend-eui10/gitignore_TO_REPLACE +46 -0
  30. package/scripts/csdr/cli/skeletons/package/frontend-eui10/karma.conf.js +7 -0
  31. package/scripts/csdr/cli/skeletons/package/frontend-eui10/ng-package.json +7 -0
  32. package/scripts/csdr/cli/skeletons/package/frontend-eui10/package.json +4 -0
  33. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/index.ts +1 -0
  34. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/lib/module.ts +11 -0
  35. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/test.ts.TO_REPLACE +21 -0
  36. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.lib.json +32 -0
  37. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.spec.json +17 -0
  38. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tslint.json +17 -0
  39. package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +3 -3
  40. package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +1 -0
  41. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +3 -0
  42. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +6 -0
  43. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +62 -28
  44. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +33 -33
  45. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +22 -10
  46. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +1 -0
  47. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +1 -0
  48. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +8 -5
  49. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +1 -1
  50. package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +3 -1
  51. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/angular.json +90 -0
  52. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/browserslist +10 -0
  53. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-base.json +2 -0
  54. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite.json +7 -0
  55. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/gitignore_TO_REPLACE +64 -0
  56. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/karma.conf.js +7 -0
  57. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/package.json_TO_REPLACE +8 -0
  58. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/dummy.scss +3 -0
  59. 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
  60. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.component.ts +71 -0
  61. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +165 -0
  62. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/custom-route-serializer.ts +28 -0
  63. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/index.ts +42 -0
  64. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +51 -0
  65. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/assets/.gitkeep +0 -0
  66. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/global.ts +31 -0
  67. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/index.ts +20 -0
  68. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/modules.ts +3 -0
  69. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.prod.ts +3 -0
  70. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.ts +15 -0
  71. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/favicon.ico +0 -0
  72. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/index.html +10 -0
  73. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/main.ts +12 -0
  74. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/polyfills.ts +86 -0
  75. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/test.ts.TO_REPLACE +20 -0
  76. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.app.json +20 -0
  77. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.spec.json +18 -0
  78. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint-remote.json +7 -0
  79. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint.json +17 -0
  80. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/webpack.extra.js +15 -0
  81. package/scripts/csdr/config/angular.js +220 -10
  82. package/scripts/csdr/config/global.js +16 -0
  83. package/scripts/csdr/install/common.js +26 -8
  84. package/scripts/csdr/jira/jira-utils.js +168 -168
  85. package/scripts/csdr/jira/update.js +150 -150
  86. package/scripts/csdr/metadata/app-envs.js +34 -33
  87. package/scripts/csdr/metadata/app-history.js +62 -61
  88. package/scripts/csdr/metadata/common.js +44 -41
  89. package/scripts/csdr/metadata/package-history.js +0 -1
  90. package/scripts/csdr/release/package/remote.js +3 -3
  91. package/scripts/csdr/release/package/ui.js +3 -3
  92. package/scripts/csdr/sync/sync-utils.js +6 -2
  93. package/scripts/utils/build/package/build-package-utils.js +45 -0
  94. package/scripts/utils/build/package/styles.js +106 -7
  95. package/scripts/utils/confluence-utils.js +126 -126
  96. package/scripts/utils/index.js +2 -2
  97. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/favicon.ico +0 -0
  98. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
  99. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
  100. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
  101. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
  102. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
  103. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
  104. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
  105. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
  106. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
  107. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
  108. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
  109. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
  110. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
  111. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
  112. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
  113. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
  114. package/scripts/utils/pre-build/injection/skeletons.js +6 -2
  115. package/scripts/utils/pre-build/projects.js +5 -1
  116. package/scripts/utils/tools.js +13 -0
  117. package/scripts/csdr/cli/skeletons/package/frontend-remote/webpack.extra.js +0 -7
@@ -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,7 @@
1
+ {
2
+ "@eui/deps-base": "^10.0.0",
3
+
4
+ "@csdr/core": "^2.0.0",
5
+ "@csdr/integration": "^2.0.0",
6
+ "@csdr/zipkin-tracing": "^4.0.0"
7
+ }
@@ -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/
@@ -0,0 +1,7 @@
1
+ const karmaConfig = require('@eui/tools/karma/karma.conf');
2
+
3
+ module.exports = function (config) {
4
+ config.set(
5
+ karmaConfig.get(config)
6
+ );
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@module.scope@/@module.name@-remote-el",
3
+ "version": "1.0.0",
4
+ "files": [
5
+ "bundles"
6
+ ],
7
+ "dependencies": {}
8
+ }
@@ -0,0 +1,3 @@
1
+ .example {
2
+ padding: 10px;
3
+ }
@@ -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
+ }
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ import { ModulesConfig } from '@eui/core';
2
+
3
+ export const MODULES: ModulesConfig = window['PROVIDERS']['CONFIG_TOKEN'].modules;
@@ -0,0 +1,3 @@
1
+ export const environment = {
2
+ production: true,
3
+ };
@@ -0,0 +1,15 @@
1
+ // This file can be replaced during build by using the `fileReplacements` array.
2
+ // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
3
+ // The list of file replacements can be found in `angular.json`.
4
+
5
+ export const environment = {
6
+ production: false,
7
+ };
8
+
9
+ /*
10
+ * In development mode, to ignore zone related error stack frames such as
11
+ * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
12
+ * import the following file, but please comment it out in production mode
13
+ * because it will have performance impact when throw error
14
+ */
15
+ // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
@@ -0,0 +1,10 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <base href="/">
6
+ </head>
7
+ <body>
8
+ dummy index.html
9
+ </body>
10
+ </html>
@@ -0,0 +1,12 @@
1
+ import { enableProdMode } from '@angular/core';
2
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
+
4
+ import { AppModule } from './app/module';
5
+ import { environment } from './environments/environment';
6
+
7
+ if (environment.production) {
8
+ enableProdMode();
9
+ }
10
+
11
+ platformBrowserDynamic().bootstrapModule(AppModule)
12
+ .catch(err => console.log(err));