@eui/tools 6.15.9 → 6.15.11

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 (22) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/package.json +1 -1
  4. package/scripts/csdr/cli/skeletons/package/frontend/17.x/default/src/lib/components/main.component.html +4 -3
  5. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/components/sample.component.html +1 -1
  6. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/components/sample.component.ts +0 -3
  7. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/containers/block-store.service.ts +8 -15
  8. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/containers/container.component.ts +1 -3
  9. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/models/block.model.ts +0 -6
  10. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/models/index.ts +0 -1
  11. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/module.ts +3 -7
  12. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/store/block.actions.ts +11 -0
  13. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/store/block.feature.ts +48 -0
  14. package/scripts/csdr/init/remotes/17.x/full/common/app/fallback.component.ts +1 -2
  15. package/scripts/csdr/init/remotes/17.x/full/common/app/module.component.ts +5 -6
  16. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/constants.ts +0 -1
  17. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/containers/generic-block-resolver.service.ts +0 -32
  18. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/models/block-type.model.ts +0 -6
  19. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/store/actions/block.actions.ts +0 -26
  20. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/store/reducers/block.reducer.ts +0 -48
  21. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/store/reducers/index.ts +0 -22
  22. package/scripts/csdr/cli/skeletons/package/frontend/17.x/participant-ngrx/src/lib/main/store/selectors/block.selectors.ts +0 -29
@@ -1 +1 @@
1
- 6.15.9
1
+ 6.15.11
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.15.11 (2024-01-23)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * skeleton code cleanup MWP-10441 [MWP-10441](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-10441) ([8200cfbc](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/8200cfbcab5905a65dabd04c07377e1a7d5b6f27))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.15.10 (2024-01-23)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * skeleton code cleanup MWP-10441 [MWP-10441](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-10441) ([0ae2f152](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/0ae2f152da135a0796c24307417ede66366ed777))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.15.9 (2024-01-17)
2
20
 
3
21
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.15.9",
3
+ "version": "6.15.11",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -10,16 +10,17 @@
10
10
  <eui-page-columns>
11
11
 
12
12
  <eui-page-column
13
- label="{{ '@module.scope-name@.FILTER' | translate }}"
13
+ [isCollapsible]="true"
14
14
  [size]="'3xl'"
15
- [isCollapsible]="true">
15
+ label="{{ '@module.scope-name@.FILTER' | translate }}">
16
16
 
17
17
  <eui-page-column-body>
18
18
 
19
19
  <!-- QUICK FILTER SECTION -->
20
20
  <div class="eui-u-flex eui-u-flex-column eui-u-mt-xs">
21
21
  <div class="eui-u-flex eui-u-flex-row">
22
- <div class="eui-u-font-size-l"><strong>{{ '@module.scope-name@.QUICK_SECTION' | translate }}</strong></div>
22
+ <div class="eui-u-font-size-l">
23
+ <strong>{{ '@module.scope-name@.QUICK_SECTION' | translate }}</strong></div>
23
24
  </div>
24
25
  </div>
25
26
 
@@ -1 +1 @@
1
- <cc-generic-block-ct [block]="block"></cc-generic-block-ct>
1
+ <div>your participant</div>
@@ -8,7 +8,4 @@ import { Block } from '../models';
8
8
  })
9
9
  export class @module.class.name@Component {
10
10
  @Input() block: Block;
11
-
12
- constructor() {
13
- }
14
11
  }
@@ -1,33 +1,26 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Injectable, inject } from '@angular/core';
2
2
  import { Store, select } from '@ngrx/store';
3
3
 
4
4
  import { Observable } from 'rxjs';
5
5
 
6
- import * as block from '../store/actions/block.actions';
6
+ import { Block } from '../models';
7
7
 
8
- import {
9
- Block,
10
- } from '../models';
11
-
12
- import * as fromBlockReducer from '../store/reducers/block.reducer';
13
-
14
- import * as fromBlockSelectors from '../store/selectors/block.selectors';
8
+ import { actions } from '../store/block.actions';
9
+ import { feature } from '../store/block.feature';
15
10
 
16
11
  @Injectable()
17
12
  export class BlockStoreService {
18
-
19
- constructor(private store$: Store<fromBlockReducer.State>) {
20
- }
13
+ private store$ = inject(Store);
21
14
 
22
15
  getBlockById(id: string): Observable<Block> {
23
- return this.store$.pipe(select(fromBlockSelectors.getBlockById(id)));
16
+ return this.store$.pipe(select(feature.getBlock(id)));
24
17
  }
25
18
 
26
19
  upsertBlock(b: Block): void {
27
- this.store$.dispatch(new block.UpsertBlock({ block: b }));
20
+ this.store$.dispatch(actions.upsertBlock({ block: b }));
28
21
  }
29
22
 
30
23
  removeBlock(id: string): void {
31
- this.store$.dispatch(new block.RemoveBlock({ id }));
24
+ this.store$.dispatch(actions.removeBlock({ id }));
32
25
  }
33
26
  }
@@ -2,19 +2,17 @@ import { ChangeDetectionStrategy, Component, Input, OnInit, OnDestroy } from '@a
2
2
 
3
3
  import { Observable } from 'rxjs';
4
4
 
5
- import { BlockComponent, GENERIC_BLOCK_RESOLVER_TOKEN } from '@cc/shared/block';
5
+ import { BlockComponent } from '@cc/shared/block';
6
6
 
7
7
  import { Block } from '../models';
8
8
 
9
9
  import { BlockStoreService } from './block-store.service';
10
- import { GenericBlockResolverService } from './generic-block-resolver.service';
11
10
 
12
11
  @Component({
13
12
  selector: '@module.scoe-name@-ct',
14
13
  changeDetection: ChangeDetectionStrategy.OnPush,
15
14
  providers: [
16
15
  BlockStoreService,
17
- { provide: GENERIC_BLOCK_RESOLVER_TOKEN, useClass: GenericBlockResolverService },
18
16
  ],
19
17
  template: `
20
18
  <@module.scope-name@-cp
@@ -1,10 +1,4 @@
1
1
  import { ParticipantBlock } from '@cc/shared/block';
2
2
 
3
- import { BlockType } from './block-type.model';
4
-
5
3
  export interface Block extends ParticipantBlock {
6
-
7
- config: {
8
- subType: BlockType;
9
- }
10
4
  }
@@ -1,2 +1 @@
1
1
  export * from './block.model';
2
- export * from './block-type.model';
@@ -25,20 +25,17 @@ const CONTAINERS = [
25
25
  const EFFECTS = [
26
26
  ];
27
27
 
28
- // -- Reducer --
29
- import { TOKEN, reducerProvider } from './store/reducers';
28
+ // -- Feature --
29
+ import { feature } from './store/block.feature';
30
30
 
31
31
  // -- Services --
32
32
  const SERVICES = [
33
33
  ];
34
34
 
35
- // -- Constants --
36
- import { namespace } from './constants';
37
-
38
35
  @NgModule({
39
36
  imports: [
40
37
  CommonModule,
41
- StoreModule.forFeature(namespace, TOKEN),
38
+ StoreModule.forFeature(feature),
42
39
  EffectsModule.forFeature(EFFECTS),
43
40
  TranslateModule,
44
41
 
@@ -49,7 +46,6 @@ import { namespace } from './constants';
49
46
  ...CONTAINERS,
50
47
  ],
51
48
  providers: [
52
- reducerProvider,
53
49
  ...SERVICES,
54
50
  ],
55
51
  exports: [
@@ -0,0 +1,11 @@
1
+ import { createActionGroup, props } from '@ngrx/store';
2
+
3
+ import { Block } from '../models';
4
+
5
+ export const actions = createActionGroup({
6
+ source: `@module.class.name@_block`,
7
+ events: {
8
+ upsertBlock: props<{ block: Block }>(),
9
+ removeBlock: props<{ id: string }>(),
10
+ },
11
+ });
@@ -0,0 +1,48 @@
1
+ import { createFeature, createReducer, on, createSelector } from '@ngrx/store';
2
+ import { createEntityAdapter, EntityState } from '@ngrx/entity';
3
+
4
+ import { Block } from '../models';
5
+
6
+ import { actions } from './block.actions';
7
+
8
+ const adapter = createEntityAdapter<Block>({
9
+ selectId: block => block.id,
10
+ });
11
+
12
+ interface State {
13
+ blocks: EntityState<Block>;
14
+ }
15
+
16
+ const initialState: State = {
17
+ blocks: adapter.getInitialState(),
18
+ };
19
+
20
+ export const feature = createFeature({
21
+ name: `@module.class.name@_block`,
22
+ reducer: createReducer(
23
+ initialState,
24
+ on(actions.upsertBlock, (state, action) => ({
25
+ ...state,
26
+ blocks: adapter.upsertOne(action.block, state.blocks),
27
+ })),
28
+ on(actions.removeBlock, (state, action) => ({
29
+ ...state,
30
+ blocks: adapter.removeOne(action.id, state.blocks),
31
+ })),
32
+ ),
33
+ extraSelectors: ({
34
+ selectBlocks,
35
+ }) => {
36
+ const getBlockEntities = createSelector(
37
+ selectBlocks,
38
+ adapter.getSelectors().selectEntities,
39
+ );
40
+ const getBlock = (id: string) => createSelector(
41
+ getBlockEntities,
42
+ entities => entities[id],
43
+ );
44
+ return {
45
+ getBlock,
46
+ };
47
+ },
48
+ });
@@ -4,8 +4,7 @@ import { Component } from '@angular/core';
4
4
  template: `
5
5
  <eui-block-content [isBlocked]="true">
6
6
  <div style="height: 100%"></div>
7
- </eui-block-content>
8
- `,
7
+ </eui-block-content>`,
9
8
  })
10
9
  export class FallbackComponent {
11
10
  }
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Inject, ElementRef, OnDestroy } from '@angular/core';
1
+ import { Component, OnInit, ElementRef, OnDestroy, inject } from '@angular/core';
2
2
 
3
3
  import { Subscription } from 'rxjs';
4
4
  import { first } from 'rxjs/operators';
@@ -53,11 +53,10 @@ export class ModuleComponent implements OnInit, OnDestroy {
53
53
 
54
54
  private initSubscription: Subscription;
55
55
 
56
- constructor(private elRef: ElementRef,
57
- @Inject(CONFIG_TOKEN) public config: any,
58
- private elementLifeCycleService: ElementLifeCycleService,
59
- private elementSetupService: ElementSetupService) {
60
- }
56
+ private elRef = inject(ElementRef);
57
+ private config = inject(CONFIG_TOKEN);
58
+ private elementLifeCycleService = inject(ElementLifeCycleService);
59
+ private elementSetupService = inject(ElementSetupService);
61
60
 
62
61
  ngOnInit() {
63
62
  const elementData = this.elementLifeCycleService.getElementData(this.elRef);
@@ -1 +0,0 @@
1
- export const namespace = '@module.class.name@:participant';
@@ -1,32 +0,0 @@
1
- import { Inject, Injectable } from '@angular/core';
2
-
3
- import { CONFIG_TOKEN } from '@eui/core';
4
-
5
- import { BlockConfig, IGenericBlock, UnknownBlockComponent } from '@cc/shared/block';
6
-
7
- // BLOCKS
8
- import { ContainerComponent } from '../../blocks/sample/containers/container.component';
9
-
10
- import { BlockType } from '../models';
11
-
12
- @Injectable()
13
- export class GenericBlockResolverService implements IGenericBlock {
14
-
15
- constructor(@Inject(CONFIG_TOKEN) private config: any) {
16
- }
17
-
18
- getComponentForBlock(block: BlockConfig): any {
19
- switch (block?.config.subType) {
20
- case BlockType.@module.class.name@: {
21
- return ContainerComponent;
22
- }
23
- default: {
24
- return UnknownBlockComponent;
25
- }
26
- }
27
- }
28
-
29
- enrichBlock(block: BlockConfig): BlockConfig {
30
- return block;
31
- }
32
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Sub-blocks
3
- */
4
- export class BlockType {
5
- static @module.class.name@ = '@module.class.name@';
6
- }
@@ -1,26 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
-
3
- import { Block } from '../../models';
4
-
5
- export enum BlockActionType {
6
- UPSERT_BLOCK = '[@module.class.name@ - Block] Upsert block',
7
- REMOVE_BLOCK = '[@module.class.name@ - Block] Remove block',
8
- }
9
-
10
- export class UpsertBlock implements Action {
11
- readonly type = BlockActionType.UPSERT_BLOCK;
12
-
13
- constructor(public payload: { block: Block }) {
14
- }
15
- }
16
-
17
- export class RemoveBlock implements Action {
18
- readonly type = BlockActionType.REMOVE_BLOCK;
19
-
20
- constructor(public payload: { id: string }) {
21
- }
22
- }
23
-
24
- export type BlockActions =
25
- UpsertBlock |
26
- RemoveBlock;
@@ -1,48 +0,0 @@
1
- import { createSelector } from '@ngrx/store';
2
- import { createEntityAdapter, Dictionary, EntityAdapter, EntityState } from '@ngrx/entity';
3
-
4
- import {
5
- BlockActionType,
6
- BlockActions,
7
- } from '../actions/block.actions';
8
-
9
- import { Block } from '../../models';
10
-
11
- export interface State extends EntityState<Block> {
12
- }
13
-
14
- export const adapter: EntityAdapter<Block> = createEntityAdapter<Block>({
15
- selectId: (block: Block) => block.id,
16
- });
17
-
18
- export const initialState: State = adapter.getInitialState({});
19
-
20
- export function reducer(state = initialState, action: BlockActions): State {
21
- switch (action.type) {
22
- case BlockActionType.UPSERT_BLOCK: {
23
- return adapter.upsertOne(action.payload.block, state);
24
- }
25
- case BlockActionType.REMOVE_BLOCK: {
26
- return adapter.removeOne(action.payload.id, state);
27
- }
28
- default: {
29
- return state;
30
- }
31
- }
32
- }
33
-
34
- export const {
35
- selectIds: getIds,
36
- selectEntities: getEntities,
37
- selectAll: getAll,
38
- selectTotal: getTotal,
39
- } = adapter.getSelectors();
40
-
41
- export const getEntityById = (id: string) => {
42
- return createSelector(
43
- getEntities,
44
- (entities: Dictionary<Block>) => {
45
- return entities[id];
46
- },
47
- );
48
- };
@@ -1,22 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ActionReducerMap } from '@ngrx/store';
3
-
4
- import * as fromBlock from './block.reducer';
5
-
6
- export interface State {
7
- block: fromBlock.State;
8
- }
9
-
10
- // -----------------
11
- // ------------ AOT
12
- export const TOKEN = new InjectionToken<ActionReducerMap<State>>('@module.class.name@Reducers');
13
-
14
- export function getReducers(): ActionReducerMap<State, any> {
15
- return {
16
- block: fromBlock.reducer,
17
- };
18
- }
19
-
20
- export const reducerProvider = [
21
- { provide: TOKEN, useFactory: getReducers },
22
- ];
@@ -1,29 +0,0 @@
1
- import {
2
- createSelector,
3
- createFeatureSelector,
4
- } from '@ngrx/store';
5
-
6
- import { State } from '../reducers';
7
-
8
- import * as fromBlock from '../reducers/block.reducer';
9
-
10
- import { Block } from '../../models';
11
-
12
- import { namespace } from '../../constants';
13
-
14
- // -----------------
15
- // --- feature selector
16
- const get@module.class.name@State = createFeatureSelector<State>(namespace);
17
-
18
- // -----------------
19
- // ----- block
20
- const getBlockState = createSelector(get@module.class.name@State, state => {
21
- return state.block;
22
- });
23
-
24
- export const getBlockById = (id: string) => {
25
- return createSelector(
26
- getBlockState,
27
- fromBlock.getEntityById(id),
28
- );
29
- };