@eui/tools 6.6.2 → 6.7.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.
Files changed (58) 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/index.html +41 -32
  5. package/scripts/app/public/index.js +34 -25
  6. package/scripts/app/routes/index.js +22 -22
  7. package/scripts/csdr/cli/constants.js +2 -1
  8. package/scripts/csdr/cli/package-build-frontend.js +1 -9
  9. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/assets/i18n/en.json +6 -0
  10. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/assets/i18n/fr.json +6 -0
  11. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/index.ts +2 -0
  12. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/components/main.component.html +57 -0
  13. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/components/main.component.ts +8 -0
  14. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/constants.ts +1 -0
  15. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/containers/container.component.ts +28 -0
  16. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/dummy.spec.ts +5 -0
  17. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/module.ts +79 -0
  18. package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/routing-module.ts +23 -0
  19. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/blocks/sample/components/sample.component.html +1 -0
  20. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/blocks/sample/components/sample.component.ts +14 -0
  21. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/blocks/sample/containers/container.component.ts +36 -0
  22. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/blocks/sample/models/block.model.ts +5 -0
  23. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/blocks/sample/models/index.ts +1 -0
  24. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/blocks/sample/module.ts +37 -0
  25. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dummy.spec.ts +5 -0
  26. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/index.ts +4 -0
  27. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/components/decide.component.html +1 -0
  28. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/components/decide.component.ts +14 -0
  29. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/constants.ts +1 -0
  30. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/containers/block-store.service.ts +33 -0
  31. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/containers/decide.container.ts +44 -0
  32. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/containers/generic-block-resolver.service.ts +32 -0
  33. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block-type.model.ts +6 -0
  34. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block.model.ts +10 -0
  35. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/index.ts +2 -0
  36. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/module.ts +60 -0
  37. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/actions/block.actions.ts +26 -0
  38. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/reducers/block.reducer.ts +48 -0
  39. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/reducers/index.ts +22 -0
  40. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/selectors/block.selectors.ts +29 -0
  41. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/module.ts +17 -0
  42. package/scripts/csdr/config/remotes.js +1 -1
  43. package/scripts/utils/tools.js +1 -0
  44. package/scripts/csdr/cli/skeletons/package/frontend-eui15/assets/i18n/en.json +0 -3
  45. package/scripts/csdr/cli/skeletons/package/frontend-eui15/assets/i18n/fr.json +0 -3
  46. package/scripts/csdr/cli/skeletons/package/frontend-eui15/src/index.ts +0 -1
  47. package/scripts/csdr/cli/skeletons/package/frontend-eui15/src/lib/module.ts +0 -11
  48. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/.eslintrc.json +0 -0
  49. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/dependencies-base.json +0 -0
  50. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/dependencies-composite.json +0 -0
  51. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/gitignore_TO_REPLACE +0 -0
  52. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/karma.conf.js +0 -0
  53. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/ng-package.json +0 -0
  54. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/package.json +0 -0
  55. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/src/dummy.spec.ts.TO_REPLACE +0 -0
  56. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/src/test.ts.TO_REPLACE +0 -0
  57. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/tsconfig.lib.json +0 -0
  58. /package/scripts/csdr/cli/skeletons/package/{frontend-eui15 → frontend/15.x/default}/tsconfig.spec.json +0 -0
@@ -1 +1 @@
1
- 6.6.2
1
+ 6.7.0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.7.0 (2023-03-06)
2
+
3
+ ##### New Features
4
+
5
+ * **other:**
6
+ * new participant and default pkg skeletons for v15 - adapted init-custom app generated json - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([dd351337](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/dd351337631dd934f1c3b067e22122effb8e8987))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.6.2 (2023-03-06)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.6.2",
3
+ "version": "6.7.0",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -26,7 +26,7 @@
26
26
  <body>
27
27
  <div id="app" class="container-fluid">
28
28
  <div class="row">
29
- <div class="col-4 full-height-flex">
29
+ <div class="col-6 full-height-flex">
30
30
  <h3 class="mt-2 mb-4">CSDR custom installation (experimental)</h3>
31
31
 
32
32
  <div class="header-flex">
@@ -35,20 +35,16 @@
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">
39
- <option>Open this select menu</option>
40
- <option selected value="my-workplace">MyWorkplace</option>
41
- <!-- <option value="sedia">Sedia</option> -->
38
+ <select disabled class="form-select" v-model="selectedApp">
39
+ <option value="my-workplace">MyWorkplace</option>
42
40
  </select>
43
41
  </div>
44
42
  </div>
45
43
  <div class="row mb-3">
46
44
  <label class="col-sm-2 col-form-label">eUI Version</label>
47
45
  <div class="col-sm-10">
48
- <select disabled class="form-select">
49
- <option>Open this select menu</option>
50
- <option selected value="15.x">eUI 15</option>
51
- <!-- <option value="10.x">eUI 10</option> -->
46
+ <select dis abled class="form-select" v-model="selectedEuiVersion">
47
+ <option value="15.x">eUI 15</option>
52
48
  </select>
53
49
  </div>
54
50
  </div>
@@ -66,32 +62,42 @@
66
62
  <table class="table table-striped" v-show="remotes.length !== 0">
67
63
  <thead>
68
64
  <tr>
69
- <th scope="col">&nbsp;</th>
70
65
  <th scope="col">Remote</th>
71
- <th scope="col">Participant ?</th>
72
- <th scope="col">Full skel.?</th>
66
+ <th scope="col">Participant</th>
67
+ <th scope="col">Full SK</th>
68
+ <th scope="col">Local</th>
69
+ <th scope="col">Installed</th>
73
70
  </tr>
74
71
  </thead>
75
72
  <tbody>
76
73
  <tr v-for="remote in remotes">
74
+ <td>{{ remote.name }}</td>
75
+ <td>
76
+ <div :class="{ 'text-primary fw-bold': remote.participant }">{{ remote.participant }}</div>
77
+ </td>
77
78
  <td>
78
- <div class="form-check" :key="remote.name">
79
+ <div :class="{ 'text-success fw-bold': remote.fullSkeletonSources }">
80
+ {{ remote.fullSkeletonSources }}
81
+ </div>
82
+ </td>
83
+ <td>
84
+ <div class="form-check form-switch">
79
85
  <input
80
86
  class="form-check-input"
81
87
  type="checkbox"
82
88
  :value="remote.name"
83
89
  :id="remote.name"
84
- v-model="selectedRemotes"
85
- @change="remoteSelected($event)" />
90
+ v-model="selectedLocalRemotes" />
86
91
  </div>
87
92
  </td>
88
- <td>{{ remote.name }}</td>
89
- <td>
90
- <div :class="{ 'text-primary fw-bold': remote.participant }">{{ remote.participant }}</div>
91
- </td>
92
93
  <td>
93
- <div :class="{ 'text-success fw-bold': remote.fullSkeletonSources }">
94
- {{ remote.fullSkeletonSources }}
94
+ <div class="form-check form-switch">
95
+ <input
96
+ class="form-check-input"
97
+ type="checkbox"
98
+ :value="remote.name"
99
+ :id="remote.name"
100
+ v-model="selectedInstalledRemotes" />
95
101
  </div>
96
102
  </td>
97
103
  </tr>
@@ -100,12 +106,17 @@
100
106
  </div>
101
107
  </div>
102
108
 
103
- <div class="col-8">
109
+ <div class="col-6">
110
+ <h5 class="mt-5 mb-3">
111
+ Selected local remotes (intialized as sources):
112
+ <span class="text-primary fw-bold">{{ selectedLocalRemotes.length }}</span>
113
+ </h5>
114
+ {{ selectedLocalRemotes }}
104
115
  <h5 class="mt-5 mb-3">
105
- Selected remotes :
106
- <span class="text-primary fw-bold">{{ selectedRemotes.length }}</span>
116
+ Selected local remotes (intialized as dependencies):
117
+ <span class="text-primary fw-bold">{{ selectedInstalledRemotes.length }}</span>
107
118
  </h5>
108
- {{ selectedRemotes }}
119
+ {{ selectedInstalledRemotes }}
109
120
 
110
121
  <h5 class="mt-5 mb-3">
111
122
  Derived dependencies:
@@ -119,15 +130,13 @@
119
130
  </h5>
120
131
  {{ packages }}
121
132
 
122
- <h5 class="mt-5 mb-3">
123
- Remotes to install as dependencies :
124
- <span class="text-primary fw-bold">{{ remotesToInstall.length }}</span>
125
- </h5>
126
- {{ remotesToInstall }}
127
-
128
133
  <hr />
129
134
 
130
- <button class="btn btn-primary" type="button" :disabled="selectedRemotes.length === 0" @click="saveConfig()">
135
+ <button
136
+ class="btn btn-primary"
137
+ type="button"
138
+ :disabled="selectedLocalRemotes.length === 0 && selectedInstalledRemotes.length === 0"
139
+ @click="saveConfig()">
131
140
  Save configuration
132
141
  </button>
133
142
 
@@ -12,11 +12,13 @@ new Vue({
12
12
  el: "#app",
13
13
  data() {
14
14
  return {
15
+ selectedApp: "my-workplace-host-playground-custom",
16
+ selectedEuiVersion: "15.x",
15
17
  remotes: [],
16
- selectedRemotes: [],
18
+ selectedLocalRemotes: [],
19
+ selectedInstalledRemotes: [],
17
20
  deps: [],
18
21
  packages: [],
19
- remotesToInstall: [],
20
22
  saveConfigSubmitted: false,
21
23
  saveConfigOK: false,
22
24
  };
@@ -30,43 +32,33 @@ new Vue({
30
32
  const res = await fetch("http://localhost:3000/api/remotes");
31
33
  const finalRes = await res.json();
32
34
  this.remotes = finalRes;
33
- this.getRemotesToInstall();
34
35
  },
35
36
  async getConfig() {
36
37
  const res = await fetch("http://localhost:3000/api/config");
37
38
  const finalRes = await res.json();
38
- if (finalRes.selectedRemotes) {
39
- this.selectedRemotes = finalRes.selectedRemotes;
39
+
40
+ if (Object.keys(finalRes).length !== 0) {
41
+ this.selectedApp = finalRes.app;
42
+ this.selectedEuiVersion = finalRes.euiVersion;
43
+ this.selectedLocalRemotes = finalRes.localRemotes;
44
+ this.selectedInstalledRemotes = finalRes.installedRemotes;
40
45
  this.deps = finalRes.deps;
41
46
  this.packages = finalRes.packages;
42
- this.remotesToInstall = finalRes.remotesToInstall;
43
47
  }
44
48
  },
45
49
  async getPackages() {
46
- const res = await fetch("http://localhost:3000/api/remotes/packages", getRequestBody(this.selectedRemotes));
50
+ const res = await fetch("http://localhost:3000/api/remotes/packages", getRequestBody(this.selectedLocalRemotes));
47
51
  const finalRes = await res.json();
48
52
  this.packages = finalRes.packages.filter(
49
53
  (p) => p.indexOf("csdr-") < 0 && p.indexOf("cc-shared-ui") < 0 && p.indexOf("mywp-shared-ui") < 0
50
54
  );
51
55
  this.deps = finalRes.deps;
52
- this.getRemotesToInstall();
53
- },
54
- remoteSelected(event) {
55
- this.getPackages();
56
- this.saveConfigSubmitted = false;
57
- },
58
- getRemotesToInstall() {
59
- this.remotesToInstall = this.remotes
60
- .map((r) => r.name)
61
- .filter((r) => {
62
- return !this.selectedRemotes.includes(r);
63
- });
64
56
  },
65
57
  reset() {
66
- this.selectedRemotes = [];
58
+ this.selectedLocalRemotes = [];
59
+ this.selectedInstalledRemotes = [];
67
60
  this.packages = [];
68
61
  this.deps = [];
69
- this.remotesToInstall = [];
70
62
  this.saveConfigOK = false;
71
63
  this.saveConfigSubmitted = false;
72
64
  },
@@ -75,10 +67,12 @@ new Vue({
75
67
  const res = await fetch(
76
68
  "http://localhost:3000/api/config",
77
69
  getRequestBody({
78
- selectedRemotes: this.selectedRemotes,
70
+ app: this.selectedApp,
71
+ euiVersion: this.selectedEuiVersion,
72
+ localRemotes: this.selectedLocalRemotes,
73
+ installedRemotes: this.selectedInstalledRemotes,
79
74
  deps: this.deps,
80
75
  packages: this.packages,
81
- remotesToInstall: this.remotesToInstall,
82
76
  })
83
77
  );
84
78
 
@@ -88,8 +82,23 @@ new Vue({
88
82
  this.saveConfigOK = true;
89
83
  }
90
84
  this.saveConfigSubmitted = true;
91
-
92
- const finalRes = await res.json();
85
+ },
86
+ },
87
+ watch: {
88
+ selectedLocalRemotes: {
89
+ handler: function (val) {
90
+ this.saveConfigOK = false;
91
+ this.saveConfigSubmitted = false;
92
+ this.getPackages();
93
+ },
94
+ deep: true,
95
+ },
96
+ selectedInstalledRemotes: {
97
+ handler: function (val) {
98
+ this.saveConfigOK = false;
99
+ this.saveConfigSubmitted = false;
100
+ },
101
+ deep: true,
93
102
  },
94
103
  },
95
104
  });
@@ -40,65 +40,65 @@ router.get('/remotes', function (req, res) {
40
40
  })
41
41
  });
42
42
 
43
- router.get('/remotes/stats', function (req, res) {
43
+ router.post('/remotes/packages', function (req, res) {
44
44
  return Promise.resolve()
45
45
  .then(() => {
46
- return metadataUtils.stats.getRemoteAllStats();
47
- })
48
- .then((stats) => {
49
- res.send(stats);
46
+ const remotes = req.body;
47
+ const depsPackages = configUtils.remotes.getRemotesPackages(remotes);
48
+ res.send(depsPackages);
50
49
  })
51
50
  .catch((e) => {
52
51
  handlerError(res, e);
53
52
  })
54
53
  });
55
54
 
56
- router.post('/remotes/packages', function (req, res) {
55
+ router.get('/config', function (req, res) {
57
56
  return Promise.resolve()
58
57
  .then(() => {
59
- const remotes = req.body;
60
- const depsPackages = configUtils.remotes.getRemotesPackages(remotes);
61
- res.send(depsPackages);
58
+ return configUtils.global.getCustomConfig();
59
+ })
60
+ .then((customConfig) => {
61
+ res.send(customConfig);
62
62
  })
63
63
  .catch((e) => {
64
64
  handlerError(res, e);
65
65
  })
66
66
  });
67
67
 
68
- router.post('/remotes/stats', function (req, res) {
68
+ router.post('/config', function (req, res) {
69
69
  return Promise.resolve()
70
70
  .then(() => {
71
- return metadataUtils.stats.getRemoteStats(req.body.remote);
71
+ return configUtils.global.generateCustomConfig(req.body);
72
72
  })
73
- .then((remoteStats) => {
74
- res.send(remoteStats);
73
+ .then(() => {
74
+ res.status(200);
75
+ res.send({ status: 'OK'})
75
76
  })
76
77
  .catch((e) => {
77
78
  handlerError(res, e);
78
79
  })
79
80
  });
80
81
 
81
- router.get('/config', function (req, res) {
82
+ router.get('/remotes/stats', function (req, res) {
82
83
  return Promise.resolve()
83
84
  .then(() => {
84
- return configUtils.global.getCustomConfig();
85
+ return metadataUtils.stats.getRemoteAllStats();
85
86
  })
86
- .then((customConfig) => {
87
- res.send(customConfig);
87
+ .then((stats) => {
88
+ res.send(stats);
88
89
  })
89
90
  .catch((e) => {
90
91
  handlerError(res, e);
91
92
  })
92
93
  });
93
94
 
94
- router.post('/config', function (req, res) {
95
+ router.post('/remotes/stats', function (req, res) {
95
96
  return Promise.resolve()
96
97
  .then(() => {
97
- return configUtils.global.generateCustomConfig(req.body);
98
+ return metadataUtils.stats.getRemoteStats(req.body.remote);
98
99
  })
99
- .then(() => {
100
- res.status(200);
101
- res.send({ status: 'OK'})
100
+ .then((remoteStats) => {
101
+ res.send(remoteStats);
102
102
  })
103
103
  .catch((e) => {
104
104
  handlerError(res, e);
@@ -5,7 +5,8 @@ const path = require('path');
5
5
  module.exports.TARGET_ROOT_PATH = path.join(process.cwd(), 'packages');
6
6
  module.exports.TARGET_ROOT_REMOTES_PATH = path.join(process.cwd(), 'remotes');
7
7
  module.exports.SKELETONS_ROOT_PATH = path.join(__dirname, 'skeletons', 'package');
8
- module.exports.FRONTEND_SKELETON_EUI15_PATH = path.join(this.SKELETONS_ROOT_PATH, 'frontend-eui15');
8
+ module.exports.FRONTEND_SKELETON_EUI15_PATH = path.join(this.SKELETONS_ROOT_PATH, 'frontend', '15.x', 'default');
9
+ module.exports.FRONTEND_SKELETON_EUI15_PARTICIPANT_PATH = path.join(this.SKELETONS_ROOT_PATH, 'frontend', '15.x', 'participant');
9
10
  module.exports.BACKEND_SKELETON_PATH = path.join(this.SKELETONS_ROOT_PATH, 'backend');
10
11
  module.exports.VIRTUAL_REMOTE_SKELETON_ROOT_PATH = path.join(__dirname, 'skeletons', 'virtual-remote');
11
12
 
@@ -40,7 +40,7 @@ const replaceContent = (targetPath, name, scope, fullName) => {
40
40
  tools.replaceInPath(targetPath, '@module.scope@', scope);
41
41
  tools.replaceInPath(targetPath, '@module.scope-name@', `${scope.substr(1)}-${name}`);
42
42
  tools.replaceInPath(targetPath, '@module.scope.string@', scope.substr(1));
43
- tools.replaceInPath(targetPath, '@module.class.name@', tools.camelCaseString(name, '-', true));
43
+ tools.replaceInPath(targetPath, '@module.class.name@', tools.camelCaseString(`${scope.substr(1)}-${name}`, '-', true));
44
44
  }
45
45
 
46
46
 
@@ -171,14 +171,6 @@ const generateDefault = (args = constants.DEFAULT_CONFIG) => {
171
171
  replaceExtensions(targetPath);
172
172
  })
173
173
 
174
- .then(() => {
175
- if (
176
- args.pkgFrontendVersion === constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI15
177
- ) {
178
- return tools.remove(path.join(targetPath, 'tslint.json'));
179
- }
180
- })
181
-
182
174
  .then(() => {
183
175
  tools.logSuccess();
184
176
  })
@@ -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,2 @@
1
+ export { @module.class.name@Module, @module.class.name@CommonModule } from './lib/module';
2
+ export { RoutingModule, routes } from './lib/routing-module';
@@ -0,0 +1,57 @@
1
+ <eui-page>
2
+ <eui-page-header [label]="'@module.scope-name@.TITLE' | translate">
3
+ <eui-page-header-action-items>
4
+
5
+ </eui-page-header-action-items>
6
+ </eui-page-header>
7
+
8
+ <eui-page-content>
9
+
10
+ <eui-page-columns>
11
+
12
+ <eui-page-column
13
+ label="{{ '@module.scope-name@.FILTER' | translate }}"
14
+ [size]="'3xl'"
15
+ [isCollapsible]="true">
16
+
17
+ <eui-page-column-body>
18
+
19
+ <!-- QUICK FILTER SECTION -->
20
+ <div class="eui-u-flex eui-u-flex-column eui-u-mt-xs">
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>
23
+ </div>
24
+ </div>
25
+
26
+ </eui-page-column-body>
27
+ </eui-page-column>
28
+
29
+ <eui-page-column>
30
+
31
+ <eui-page-column-header-left-content>
32
+ <div class="eui-page-column__header-left-content-label">{{ '@module.scope-name@.SEARCH_RESULT' | translate }}</div>
33
+ </eui-page-column-header-left-content>
34
+
35
+ <eui-page-column-header-right-content>
36
+ <div class="eui-u-flex">
37
+ <button
38
+ euiButton
39
+ euiSecondary>
40
+ <span euiIcon iconClass="eui-icon-refresh"></span>
41
+ <span euiLabel>{{ '@module.scope-name@.CREATE_DOSSIER' | translate }}</span>
42
+ </button>
43
+ </div>
44
+ </eui-page-column-header-right-content>
45
+
46
+ <eui-page-column-header-body>
47
+ </eui-page-column-header-body>
48
+
49
+ <eui-page-column-body>
50
+ </eui-page-column-body>
51
+
52
+ </eui-page-column>
53
+
54
+ </eui-page-columns>
55
+
56
+ </eui-page-content>
57
+ </eui-page>
@@ -0,0 +1,8 @@
1
+ import { Component, Input } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: '@module.scope-name@-cp',
5
+ templateUrl: './main.component.html',
6
+ })
7
+ export class @module.class.name@Component {
8
+ }
@@ -0,0 +1 @@
1
+ export const namespace = '@module.class.name@:main';
@@ -0,0 +1,28 @@
1
+ import { ChangeDetectionStrategy, Component, Input, OnInit, OnDestroy } from '@angular/core';
2
+
3
+ import { BreadcrumbsService } from '@csdr/core';
4
+
5
+ @Component({
6
+ selector: '@module.scope-name@-ct',
7
+ changeDetection: ChangeDetectionStrategy.OnPush,
8
+ template: `
9
+ <@module.scope-name@-cp>
10
+ </@module.scope-name@-cp>`,
11
+ })
12
+ export class @module.class.name@ContainerComponent implements OnInit, OnDestroy {
13
+
14
+ constructor(private breadcrumbs: BreadcrumbsService) {
15
+ }
16
+
17
+ ngOnInit(): void {
18
+ this.breadcrumbs.removeAll();
19
+ this.breadcrumbs.addItem({
20
+ id: '@module.scope-name@',
21
+ description: '@module.class.name@',
22
+ url: '/@module.scope-name@',
23
+ });
24
+ }
25
+
26
+ ngOnDestroy(): void {
27
+ }
28
+ }
@@ -0,0 +1,5 @@
1
+ describe('First test', () => {
2
+ it('should work', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
@@ -0,0 +1,79 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ // import { StoreModule } from '@ngrx/store';
4
+ // import { EffectsModule } from '@ngrx/effects';
5
+
6
+ import { TranslateModule } from '@ngx-translate/core';
7
+
8
+ import { EuiButtonModule } from '@eui/components/eui-button';
9
+ import { EuiPageModule } from '@eui/components/eui-page';
10
+
11
+ import { CcSharedModule } from '@cc/shared';
12
+
13
+ // -- Components --
14
+ import { @module.class.name@Component } from './components/main.component';
15
+
16
+ const COMPONENTS = [
17
+ @module.class.name@Component,
18
+ ];
19
+
20
+ // -- Containers --
21
+ import { @module.class.name@ContainerComponent } from './containers/container.component';
22
+
23
+ const CONTAINERS = [
24
+ @module.class.name@ContainerComponent,
25
+ ];
26
+
27
+ // -- Effects --
28
+ const EFFECTS = [
29
+ ];
30
+
31
+ // -- Reducer --
32
+ // import { TOKEN, reducerProvider } from './store/reducers';
33
+
34
+ // -- Services --
35
+ const SERVICES = [
36
+ ];
37
+
38
+ // -- Constants --
39
+ import { namespace } from './constants';
40
+
41
+ // -- Routes --
42
+ import { RoutingModule } from './routing-module';
43
+
44
+ @NgModule({
45
+ imports: [
46
+ CommonModule,
47
+ // StoreModule.forFeature(namespace, TOKEN),
48
+ // EffectsModule.forFeature(EFFECTS),
49
+ TranslateModule,
50
+
51
+ EuiButtonModule,
52
+ EuiPageModule,
53
+
54
+ CcSharedModule,
55
+ ],
56
+ declarations: [
57
+ ...COMPONENTS,
58
+ ...CONTAINERS,
59
+ ],
60
+ providers: [
61
+ // reducerProvider,
62
+ ...SERVICES,
63
+ ],
64
+ exports: [],
65
+ })
66
+ export class @module.class.name@CommonModule {
67
+ }
68
+
69
+ @NgModule({
70
+ imports: [
71
+ @module.class.name@CommonModule,
72
+ RoutingModule,
73
+ ],
74
+ exports: [
75
+ @module.class.name@CommonModule,
76
+ ],
77
+ })
78
+ export class @module.class.name@Module {
79
+ }
@@ -0,0 +1,23 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+
4
+ import { @module.class.name@ContainerComponent } from './containers/container.component';
5
+
6
+ export const routes: Routes = [
7
+ {
8
+ path: '',
9
+ pathMatch: 'full',
10
+ component: @module.class.name@ContainerComponent,
11
+ },
12
+ ];
13
+
14
+ @NgModule({
15
+ imports: [
16
+ RouterModule.forChild(routes),
17
+ ],
18
+ exports: [
19
+ RouterModule,
20
+ ],
21
+ })
22
+ export class RoutingModule {
23
+ }
@@ -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 SampleComponent {
10
+ @Input() block: Block;
11
+
12
+ constructor() {
13
+ }
14
+ }
@@ -0,0 +1,36 @@
1
+ import { ChangeDetectionStrategy, Component, Input, OnInit, OnDestroy } from '@angular/core';
2
+
3
+ import { Observable } from 'rxjs';
4
+
5
+ import { BlockComponent } from '@cc/shared';
6
+
7
+ import { Block } from '../models';
8
+
9
+ @Component({
10
+ selector: '@module.scope-name@-ct',
11
+ changeDetection: ChangeDetectionStrategy.OnPush,
12
+ template: `
13
+ <@module.scope-name@-cp
14
+ [block]="block$ | async">
15
+ </@module.scope-name@-cp>`,
16
+ })
17
+ export class ContainerComponent implements BlockComponent, OnInit, OnDestroy {
18
+ @Input() readonly block: Block;
19
+
20
+ block$: Observable<Block>;
21
+
22
+ constructor() {
23
+ }
24
+
25
+ ngOnInit(): void {
26
+ this.asyncPipeObs();
27
+ }
28
+
29
+ ngOnDestroy(): void {
30
+ }
31
+
32
+ private asyncPipeObs(): void {
33
+ // todo: retrieve block$ from the store
34
+ // this.block$
35
+ }
36
+ }
@@ -0,0 +1,5 @@
1
+ import { ParticipantBlock } from '@cc/shared';
2
+
3
+ export interface Block extends ParticipantBlock {
4
+
5
+ }
@@ -0,0 +1,37 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ import { TranslateModule } from '@ngx-translate/core';
5
+
6
+ import { CcSharedModule } from '@cc/shared';
7
+
8
+ // -- Components --
9
+ import { SampleComponent } from './components/sample.component';
10
+
11
+ const COMPONENTS = [
12
+ SampleComponent,
13
+ ];
14
+
15
+ // -- Containers --
16
+ import { ContainerComponent } from './containers/container.component';
17
+
18
+ const CONTAINERS = [
19
+ ContainerComponent,
20
+ ];
21
+
22
+ @NgModule({
23
+ imports: [
24
+ CommonModule,
25
+ TranslateModule,
26
+ CcSharedModule,
27
+ ],
28
+ declarations: [
29
+ ...COMPONENTS,
30
+ ...CONTAINERS,
31
+ ],
32
+ exports: [
33
+ ContainerComponent,
34
+ ],
35
+ })
36
+ export class CreateDossierModule {
37
+ }
@@ -0,0 +1,5 @@
1
+ describe('First test', () => {
2
+ it('should work', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
@@ -0,0 +1,4 @@
1
+ export { DecideParticipantModule } from './module';
2
+
3
+ export { MainParticipantModule } from './main/module';
4
+ export { DecideParticipantContainerComponent } from './main/containers/decide.container';
@@ -0,0 +1 @@
1
+ <cc-generic-block-ct [block]="block"></cc-generic-block-ct>
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1 @@
1
+ export const namespace = 'ccDecide:participant';
@@ -0,0 +1,33 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { Store, select } from '@ngrx/store';
3
+
4
+ import { Observable } from 'rxjs';
5
+
6
+ import * as block from '../store/actions/block.actions';
7
+
8
+ import {
9
+ DecideBlock,
10
+ } from '../models';
11
+
12
+ import * as fromBlockReducer from '../store/reducers/block.reducer';
13
+
14
+ import * as fromBlockSelectors from '../store/selectors/block.selectors';
15
+
16
+ @Injectable()
17
+ export class BlockStoreService {
18
+
19
+ constructor(private store$: Store<fromBlockReducer.State>) {
20
+ }
21
+
22
+ getBlockById(id: string): Observable<DecideBlock> {
23
+ return this.store$.pipe(select(fromBlockSelectors.getBlockById(id)));
24
+ }
25
+
26
+ upsertBlock(b: DecideBlock): void {
27
+ this.store$.dispatch(new block.UpsertBlock({ block: b }));
28
+ }
29
+
30
+ removeBlock(id: string): void {
31
+ this.store$.dispatch(new block.RemoveBlock({ id }));
32
+ }
33
+ }
@@ -0,0 +1,44 @@
1
+ import { ChangeDetectionStrategy, Component, Input, OnInit, OnDestroy } from '@angular/core';
2
+
3
+ import { Observable } from 'rxjs';
4
+
5
+ import { BlockComponent, GENERIC_BLOCK_RESOLVER_TOKEN } from '@cc/shared';
6
+
7
+ import { DecideBlock } from '../models';
8
+
9
+ import { BlockStoreService } from './block-store.service';
10
+ import { GenericBlockResolverService } from './generic-block-resolver.service';
11
+
12
+ @Component({
13
+ selector: 'cc-decide-participant-ct',
14
+ changeDetection: ChangeDetectionStrategy.OnPush,
15
+ providers: [
16
+ BlockStoreService,
17
+ { provide: GENERIC_BLOCK_RESOLVER_TOKEN, useClass: GenericBlockResolverService },
18
+ ],
19
+ template: `
20
+ <cc-decide-cp
21
+ [block]="block$ | async">
22
+ </cc-decide-cp>`,
23
+ })
24
+ export class DecideParticipantContainerComponent implements BlockComponent, OnInit, OnDestroy {
25
+ @Input() readonly block: DecideBlock;
26
+
27
+ block$: Observable<DecideBlock>;
28
+
29
+ constructor(private blockStore: BlockStoreService) {
30
+ }
31
+
32
+ ngOnInit(): void {
33
+ this.asyncPipeObs();
34
+
35
+ this.blockStore.upsertBlock(this.block);
36
+ }
37
+
38
+ ngOnDestroy(): void {
39
+ }
40
+
41
+ private asyncPipeObs(): void {
42
+ this.block$ = this.blockStore.getBlockById(this.block.id);
43
+ }
44
+ }
@@ -0,0 +1,32 @@
1
+ import { Inject, Injectable } from '@angular/core';
2
+
3
+ import { CONFIG_TOKEN } from '@eui/core';
4
+
5
+ import { BlockConfig, IGenericBlock, UnknownBlockComponent } from '@cc/shared';
6
+
7
+ // DECIDE BLOCKS
8
+ import { CreateDossierContainerComponent } from '../../blocks/create-dossier/containers/create-dossier.container';
9
+
10
+ import { DecideBlockType } 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 DecideBlockType.CreateDossier: {
21
+ return CreateDossierContainerComponent;
22
+ }
23
+ default: {
24
+ return UnknownBlockComponent;
25
+ }
26
+ }
27
+ }
28
+
29
+ enrichBlock(block: BlockConfig): BlockConfig {
30
+ return block;
31
+ }
32
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Sub-blocks
3
+ */
4
+ export class DecideBlockType {
5
+ static CreateDossier = 'createDossier';
6
+ }
@@ -0,0 +1,10 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ export * from './decide-block.model';
2
+ export * from './decide-block-type.model';
@@ -0,0 +1,60 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { StoreModule } from '@ngrx/store';
4
+ import { EffectsModule } from '@ngrx/effects';
5
+
6
+ import { TranslateModule } from '@ngx-translate/core';
7
+
8
+ import { CcSharedModule } from '@cc/shared';
9
+
10
+ // -- Components --
11
+ import { DecideComponent } from './components/decide.component';
12
+
13
+ const COMPONENTS = [
14
+ DecideComponent,
15
+ ];
16
+
17
+ // -- Containers --
18
+ import { DecideParticipantContainerComponent } from './containers/decide.container';
19
+
20
+ const CONTAINERS = [
21
+ DecideParticipantContainerComponent,
22
+ ];
23
+
24
+ // -- Effects --
25
+ const EFFECTS = [
26
+ ];
27
+
28
+ // -- Reducer --
29
+ import { TOKEN, reducerProvider } from './store/reducers';
30
+
31
+ // -- Services --
32
+ const SERVICES = [
33
+ ];
34
+
35
+ // -- Constants --
36
+ import { namespace } from './constants';
37
+
38
+ @NgModule({
39
+ imports: [
40
+ CommonModule,
41
+ StoreModule.forFeature(namespace, TOKEN),
42
+ EffectsModule.forFeature(EFFECTS),
43
+ TranslateModule,
44
+
45
+ CcSharedModule,
46
+ ],
47
+ declarations: [
48
+ ...COMPONENTS,
49
+ ...CONTAINERS,
50
+ ],
51
+ providers: [
52
+ reducerProvider,
53
+ ...SERVICES,
54
+ ],
55
+ exports: [
56
+ DecideParticipantContainerComponent,
57
+ ],
58
+ })
59
+ export class MainParticipantModule {
60
+ }
@@ -0,0 +1,26 @@
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;
@@ -0,0 +1,48 @@
1
+ import { createSelector } from '@ngrx/store';
2
+ import { createEntityAdapter, Dictionary, EntityAdapter, EntityState } from '@ngrx/entity';
3
+
4
+ import {
5
+ DecideBlockActionType,
6
+ BlockActions,
7
+ } from '../actions/block.actions';
8
+
9
+ import { DecideBlock } from '../../models';
10
+
11
+ export interface State extends EntityState<DecideBlock> {
12
+ }
13
+
14
+ export const adapter: EntityAdapter<DecideBlock> = createEntityAdapter<DecideBlock>({
15
+ selectId: (block: DecideBlock) => 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 DecideBlockActionType.UPSERT_BLOCK: {
23
+ return adapter.upsertOne(action.payload.block, state);
24
+ }
25
+ case DecideBlockActionType.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<DecideBlock>) => {
45
+ return entities[id];
46
+ },
47
+ );
48
+ };
@@ -0,0 +1,22 @@
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>>('ccDecideReducers');
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
+ ];
@@ -0,0 +1,29 @@
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 { DecideBlock } from '../../models';
11
+
12
+ import { namespace } from '../../constants';
13
+
14
+ // -----------------
15
+ // --- feature selector
16
+ const getCcDecideState = createFeatureSelector<State>(namespace);
17
+
18
+ // -----------------
19
+ // ----- block
20
+ const getBlockState = createSelector(getCcDecideState, state => {
21
+ return state.block;
22
+ });
23
+
24
+ export const getBlockById = (id: string) => {
25
+ return createSelector(
26
+ getBlockState,
27
+ fromBlock.getEntityById(id),
28
+ );
29
+ };
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+
3
+ import { MainParticipantModule } from './main/module';
4
+
5
+ import { CreateDossierModule } from './blocks/create-dossier/module';
6
+
7
+ @NgModule({
8
+ imports: [
9
+ MainParticipantModule,
10
+ CreateDossierModule,
11
+ ],
12
+ exports: [
13
+ MainParticipantModule,
14
+ ],
15
+ })
16
+ export class DecideParticipantModule {
17
+ }
@@ -153,7 +153,7 @@ module.exports.isLocalRemote = (npmPkg) => {
153
153
  module.exports.getRemotesPackages = (remotes) => {
154
154
  let packages = [], deps = [];
155
155
 
156
- remotes.forEach((r) => {
156
+ remotes.forEach((r) => {
157
157
  const remote = this.getRemote(r);
158
158
  const npmPkgs = Object.keys(remote.dependencies.composite);
159
159
 
@@ -448,6 +448,7 @@ function replaceInPath(rootPath, fromString, toString) {
448
448
  const fromRegExp = new RegExp(fromString, 'g');
449
449
 
450
450
  return replace.sync({
451
+ glob: { dot: true },
451
452
  files: [rootPath + '/**/*.*'],
452
453
  from: fromRegExp,
453
454
  to: toString,
@@ -1,3 +0,0 @@
1
- {
2
- "@module.name@.KEY": "english text"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "@module.name@.KEY": "texte en français"
3
- }
@@ -1 +0,0 @@
1
- export * from './lib/module';
@@ -1,11 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
-
3
- @NgModule({
4
- declarations: [
5
- ],
6
- imports: [
7
- ],
8
- exports: [
9
- ],
10
- })
11
- export class Module { }