@eui/tools 6.21.125 → 6.21.127
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 +18 -0
- package/package.json +1 -4
- package/scripts/csdr/init/resources/17.x/yarn.lock +18166 -0
- package/scripts/csdr/init/resources/18.x/{yarn.lock.old → yarn.lock} +5086 -4702
- package/scripts/csdr/init/resources/19.x/yarn.lock +15686 -0
- package/scripts/csdr/install/common.js +1 -1
- package/scripts/utils/build/package/nodeJs.js +0 -5
- package/scripts/utils/clean/clean-utils.js +8 -0
- package/scripts/utils/migrate/migrate-utils.js +10 -8
- package/scripts/utils/test/test-utils.js +0 -36
- package/scripts/csdr/config/projects.test.js +0 -24
- package/scripts/csdr/init/remotes/10.x/base/angular.json +0 -89
- package/scripts/csdr/init/remotes/10.x/base/browserslist +0 -6
- package/scripts/csdr/init/remotes/10.x/base/package.json_TO_REPLACE +0 -14
- package/scripts/csdr/init/remotes/10.x/base/tsconfig.app.json +0 -20
- package/scripts/csdr/init/remotes/10.x/full/common/app/eui-components.ts +0 -11
- package/scripts/csdr/init/remotes/10.x/full/common/app/fallback.component.ts +0 -11
- package/scripts/csdr/init/remotes/10.x/full/common/app/module.component.ts +0 -98
- package/scripts/csdr/init/remotes/10.x/full/common/app/module.ts +0 -97
- package/scripts/csdr/init/remotes/10.x/full/common/app/reducers/custom-route-serializer.ts +0 -28
- package/scripts/csdr/init/remotes/10.x/full/common/app/reducers/index.ts +0 -51
- package/scripts/csdr/init/remotes/10.x/full/common/app/routing.module.ts +0 -34
- package/scripts/csdr/init/remotes/10.x/full/common/assets/.gitkeep +0 -0
- package/scripts/csdr/init/remotes/10.x/full/common/config/global.ts +0 -115
- package/scripts/csdr/init/remotes/10.x/full/common/config/index.ts +0 -10
- package/scripts/csdr/init/remotes/10.x/full/common/config/modules.ts +0 -3
- package/scripts/csdr/init/remotes/10.x/full/common/environments/environment.prod.ts +0 -3
- package/scripts/csdr/init/remotes/10.x/full/common/environments/environment.ts +0 -3
- package/scripts/csdr/init/remotes/10.x/full/common/favicon.ico +0 -0
- package/scripts/csdr/init/remotes/10.x/full/common/index.html +0 -10
- package/scripts/csdr/init/remotes/10.x/full/common/main.ts +0 -11
- package/scripts/csdr/init/remotes/10.x/full/common/polyfills.ts +0 -87
- package/scripts/csdr/init/remotes/10.x/full/common/test.ts +0 -20
- package/scripts/csdr/init/remotes/10.x/full/options/all-locales/config/global.ts +0 -119
- package/scripts/csdr/init/remotes/10.x/full/options/definitions/dynatrace.json +0 -4
- package/scripts/csdr/init/remotes/10.x/full/options/definitions/participant.json +0 -3
- package/scripts/csdr/init/remotes/10.x/full/options/definitions/user-reducers.json +0 -3
- package/scripts/csdr/init/remotes/10.x/full/options/definitions/zipkin.json +0 -5
- package/scripts/csdr/init/remotes/10.x/full/options/participant/app/module.component.ts +0 -101
- package/scripts/csdr/init/remotes/10.x/full/options/participant/app/routing.module.ts +0 -26
- package/scripts/csdr/init/remotes/10.x/full/options/participant/config/index.ts +0 -10
- package/scripts/csdr/init/remotes/10.x/full/options/user-reducers/app/reducers/index.ts +0 -75
- package/scripts/csdr/init/remotes/15.x/base/angular.json +0 -87
- package/scripts/csdr/init/remotes/15.x/base/browserslist +0 -6
- package/scripts/csdr/init/remotes/15.x/base/package.json_TO_REPLACE +0 -10
- package/scripts/csdr/init/remotes/15.x/base/tsconfig.app.json +0 -24
- package/scripts/csdr/init/remotes/15.x/base/yarn.lock.old +0 -14091
- package/scripts/csdr/init/remotes/15.x/full/common/app/eui-components.ts +0 -9
- package/scripts/csdr/init/remotes/15.x/full/common/app/fallback.component.ts +0 -11
- package/scripts/csdr/init/remotes/15.x/full/common/app/module.component.ts +0 -98
- package/scripts/csdr/init/remotes/15.x/full/common/app/module.ts +0 -100
- package/scripts/csdr/init/remotes/15.x/full/common/app/reducers/custom-route-serializer.ts +0 -28
- package/scripts/csdr/init/remotes/15.x/full/common/app/reducers/index.ts +0 -51
- package/scripts/csdr/init/remotes/15.x/full/common/app/routing.module.ts +0 -34
- package/scripts/csdr/init/remotes/15.x/full/common/assets/.gitkeep +0 -0
- package/scripts/csdr/init/remotes/15.x/full/common/config/global.ts +0 -118
- package/scripts/csdr/init/remotes/15.x/full/common/config/index.ts +0 -10
- package/scripts/csdr/init/remotes/15.x/full/common/config/modules.ts +0 -3
- package/scripts/csdr/init/remotes/15.x/full/common/environments/environment.prod.ts +0 -3
- package/scripts/csdr/init/remotes/15.x/full/common/environments/environment.ts +0 -3
- package/scripts/csdr/init/remotes/15.x/full/common/favicon.ico +0 -0
- package/scripts/csdr/init/remotes/15.x/full/common/index.html +0 -10
- package/scripts/csdr/init/remotes/15.x/full/common/main.ts +0 -11
- package/scripts/csdr/init/remotes/15.x/full/common/polyfills.ts +0 -88
- package/scripts/csdr/init/remotes/15.x/full/common/test.ts +0 -20
- package/scripts/csdr/init/remotes/15.x/full/options/ag-grid/main.ts +0 -17
- package/scripts/csdr/init/remotes/15.x/full/options/all-locales/config/global.ts +0 -122
- package/scripts/csdr/init/remotes/15.x/full/options/definitions/dynamic-forms.json +0 -4
- package/scripts/csdr/init/remotes/15.x/full/options/definitions/dynatrace.json +0 -4
- package/scripts/csdr/init/remotes/15.x/full/options/definitions/participant.json +0 -3
- package/scripts/csdr/init/remotes/15.x/full/options/definitions/user-reducers.json +0 -3
- package/scripts/csdr/init/remotes/15.x/full/options/definitions/zipkin.json +0 -5
- package/scripts/csdr/init/remotes/15.x/full/options/participant/app/module.component.ts +0 -101
- package/scripts/csdr/init/remotes/15.x/full/options/participant/app/routing.module.ts +0 -26
- package/scripts/csdr/init/remotes/15.x/full/options/participant/config/index.ts +0 -10
- package/scripts/csdr/init/remotes/15.x/full/options/user-reducers/app/reducers/index.ts +0 -75
- package/scripts/csdr/init/resources/15.x/browserslistrc +0 -6
- package/scripts/csdr/init/resources/15.x/resolutions.json +0 -11
- package/scripts/csdr/init/resources/15.x/yarn.lock.old +0 -14091
- package/scripts/csdr/init/resources/17.x/yarn.lock.old +0 -13395
- package/scripts/csdr/init/resources/nodejs-10.x/resolutions.json +0 -17
- package/scripts/csdr/version/common.test.js +0 -205
- package/scripts/index.test.js +0 -7
|
@@ -149,7 +149,7 @@ const executeInstall = (module.exports.executeInstall = (cwdPath, npmRegistry) =
|
|
|
149
149
|
installRegistry = getInstallRegistry();
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
tools.logInfo(`Install from : ${installRegistry}`);
|
|
152
|
+
// tools.logInfo(`Install from : ${installRegistry}`);
|
|
153
153
|
if (!dryRun && !skipInstall) {
|
|
154
154
|
if (installRegistry) {
|
|
155
155
|
return execa.shellSync(`yarn --registry ${installRegistry}`, { cwd: cwdPath, stdio: 'inherit' });
|
|
@@ -33,6 +33,14 @@ module.exports.cleanPackage = (pkg) => {
|
|
|
33
33
|
return tools.rimraf(pkg.paths.root + '/**/test');
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
+
.then(() => {
|
|
37
|
+
tools.logInfo('Cleaning test files')
|
|
38
|
+
if (pkg.standalone) {
|
|
39
|
+
return tools.rimraf(pkg.paths.root + '/coverage');
|
|
40
|
+
} else {
|
|
41
|
+
return tools.rimraf(pkg.paths.root + '/**/coverage');
|
|
42
|
+
}
|
|
43
|
+
})
|
|
36
44
|
.then(() => {
|
|
37
45
|
tools.logSuccess();
|
|
38
46
|
})
|
|
@@ -119,15 +119,17 @@ module.exports.migrate = (pkg) => {
|
|
|
119
119
|
const remoteSDLCConfigFile = path.join(process.cwd(), '.sdlc-config', 'remotes', '.euirc-remotes.json');
|
|
120
120
|
const remotesSDLCConfig = require(remoteSDLCConfigFile);
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
// try {
|
|
123
|
+
delete currentRemoteConfig['slack'];
|
|
124
|
+
currentRemoteConfig['npmPkg'] = currentRemoteConfig['npmPkg'].replace(`eui${euiVersion}-remote-el`, `remote-eui${euiVersion}`);
|
|
125
|
+
|
|
126
|
+
currentRemoteConfig['notificationChannel'] = 'pipeline-ui-mwp';
|
|
127
|
+
|
|
128
|
+
currentRemoteConfig['migrated'] = true;
|
|
129
|
+
|
|
130
|
+
remotesSDLCConfig[newRemoteName] = currentRemoteConfig;
|
|
131
|
+
// } catch(e) {}
|
|
129
132
|
|
|
130
|
-
remotesSDLCConfig[newRemoteName] = currentRemoteConfig;
|
|
131
133
|
|
|
132
134
|
tools.writeJsonFileSync(remoteSDLCConfigFile, remotesSDLCConfig);
|
|
133
135
|
|
|
@@ -79,39 +79,3 @@ module.exports.run = () => {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
module.exports.runMocha = (pkg) => {
|
|
83
|
-
return Promise.resolve()
|
|
84
|
-
.then(() => {
|
|
85
|
-
tools.logTitle(`Executing Mocha test for pkg: ${pkg.name}`);
|
|
86
|
-
|
|
87
|
-
// set jest binary
|
|
88
|
-
const mocha = path.resolve(process.cwd(), 'node_modules', 'mocha', 'bin', '_mocha');
|
|
89
|
-
const nyc = path.resolve(process.cwd(), 'node_modules', 'nyc', 'bin', 'nyc');
|
|
90
|
-
|
|
91
|
-
// default arguments
|
|
92
|
-
let args;
|
|
93
|
-
|
|
94
|
-
if (!skipCoverage && !build) {
|
|
95
|
-
args = [nyc, '--reporter=text', mocha, pkg.paths.fromRoot + '/**/*.test.js'];
|
|
96
|
-
} else {
|
|
97
|
-
args = [mocha, pkg.paths.fromRoot + '/**/*.test.js'];
|
|
98
|
-
}
|
|
99
|
-
if (watch) {
|
|
100
|
-
args.push('--watch');
|
|
101
|
-
}
|
|
102
|
-
if (timeout) {
|
|
103
|
-
args.push(`--timeout ${timeout}`);
|
|
104
|
-
} else {
|
|
105
|
-
args.push('--timeout 20000');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return execa('node', args, { cwd: process.cwd(), stdio: 'inherit' });
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
.catch((e) => {
|
|
112
|
-
throw e;
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { expect, assert } = require('chai');
|
|
4
|
-
|
|
5
|
-
const projects = require('./projects');
|
|
6
|
-
|
|
7
|
-
describe('[csdr/config/config-utils] - getCsdrProject()', () => {
|
|
8
|
-
|
|
9
|
-
it('should return null if project does not exist', () => {
|
|
10
|
-
const prj = projects.getCsdrProject('UNKNOWN_PROJECT');
|
|
11
|
-
expect(prj).to.be.undefined;
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
it('should return valid project details if project exists', () => {
|
|
16
|
-
const prj = projects.getCsdrProject('my-workplace-host');
|
|
17
|
-
expect(prj).not.to.be.null;
|
|
18
|
-
expect(prj.name).to.equal('my-workplace-host');
|
|
19
|
-
expect(prj.devopsMetadataFile).to.equal('app-my-workplace-host-build-metadata.json');
|
|
20
|
-
expect(prj.devopsEnvsMetadataFile).to.equal('app-my-workplace-host-envs-metadata.json');
|
|
21
|
-
expect(prj.devopsVersionsMetadataFile).to.equal('app-my-workplace-host-versions-metadata.json');
|
|
22
|
-
expect(prj.devopsHistoryMetadataFile).to.equal('app-my-workplace-host-history-metadata.json');
|
|
23
|
-
})
|
|
24
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"newProjectRoot": "apps",
|
|
5
|
-
"projects": {
|
|
6
|
-
"@remote.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": "@remote.deploy.url.root@/assets/elements/@remote.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/@eui/styles/dist/assets/fonts/font-awesome/font-awesome.min.css",
|
|
34
|
-
"./node_modules/@eui/styles/dist/assets/fonts/flag-icons/css/flag-icon.min.css"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
"configurations": {
|
|
38
|
-
"production": {
|
|
39
|
-
"fileReplacements": [
|
|
40
|
-
{
|
|
41
|
-
"replace": "src/environments/environment.ts",
|
|
42
|
-
"with": "src/environments/environment.prod.ts"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"optimization": true,
|
|
46
|
-
"outputHashing": "all",
|
|
47
|
-
"sourceMap": false,
|
|
48
|
-
"extractCss": true,
|
|
49
|
-
"namedChunks": false,
|
|
50
|
-
"aot": true,
|
|
51
|
-
"extractLicenses": true,
|
|
52
|
-
"vendorChunk": false,
|
|
53
|
-
"buildOptimizer": true
|
|
54
|
-
},
|
|
55
|
-
"serve-dist": {
|
|
56
|
-
"outputPath": "serve-dist",
|
|
57
|
-
"wath": true
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"serve": {
|
|
62
|
-
"builder": "./node_modules/@angular-devkit/build-angular:dev-server",
|
|
63
|
-
"options": {
|
|
64
|
-
"deployUrl": "/assets/elements/@remote.name@/bundles/",
|
|
65
|
-
"browserTarget": "@remote.name@:build:serve-dist"
|
|
66
|
-
},
|
|
67
|
-
"configurations": {
|
|
68
|
-
"production": {
|
|
69
|
-
"browserTarget": "@remote.name@:build:production"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"test": {
|
|
74
|
-
"builder": "./node_modules/@angular-devkit/build-angular:karma",
|
|
75
|
-
"options": {
|
|
76
|
-
"main": "src/test.ts",
|
|
77
|
-
"polyfills": "src/polyfills.ts",
|
|
78
|
-
"tsConfig": "tsconfig.spec.json",
|
|
79
|
-
"karmaConfig": "karma.conf.js",
|
|
80
|
-
"scripts": []
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"cli": {
|
|
87
|
-
"analytics": false
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "generated",
|
|
3
|
-
"version": "1.0.0-SNAPSHOT.0",
|
|
4
|
-
"files": [
|
|
5
|
-
"bundles"
|
|
6
|
-
],
|
|
7
|
-
"dependencies": {},
|
|
8
|
-
"resolutions": {
|
|
9
|
-
"minimist": ">=1.2.6",
|
|
10
|
-
"xmlhttprequest-ssl": ">=1.6.1",
|
|
11
|
-
"@types/node": "14.14.10",
|
|
12
|
-
"get-stream": "4.1.0"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./out-tsc/app",
|
|
5
|
-
"module": "es2015",
|
|
6
|
-
"target": "es2015",
|
|
7
|
-
"types": [
|
|
8
|
-
"node"
|
|
9
|
-
],
|
|
10
|
-
"paths": {
|
|
11
|
-
"os": ["./node_modules/empty-module/index.js"],
|
|
12
|
-
"node-fetch": ["./node_modules/empty-module/index.js"],
|
|
13
|
-
"zipkin": ["./node_modules/zipkin/dist/zipkin.js"]
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"exclude": [
|
|
17
|
-
"src/test.ts",
|
|
18
|
-
"**/*.spec.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, Inject, ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { Subscription } from 'rxjs';
|
|
4
|
-
import { first } from 'rxjs/operators';
|
|
5
|
-
|
|
6
|
-
import { CONFIG_TOKEN } from '@eui/core';
|
|
7
|
-
import { ElementSetupService, ElementLifeCycleService } from '@csdr/integration/element';
|
|
8
|
-
|
|
9
|
-
enum ElementStatus {
|
|
10
|
-
Loading = 'loading',
|
|
11
|
-
Loaded = 'loaded',
|
|
12
|
-
Error = 'error',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Component({
|
|
16
|
-
template: `
|
|
17
|
-
<eui-block-content *ngIf="moduleStatus === ElementStatus.Loading" [isBlocked]="true">
|
|
18
|
-
<div style="height: 100%"></div>
|
|
19
|
-
</eui-block-content>
|
|
20
|
-
<ng-container *ngIf="moduleStatus === ElementStatus.Loaded">
|
|
21
|
-
<router-outlet></router-outlet>
|
|
22
|
-
</ng-container>
|
|
23
|
-
<ng-container *ngIf="moduleStatus === ElementStatus.Error">
|
|
24
|
-
<div class="error-container">
|
|
25
|
-
<div>
|
|
26
|
-
<h1>Translations or user data for this module failed to load.</h1>
|
|
27
|
-
<p>Do you want to try again?</p>
|
|
28
|
-
<button euiButton euiPrimary (click)="loadData()">
|
|
29
|
-
<span euiLabel>{{ 'global.RELOAD' | translate }}</span>
|
|
30
|
-
</button>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</ng-container>
|
|
34
|
-
`,
|
|
35
|
-
styles: [`
|
|
36
|
-
.error-container {
|
|
37
|
-
width: 50vw;
|
|
38
|
-
height: 50vh;
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 50%;
|
|
41
|
-
left: 50%;
|
|
42
|
-
transform: translate(-50%, -50%);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.error-container div {
|
|
46
|
-
text-align: center
|
|
47
|
-
}
|
|
48
|
-
`],
|
|
49
|
-
})
|
|
50
|
-
export class ModuleComponent implements OnInit, OnDestroy {
|
|
51
|
-
ElementStatus = ElementStatus;
|
|
52
|
-
moduleStatus: ElementStatus;
|
|
53
|
-
|
|
54
|
-
private initSubscription: Subscription;
|
|
55
|
-
|
|
56
|
-
constructor(private elRef: ElementRef,
|
|
57
|
-
@Inject(CONFIG_TOKEN) public config: any,
|
|
58
|
-
private elementLifeCycleService: ElementLifeCycleService,
|
|
59
|
-
private elementSetupService: ElementSetupService) {
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ngOnInit() {
|
|
63
|
-
const elementData = this.elementLifeCycleService.getElementData(this.elRef);
|
|
64
|
-
this.elementLifeCycleService.setup(elementData);
|
|
65
|
-
this.loadData();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
ngOnDestroy(): void {
|
|
69
|
-
this.initSubscription?.unsubscribe();
|
|
70
|
-
this.elementLifeCycleService.cleanup();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private loadData() {
|
|
74
|
-
this.setStatus(ElementStatus.Loading);
|
|
75
|
-
try {
|
|
76
|
-
this.initSubscription?.unsubscribe();
|
|
77
|
-
|
|
78
|
-
this.initSubscription = this.elementSetupService
|
|
79
|
-
.init()
|
|
80
|
-
.pipe(first())
|
|
81
|
-
.subscribe((loadStatus: { success: boolean; error?: string }) => {
|
|
82
|
-
if (!loadStatus.success) {
|
|
83
|
-
this.setStatus(ElementStatus.Error);
|
|
84
|
-
console.error(`[ELEMENT: ${this.config.global.elementName}] `, loadStatus.error);
|
|
85
|
-
} else {
|
|
86
|
-
this.setStatus(ElementStatus.Loaded);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
} catch (e) {
|
|
90
|
-
console.log(e);
|
|
91
|
-
this.setStatus(ElementStatus.Error);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private setStatus(status: ElementStatus) {
|
|
96
|
-
this.moduleStatus = status;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { NgModule, Injector, DoBootstrap, ApplicationRef } from '@angular/core';
|
|
2
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
3
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
|
-
import { HttpClient, HttpClientModule, HttpHeaders } from '@angular/common/http';
|
|
5
|
-
import { createCustomElement } from '@angular/elements';
|
|
6
|
-
|
|
7
|
-
import { StoreModule, USER_PROVIDED_META_REDUCERS } 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 } from '@ngx-translate/core';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
CoreModule,
|
|
16
|
-
CONFIG_TOKEN,
|
|
17
|
-
EUI_CONFIG_TOKEN,
|
|
18
|
-
translateConfig,
|
|
19
|
-
} from '@eui/core';
|
|
20
|
-
import { EUI_COMPONENTS_MODULES } from './eui-components';
|
|
21
|
-
import {
|
|
22
|
-
CsdrCoreModule,
|
|
23
|
-
ElementStorageService,
|
|
24
|
-
} from '@csdr/core';
|
|
25
|
-
|
|
26
|
-
import { TOKEN, reducerProvider, metaReducers, runtimeChecks } from './reducers/index';
|
|
27
|
-
import { CustomSerializer } from './reducers/custom-route-serializer';
|
|
28
|
-
|
|
29
|
-
import { environment } from '../environments/environment';
|
|
30
|
-
import { appConfig } from '../config';
|
|
31
|
-
|
|
32
|
-
import { @root.common.module@ as RootCommonModule } from '@root.npm.pkg@';
|
|
33
|
-
import {
|
|
34
|
-
DEFAULT_MAPPED_PROVIDERS,
|
|
35
|
-
} from '@csdr/integration/element';
|
|
36
|
-
import { RoutingModule } from './routing.module';
|
|
37
|
-
|
|
38
|
-
import { FallbackComponent } from './fallback.component';
|
|
39
|
-
import { ModuleComponent } from './module.component';
|
|
40
|
-
|
|
41
|
-
// IMPORTS
|
|
42
|
-
|
|
43
|
-
// DECLARATIONS
|
|
44
|
-
|
|
45
|
-
@NgModule({
|
|
46
|
-
imports: [
|
|
47
|
-
BrowserModule,
|
|
48
|
-
BrowserAnimationsModule,
|
|
49
|
-
HttpClientModule,
|
|
50
|
-
StoreRouterConnectingModule.forRoot({ stateKey: 'router', serializer: CustomSerializer }),
|
|
51
|
-
EffectsModule.forRoot([]),
|
|
52
|
-
StoreDevtoolsModule.instrument({ name: appConfig.global.storeName, maxAge: 150, logOnly: environment.production }),
|
|
53
|
-
TranslateModule.forRoot(translateConfig),
|
|
54
|
-
|
|
55
|
-
CoreModule.forRoot(),
|
|
56
|
-
CsdrCoreModule.forRoot(),
|
|
57
|
-
RootCommonModule,
|
|
58
|
-
RoutingModule,
|
|
59
|
-
...EUI_COMPONENTS_MODULES,
|
|
60
|
-
|
|
61
|
-
// DEFINITIONS
|
|
62
|
-
],
|
|
63
|
-
declarations: [
|
|
64
|
-
FallbackComponent,
|
|
65
|
-
ModuleComponent,
|
|
66
|
-
],
|
|
67
|
-
entryComponents: [
|
|
68
|
-
FallbackComponent,
|
|
69
|
-
ModuleComponent,
|
|
70
|
-
],
|
|
71
|
-
providers: [
|
|
72
|
-
reducerProvider,
|
|
73
|
-
{
|
|
74
|
-
provide: EUI_CONFIG_TOKEN,
|
|
75
|
-
useValue: { appConfig: { ...appConfig, ...environment }, environment },
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
...DEFAULT_MAPPED_PROVIDERS,
|
|
79
|
-
|
|
80
|
-
// PROVIDERS
|
|
81
|
-
],
|
|
82
|
-
})
|
|
83
|
-
export class AppModule implements DoBootstrap {
|
|
84
|
-
|
|
85
|
-
constructor(private injector: Injector, private http: HttpClient) {
|
|
86
|
-
// CONSTRUCTOR DECLARATIONS
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
ngDoBootstrap(appRef: ApplicationRef): void {
|
|
90
|
-
const elementSampleEui = createCustomElement(ModuleComponent, { injector: this.injector });
|
|
91
|
-
try {
|
|
92
|
-
customElements.define(appConfig.global.elementName, elementSampleEui);
|
|
93
|
-
} catch (e) {
|
|
94
|
-
console.log(e);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -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,51 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { ActionReducer, ActionReducerMap, MetaReducer, RuntimeChecks } 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];
|
|
43
|
-
|
|
44
|
-
export const runtimeChecks: RuntimeChecks = {
|
|
45
|
-
strictStateSerializability: false,
|
|
46
|
-
strictActionSerializability: false,
|
|
47
|
-
strictStateImmutability: false,
|
|
48
|
-
strictActionImmutability: false,
|
|
49
|
-
strictActionWithinNgZone: false,
|
|
50
|
-
strictActionTypeUniqueness: false,
|
|
51
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { RouterModule, Routes } from '@angular/router';
|
|
3
|
-
|
|
4
|
-
import { ELEMENT_ROUTES_TOKEN } from '@csdr/integration/element';
|
|
5
|
-
|
|
6
|
-
import { routes } from '@root.npm.pkg@';
|
|
7
|
-
// DON'T PAY ATTENTION TO IMPORT ERRORS HERE, those files are injected at serve/build time
|
|
8
|
-
import { appConfig } from '../config/index';
|
|
9
|
-
import { FallbackComponent } from './fallback.component';
|
|
10
|
-
import { ModuleComponent } from './module.component';
|
|
11
|
-
|
|
12
|
-
const elementRoutes: Routes = [
|
|
13
|
-
{ path: '', component: ModuleComponent },
|
|
14
|
-
{
|
|
15
|
-
path: appConfig.global.baseUrl,
|
|
16
|
-
children: routes,
|
|
17
|
-
},
|
|
18
|
-
{ path: '**', component: FallbackComponent },
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
// @dynamic
|
|
22
|
-
@NgModule({
|
|
23
|
-
imports: [
|
|
24
|
-
RouterModule.forRoot(elementRoutes),
|
|
25
|
-
],
|
|
26
|
-
providers: [
|
|
27
|
-
{ provide: ELEMENT_ROUTES_TOKEN, useValue: elementRoutes },
|
|
28
|
-
],
|
|
29
|
-
exports: [
|
|
30
|
-
RouterModule,
|
|
31
|
-
],
|
|
32
|
-
})
|
|
33
|
-
export class RoutingModule {
|
|
34
|
-
}
|
|
File without changes
|