@eui/tools 6.15.20 → 6.16.0
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 -1
- package/scripts/csdr/config/angular.js +5 -5
- package/scripts/csdr/init/remotes/18.x/base/angular.json +87 -0
- package/scripts/csdr/init/remotes/18.x/base/browserslist +6 -0
- package/scripts/csdr/init/remotes/18.x/base/package.json_TO_REPLACE +10 -0
- package/scripts/csdr/init/remotes/18.x/base/tsconfig.app.json +24 -0
- package/scripts/csdr/init/remotes/18.x/base/yarn.lock +14275 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/eui-components.ts +9 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/fallback.component.ts +10 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/module.component.ts +97 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/module.ts +96 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/reducers/custom-route-serializer.ts +28 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/reducers/index.ts +51 -0
- package/scripts/csdr/init/remotes/18.x/full/common/app/routing.module.ts +29 -0
- package/scripts/csdr/init/remotes/18.x/full/common/assets/.gitkeep +0 -0
- package/scripts/csdr/init/remotes/18.x/full/common/config/global.ts +54 -0
- package/scripts/csdr/init/remotes/18.x/full/common/config/index.ts +10 -0
- package/scripts/csdr/init/remotes/18.x/full/common/config/modules.ts +3 -0
- package/scripts/csdr/init/remotes/18.x/full/common/environments/environment.prod.ts +3 -0
- package/scripts/csdr/init/remotes/18.x/full/common/environments/environment.ts +3 -0
- package/scripts/csdr/init/remotes/18.x/full/common/favicon.ico +0 -0
- package/scripts/csdr/init/remotes/18.x/full/common/index.html +10 -0
- package/scripts/csdr/init/remotes/18.x/full/common/main.ts +12 -0
- package/scripts/csdr/init/remotes/18.x/full/common/polyfills.ts +88 -0
- package/scripts/csdr/init/remotes/18.x/full/options/ag-grid/main.ts +17 -0
- package/scripts/csdr/init/remotes/18.x/full/options/all-locales/config/global.ts +122 -0
- package/scripts/csdr/init/remotes/18.x/full/options/definitions/dynamic-forms.json +4 -0
- package/scripts/csdr/init/remotes/18.x/full/options/definitions/dynatrace.json +4 -0
- package/scripts/csdr/init/remotes/18.x/full/options/definitions/participant.json +3 -0
- package/scripts/csdr/init/remotes/18.x/full/options/definitions/user-reducers.json +3 -0
- package/scripts/csdr/init/remotes/18.x/full/options/definitions/zipkin.json +5 -0
- package/scripts/csdr/init/remotes/18.x/full/options/participant/app/module.component.ts +101 -0
- package/scripts/csdr/init/remotes/18.x/full/options/participant/app/routing.module.ts +21 -0
- package/scripts/csdr/init/remotes/18.x/full/options/participant/config/index.ts +10 -0
- package/scripts/csdr/init/remotes/18.x/full/options/user-reducers/app/reducers/index.ts +75 -0
- package/scripts/csdr/init/resources/18.x/browserslistrc +6 -0
- package/scripts/csdr/init/resources/18.x/resolutions.json +7 -0
- package/scripts/csdr/init/resources/18.x/yarn.lock +13395 -0
- package/scripts/csdr/version/package-common.js +1 -1
- package/scripts/utils/build/package/build-package-utils.js +1 -1
- package/scripts/utils/build/package/styles.js +2 -1
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/app/app.module.ts +52 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/app/core/reducers/index.ts +49 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/config/global.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/config/index.ts +8 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/config/modules.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/environments/environment.dev.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/environments/environment.prod.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/environments/environment.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/main.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/src/_generated/polyfills.ts +86 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/tsconfig.app.json +28 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui18/tsconfig.spec.json +9 -0
- package/scripts/utils/pre-build/injection/skeletons.js +3 -0
- package/scripts/utils/pre-build/projects.js +2 -0
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
<!-- BLOCK_CONTAINER_PLACEHOLDER -->
|
|
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
|
+
block: any;
|
|
55
|
+
|
|
56
|
+
private initSubscription: Subscription;
|
|
57
|
+
|
|
58
|
+
constructor(private elRef: ElementRef,
|
|
59
|
+
@Inject(CONFIG_TOKEN) public config: any,
|
|
60
|
+
private elementLifeCycleService: ElementLifeCycleService,
|
|
61
|
+
private elementSetupService: ElementSetupService) {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ngOnInit() {
|
|
65
|
+
this.block = this.elRef.nativeElement.block;
|
|
66
|
+
const elementData = this.elementLifeCycleService.getElementData(this.elRef);
|
|
67
|
+
this.elementLifeCycleService.setup(elementData);
|
|
68
|
+
this.loadData();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ngOnDestroy(): void {
|
|
72
|
+
this.initSubscription?.unsubscribe();
|
|
73
|
+
this.elementLifeCycleService.cleanup();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private loadData() {
|
|
77
|
+
this.setStatus(ElementStatus.Loading);
|
|
78
|
+
try {
|
|
79
|
+
this.initSubscription?.unsubscribe();
|
|
80
|
+
|
|
81
|
+
this.initSubscription = this.elementSetupService
|
|
82
|
+
.init()
|
|
83
|
+
.pipe(first())
|
|
84
|
+
.subscribe((loadStatus: { success: boolean, error?: string }) => {
|
|
85
|
+
if (!loadStatus.success) {
|
|
86
|
+
this.setStatus(ElementStatus.Error);
|
|
87
|
+
console.error(`[ELEMENT: ${this.config.global.elementName}] `, loadStatus.error);
|
|
88
|
+
} else {
|
|
89
|
+
this.setStatus(ElementStatus.Loaded);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
} catch (e) {
|
|
93
|
+
console.log(e);
|
|
94
|
+
this.setStatus(ElementStatus.Error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private setStatus(status: ElementStatus) {
|
|
99
|
+
this.moduleStatus = status;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RouterModule, Routes } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { appConfig } from '../config/index'; // tslint:disable-line
|
|
5
|
+
import { FallbackComponent } from './fallback.component'; // tslint:disable-line
|
|
6
|
+
import { ModuleComponent } from './module.component';
|
|
7
|
+
|
|
8
|
+
const elementRoutes: Routes = [
|
|
9
|
+
{ path: '**', component: ModuleComponent },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
@NgModule({
|
|
13
|
+
imports: [
|
|
14
|
+
RouterModule.forRoot(elementRoutes),
|
|
15
|
+
],
|
|
16
|
+
exports: [
|
|
17
|
+
RouterModule,
|
|
18
|
+
],
|
|
19
|
+
})
|
|
20
|
+
export class RoutingModule {
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GLOBAL } from './global';
|
|
2
|
+
import { MODULES } from './modules';
|
|
3
|
+
|
|
4
|
+
import { EuiAppConfig } from '@eui/core';
|
|
5
|
+
import { configMapping } from '@csdr/integration/element';
|
|
6
|
+
|
|
7
|
+
export const appConfig: EuiAppConfig = configMapping({
|
|
8
|
+
global: GLOBAL,
|
|
9
|
+
modules: MODULES,
|
|
10
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { ActionReducer, ActionReducerMap, MetaReducer, INIT, RuntimeChecks } from '@ngrx/store';
|
|
3
|
+
import * as fromRouter from '@ngrx/router-store';
|
|
4
|
+
import { storeFreeze } from 'ngrx-store-freeze';
|
|
5
|
+
|
|
6
|
+
import { reducers as coreReducers, CoreState } from '@eui/core';
|
|
7
|
+
import { ElementStorageService } from '@csdr/core';
|
|
8
|
+
|
|
9
|
+
import { environment } from '../../environments/environment';
|
|
10
|
+
|
|
11
|
+
export interface AppState extends CoreState {
|
|
12
|
+
router: fromRouter.RouterReducerState<any>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// -----------------
|
|
16
|
+
// ------------ AOT
|
|
17
|
+
export const TOKEN = new InjectionToken<any>('AppReducers');
|
|
18
|
+
|
|
19
|
+
export function getReducers(): ActionReducerMap<AppState, any> {
|
|
20
|
+
return {
|
|
21
|
+
router: fromRouter.routerReducer,
|
|
22
|
+
...coreReducers,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const reducerProvider = [
|
|
27
|
+
{ provide: TOKEN, useFactory: getReducers },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
// console.log all actions
|
|
31
|
+
export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
|
|
32
|
+
return (state, action) => {
|
|
33
|
+
const result = reducer(state, action);
|
|
34
|
+
console.groupCollapsed(action.type);
|
|
35
|
+
console.log('prev state', state);
|
|
36
|
+
console.log('action', action);
|
|
37
|
+
console.log('next state', result);
|
|
38
|
+
console.groupEnd();
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function hydrationFactory(config: any, elementStorage: ElementStorageService): MetaReducer<AppState> {
|
|
45
|
+
return (reducer: ActionReducer<AppState>): ActionReducer<any> => {
|
|
46
|
+
return (state, action) => {
|
|
47
|
+
const key = `NgRx store: ${config.global.elementName}`;
|
|
48
|
+
if (action.type === INIT && elementStorage.hasData(key)) {
|
|
49
|
+
const cachedState = elementStorage.getData(key);
|
|
50
|
+
const nextStateFromCache = reducer(cachedState as AppState, action);
|
|
51
|
+
elementStorage.setData(key, nextStateFromCache);
|
|
52
|
+
return nextStateFromCache;
|
|
53
|
+
}
|
|
54
|
+
const nextState = reducer(state, action);
|
|
55
|
+
elementStorage.setData(key, nextState);
|
|
56
|
+
return nextState;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function metaReducers(config: any, elementStorage: ElementStorageService): MetaReducer<AppState>[] {
|
|
62
|
+
if (!environment.production) {
|
|
63
|
+
return [logger, storeFreeze, hydrationFactory(config, elementStorage)];
|
|
64
|
+
}
|
|
65
|
+
return [hydrationFactory(config, elementStorage)];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const runtimeChecks: RuntimeChecks = {
|
|
69
|
+
strictStateSerializability: false,
|
|
70
|
+
strictActionSerializability: false,
|
|
71
|
+
strictStateImmutability: false,
|
|
72
|
+
strictActionImmutability: false,
|
|
73
|
+
strictActionWithinNgZone: false,
|
|
74
|
+
strictActionTypeUniqueness: false,
|
|
75
|
+
};
|