@eui/tools 6.7.0 → 6.7.1

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 (49) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +9 -0
  3. package/package.json +1 -1
  4. package/scripts/app/public/package-init.html +11 -0
  5. package/scripts/app/public/package-init.js +2 -0
  6. package/scripts/csdr/cli/package-build-frontend.js +5 -1
  7. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/.eslintrc.json +79 -0
  8. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/assets/i18n/en.json +6 -0
  9. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/assets/i18n/fr.json +6 -0
  10. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dependencies-base.json +2 -0
  11. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dependencies-composite.json +3 -0
  12. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/gitignore_TO_REPLACE +46 -0
  13. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/karma.conf.js +7 -0
  14. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/ng-package.json +7 -0
  15. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/package.json +4 -0
  16. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/index.ts +4 -0
  17. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/module.ts +1 -1
  18. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/components/sample.component.ts +14 -0
  19. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/constants.ts +1 -0
  20. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/containers/block-store.service.ts +3 -3
  21. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main/containers/decide.container.ts → src/lib/main/containers/container.component.ts} +7 -7
  22. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/containers/generic-block-resolver.service.ts +5 -5
  23. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/block-type.model.ts +6 -0
  24. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/block.model.ts +10 -0
  25. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/index.ts +2 -0
  26. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/module.ts +5 -5
  27. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/store/actions/block.actions.ts +26 -0
  28. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/reducers/block.reducer.ts +8 -8
  29. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/reducers/index.ts +1 -1
  30. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/selectors/block.selectors.ts +3 -3
  31. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{module.ts → src/lib/module.ts} +3 -3
  32. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/test.ts.TO_REPLACE +21 -0
  33. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/tsconfig.lib.json +32 -0
  34. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/tsconfig.spec.json +17 -0
  35. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dummy.spec.ts +0 -5
  36. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/index.ts +0 -4
  37. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/components/decide.component.ts +0 -14
  38. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/constants.ts +0 -1
  39. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block-type.model.ts +0 -6
  40. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block.model.ts +0 -10
  41. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/index.ts +0 -2
  42. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/actions/block.actions.ts +0 -26
  43. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/{default/src/lib/dummy.spec.ts → participant/src/dummy.spec.ts.TO_REPLACE} +0 -0
  44. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/components/sample.component.html +0 -0
  45. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/components/sample.component.ts +0 -0
  46. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/containers/container.component.ts +0 -0
  47. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/models/block.model.ts +0 -0
  48. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/models/index.ts +0 -0
  49. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main/components/decide.component.html → src/lib/main/components/sample.component.html} +0 -0
@@ -1 +1 @@
1
- 6.7.0
1
+ 6.7.1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.7.1 (2023-03-06)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * participant skeleton for new package v15 creation - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([778ad270](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/778ad270965e92d7fb452efdf3151a7af8fe4689))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.7.0 (2023-03-06)
2
11
 
3
12
  ##### New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.7.0",
3
+ "version": "6.7.1",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -86,6 +86,17 @@
86
86
  v-model="params.externalRepoName" />
87
87
  </div>
88
88
  </div>
89
+
90
+ <div class="row mt-3 mb-3">
91
+ <div class="col-sm-4">
92
+ <label class="form-check-label d-flex justify-content-end"> Participant package type ?</label>
93
+ </div>
94
+ <div class="col-sm-8">
95
+ <div class="form-check form-switch">
96
+ <input class="form-check-input" type="checkbox" v-model="params.pkgFrontendParticipant" />
97
+ </div>
98
+ </div>
99
+ </div>
89
100
  </div>
90
101
 
91
102
  <div v-if="params.pkgFrontendType === 'remote'">
@@ -46,6 +46,7 @@ new Vue({
46
46
  pkgScope: "@zzz",
47
47
  pkgName: "my-package",
48
48
  csdrRepo: true,
49
+ pkgFrontendParticipant: false,
49
50
  pkgGroupId: "eu.europa.ec.cc",
50
51
  remoteConfig: {
51
52
  rmTeamName: "cc-digit-ui-rm",
@@ -127,6 +128,7 @@ new Vue({
127
128
  if (!params.csdrRepo) {
128
129
  params.externalRepoName = this.params.externalRepoName;
129
130
  }
131
+ params.pkgFrontendParticipant = this.params.pkgFrontendParticipant;
130
132
  } else {
131
133
  params.remoteConfig = this.params.remoteConfig;
132
134
  }
@@ -140,7 +140,11 @@ const generateDefault = (args = constants.DEFAULT_CONFIG) => {
140
140
  .then(() => {
141
141
  tools.logInfo('Copying skeleton to target');
142
142
  if (args.pkgFrontendVersion === constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI15) {
143
- tools.copydir(constants.FRONTEND_SKELETON_EUI15_PATH, targetPath, true);
143
+ if (args.pkgFrontendParticipant) {
144
+ tools.copydir(constants.FRONTEND_SKELETON_EUI15_PARTICIPANT_PATH, targetPath, true);
145
+ } else {
146
+ tools.copydir(constants.FRONTEND_SKELETON_EUI15_PATH, targetPath, true);
147
+ }
144
148
  }
145
149
 
146
150
  // REPLACING PLACEHOLDERS
@@ -0,0 +1,79 @@
1
+ {
2
+ "extends": "../../.eslintrc.json",
3
+ "ignorePatterns": [
4
+ "!**/*",
5
+ "**/*.d.ts",
6
+ "dist"
7
+ ],
8
+ "overrides": [
9
+ {
10
+ "files": [
11
+ "*.ts"
12
+ ],
13
+ "parserOptions": {
14
+ "createDefaultProgram": true
15
+ },
16
+ "rules": {
17
+ "@angular-eslint/component-selector": [
18
+ "error",
19
+ {
20
+ "type": "element",
21
+ "prefix": "@module.scope.string@",
22
+ "style": "kebab-case"
23
+ }
24
+ ],
25
+ "@angular-eslint/directive-selector": [
26
+ "error",
27
+ {
28
+ "type": "attribute",
29
+ "prefix": "@module.scope.string@",
30
+ "style": "camelCase"
31
+ }
32
+ ],
33
+ "@typescript-eslint/ban-ts-comment": "off",
34
+ "@typescript-eslint/ban-types": "error",
35
+ "@typescript-eslint/consistent-type-definitions": "off",
36
+ "@typescript-eslint/dot-notation": "off",
37
+ "@typescript-eslint/explicit-member-accessibility": [
38
+ "off",
39
+ {
40
+ "accessibility": "explicit"
41
+ }
42
+ ],
43
+ "@typescript-eslint/no-inferrable-types": "off",
44
+ "@typescript-eslint/no-unused-vars": "off",
45
+ "@typescript-eslint/no-var-requires": "error",
46
+ "@typescript-eslint/require-await": "error",
47
+ "id-blacklist": "off",
48
+ "id-match": "off",
49
+ "max-len": [
50
+ "error",
51
+ {
52
+ "code": 160
53
+ }
54
+ ],
55
+ "no-duplicate-case": "error",
56
+ "no-duplicate-imports": "off",
57
+ "no-invalid-this": "error",
58
+ "no-multiple-empty-lines": [
59
+ "error",
60
+ {
61
+ "max": 1
62
+ }
63
+ ],
64
+ "no-new-func": "error",
65
+ "no-template-curly-in-string": "error",
66
+ "no-underscore-dangle": "off",
67
+ "no-var": "off",
68
+ "prefer-const": "off",
69
+ "comma-dangle": "off"
70
+ }
71
+ },
72
+ {
73
+ "files": [
74
+ "*.html"
75
+ ],
76
+ "rules": {}
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "@module.scope-name@.TITLE": "@module.scope-name@",
3
+ "@module.scope-name@.FILTER": "Search filter",
4
+ "@module.scope-name@.QUICK_SECTION": "Quick filter",
5
+ "@module.scope-name@.SEARCH_RESULT": "Filter results"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "@module.scope-name@.TITLE": "**fr** @module.scope-name@ **fr**",
3
+ "@module.scope-name@.FILTER": "**fr** Search filter **fr**",
4
+ "@module.scope-name@.QUICK_SECTION": "**fr** Quick filter **fr**",
5
+ "@module.scope-name@.SEARCH_RESULT": "**fr** Filter results **fr**"
6
+ }
@@ -0,0 +1,46 @@
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
+ **/test/reports
11
+
12
+ # IDEs and editors
13
+ /.idea
14
+ .project
15
+ .classpath
16
+ .c9/
17
+ *.launch
18
+ .settings/
19
+ *.sublime-workspace
20
+
21
+ # IDE - VSCode
22
+ .vscode/*
23
+ !.vscode/settings.json
24
+ !.vscode/tasks.json
25
+ !.vscode/launch.json
26
+ !.vscode/extensions.json
27
+
28
+ # misc
29
+ /.sass-cache
30
+ /connect.lock
31
+ /coverage
32
+ /libpeerconnection.log
33
+ npm-debug.log
34
+ testem.log
35
+ /typings
36
+ yarn-error.log
37
+
38
+ # e2e
39
+ /e2e/*.js
40
+ /e2e/*.map
41
+ **/src/**/*.js
42
+ **/src/**/*.map
43
+
44
+ # System Files
45
+ .DS_Store
46
+ Thumbs.db
@@ -0,0 +1,7 @@
1
+ const karmaConfig = require('@eui/tools/karma/karma.conf.pkg');
2
+
3
+ module.exports = function (config) {
4
+ config.set(
5
+ karmaConfig.get(config, '@module.full.name@', {})
6
+ );
7
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "./dist",
4
+ "lib": {
5
+ "entryFile": "src/index.ts"
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "@module.scope@/@module.name@",
3
+ "version": "1.0.0"
4
+ }
@@ -0,0 +1,4 @@
1
+ export { @module.class.name@Module } from './lib/module';
2
+
3
+ export { MainParticipantModule } from './lib/main/module';
4
+ export { @module.class.name@ContainerComponent } from './lib/main/containers/container.component';
@@ -33,5 +33,5 @@ const CONTAINERS = [
33
33
  ContainerComponent,
34
34
  ],
35
35
  })
36
- export class CreateDossierModule {
36
+ export class @module.class.name@BlockSampleModule {
37
37
  }
@@ -0,0 +1,14 @@
1
+ import { Component, Input } from '@angular/core';
2
+
3
+ import { Block } from '../models';
4
+
5
+ @Component({
6
+ selector: '@module.scope-name@-cp',
7
+ templateUrl: './sample.component.html',
8
+ })
9
+ export class @module.class.name@Component {
10
+ @Input() block: Block;
11
+
12
+ constructor() {
13
+ }
14
+ }
@@ -0,0 +1 @@
1
+ export const namespace = '@module.class.name@:participant';
@@ -6,7 +6,7 @@ import { Observable } from 'rxjs';
6
6
  import * as block from '../store/actions/block.actions';
7
7
 
8
8
  import {
9
- DecideBlock,
9
+ Block,
10
10
  } from '../models';
11
11
 
12
12
  import * as fromBlockReducer from '../store/reducers/block.reducer';
@@ -19,11 +19,11 @@ export class BlockStoreService {
19
19
  constructor(private store$: Store<fromBlockReducer.State>) {
20
20
  }
21
21
 
22
- getBlockById(id: string): Observable<DecideBlock> {
22
+ getBlockById(id: string): Observable<Block> {
23
23
  return this.store$.pipe(select(fromBlockSelectors.getBlockById(id)));
24
24
  }
25
25
 
26
- upsertBlock(b: DecideBlock): void {
26
+ upsertBlock(b: Block): void {
27
27
  this.store$.dispatch(new block.UpsertBlock({ block: b }));
28
28
  }
29
29
 
@@ -4,27 +4,27 @@ import { Observable } from 'rxjs';
4
4
 
5
5
  import { BlockComponent, GENERIC_BLOCK_RESOLVER_TOKEN } from '@cc/shared';
6
6
 
7
- import { DecideBlock } from '../models';
7
+ import { Block } from '../models';
8
8
 
9
9
  import { BlockStoreService } from './block-store.service';
10
10
  import { GenericBlockResolverService } from './generic-block-resolver.service';
11
11
 
12
12
  @Component({
13
- selector: 'cc-decide-participant-ct',
13
+ selector: '@module.scoe-name@-ct',
14
14
  changeDetection: ChangeDetectionStrategy.OnPush,
15
15
  providers: [
16
16
  BlockStoreService,
17
17
  { provide: GENERIC_BLOCK_RESOLVER_TOKEN, useClass: GenericBlockResolverService },
18
18
  ],
19
19
  template: `
20
- <cc-decide-cp
20
+ <@module.scope-name@-cp
21
21
  [block]="block$ | async">
22
- </cc-decide-cp>`,
22
+ </@module.scope-name@-cp>`,
23
23
  })
24
- export class DecideParticipantContainerComponent implements BlockComponent, OnInit, OnDestroy {
25
- @Input() readonly block: DecideBlock;
24
+ export class @module.class.name@ContainerComponent implements BlockComponent, OnInit, OnDestroy {
25
+ @Input() readonly block: Block;
26
26
 
27
- block$: Observable<DecideBlock>;
27
+ block$: Observable<Block>;
28
28
 
29
29
  constructor(private blockStore: BlockStoreService) {
30
30
  }
@@ -4,10 +4,10 @@ import { CONFIG_TOKEN } from '@eui/core';
4
4
 
5
5
  import { BlockConfig, IGenericBlock, UnknownBlockComponent } from '@cc/shared';
6
6
 
7
- // DECIDE BLOCKS
8
- import { CreateDossierContainerComponent } from '../../blocks/create-dossier/containers/create-dossier.container';
7
+ // BLOCKS
8
+ import { ContainerComponent } from '../../blocks/sample/containers/container.component';
9
9
 
10
- import { DecideBlockType } from '../models';
10
+ import { BlockType } from '../models';
11
11
 
12
12
  @Injectable()
13
13
  export class GenericBlockResolverService implements IGenericBlock {
@@ -17,8 +17,8 @@ export class GenericBlockResolverService implements IGenericBlock {
17
17
 
18
18
  getComponentForBlock(block: BlockConfig): any {
19
19
  switch (block?.config.subType) {
20
- case DecideBlockType.CreateDossier: {
21
- return CreateDossierContainerComponent;
20
+ case BlockType.@module.class.name@: {
21
+ return ContainerComponent;
22
22
  }
23
23
  default: {
24
24
  return UnknownBlockComponent;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Sub-blocks
3
+ */
4
+ export class BlockType {
5
+ static @module.class.name@ = '@module.class.name@';
6
+ }
@@ -0,0 +1,10 @@
1
+ import { ParticipantBlock } from '@cc/shared';
2
+
3
+ import { BlockType } from './block-type.model';
4
+
5
+ export interface Block extends ParticipantBlock {
6
+
7
+ config: {
8
+ subType: BlockType;
9
+ }
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from './block.model';
2
+ export * from './block-type.model';
@@ -8,17 +8,17 @@ import { TranslateModule } from '@ngx-translate/core';
8
8
  import { CcSharedModule } from '@cc/shared';
9
9
 
10
10
  // -- Components --
11
- import { DecideComponent } from './components/decide.component';
11
+ import { @module.class.name@Component } from './components/sample.component';
12
12
 
13
13
  const COMPONENTS = [
14
- DecideComponent,
14
+ @module.class.name@Component,
15
15
  ];
16
16
 
17
17
  // -- Containers --
18
- import { DecideParticipantContainerComponent } from './containers/decide.container';
18
+ import { @module.class.name@ContainerComponent } from './containers/container.component';
19
19
 
20
20
  const CONTAINERS = [
21
- DecideParticipantContainerComponent,
21
+ @module.class.name@ContainerComponent,
22
22
  ];
23
23
 
24
24
  // -- Effects --
@@ -53,7 +53,7 @@ import { namespace } from './constants';
53
53
  ...SERVICES,
54
54
  ],
55
55
  exports: [
56
- DecideParticipantContainerComponent,
56
+ @module.class.name@ContainerComponent,
57
57
  ],
58
58
  })
59
59
  export class MainParticipantModule {
@@ -0,0 +1,26 @@
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;
@@ -2,27 +2,27 @@ import { createSelector } from '@ngrx/store';
2
2
  import { createEntityAdapter, Dictionary, EntityAdapter, EntityState } from '@ngrx/entity';
3
3
 
4
4
  import {
5
- DecideBlockActionType,
5
+ BlockActionType,
6
6
  BlockActions,
7
7
  } from '../actions/block.actions';
8
8
 
9
- import { DecideBlock } from '../../models';
9
+ import { Block } from '../../models';
10
10
 
11
- export interface State extends EntityState<DecideBlock> {
11
+ export interface State extends EntityState<Block> {
12
12
  }
13
13
 
14
- export const adapter: EntityAdapter<DecideBlock> = createEntityAdapter<DecideBlock>({
15
- selectId: (block: DecideBlock) => block.id,
14
+ export const adapter: EntityAdapter<Block> = createEntityAdapter<Block>({
15
+ selectId: (block: Block) => block.id,
16
16
  });
17
17
 
18
18
  export const initialState: State = adapter.getInitialState({});
19
19
 
20
20
  export function reducer(state = initialState, action: BlockActions): State {
21
21
  switch (action.type) {
22
- case DecideBlockActionType.UPSERT_BLOCK: {
22
+ case BlockActionType.UPSERT_BLOCK: {
23
23
  return adapter.upsertOne(action.payload.block, state);
24
24
  }
25
- case DecideBlockActionType.REMOVE_BLOCK: {
25
+ case BlockActionType.REMOVE_BLOCK: {
26
26
  return adapter.removeOne(action.payload.id, state);
27
27
  }
28
28
  default: {
@@ -41,7 +41,7 @@ export const {
41
41
  export const getEntityById = (id: string) => {
42
42
  return createSelector(
43
43
  getEntities,
44
- (entities: Dictionary<DecideBlock>) => {
44
+ (entities: Dictionary<Block>) => {
45
45
  return entities[id];
46
46
  },
47
47
  );
@@ -9,7 +9,7 @@ export interface State {
9
9
 
10
10
  // -----------------
11
11
  // ------------ AOT
12
- export const TOKEN = new InjectionToken<ActionReducerMap<State>>('ccDecideReducers');
12
+ export const TOKEN = new InjectionToken<ActionReducerMap<State>>('@module.class.name@Reducers');
13
13
 
14
14
  export function getReducers(): ActionReducerMap<State, any> {
15
15
  return {
@@ -7,17 +7,17 @@ import { State } from '../reducers';
7
7
 
8
8
  import * as fromBlock from '../reducers/block.reducer';
9
9
 
10
- import { DecideBlock } from '../../models';
10
+ import { Block } from '../../models';
11
11
 
12
12
  import { namespace } from '../../constants';
13
13
 
14
14
  // -----------------
15
15
  // --- feature selector
16
- const getCcDecideState = createFeatureSelector<State>(namespace);
16
+ const get@module.class.name@State = createFeatureSelector<State>(namespace);
17
17
 
18
18
  // -----------------
19
19
  // ----- block
20
- const getBlockState = createSelector(getCcDecideState, state => {
20
+ const getBlockState = createSelector(get@module.class.name@State, state => {
21
21
  return state.block;
22
22
  });
23
23
 
@@ -2,16 +2,16 @@ import { NgModule } from '@angular/core';
2
2
 
3
3
  import { MainParticipantModule } from './main/module';
4
4
 
5
- import { CreateDossierModule } from './blocks/create-dossier/module';
5
+ import { @module.class.name@BlockSampleModule } from './blocks/sample/module';
6
6
 
7
7
  @NgModule({
8
8
  imports: [
9
9
  MainParticipantModule,
10
- CreateDossierModule,
10
+ @module.class.name@BlockSampleModule,
11
11
  ],
12
12
  exports: [
13
13
  MainParticipantModule,
14
14
  ],
15
15
  })
16
- export class DecideParticipantModule {
16
+ export class @module.class.name@Module {
17
17
  }
@@ -0,0 +1,21 @@
1
+ // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+ import 'zone.js/dist/zone';
4
+ import 'zone.js/dist/zone-testing';
5
+ import { getTestBed } from '@angular/core/testing';
6
+ import {
7
+ BrowserDynamicTestingModule,
8
+ platformBrowserDynamicTesting
9
+ } from '@angular/platform-browser-dynamic/testing';
10
+
11
+ declare const require: any;
12
+
13
+ // First, initialize the Angular testing environment.
14
+ getTestBed().initTestEnvironment(
15
+ BrowserDynamicTestingModule,
16
+ platformBrowserDynamicTesting()
17
+ );
18
+ // Then we find all the tests.
19
+ const context = require.context('./', true, /\.spec\.ts$/);
20
+ // And load the modules.
21
+ context.keys().map(context);
@@ -0,0 +1,32 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/lib",
5
+ "target": "ES2022",
6
+ "module": "ES2022",
7
+ "moduleResolution": "node",
8
+ "declaration": true,
9
+ "sourceMap": true,
10
+ "inlineSources": true,
11
+ "emitDecoratorMetadata": true,
12
+ "experimentalDecorators": true,
13
+ "importHelpers": true,
14
+ "types": [],
15
+ "lib": [
16
+ "ES2022",
17
+ "dom"
18
+ ]
19
+ },
20
+ "angularCompilerOptions": {
21
+ "annotateForClosureCompiler": true,
22
+ "skipTemplateCodegen": true,
23
+ "strictMetadataEmit": true,
24
+ "fullTemplateTypeCheck": true,
25
+ "strictInjectionParameters": true,
26
+ "enableResourceInlining": true
27
+ },
28
+ "exclude": [
29
+ "src/test.ts",
30
+ "**/*.spec.ts"
31
+ ]
32
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/spec",
5
+ "types": [
6
+ "jasmine",
7
+ "node"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }
@@ -1,5 +0,0 @@
1
- describe('First test', () => {
2
- it('should work', () => {
3
- expect(true).toBe(true);
4
- });
5
- });
@@ -1,4 +0,0 @@
1
- export { DecideParticipantModule } from './module';
2
-
3
- export { MainParticipantModule } from './main/module';
4
- export { DecideParticipantContainerComponent } from './main/containers/decide.container';
@@ -1,14 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
-
3
- import { DecideBlock } from '../models';
4
-
5
- @Component({
6
- selector: 'cc-decide-cp',
7
- templateUrl: './decide.component.html',
8
- })
9
- export class DecideComponent {
10
- @Input() block: DecideBlock;
11
-
12
- constructor() {
13
- }
14
- }
@@ -1 +0,0 @@
1
- export const namespace = 'ccDecide:participant';
@@ -1,6 +0,0 @@
1
- /**
2
- * Sub-blocks
3
- */
4
- export class DecideBlockType {
5
- static CreateDossier = 'createDossier';
6
- }
@@ -1,10 +0,0 @@
1
- import { ParticipantBlock } from '@cc/shared';
2
-
3
- import { DecideBlockType } from './decide-block-type.model';
4
-
5
- export interface DecideBlock extends ParticipantBlock {
6
-
7
- config: {
8
- subType: DecideBlockType;
9
- }
10
- }
@@ -1,2 +0,0 @@
1
- export * from './decide-block.model';
2
- export * from './decide-block-type.model';
@@ -1,26 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
-
3
- import { DecideBlock } from '../../models';
4
-
5
- export enum DecideBlockActionType {
6
- UPSERT_BLOCK = '[ccDecide - Block] Upsert block',
7
- REMOVE_BLOCK = '[ccDecide - Block] Remove block',
8
- }
9
-
10
- export class UpsertBlock implements Action {
11
- readonly type = DecideBlockActionType.UPSERT_BLOCK;
12
-
13
- constructor(public payload: { block: DecideBlock }) {
14
- }
15
- }
16
-
17
- export class RemoveBlock implements Action {
18
- readonly type = DecideBlockActionType.REMOVE_BLOCK;
19
-
20
- constructor(public payload: { id: string }) {
21
- }
22
- }
23
-
24
- export type BlockActions =
25
- UpsertBlock |
26
- RemoveBlock;