@eui/tools 6.11.19 → 6.11.20
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 +9 -0
- package/package.json +1 -1
- package/scripts/csdr/init/remotes/16.x/base/angular.json +87 -0
- package/scripts/csdr/init/remotes/16.x/base/browserslist +6 -0
- package/scripts/csdr/init/remotes/16.x/base/package.json_TO_REPLACE +10 -0
- package/scripts/csdr/init/remotes/16.x/base/tsconfig.app.json +24 -0
- package/scripts/csdr/init/remotes/16.x/base/yarn.lock +14275 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/eui-components.ts +9 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/fallback.component.ts +11 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/module.component.ts +91 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/module.ts +100 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/reducers/custom-route-serializer.ts +28 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/reducers/index.ts +42 -0
- package/scripts/csdr/init/remotes/16.x/full/common/app/routing.module.ts +34 -0
- package/scripts/csdr/init/remotes/16.x/full/common/assets/.gitkeep +0 -0
- package/scripts/csdr/init/remotes/16.x/full/common/config/global.ts +54 -0
- package/scripts/csdr/init/remotes/16.x/full/common/config/index.ts +10 -0
- package/scripts/csdr/init/remotes/16.x/full/common/config/modules.ts +3 -0
- package/scripts/csdr/init/remotes/16.x/full/common/environments/environment.prod.ts +3 -0
- package/scripts/csdr/init/remotes/16.x/full/common/environments/environment.ts +3 -0
- package/scripts/csdr/init/remotes/16.x/full/common/favicon.ico +0 -0
- package/scripts/csdr/init/remotes/16.x/full/common/index.html +10 -0
- package/scripts/csdr/init/remotes/16.x/full/common/main.ts +11 -0
- package/scripts/csdr/init/remotes/16.x/full/common/polyfills.ts +88 -0
- package/scripts/csdr/init/remotes/16.x/full/common/test.ts +20 -0
- package/scripts/csdr/init/remotes/16.x/full/options/definitions/dynamic-forms.json +4 -0
- package/scripts/csdr/init/remotes/16.x/full/options/definitions/dynatrace.json +4 -0
- package/scripts/csdr/init/remotes/16.x/full/options/definitions/participant.json +3 -0
- package/scripts/csdr/init/remotes/16.x/full/options/definitions/user-reducers.json +3 -0
- package/scripts/csdr/init/remotes/16.x/full/options/definitions/zipkin.json +5 -0
- package/scripts/csdr/init/remotes/16.x/full/options/participant/app/module.component.ts +94 -0
- package/scripts/csdr/init/remotes/16.x/full/options/participant/app/routing.module.ts +26 -0
- package/scripts/csdr/init/remotes/16.x/full/options/participant/config/index.ts +10 -0
- package/scripts/csdr/init/remotes/16.x/full/options/user-reducers/app/reducers/index.ts +66 -0
|
@@ -0,0 +1,26 @@
|
|
|
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 { appConfig } from '../config/index'; // tslint:disable-line
|
|
7
|
+
import { FallbackComponent } from './fallback.component'; // tslint:disable-line
|
|
8
|
+
import { ModuleComponent } from './module.component';
|
|
9
|
+
|
|
10
|
+
const elementRoutes: Routes = [
|
|
11
|
+
{ path: '**', component: ModuleComponent },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
@NgModule({
|
|
15
|
+
imports: [
|
|
16
|
+
RouterModule.forRoot(elementRoutes),
|
|
17
|
+
],
|
|
18
|
+
providers: [
|
|
19
|
+
{ provide: ELEMENT_ROUTES_TOKEN, useValue: elementRoutes },
|
|
20
|
+
],
|
|
21
|
+
exports: [
|
|
22
|
+
RouterModule,
|
|
23
|
+
],
|
|
24
|
+
})
|
|
25
|
+
export class RoutingModule {
|
|
26
|
+
}
|
|
@@ -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,66 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { ActionReducer, ActionReducerMap, MetaReducer, INIT } 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, localStorageSync } 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, localStorageSync, storeFreeze, hydrationFactory(config, elementStorage)];
|
|
64
|
+
}
|
|
65
|
+
return [localStorageSync, hydrationFactory(config, elementStorage)];
|
|
66
|
+
}
|