@eui/tools 6.7.0 → 6.7.2
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/app/public/index.html +5 -5
- package/scripts/app/public/index.js +6 -6
- package/scripts/app/public/package-init.html +11 -0
- package/scripts/app/public/package-init.js +2 -0
- package/scripts/csdr/cli/package-build-frontend.js +5 -1
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/.eslintrc.json +79 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/assets/i18n/en.json +6 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/assets/i18n/fr.json +6 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dependencies-base.json +2 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dependencies-composite.json +3 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/gitignore_TO_REPLACE +46 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/karma.conf.js +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/ng-package.json +7 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/package.json +4 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/index.ts +4 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/module.ts +1 -1
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/components/sample.component.ts +14 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/constants.ts +1 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/containers/block-store.service.ts +3 -3
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main/containers/decide.container.ts → src/lib/main/containers/container.component.ts} +7 -7
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/containers/generic-block-resolver.service.ts +5 -5
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/block-type.model.ts +6 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/block.model.ts +10 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/index.ts +2 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/module.ts +5 -5
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/store/actions/block.actions.ts +26 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/reducers/block.reducer.ts +8 -8
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/reducers/index.ts +1 -1
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/selectors/block.selectors.ts +3 -3
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{module.ts → src/lib/module.ts} +3 -3
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/test.ts.TO_REPLACE +21 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/tsconfig.lib.json +32 -0
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/tsconfig.spec.json +17 -0
- package/scripts/csdr/config/init.js +45 -2
- package/scripts/csdr/init/init-custom.js +54 -0
- package/scripts/csdr/init/init-old.js +210 -0
- package/scripts/csdr/init/init-package.js +63 -0
- package/scripts/csdr/init/init-project.js +103 -0
- package/scripts/csdr/init/init-remote.js +47 -0
- package/scripts/csdr/init/init-utils.js +3 -0
- package/scripts/csdr/init/init.js +19 -111
- package/scripts/utils/pre-build/injection/externals.js +13 -12
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dummy.spec.ts +0 -5
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/index.ts +0 -4
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/components/decide.component.ts +0 -14
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/constants.ts +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block-type.model.ts +0 -6
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block.model.ts +0 -10
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/index.ts +0 -2
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/actions/block.actions.ts +0 -26
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/{default/src/lib/dummy.spec.ts → participant/src/dummy.spec.ts.TO_REPLACE} +0 -0
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/components/sample.component.html +0 -0
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/components/sample.component.ts +0 -0
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/containers/container.component.ts +0 -0
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/models/block.model.ts +0 -0
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/models/index.ts +0 -0
- /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main/components/decide.component.html → src/lib/main/components/sample.component.html} +0 -0
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.7.
|
|
1
|
+
6.7.2
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 6.7.2 (2023-03-07)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* mwp v15 custom installation - Phase 2 - WIP - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([981bfc57](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/981bfc575501099c0d7d1479042ce22d5118918d))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
10
|
+
## 6.7.1 (2023-03-06)
|
|
11
|
+
|
|
12
|
+
##### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **other:**
|
|
15
|
+
* 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))
|
|
16
|
+
|
|
17
|
+
* * *
|
|
18
|
+
* * *
|
|
1
19
|
## 6.7.0 (2023-03-06)
|
|
2
20
|
|
|
3
21
|
##### New Features
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<div class="row mb-3">
|
|
36
36
|
<label class="col-sm-2 col-form-label">App</label>
|
|
37
37
|
<div class="col-sm-10">
|
|
38
|
-
<select disabled class="form-select" v-model="
|
|
38
|
+
<select disabled class="form-select" v-model="selectedProject">
|
|
39
39
|
<option value="my-workplace">MyWorkplace</option>
|
|
40
40
|
</select>
|
|
41
41
|
</div>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
type="checkbox"
|
|
88
88
|
:value="remote.name"
|
|
89
89
|
:id="remote.name"
|
|
90
|
-
v-model="
|
|
90
|
+
v-model="selectedRemotes" />
|
|
91
91
|
</div>
|
|
92
92
|
</td>
|
|
93
93
|
<td>
|
|
@@ -109,9 +109,9 @@
|
|
|
109
109
|
<div class="col-6">
|
|
110
110
|
<h5 class="mt-5 mb-3">
|
|
111
111
|
Selected local remotes (intialized as sources):
|
|
112
|
-
<span class="text-primary fw-bold">{{
|
|
112
|
+
<span class="text-primary fw-bold">{{ selectedRemotes.length }}</span>
|
|
113
113
|
</h5>
|
|
114
|
-
{{
|
|
114
|
+
{{ selectedRemotes }}
|
|
115
115
|
<h5 class="mt-5 mb-3">
|
|
116
116
|
Selected local remotes (intialized as dependencies):
|
|
117
117
|
<span class="text-primary fw-bold">{{ selectedInstalledRemotes.length }}</span>
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
<button
|
|
136
136
|
class="btn btn-primary"
|
|
137
137
|
type="button"
|
|
138
|
-
:disabled="
|
|
138
|
+
:disabled="selectedRemotes.length === 0 && selectedInstalledRemotes.length === 0"
|
|
139
139
|
@click="saveConfig()">
|
|
140
140
|
Save configuration
|
|
141
141
|
</button>
|
|
@@ -12,10 +12,10 @@ new Vue({
|
|
|
12
12
|
el: "#app",
|
|
13
13
|
data() {
|
|
14
14
|
return {
|
|
15
|
-
|
|
15
|
+
selectedProject: "my-workplace-host-playground-custom",
|
|
16
16
|
selectedEuiVersion: "15.x",
|
|
17
17
|
remotes: [],
|
|
18
|
-
|
|
18
|
+
selectedRemotes: [],
|
|
19
19
|
selectedInstalledRemotes: [],
|
|
20
20
|
deps: [],
|
|
21
21
|
packages: [],
|
|
@@ -38,9 +38,9 @@ new Vue({
|
|
|
38
38
|
const finalRes = await res.json();
|
|
39
39
|
|
|
40
40
|
if (Object.keys(finalRes).length !== 0) {
|
|
41
|
-
this.selectedApp = finalRes.
|
|
41
|
+
this.selectedApp = finalRes.project;
|
|
42
42
|
this.selectedEuiVersion = finalRes.euiVersion;
|
|
43
|
-
this.selectedLocalRemotes = finalRes.
|
|
43
|
+
this.selectedLocalRemotes = finalRes.remotes;
|
|
44
44
|
this.selectedInstalledRemotes = finalRes.installedRemotes;
|
|
45
45
|
this.deps = finalRes.deps;
|
|
46
46
|
this.packages = finalRes.packages;
|
|
@@ -67,9 +67,9 @@ new Vue({
|
|
|
67
67
|
const res = await fetch(
|
|
68
68
|
"http://localhost:3000/api/config",
|
|
69
69
|
getRequestBody({
|
|
70
|
-
|
|
70
|
+
project: this.selectedProject,
|
|
71
71
|
euiVersion: this.selectedEuiVersion,
|
|
72
|
-
|
|
72
|
+
remotes: this.selectedRemotes,
|
|
73
73
|
installedRemotes: this.selectedInstalledRemotes,
|
|
74
74
|
deps: this.deps,
|
|
75
75
|
packages: this.packages,
|
|
@@ -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
|
-
|
|
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": "**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,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
|
+
}
|
package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/constants.ts
ADDED
|
@@ -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
|
-
|
|
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<
|
|
22
|
+
getBlockById(id: string): Observable<Block> {
|
|
23
23
|
return this.store$.pipe(select(fromBlockSelectors.getBlockById(id)));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
upsertBlock(b:
|
|
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 {
|
|
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: '
|
|
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
|
-
|
|
20
|
+
<@module.scope-name@-cp
|
|
21
21
|
[block]="block$ | async">
|
|
22
|
-
|
|
22
|
+
</@module.scope-name@-cp>`,
|
|
23
23
|
})
|
|
24
|
-
export class
|
|
25
|
-
@Input() readonly block:
|
|
24
|
+
export class @module.class.name@ContainerComponent implements BlockComponent, OnInit, OnDestroy {
|
|
25
|
+
@Input() readonly block: Block;
|
|
26
26
|
|
|
27
|
-
block$: Observable<
|
|
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
|
-
//
|
|
8
|
-
import {
|
|
7
|
+
// BLOCKS
|
|
8
|
+
import { ContainerComponent } from '../../blocks/sample/containers/container.component';
|
|
9
9
|
|
|
10
|
-
import {
|
|
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
|
|
21
|
-
return
|
|
20
|
+
case BlockType.@module.class.name@: {
|
|
21
|
+
return ContainerComponent;
|
|
22
22
|
}
|
|
23
23
|
default: {
|
|
24
24
|
return UnknownBlockComponent;
|
package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/module.ts
RENAMED
|
@@ -8,17 +8,17 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
8
8
|
import { CcSharedModule } from '@cc/shared';
|
|
9
9
|
|
|
10
10
|
// -- Components --
|
|
11
|
-
import {
|
|
11
|
+
import { @module.class.name@Component } from './components/sample.component';
|
|
12
12
|
|
|
13
13
|
const COMPONENTS = [
|
|
14
|
-
|
|
14
|
+
@module.class.name@Component,
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
// -- Containers --
|
|
18
|
-
import {
|
|
18
|
+
import { @module.class.name@ContainerComponent } from './containers/container.component';
|
|
19
19
|
|
|
20
20
|
const CONTAINERS = [
|
|
21
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5
|
+
BlockActionType,
|
|
6
6
|
BlockActions,
|
|
7
7
|
} from '../actions/block.actions';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Block } from '../../models';
|
|
10
10
|
|
|
11
|
-
export interface State extends EntityState<
|
|
11
|
+
export interface State extends EntityState<Block> {
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const adapter: EntityAdapter<
|
|
15
|
-
selectId: (block:
|
|
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
|
|
22
|
+
case BlockActionType.UPSERT_BLOCK: {
|
|
23
23
|
return adapter.upsertOne(action.payload.block, state);
|
|
24
24
|
}
|
|
25
|
-
case
|
|
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<
|
|
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>>('
|
|
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 {
|
|
10
|
+
import { Block } from '../../models';
|
|
11
11
|
|
|
12
12
|
import { namespace } from '../../constants';
|
|
13
13
|
|
|
14
14
|
// -----------------
|
|
15
15
|
// --- feature selector
|
|
16
|
-
const
|
|
16
|
+
const get@module.class.name@State = createFeatureSelector<State>(namespace);
|
|
17
17
|
|
|
18
18
|
// -----------------
|
|
19
19
|
// ----- block
|
|
20
|
-
const getBlockState = createSelector(
|
|
20
|
+
const getBlockState = createSelector(get@module.class.name@State, state => {
|
|
21
21
|
return state.block;
|
|
22
22
|
});
|
|
23
23
|
|
package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{module.ts → src/lib/module.ts}
RENAMED
|
@@ -2,16 +2,16 @@ import { NgModule } from '@angular/core';
|
|
|
2
2
|
|
|
3
3
|
import { MainParticipantModule } from './main/module';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { @module.class.name@BlockSampleModule } from './blocks/sample/module';
|
|
6
6
|
|
|
7
7
|
@NgModule({
|
|
8
8
|
imports: [
|
|
9
9
|
MainParticipantModule,
|
|
10
|
-
|
|
10
|
+
@module.class.name@BlockSampleModule,
|
|
11
11
|
],
|
|
12
12
|
exports: [
|
|
13
13
|
MainParticipantModule,
|
|
14
14
|
],
|
|
15
15
|
})
|
|
16
|
-
export class
|
|
16
|
+
export class @module.class.name@Module {
|
|
17
17
|
}
|