@eui/tools 5.0.0-rc.2 → 5.0.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +746 -5
  3. package/bin/eui-scripts.js +6 -6
  4. package/bin/scripts/build-package-sub.js +20 -0
  5. package/bin/scripts/version.js +12 -0
  6. package/global.test.js +61 -45
  7. package/package.json +18 -21
  8. package/sandbox.js +169 -6
  9. package/scripts/csdr/audit/audit-utils.js +2 -2
  10. package/scripts/csdr/cli/app.js +43 -5
  11. package/scripts/csdr/cli/package.js +93 -9
  12. package/scripts/csdr/cli/skeletons/app-eui10/angular-config.json +20 -0
  13. package/scripts/csdr/cli/skeletons/app-eui10/dependencies-base.json +2 -0
  14. package/scripts/csdr/cli/skeletons/app-eui10/dependencies-composite.json +5 -0
  15. package/scripts/csdr/cli/skeletons/app-eui10/gitignore_TO_REPLACE +63 -0
  16. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/models/user.js +8 -0
  17. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/index.js +5 -0
  18. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/user_routes.js +24 -0
  19. package/scripts/csdr/cli/skeletons/app-eui10/mock/db/db.json +12 -0
  20. package/scripts/csdr/cli/skeletons/app-eui10/mock/server.js +16 -0
  21. package/scripts/csdr/cli/skeletons/app-eui10/package.json +6 -0
  22. package/scripts/csdr/cli/skeletons/app-eui10/scripts.json +5 -0
  23. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-routing.module.ts +18 -0
  24. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-starter.service.ts +68 -0
  25. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.html +29 -0
  26. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.ts +55 -0
  27. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.module.ts +27 -0
  28. package/scripts/{utils/pre-build/translations/common.js → csdr/cli/skeletons/app-eui10/src/app/core/components/.gitkeep} +0 -0
  29. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/core.module.ts +84 -0
  30. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/reducers/index.ts +33 -0
  31. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home-routing.module.ts +15 -0
  32. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.html +7 -0
  33. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.ts +19 -0
  34. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.module.ts +18 -0
  35. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.html +7 -0
  36. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.ts +7 -0
  37. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.html +7 -0
  38. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.ts +7 -0
  39. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1-routing.module.ts +18 -0
  40. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.html +7 -0
  41. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.ts +8 -0
  42. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.module.ts +21 -0
  43. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2-routing.module.ts +16 -0
  44. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.html +8 -0
  45. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.ts +7 -0
  46. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.module.ts +17 -0
  47. package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/shared.module.ts +21 -0
  48. package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/testing/router.mock.ts +18 -0
  49. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/config/env-json-config.json +8 -0
  50. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/en.json +7 -0
  51. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/fr.json +7 -0
  52. package/scripts/csdr/cli/skeletons/app-eui10/src/config/global.ts +20 -0
  53. package/scripts/csdr/cli/skeletons/app-eui10/src/config/index.ts +8 -0
  54. package/scripts/csdr/cli/skeletons/app-eui10/src/config/modules.ts +4 -0
  55. package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.prod.ts +9 -0
  56. package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.ts +9 -0
  57. package/scripts/csdr/cli/skeletons/app-eui10/src/index.html +21 -0
  58. package/scripts/csdr/cli/skeletons/app-eui10/src/styles.scss +1 -0
  59. package/scripts/csdr/cli/skeletons/app-eui10/tslint.json +17 -0
  60. package/scripts/csdr/cli/skeletons/app-showcase/angular-config.json +98 -33
  61. package/scripts/csdr/cli/skeletons/app-showcase/dependencies-composite.json +1 -1
  62. package/scripts/csdr/cli/skeletons/app-showcase/src/app/app.component.html +16 -18
  63. package/scripts/csdr/cli/skeletons/app-showcase/src/app/app.routes.ts +1 -1
  64. package/scripts/csdr/cli/skeletons/app-showcase/src/app/features/_home/home.module.ts +2 -2
  65. package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
  66. package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
  67. package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
  68. package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
  69. package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
  70. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
  71. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
  72. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
  73. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
  74. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
  75. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
  76. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
  77. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
  78. package/scripts/csdr/cli/skeletons/{app-showcase → app-showcase-eui13}/src/app/features/shared/shared.module.ts +0 -0
  79. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
  80. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
  81. package/scripts/csdr/cli/skeletons/{app-showcase → app-showcase-eui13}/src/index.html +0 -0
  82. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/en.json +3 -0
  83. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/i18n/fr.json +3 -0
  84. package/scripts/csdr/cli/skeletons/package/frontend-eui10/gitignore_TO_REPLACE +46 -0
  85. package/scripts/csdr/cli/skeletons/package/frontend-eui10/karma.conf.js +7 -0
  86. package/scripts/csdr/cli/skeletons/package/frontend-eui10/ng-package.json +7 -0
  87. package/scripts/csdr/cli/skeletons/package/frontend-eui10/package.json +4 -0
  88. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/dummy.spec.ts.TO_REPLACE +5 -0
  89. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/index.ts +1 -0
  90. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/lib/module.ts +11 -0
  91. package/scripts/csdr/cli/skeletons/package/frontend-eui10/src/test.ts.TO_REPLACE +21 -0
  92. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.lib.json +32 -0
  93. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tsconfig.spec.json +17 -0
  94. package/scripts/csdr/cli/skeletons/package/frontend-eui10/tslint.json +17 -0
  95. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.html +1 -0
  96. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.spec.ts.TO_REPLACE +25 -0
  97. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/components/cmp1/cmp1.component.ts +14 -0
  98. package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +3 -3
  99. package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +1 -0
  100. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +3 -0
  101. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +6 -0
  102. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +62 -28
  103. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +44 -39
  104. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +23 -9
  105. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +1 -0
  106. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +1 -0
  107. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +6 -5
  108. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +1 -1
  109. package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +3 -1
  110. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/angular.json +90 -0
  111. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/browserslist +10 -0
  112. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-base.json +2 -0
  113. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite.json +6 -0
  114. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/gitignore_TO_REPLACE +64 -0
  115. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/karma.conf.js +7 -0
  116. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/package.json_TO_REPLACE +8 -0
  117. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/dummy.scss +3 -0
  118. package/scripts/csdr/cli/skeletons/package/{frontend-remote/src/app/dummy.spec.ts.TO_REPLACE → frontend-remote-eui10/src/app/dummy.spec.ts} +0 -0
  119. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/fallback.component.ts +11 -0
  120. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.component.ts +90 -0
  121. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +219 -0
  122. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/custom-route-serializer.ts +28 -0
  123. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/reducers/index.ts +42 -0
  124. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +55 -0
  125. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/assets/.gitkeep +0 -0
  126. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/global.ts +31 -0
  127. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/index.ts +20 -0
  128. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/modules.ts +3 -0
  129. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.prod.ts +3 -0
  130. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/environments/environment.ts +15 -0
  131. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/favicon.ico +0 -0
  132. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/index.html +10 -0
  133. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/main.ts +12 -0
  134. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/polyfills.ts +86 -0
  135. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/test.ts.TO_REPLACE +20 -0
  136. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.app.json +20 -0
  137. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tsconfig.spec.json +18 -0
  138. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint-remote.json +7 -0
  139. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/tslint.json +17 -0
  140. package/scripts/csdr/cli/skeletons/package/{frontend-remote → frontend-remote-eui10}/webpack.extra.js +0 -0
  141. package/scripts/csdr/config/angular.js +734 -47
  142. package/scripts/csdr/config/global.js +43 -6
  143. package/scripts/csdr/config/packages.js +64 -1
  144. package/scripts/csdr/config/projects.js +24 -6
  145. package/scripts/csdr/config/projects.test.js +11 -9
  146. package/scripts/csdr/config/sync.js +6 -3
  147. package/scripts/csdr/init/init-utils.js +72 -0
  148. package/scripts/csdr/init/init.js +6 -0
  149. package/scripts/csdr/init/prompt.js +3 -1
  150. package/scripts/csdr/init/resources/10.x/yarn.lock +16428 -0
  151. package/scripts/csdr/init/resources/13.x/browserslistrc +6 -0
  152. package/scripts/csdr/init/resources/13.x/resolutions.json +6 -0
  153. package/scripts/csdr/init/resources/14.x/browserslistrc +6 -0
  154. package/scripts/csdr/init/resources/14.x/resolutions.json +5 -0
  155. package/scripts/csdr/install/build-app.js +6 -38
  156. package/scripts/csdr/install/build-package.js +16 -157
  157. package/scripts/csdr/install/common.js +21 -13
  158. package/scripts/csdr/install/composite-core.js +256 -0
  159. package/scripts/csdr/install/install-utils.js +8 -4
  160. package/scripts/csdr/install/local-dev.js +5 -3
  161. package/scripts/csdr/install/packages.js +90 -0
  162. package/scripts/csdr/install/projects.js +76 -0
  163. package/scripts/csdr/install/{remote.js → remotes.js} +46 -51
  164. package/scripts/csdr/metadata/app-envs.js +1 -39
  165. package/scripts/csdr/metadata/app-history.js +1 -66
  166. package/scripts/csdr/metadata/app-versions.js +2 -12
  167. package/scripts/csdr/metadata/app.js +49 -9
  168. package/scripts/csdr/metadata/common.js +21 -45
  169. package/scripts/csdr/metadata/metadata-utils.js +2 -0
  170. package/scripts/csdr/metadata/package-envs.js +71 -0
  171. package/scripts/csdr/metadata/package-history.js +5 -1
  172. package/scripts/csdr/metadata/package-versions.js +79 -0
  173. package/scripts/csdr/metadata/package.js +169 -101
  174. package/scripts/csdr/metadata/stats.js +9 -5
  175. package/scripts/csdr/release/app/release-app.js +16 -21
  176. package/scripts/csdr/release/package/backend.js +26 -0
  177. package/scripts/csdr/release/package/common.js +220 -18
  178. package/scripts/csdr/release/package/release-package.js +41 -7
  179. package/scripts/csdr/release/package/remote.js +2 -17
  180. package/scripts/csdr/release/package/ui.js +86 -3
  181. package/scripts/csdr/sync/sync-utils.js +9 -2
  182. package/scripts/csdr/version/app-common.js +32 -0
  183. package/scripts/csdr/version/app-env-target.js +5 -295
  184. package/scripts/csdr/version/app.js +5 -3
  185. package/scripts/csdr/version/common.js +282 -0
  186. package/scripts/csdr/version/{app-env-target.test.js → common.test.js} +48 -36
  187. package/scripts/csdr/version/package-common.js +158 -0
  188. package/scripts/csdr/version/package-default.js +144 -0
  189. package/scripts/csdr/version/package-remote.js +51 -0
  190. package/scripts/csdr/version/package.js +16 -270
  191. package/scripts/csdr/version/version-utils.js +12 -7
  192. package/scripts/utils/api-utils.js +90 -0
  193. package/scripts/utils/build/app/build-app-utils.js +11 -9
  194. package/scripts/utils/build/package/angular.js +4 -30
  195. package/scripts/utils/build/package/build-package-utils.js +50 -1
  196. package/scripts/utils/build/package/element.js +17 -18
  197. package/scripts/utils/build/package/nodeJs.js +2 -1
  198. package/scripts/utils/build/package/skeletons/elements/index.html +9 -0
  199. package/scripts/utils/build/package/styles.js +83 -86
  200. package/scripts/utils/git-utils.js +69 -6
  201. package/scripts/utils/index.js +0 -2
  202. package/scripts/utils/notification/common.js +5 -0
  203. package/scripts/utils/notification/mail-utils.js +3 -0
  204. package/scripts/utils/notification/mailstack.js +3 -5
  205. package/scripts/utils/notification/package.js +0 -2
  206. package/scripts/utils/notification/slack-utils.js +6 -7
  207. package/scripts/utils/pre-build/elements.js +8 -4
  208. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/app/app.module.ts +1 -1
  209. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/tsconfig.app.json +1 -2
  210. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
  211. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
  212. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
  213. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
  214. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
  215. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
  216. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
  217. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
  218. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
  219. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
  220. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
  221. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
  222. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
  223. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
  224. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
  225. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
  226. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/app.module.ts +52 -0
  227. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/core/reducers/index.ts +40 -0
  228. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/global.ts +4 -0
  229. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/index.ts +8 -0
  230. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/modules.ts +4 -0
  231. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.dev.ts +9 -0
  232. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.prod.ts +9 -0
  233. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.ts +21 -0
  234. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/favicon.ico +0 -0
  235. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/karma.conf.js +7 -0
  236. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/main.ts +21 -0
  237. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/polyfills.ts +86 -0
  238. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/tst.ts +33 -0
  239. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.app.json +19 -0
  240. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.spec.json +9 -0
  241. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tslint.json +17 -0
  242. package/scripts/utils/pre-build/injection/config.js +30 -31
  243. package/scripts/utils/pre-build/injection/externals.js +70 -72
  244. package/scripts/utils/pre-build/injection/injection-utils.js +2 -0
  245. package/scripts/utils/pre-build/injection/routes-replacement.js +318 -0
  246. package/scripts/utils/pre-build/injection/skeletons.js +9 -3
  247. package/scripts/utils/pre-build/projects.js +28 -15
  248. package/scripts/utils/pre-build/translations/elements.js +21 -11
  249. package/scripts/utils/serve/app.js +7 -4
  250. package/scripts/utils/test/test-utils.js +39 -1
  251. package/scripts/utils/tools.js +370 -285
  252. package/bin/scripts/csdr-jira-update.js +0 -12
  253. package/bin/scripts/csdr-migrate-package.js +0 -17
  254. package/bin/scripts/e2e-app.js +0 -62
  255. package/scripts/csdr/install/composite-utils.js +0 -292
  256. package/scripts/csdr/jira/jira-utils.js +0 -169
  257. package/scripts/csdr/jira/update.js +0 -153
  258. package/scripts/migration/eui8-migration.js +0 -94
  259. package/scripts/migration/migrate-utils.js +0 -191
  260. package/scripts/utils/confluence-utils.js +0 -126
@@ -13,7 +13,9 @@ const configUtils = require('../config/config-utils');
13
13
  const TARGET_ROOT_PATH = path.join(process.cwd(), 'packages');
14
14
  const SKELETONS_ROOT_PATH = path.join(__dirname, 'skeletons', 'package');
15
15
  const FRONTEND_SKELETON_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend');
16
+ const FRONTEND_SKELETON_EUI10_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui10');
16
17
  const FRONTEND_SKELETON_REMOTE_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote');
18
+ const FRONTEND_SKELETON_REMOTE_EUI10_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui10');
17
19
  const FRONTEND_OPTION_ROUTE_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-option-route');
18
20
  const BACKEND_SKELETON_PATH = path.join(SKELETONS_ROOT_PATH, 'backend');
19
21
 
@@ -28,7 +30,13 @@ const defaultConfig = {
28
30
  DEFAULT: 'default',
29
31
  REMOTE: 'remote'
30
32
  },
33
+ pkgFrontendVersion: {
34
+ DEFAULT: 'eui7',
35
+ EUI10: 'eui10'
36
+ },
31
37
  isRouteModule: true,
38
+ isCsdrRepo: true,
39
+ externalRepoName: null,
32
40
  pkgGroupId: 'eu.europa.ec.cc'
33
41
  };
34
42
 
@@ -76,6 +84,24 @@ const prompt = () => {
76
84
  }
77
85
  }
78
86
  },
87
+ {
88
+ type: 'list',
89
+ name: 'pkgFrontendVersion',
90
+ message: 'Select eUI version target :',
91
+ choices: [
92
+ { name: 'v7', value: defaultConfig.pkgFrontendVersion.DEFAULT },
93
+ { name: 'v10', value: defaultConfig.pkgFrontendVersion.EUI10 },
94
+ ],
95
+ default: defaultConfig.pkgFrontendType.DEFAULT,
96
+ when: function (answers) {
97
+ return (answers.pkgType === defaultConfig.pkgType.FRONTEND);
98
+ },
99
+ validate: function (value) {
100
+ if (value.length) {
101
+ return true;
102
+ }
103
+ }
104
+ },
79
105
  {
80
106
  name: 'pkgScope',
81
107
  type: 'input',
@@ -99,7 +125,24 @@ const prompt = () => {
99
125
  answers.pkgFrontendType !== defaultConfig.pkgFrontendType.REMOTE
100
126
  );
101
127
  }
102
- }
128
+ },
129
+ {
130
+ name: 'isCsdrRepo',
131
+ type: 'confirm',
132
+ message: 'Is the repository within CSDR git project ?',
133
+ default: defaultConfig.isCsdrRepo
134
+ },
135
+ {
136
+ name: 'externalRepoName',
137
+ type: 'input',
138
+ message: 'Enter the project CITnet project name where the repository is located :',
139
+ default: defaultConfig.externalRepoName,
140
+ when: function (answers) {
141
+ return (
142
+ answers.isCsdrRepo === false
143
+ );
144
+ }
145
+ },
103
146
  ]);
104
147
  })
105
148
 
@@ -110,22 +153,40 @@ const prompt = () => {
110
153
 
111
154
 
112
155
 
113
- const buildFrontend = (name, scope, frontendType, isRouteModule) => {
156
+ const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule, isCsdrRepo, externalRepoName) => {
114
157
  tools.logTitle('Generating package');
115
158
 
116
159
  let fullName = scope.substr(1) + '-' + name;
160
+ let npmPkgName, repoName;
161
+
117
162
  if (frontendType === defaultConfig.pkgFrontendType.DEFAULT) {
118
163
  fullName += '-ui';
164
+ npmPkgName = `${scope}/${name}`;
165
+
119
166
  } else if (frontendType === defaultConfig.pkgFrontendType.REMOTE) {
120
- fullName += '-remote-el-ui';
167
+ if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
168
+ fullName += '-eui10-remote-el-ui';
169
+ npmPkgName = `${scope}/${name}-eui10-remote-el`;
170
+
171
+ } else {
172
+ fullName += '-remote-el-ui';
173
+ npmPkgName = `${scope}/${name}-remote-el`;
174
+ }
175
+ }
176
+
177
+ if (isCsdrRepo) {
178
+ repoName = `${fullName}.git`;
179
+
180
+ } else {
181
+ repoName = `${externalRepoName}/${fullName}.git`;
121
182
  }
122
183
 
123
184
  const targetPath = path.join(TARGET_ROOT_PATH, fullName);
124
185
 
125
186
  const pkg = {
126
187
  name: fullName,
127
- npmPkgScope: scope,
128
- npmPkgName: name
188
+ repoName: repoName,
189
+ npmPkgName: npmPkgName
129
190
  };
130
191
 
131
192
  return Promise.resolve()
@@ -143,9 +204,17 @@ const buildFrontend = (name, scope, frontendType, isRouteModule) => {
143
204
  .then(() => {
144
205
  tools.logInfo('Copying skeleton to target');
145
206
  if (frontendType === defaultConfig.pkgFrontendType.REMOTE) {
146
- return tools.copydir(FRONTEND_SKELETON_REMOTE_PATH, targetPath, true);
207
+ if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
208
+ return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
209
+ } else {
210
+ return tools.copydir(FRONTEND_SKELETON_REMOTE_PATH, targetPath, true);
211
+ }
147
212
  } else {
148
- return tools.copydir(FRONTEND_SKELETON_PATH, targetPath, true);
213
+ if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
214
+ return tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
215
+ } else {
216
+ return tools.copydir(FRONTEND_SKELETON_PATH, targetPath, true);
217
+ }
149
218
  }
150
219
  })
151
220
 
@@ -171,6 +240,9 @@ const buildFrontend = (name, scope, frontendType, isRouteModule) => {
171
240
  .then(() => {
172
241
  return tools.replaceInPath(targetPath, '@module.scope@', scope);
173
242
  })
243
+ .then(() => {
244
+ return tools.replaceInPath(targetPath, '@module.scope-name@', `${scope.substr(1)}-${name}`);
245
+ })
174
246
  .then(() => {
175
247
  return tools.replaceInPath(targetPath, '@module.scope.string@', scope.substr(1));
176
248
  })
@@ -302,10 +374,22 @@ module.exports.generate = () => {
302
374
  console.log(answers);
303
375
 
304
376
  if (answers.pkgType === defaultConfig.pkgType.FRONTEND) {
305
- return buildFrontend(answers.pkgName, answers.pkgScope, answers.pkgFrontendType, answers.isRouteModule);
377
+ return buildFrontend(
378
+ answers.pkgName,
379
+ answers.pkgScope,
380
+ answers.pkgFrontendType,
381
+ answers.pkgFrontendVersion,
382
+ answers.isRouteModule,
383
+ answers.isCsdrRepo,
384
+ answers.externalRepoName,
385
+ );
306
386
 
307
387
  } else if (answers.pkgType === defaultConfig.pkgType.BACKEND) {
308
- return buildBackend(answers.pkgName, answers.pkgScope, answers.pkgGroupId);
388
+ return buildBackend(
389
+ answers.pkgName,
390
+ answers.pkgScope,
391
+ answers.pkgGroupId,
392
+ );
309
393
  }
310
394
  })
311
395
 
@@ -0,0 +1,20 @@
1
+ {
2
+ "build": {
3
+ "assets": [
4
+ "apps/@app.name@/src/favicon.ico",
5
+ "apps/@app.name@/src/assets",
6
+ {
7
+ "glob": "**/*",
8
+ "input": "node_modules/@eui/core/assets/",
9
+ "output": "./assets"
10
+ }
11
+ ],
12
+ "styles": [
13
+ "node_modules/@eui/styles/dist/styles/eui.css",
14
+ "node_modules/@eui/styles/dist/styles/eui-components.css",
15
+ "node_modules/@eui/styles/dist/styles/eui-next.css",
16
+ "apps/@app.name@/src/styles.scss"
17
+ ],
18
+ "scripts": []
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "@eui/deps-base": "^10.0.0"
4
+ }
5
+ }
@@ -0,0 +1,63 @@
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
+ **/tests/reports
11
+ # /src/assets/i18n-compiled/*
12
+ # /src/assets/openid-login-config*
13
+
14
+ # IDEs and editors
15
+ /.idea
16
+ .project
17
+ .classpath
18
+ .c9/
19
+ *.launch
20
+ .settings/
21
+ *.sublime-workspace
22
+
23
+ # IDE - VSCode
24
+ .vscode/*
25
+ !.vscode/settings.json
26
+ !.vscode/tasks.json
27
+ !.vscode/launch.json
28
+ !.vscode/extensions.json
29
+
30
+ # misc
31
+ /.sass-cache
32
+ /connect.lock
33
+ /coverage
34
+ /libpeerconnection.log
35
+ npm-debug.log
36
+ testem.log
37
+ /typings
38
+ yarn-error.log
39
+
40
+ # e2e
41
+ /e2e/*.js
42
+ /e2e/*.map
43
+
44
+ # System Files
45
+ .DS_Store
46
+ Thumbs.db
47
+
48
+ /*.iml
49
+
50
+ /proxy-mock.conf.json
51
+ /proxy.conf.json
52
+ /src/assets/dynamic-config.prod.json
53
+ /src/assets/jsrsasign-all-min.js
54
+ /src/assets/oidc-client.min.js
55
+ /src/assets/openid-login-config.json
56
+ /src/assets/openid-login.js
57
+ /src/karma.conf.js
58
+ /src/main.ts
59
+ /src/polyfills.ts
60
+ /src/test.ts
61
+ /tsconfig.app.json
62
+ /tsconfig.spec.json
63
+ /webpack.extra.js
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ id: 0,
3
+ firstName: '',
4
+ lastName: '',
5
+ email: '',
6
+ isAdmin: false,
7
+ birthdate: null
8
+ }
@@ -0,0 +1,5 @@
1
+ const userRoutes = require('./user_routes');
2
+
3
+ module.exports = function (app, db) {
4
+ userRoutes(app, db);
5
+ };
@@ -0,0 +1,24 @@
1
+ const User = require('../models/user');
2
+ const uuid = require('uuid');
3
+
4
+ module.exports = function (app, db) {
5
+ db.then(db => {
6
+
7
+ app.get('/api/user-details', (req, res) => {
8
+ res.send(db.get('user-details'))
9
+ });
10
+
11
+ app.get('/api/users', (req, res) => {
12
+ res.send(db.get('users'))
13
+ });
14
+
15
+ app.post('/api/users', (req, res) => {
16
+ db.get('users')
17
+ .push({ ...User, ...req.body, ...{ id: uuid.v1() } })
18
+ .last()
19
+ .write()
20
+ .then(user => res.send(user))
21
+ });
22
+
23
+ });
24
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "user-details": {
3
+ "firstName": "John",
4
+ "lastName": "Doe",
5
+ "fullName": "John Doe",
6
+ "organisationRef": {
7
+ "id": "123456", "abbreviation": "DIGIT.B.3"
8
+ },
9
+ "userId": "doejohn",
10
+ "email": "John.DOE@ec.europa.eu"
11
+ }
12
+ }
@@ -0,0 +1,16 @@
1
+ const express = require('express');
2
+ const bodyParser = require('body-parser');
3
+ const app = express();
4
+ const low = require('lowdb')
5
+ const FileAsync = require('lowdb/adapters/FileAsync')
6
+ const adapter = new FileAsync('apps/@app.name@/mock/db/db.json')
7
+ const db = low(adapter)
8
+ const port = 3000;
9
+
10
+ app.use(bodyParser.urlencoded({ extended: true }));
11
+
12
+ require('./app/routes')(app, db);
13
+
14
+ app.listen(port, () => {
15
+ console.log('We are live on ' + port);
16
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@app.name@",
3
+ "version": "1.0.0",
4
+ "license": "EUPL-1.1",
5
+ "private": true
6
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "@app.name@:start-mock-server": "nodemon --ext js --watch ./apps/@app.name@/mock ./apps/@app.name@/mock/server.js",
3
+ "@app.name@:start-serve": "eui-scripts serve-app @app.name@ --configuration=proxy-mock",
4
+ "@app.name@:start": "npm-run-all --parallel @app.name@:start-mock-server @app.name@:start-serve"
5
+ }
@@ -0,0 +1,18 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+
4
+ const routes: Routes = [
5
+ { path: '', redirectTo: 'home', pathMatch: 'full' },
6
+ { path: 'index.jsp', redirectTo: 'home' },
7
+ { path: 'home', loadChildren: './features/home/home.module#Module' },
8
+ { path: 'module1', loadChildren: './features/module1/module1.module#Module' },
9
+ { path: 'module2', loadChildren: './features/module2/module2.module#Module' },
10
+
11
+ ];
12
+
13
+ @NgModule({
14
+ imports: [
15
+ RouterModule.forRoot(routes),
16
+ ],
17
+ })
18
+ export class AppRoutingModule {}
@@ -0,0 +1,68 @@
1
+ import { Inject, Injectable } from '@angular/core';
2
+ import {
3
+ CONFIG_TOKEN,
4
+ UserService,
5
+ EuiAppConfig,
6
+ UserDetails,
7
+ UserPreferences,
8
+ I18nService,
9
+ } from '@eui/core';
10
+ import { HttpClient } from '@angular/common/http';
11
+ import { Observable, of, zip } from 'rxjs';
12
+ import { switchMap } from 'rxjs/operators';
13
+
14
+ @Injectable({
15
+ providedIn: 'root',
16
+ })
17
+ export class AppStarterService {
18
+ defaultUserPreferences: UserPreferences;
19
+
20
+ constructor(
21
+ protected userService: UserService,
22
+ protected i18nService: I18nService,
23
+ @Inject(CONFIG_TOKEN) private config: EuiAppConfig,
24
+ protected http: HttpClient,
25
+ ) {
26
+ }
27
+
28
+ start(): Observable<any> {
29
+
30
+ return zip(
31
+ this.initUserService().pipe(
32
+ switchMap((userStatus) => {
33
+ console.log(userStatus);
34
+ return this.i18nService.init();
35
+ }),
36
+ ),
37
+ );
38
+ }
39
+
40
+ /**
41
+ * Fetches user details,
42
+ * create user: UserState object
43
+ * then initialise to the UserService on run time
44
+ */
45
+ initUserService(): Observable<any> {
46
+ return zip(
47
+ this.fetchUserDetails(),
48
+ ).pipe(
49
+ switchMap(([userDetails]) => {
50
+ return this.userService.init(userDetails);
51
+ }));
52
+ }
53
+
54
+ /**
55
+ * Fetches user details
56
+ */
57
+ private fetchUserDetails(): Observable<UserDetails> {
58
+ // const url = this.config.modules.your_custom_module.your_custom_endpoint
59
+ const moduleCoreApi = this.config.modules.core;
60
+ const url = `${moduleCoreApi.base}${moduleCoreApi.userDetails}`;
61
+ const user = { userId: 'anonymous' };
62
+
63
+ if (!url) {
64
+ return of(user);
65
+ }
66
+ return this.http.get<UserDetails>(url);
67
+ }
68
+ }
@@ -0,0 +1,29 @@
1
+ <eui-app [userInfos]="userInfos?.fullName" isSidebarOpen=true>
2
+ <eui-app-toolbar>
3
+ <eui-toolbar>
4
+ <eui-toolbar-logo></eui-toolbar-logo>
5
+ <eui-toolbar-app appName="@app.name@"></eui-toolbar-app>
6
+ <eui-toolbar-environment>MOCK</eui-toolbar-environment>
7
+ <eui-toolbar-items euiPositionRight>
8
+ <eui-toolbar-item-user-profile>
9
+ <eui-user-profile-menu>
10
+ <eui-user-profile-menu-item>
11
+ <eui-icon iconClass="eui-icon-person-thin"></eui-icon> {{ 'eui.my-profile-informations' | translate }}
12
+ </eui-user-profile-menu-item>
13
+ <eui-user-profile-menu-item>
14
+ <eui-icon iconClass="eui-icon-logout-thin"></eui-icon> {{ 'eui.sign-out' | translate }}
15
+ </eui-user-profile-menu-item>
16
+ </eui-user-profile-menu>
17
+ </eui-toolbar-item-user-profile>
18
+ <eui-toolbar-item-notifications>
19
+ <eui-notifications [count]="notificationItems?.length" [items]="notificationItems"></eui-notifications>
20
+ </eui-toolbar-item-notifications>
21
+ </eui-toolbar-items>
22
+ </eui-toolbar>
23
+ </eui-app-toolbar>
24
+ <eui-app-sidebar>
25
+ <eui-app-sidebar-body>
26
+ <eui-app-sidebar-menu [items]="sidebarItems"></eui-app-sidebar-menu>
27
+ </eui-app-sidebar-body>
28
+ </eui-app-sidebar>
29
+ </eui-app>
@@ -0,0 +1,55 @@
1
+ import { Component, OnDestroy, OnInit } from '@angular/core';
2
+ import { Store } from '@ngrx/store';
3
+ import {
4
+ getUserState,
5
+ UserState,
6
+ } from '@eui/core';
7
+ import { Observable, Subscription } from 'rxjs';
8
+ import { AppStarterService } from './app-starter.service';
9
+
10
+ @Component({
11
+ selector: 'app-root',
12
+ templateUrl: './app.component.html',
13
+ })
14
+ export class AppComponent implements OnInit, OnDestroy {
15
+ userInfos: UserState;
16
+ // Observe state changes
17
+ userState: Observable<UserState>;
18
+ // an array to keep all subscriptions and easily unsubscribe
19
+ subs: Subscription[] = [];
20
+
21
+ sidebarItems = [
22
+ { label: 'Home', url: 'home', iconClass: 'eui-icon-home' },
23
+ { label: 'Module 1', url: 'module1', iconClass: 'eui-icon-work', children: [
24
+ { label: 'page 1', url: 'module1/page1' },
25
+ { label: 'page 2', url: 'module1/page2' },
26
+ ] },
27
+ { label: 'Module 2', url: 'module2', iconClass: 'eui-icon-work' },
28
+ ];
29
+ notificationItems = [
30
+ { label: 'Title label 1', subLabel: 'Subtitle label' },
31
+ { label: 'Title label 2', subLabel: 'Subtitle label' },
32
+ { label: 'Title label 3', subLabel: 'Subtitle label' },
33
+ { label: 'Title label 4', subLabel: 'Subtitle label' },
34
+ ];
35
+
36
+ constructor(
37
+ private store: Store<any>,
38
+ private appStarterService: AppStarterService,
39
+ ) {
40
+ this.appStarterService.start().subscribe(() => {
41
+ this.userState = <any>this.store.select(getUserState);
42
+ this.subs.push(this.userState.subscribe((user: UserState) => {
43
+ this.userInfos = { ...user };
44
+ console.log(user);
45
+ }));
46
+ });
47
+ }
48
+
49
+ ngOnInit() {
50
+ }
51
+
52
+ ngOnDestroy() {
53
+ this.subs.forEach((s: Subscription) => s.unsubscribe());
54
+ }
55
+ }
@@ -0,0 +1,27 @@
1
+ import { BrowserModule } from '@angular/platform-browser';
2
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3
+ import { NgModule } from '@angular/core';
4
+
5
+ import { AppRoutingModule } from './app-routing.module';
6
+ import { AppComponent } from './app.component';
7
+ import { CoreModule } from './core/core.module';
8
+ import { AppStarterService } from './app-starter.service';
9
+
10
+ @NgModule({
11
+ declarations: [
12
+ AppComponent,
13
+ ],
14
+ imports: [
15
+ BrowserModule,
16
+ BrowserAnimationsModule,
17
+ CoreModule,
18
+ AppRoutingModule,
19
+ ],
20
+ providers: [
21
+ AppStarterService,
22
+ ],
23
+ bootstrap: [
24
+ AppComponent,
25
+ ],
26
+ })
27
+ export class AppModule {}
@@ -0,0 +1,84 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { TranslateModule } from '@ngx-translate/core';
3
+ import { StoreModule } from '@ngrx/store';
4
+ import { EffectsModule } from '@ngrx/effects';
5
+ import { StoreDevtoolsModule } from '@ngrx/store-devtools';
6
+
7
+ import { HTTP_INTERCEPTORS } from '@angular/common/http';
8
+ import {
9
+ CachePreventionInterceptor,
10
+ CorsSecurityInterceptor,
11
+ CsrfPreventionInterceptor,
12
+ EuLoginSessionTimeoutHandlingInterceptor,
13
+ CoreModule as EuiCoreModule,
14
+ translateConfig,
15
+ CoreModuleEffects,
16
+ EUI_CONFIG_TOKEN,
17
+ } from '@eui/core';
18
+
19
+ import { appConfig } from '../../config/index';
20
+ import { environment } from '../../environments/environment';
21
+
22
+ import { REDUCER_TOKEN, getReducers, metaReducers } from './reducers/index';
23
+
24
+ import { SharedModule } from '../shared/shared.module';
25
+
26
+ @NgModule({
27
+ imports: [
28
+ SharedModule,
29
+ EuiCoreModule.forRoot(),
30
+ EffectsModule.forRoot([...CoreModuleEffects]),
31
+ TranslateModule.forRoot(translateConfig),
32
+ StoreModule.forRoot(REDUCER_TOKEN, { metaReducers }),
33
+ !environment.production ? StoreDevtoolsModule.instrument({ maxAge: 50 }) : [],
34
+ ],
35
+ declarations: [
36
+ ],
37
+ exports: [
38
+ SharedModule,
39
+ ],
40
+ providers: [
41
+ {
42
+ provide: REDUCER_TOKEN,
43
+ deps: [],
44
+ useFactory: getReducers,
45
+ },
46
+ {
47
+ provide: EUI_CONFIG_TOKEN,
48
+ useValue: { appConfig: appConfig, environment: environment }
49
+ },
50
+ {
51
+ // Sets the withCredentials on Ajax Request to send the JSESSIONID cookie to another domain.
52
+ // This is necessary when a request is being made to another domain that is protected by EU Login.
53
+ provide: HTTP_INTERCEPTORS,
54
+ useClass: CorsSecurityInterceptor,
55
+ multi: true,
56
+ },
57
+ {
58
+ // WARNING: in case of OpenID this is not needed since OpenID is stateless therefore no revalidation needed.
59
+ // When the authentication session is invalid, we need to re-authenticate. The browser refreshes the current URL,
60
+ // and lets the EU Login client redirect to the official EU Login page.
61
+ provide: HTTP_INTERCEPTORS,
62
+ useClass: EuLoginSessionTimeoutHandlingInterceptor,
63
+ multi: true,
64
+ },
65
+ {
66
+ // Adds HTTP header to each Ajax request that ensures the request is set by a piece of JavaScript code in the application.
67
+ // This prevents dynamically-loaded content from forging a request in the name of the currently logged-in user.
68
+ // Be aware that this assumes that cross-site scripting (XSS) is already put in place, (default setting in Angular).
69
+ provide: HTTP_INTERCEPTORS,
70
+ useClass: CsrfPreventionInterceptor,
71
+ multi: true,
72
+ },
73
+ {
74
+ // Asks the intermediate proxies not to return a cache copy of the resource.
75
+ // In matter of fact forces each server in the chain to validate the freshness of the resource.
76
+ provide: HTTP_INTERCEPTORS,
77
+ useClass: CachePreventionInterceptor,
78
+ multi: true,
79
+ },
80
+ ]
81
+ })
82
+ export class CoreModule {
83
+
84
+ }
@@ -0,0 +1,33 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { MetaReducer } from '@ngrx/store';
3
+ import { storeFreeze } from 'ngrx-store-freeze';
4
+ import { reducers as coreReducers, CoreState, getAppState, localStorageSync } from '@eui/core';
5
+
6
+ import { environment } from '../../../environments/environment';
7
+
8
+ export const REDUCER_TOKEN = new InjectionToken<any>('Registered Reducers');
9
+
10
+ /**
11
+ * Define here your app state
12
+ *
13
+ * [IMPORTANT]
14
+ * There are some **reserved** slice of the state
15
+ * that you **can not** use in your application ==> app |user | notification
16
+ */
17
+ /* tslint:disable-next-line */
18
+ export interface AppState extends CoreState {
19
+ // [key: string]: fromTaskManager.State | any;
20
+ }
21
+
22
+ /**
23
+ * Define here the reducers of your app
24
+ */
25
+ const rootReducer = Object.assign({}, coreReducers, {
26
+ // [fromTaskManager.namespace]: fromTaskManager.reducers,
27
+ });
28
+
29
+ export function getReducers() {
30
+ return rootReducer;
31
+ }
32
+
33
+ export const metaReducers: MetaReducer<AppState>[] = !environment.production ? [localStorageSync, storeFreeze] : [localStorageSync];