generator-jhipster 7.2.0 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/cli/environment-builder.js +1 -0
  2. package/cli/import-jdl.js +3 -2
  3. package/cli/jdl.js +1 -0
  4. package/cli/jhipster-command.js +2 -2
  5. package/cli/program.js +32 -29
  6. package/generators/app/index.js +35 -26
  7. package/generators/aws/index.js +8 -8
  8. package/generators/aws/lib/eb.js +1 -1
  9. package/generators/azure-app-service/index.js +16 -9
  10. package/generators/azure-app-service/templates/github/workflows/azure-app-service.yml.ejs +2 -2
  11. package/generators/azure-spring-cloud/index.js +16 -9
  12. package/generators/azure-spring-cloud/templates/github/workflows/azure-spring-cloud.yml.ejs +2 -2
  13. package/generators/bootstrap/index.js +57 -61
  14. package/generators/ci-cd/index.js +11 -8
  15. package/generators/ci-cd/templates/github-actions.yml.ejs +1 -1
  16. package/generators/ci-cd/templates/travis.yml.ejs +9 -4
  17. package/generators/client/__workflow/devserver-angular.json +1 -1
  18. package/generators/client/__workflow/devserver-react.json +1 -1
  19. package/generators/client/__workflow/devserver-vue.json +1 -1
  20. package/generators/client/files-angular.js +6 -0
  21. package/generators/client/files-common.js +6 -2
  22. package/generators/client/files-react.js +13 -2
  23. package/generators/client/files-vue.js +56 -6
  24. package/generators/client/index.js +114 -32
  25. package/generators/client/needle-api/needle-client-angular.js +1 -1
  26. package/generators/client/needle-api/needle-client-vue.js +57 -7
  27. package/generators/client/templates/angular/.eslintrc.json.ejs +1 -0
  28. package/generators/client/templates/angular/package.json +19 -19
  29. package/generators/client/templates/angular/package.json.ejs +2 -1
  30. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.component.spec.ts.ejs +52 -54
  31. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.service.spec.ts.ejs +65 -0
  32. package/generators/client/templates/angular/src/main/webapp/app/account/password/password-strength-bar/password-strength-bar.component.spec.ts.ejs +35 -37
  33. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.component.spec.ts.ejs +78 -80
  34. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.service.spec.ts.ejs +41 -0
  35. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.spec.ts.ejs +73 -75
  36. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.spec.ts.ejs +62 -0
  37. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.component.spec.ts.ejs +44 -46
  38. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.service.spec.ts.ejs +61 -0
  39. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.component.spec.ts.ejs +116 -118
  40. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.service.spec.ts.ejs +66 -0
  41. package/generators/client/templates/angular/src/main/webapp/app/account/sessions/sessions.component.spec.ts.ejs +75 -77
  42. package/generators/client/templates/angular/src/main/webapp/app/account/settings/settings.component.spec.ts.ejs +74 -76
  43. package/generators/client/templates/angular/src/main/webapp/app/admin/configuration/configuration.component.spec.ts.ejs +48 -50
  44. package/generators/client/templates/angular/src/main/webapp/app/admin/configuration/configuration.service.spec.ts.ejs +50 -52
  45. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.spec.ts.ejs +45 -47
  46. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.service.spec.ts.ejs +66 -0
  47. package/generators/client/templates/angular/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.ejs +99 -101
  48. package/generators/client/templates/angular/src/main/webapp/app/admin/logs/logs.component.spec.ts.ejs +61 -63
  49. package/generators/client/templates/angular/src/main/webapp/app/admin/logs/logs.service.spec.ts.ejs +19 -21
  50. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.component.html.ejs +2 -2
  51. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/metrics.component.spec.ts.ejs +28 -30
  52. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/metrics.service.spec.ts.ejs +62 -64
  53. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.spec.ts.ejs +35 -37
  54. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/detail/user-management-detail.component.spec.ts.ejs +40 -42
  55. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.spec.ts.ejs +87 -89
  56. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/service/user-management.service.spec.ts.ejs +41 -43
  57. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.spec.ts.ejs +81 -83
  58. package/generators/client/templates/angular/src/main/webapp/app/app.module.ts.ejs +3 -0
  59. package/generators/client/templates/angular/src/main/webapp/app/core/auth/account.service.spec.ts.ejs +178 -180
  60. package/generators/client/templates/angular/src/main/webapp/app/core/config/application-config.service.ts.ejs +9 -0
  61. package/generators/client/templates/angular/src/main/webapp/app/entities/user/user.service.spec.ts.ejs +87 -89
  62. package/generators/client/templates/angular/src/main/webapp/app/home/home.component.spec.ts.ejs +93 -95
  63. package/generators/client/templates/angular/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs +166 -168
  64. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts.ejs +66 -68
  65. package/generators/client/templates/angular/src/main/webapp/app/layouts/profiles/page-ribbon.component.spec.ts.ejs +27 -29
  66. package/generators/client/templates/angular/src/main/webapp/app/login/login.component.spec.ts.ejs +112 -114
  67. package/generators/client/templates/angular/src/main/webapp/app/shared/alert/alert-error.component.spec.ts.ejs +132 -134
  68. package/generators/client/templates/angular/src/main/webapp/app/shared/alert/alert.component.spec.ts.ejs +29 -31
  69. package/generators/client/templates/angular/webpack/webpack.custom.js.ejs +2 -3
  70. package/generators/client/templates/common/README.md.jhi.client.ejs +34 -0
  71. package/generators/client/templates/common/package.json +7 -7
  72. package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +56 -0
  73. package/generators/client/templates/react/.eslintrc.json.ejs +1 -0
  74. package/generators/client/templates/react/package.json +57 -56
  75. package/generators/client/templates/react/package.json.ejs +5 -2
  76. package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +0 -3
  77. package/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs +2 -2
  78. package/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +2 -2
  79. package/generators/client/templates/react/src/main/webapp/app/modules/administration/gateway/gateway.tsx.ejs +2 -2
  80. package/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +6 -6
  81. package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +8 -8
  82. package/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
  83. package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +1 -1
  84. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +3 -3
  85. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +7 -7
  86. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-components.tsx.ejs +1 -1
  87. package/generators/client/templates/react/webpack/webpack.dev.js.ejs +17 -1
  88. package/generators/client/templates/react/webpack/webpack.prod.js.ejs +13 -1
  89. package/generators/client/templates/vue/.eslintrc.js.ejs +8 -5
  90. package/generators/client/templates/vue/package.json +40 -49
  91. package/generators/client/templates/vue/package.json.ejs +14 -18
  92. package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +6 -5
  93. package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs +7 -1
  94. package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.service.ts.ejs +1 -1
  95. package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.vue.ejs +1 -1
  96. package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs +1 -1
  97. package/generators/client/templates/vue/src/main/webapp/app/admin/tracker/tracker.service.ts.ejs +5 -4
  98. package/generators/client/templates/vue/src/main/webapp/app/admin/user-management/user-management-edit.component.ts.ejs +9 -0
  99. package/generators/client/templates/vue/src/main/webapp/app/admin/user-management/user-management-view.component.ts.ejs +5 -0
  100. package/generators/client/templates/vue/src/main/webapp/app/admin/user-management/user-management.component.ts.ejs +5 -0
  101. package/generators/client/templates/vue/src/main/webapp/app/constants.ts.ejs +16 -6
  102. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +27 -8
  103. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +6 -0
  104. package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +41 -0
  105. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs +34 -0
  106. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.vue.ejs +13 -0
  107. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +14 -0
  108. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.vue.ejs +5 -0
  109. package/generators/client/templates/vue/{webpack/utils.js.ejs → src/main/webapp/app/index.ts.ejs} +1 -12
  110. package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs +26 -9
  111. package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +23 -11
  112. package/generators/client/templates/vue/src/main/webapp/app/router/admin.ts.ejs +4 -4
  113. package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +45 -3
  114. package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +19 -3
  115. package/generators/client/templates/vue/src/main/webapp/app/shared/alert/alert.service.ts.ejs +61 -0
  116. package/generators/client/templates/vue/src/main/webapp/app/shared/config/axios-interceptor.ts.ejs +0 -2
  117. package/generators/client/templates/vue/src/main/webapp/app/shared/data/data-utils.service.ts.ejs +3 -1
  118. package/generators/client/templates/vue/src/main/webapp/app/shims-vue.d.ts.ejs +17 -3
  119. package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +25 -10
  120. package/generators/client/templates/vue/src/test/javascript/spec/app/account/account.service.spec.ts.ejs +2 -2
  121. package/generators/client/templates/vue/src/test/javascript/spec/app/account/login-form/login-form.component.spec.ts.ejs +2 -2
  122. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/tracker/tracker.component.spec.ts.ejs +12 -12
  123. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/tracker/tracker.service.spec.ts.ejs +2 -1
  124. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management-edit.component.spec.ts.ejs +5 -1
  125. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management-view.component.spec.ts.ejs +2 -1
  126. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs +5 -1
  127. package/generators/client/templates/vue/src/test/javascript/spec/app/core/jhi-navbar/jhi-navbar.component.spec.ts.ejs +10 -4
  128. package/generators/client/templates/vue/src/test/javascript/spec/app/entities/entities-menu.spec.ts.ejs +52 -0
  129. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.component.ts.ejs +4 -0
  130. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.vue.ejs +7 -0
  131. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-router.ts.ejs +1 -0
  132. package/generators/client/templates/vue/src/test/javascript/spec/app/shared/alert/alert.service.spec.ts.ejs +124 -0
  133. package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/axios-interceptor.spec.ts.ejs +0 -1
  134. package/generators/client/templates/vue/tsconfig.json.ejs +6 -10
  135. package/generators/client/templates/vue/tsconfig.spec.json.ejs +37 -0
  136. package/generators/client/templates/vue/webpack/config.js.ejs +50 -0
  137. package/generators/client/templates/vue/webpack/vue.utils.js.ejs +33 -32
  138. package/generators/client/templates/vue/webpack/webpack.common.js.ejs +152 -126
  139. package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +19 -76
  140. package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +77 -0
  141. package/generators/client/templates/vue/webpack/webpack.prod.js.ejs +5 -41
  142. package/generators/cloudfoundry/index.js +9 -9
  143. package/generators/common/index.js +12 -10
  144. package/generators/common/templates/.husky/pre-commit +1 -1
  145. package/generators/common/templates/.prettierrc.ejs +1 -1
  146. package/generators/common/templates/README.md.jhi.ejs +21 -0
  147. package/generators/common/templates/package.json +4 -4
  148. package/generators/cypress/index.js +12 -9
  149. package/generators/cypress/templates/cypress.json.ejs +9 -2
  150. package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +4 -4
  151. package/generators/cypress/templates/src/test/javascript/cypress/support/commands.ts.ejs +30 -2
  152. package/generators/cypress/templates/src/test/javascript/cypress/support/entity.ts.ejs +4 -4
  153. package/generators/cypress/templates/src/test/javascript/cypress/support/index.ts.ejs +1 -1
  154. package/generators/cypress/templates/src/test/javascript/cypress/support/management.ts.ejs +1 -1
  155. package/generators/cypress/templates/src/test/javascript/cypress/support/navbar.ts.ejs +1 -1
  156. package/generators/database-changelog/index.js +33 -22
  157. package/generators/database-changelog-liquibase/index.js +12 -8
  158. package/generators/database-changelog-liquibase/templates/src/main/resources/config/liquibase/changelog/updated_entity_constraints.xml.ejs +1 -1
  159. package/generators/docker-compose/index.js +11 -12
  160. package/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +13 -12
  161. package/generators/entities/index.js +35 -26
  162. package/generators/entities-client/index.js +10 -7
  163. package/generators/entity/index.js +49 -29
  164. package/generators/entity-client/files.js +7 -16
  165. package/generators/entity-client/index.js +74 -11
  166. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/delete/entity-management-delete-dialog.component.spec.ts.ejs +42 -44
  167. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.spec.ts.ejs +58 -60
  168. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.module.ts.ejs +1 -1
  169. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.spec.ts.ejs +105 -107
  170. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +8 -1
  171. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/route/entity-management-routing-resolve.service.spec.ts.ejs +52 -54
  172. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/route/entity-management-routing.module.ts.ejs +1 -1
  173. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.spec.ts.ejs +173 -175
  174. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.html.ejs +2 -4
  175. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.spec.ts.ejs +193 -195
  176. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.ts.ejs +7 -0
  177. package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +269 -109
  178. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-delete-dialog.tsx.ejs +5 -2
  179. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +17 -14
  180. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +11 -13
  181. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-details.component.ts.ejs +5 -0
  182. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.component.ts.ejs +23 -8
  183. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.vue.ejs +6 -9
  184. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +9 -1
  185. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.model.ts.ejs +1 -1
  186. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs +2 -6
  187. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity-details.component.spec.ts.ejs +2 -1
  188. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity-update.component.spec.ts.ejs +8 -1
  189. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.component.spec.ts.ejs +8 -2
  190. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.service.spec.ts.ejs +1 -1
  191. package/generators/entity-i18n/index.js +7 -4
  192. package/generators/entity-server/files-couchbase.js +2 -2
  193. package/generators/entity-server/files.js +35 -30
  194. package/generators/entity-server/index.js +12 -8
  195. package/generators/entity-server/templates/couchbase/src/main/java/package/repository/EntityRepository.java.ejs +2 -2
  196. package/generators/entity-server/templates/couchbase/src/main/resources/config/couchmove/changelog/entity.fts.ejs +1 -1
  197. package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +6 -2
  198. package/generators/entity-server/templates/src/main/java/package/domain/enumeration/Enum.java.ejs +1 -1
  199. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository.java.ejs +2 -2
  200. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +17 -30
  201. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository_reactive.java.ejs +5 -5
  202. package/generators/entity-server/templates/src/main/java/package/repository/EntitySqlHelper_reactive.java.ejs +46 -0
  203. package/generators/entity-server/templates/src/main/java/package/repository/rowmapper/EntityRowMapper.java.ejs +3 -3
  204. package/generators/entity-server/templates/src/main/java/package/repository/search/EntitySearchRepository.java.ejs +2 -2
  205. package/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs +8 -8
  206. package/generators/entity-server/templates/src/main/java/package/service/EntityService.java.ejs +4 -4
  207. package/generators/entity-server/templates/src/main/java/package/service/criteria/EntityCriteria.java.ejs +4 -4
  208. package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +7 -3
  209. package/generators/entity-server/templates/src/main/java/package/service/impl/EntityServiceImpl.java.ejs +8 -8
  210. package/generators/entity-server/templates/src/main/java/package/service/mapper/BaseEntityMapper.java.ejs +1 -1
  211. package/generators/entity-server/templates/src/main/java/package/service/mapper/EntityMapper.java.ejs +7 -3
  212. package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +51 -53
  213. package/generators/entity-server/templates/src/test/java/package/domain/EntityTest.java.ejs +1 -1
  214. package/generators/entity-server/templates/src/test/java/package/repository/search/EntitySearchRepositoryMockConfiguration.java.ejs +1 -1
  215. package/generators/entity-server/templates/src/test/java/package/service/dto/EntityDTOTest.java.ejs +1 -1
  216. package/generators/entity-server/templates/src/test/java/package/service/mapper/EntityMapperTest.java.ejs +1 -1
  217. package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +17 -14
  218. package/generators/gae/index.js +10 -10
  219. package/generators/generator-base-blueprint.js +14 -46
  220. package/generators/generator-base-private.js +42 -22
  221. package/generators/generator-base.js +57 -20
  222. package/generators/generator-constants.js +29 -21
  223. package/generators/generator-transforms.js +39 -27
  224. package/generators/heroku/index.js +27 -48
  225. package/generators/init/constants.cjs +1 -1
  226. package/generators/init/templates/.husky/pre-commit +1 -1
  227. package/generators/java/constants.cjs +1 -1
  228. package/generators/kubernetes/files.js +3 -0
  229. package/generators/kubernetes/index.js +10 -10
  230. package/generators/kubernetes/templates/db/couchbase.yml.ejs +1 -1
  231. package/generators/kubernetes/templates/deployment.yml.ejs +8 -3
  232. package/generators/kubernetes/templates/istio/destination-rule.yml.ejs +1 -1
  233. package/generators/kubernetes/templates/istio/gateway/grafana-gateway.yml.ejs +5 -2
  234. package/generators/kubernetes/templates/istio/gateway/jhipster-grafana-gateway.yml.ejs +5 -2
  235. package/generators/kubernetes/templates/istio/gateway/kiali-gateway.yml.ejs +10 -8
  236. package/generators/kubernetes/templates/istio/gateway/zipkin-gateway.yml.ejs +5 -2
  237. package/generators/kubernetes/templates/istio/gateway.yml.ejs +7 -5
  238. package/generators/kubernetes/templates/secret/couchbase-secret.yml.ejs +9 -0
  239. package/generators/kubernetes-base.js +1 -0
  240. package/generators/kubernetes-helm/files.js +3 -8
  241. package/generators/kubernetes-helm/index.js +10 -10
  242. package/generators/kubernetes-helm/templates/README-KUBERNETES-HELM.md.ejs +0 -1
  243. package/generators/kubernetes-helm/templates/app/Chart.yml.ejs +27 -0
  244. package/generators/kubernetes-helm/templates/app/helpers.tpl.ejs +0 -11
  245. package/generators/kubernetes-helm/templates/app/requirements.yml.ejs +7 -2
  246. package/generators/kubernetes-helm/templates/app/values.yml.ejs +68 -5
  247. package/generators/kubernetes-helm/templates/csvc/Chart.yml.ejs +17 -0
  248. package/generators/kubernetes-helm/templates/csvc/requirements.yml.ejs +2 -2
  249. package/generators/kubernetes-knative/index.js +10 -10
  250. package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +6 -4
  251. package/generators/kubernetes-knative/templates/service.yml.ejs +1 -1
  252. package/generators/languages/index.js +13 -13
  253. package/generators/languages/templates/src/main/webapp/i18n/hr/reset.json.ejs +1 -2
  254. package/generators/languages/templates/src/main/webapp/i18n/vi/login.json +1 -1
  255. package/generators/maven/templates/.mvn/wrapper/maven-wrapper.properties +1 -1
  256. package/generators/openapi-client/index.js +13 -10
  257. package/generators/openshift/index.js +10 -11
  258. package/generators/openshift/templates/deployment.yml.ejs +1 -1
  259. package/generators/page/index.js +12 -10
  260. package/generators/server/__snapshots__/generator.spec.mjs.snap +12 -0
  261. package/generators/server/files-sql.js +52 -0
  262. package/generators/server/files.js +15 -0
  263. package/generators/server/index.js +100 -33
  264. package/generators/server/needle-api/needle-server-cache.js +4 -6
  265. package/generators/server/templates/.mvn/wrapper/maven-wrapper.properties +1 -1
  266. package/generators/server/templates/build.gradle.ejs +17 -1
  267. package/generators/server/templates/gradle.properties.ejs +11 -11
  268. package/generators/server/templates/npmw +1 -1
  269. package/generators/server/templates/npmw.cmd +1 -1
  270. package/generators/server/templates/pom.xml.ejs +128 -9
  271. package/generators/server/templates/settings.gradle.ejs +9 -0
  272. package/generators/server/templates/sql/reactive/src/main/java/package/repository/UserSqlHelper.java.ejs +48 -0
  273. package/generators/server/templates/src/main/docker/app.yml.ejs +2 -1
  274. package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +13 -12
  275. package/generators/server/templates/src/main/java/package/aop/logging/LoggingAspect.java.ejs +1 -1
  276. package/generators/server/templates/src/main/java/package/config/DatabaseConfiguration_cassandra.java.ejs +0 -6
  277. package/generators/server/templates/src/main/java/package/config/DatabaseConfiguration_sql.java.ejs +2 -2
  278. package/generators/server/templates/src/main/java/package/config/JacksonConfiguration.java.ejs +1 -1
  279. package/generators/server/templates/src/main/java/package/config/LocaleConfiguration.java.ejs +0 -2
  280. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +2 -5
  281. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +9 -1
  282. package/generators/server/templates/src/main/java/package/config/WebConfigurer.java.ejs +0 -1
  283. package/generators/server/templates/src/main/java/package/management/SecurityMetersService.java.ejs +68 -0
  284. package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +0 -23
  285. package/generators/server/templates/src/main/java/package/security/PersistentTokenRememberMeServices.java.ejs +0 -2
  286. package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +29 -4
  287. package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +21 -9
  288. package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +13 -5
  289. package/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +1 -1
  290. package/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +1 -1
  291. package/generators/server/templates/src/main/resources/config/application.yml.ejs +7 -7
  292. package/generators/server/templates/src/main/resources/static/microservices_index.html.ejs +1 -1
  293. package/generators/server/templates/src/test/java/package/management/SecurityMetersServiceTests.java.ejs +113 -0
  294. package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +6 -1
  295. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderSecurityMetersTests.java.ejs +198 -0
  296. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderTest.java.ejs +13 -3
  297. package/generators/server/templates/src/test/java/package/security/oauth2/AuthorizationHeaderUtilTest.java.ejs +16 -2
  298. package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +63 -0
  299. package/generators/spring-controller/index.js +9 -7
  300. package/generators/spring-service/index.js +10 -7
  301. package/generators/upgrade/index.js +4 -5
  302. package/generators/utils.js +2 -2
  303. package/generators/workspaces/index.js +16 -7
  304. package/jdl/jhipster/default-application-options.js +9 -7
  305. package/package.json +23 -23
  306. package/utils/entity.js +21 -4
  307. package/utils/field.js +12 -2
  308. package/utils/multi-step-transform/index.js +8 -8
  309. package/generators/client/templates/react/.npmrc.ejs +0 -1
  310. package/generators/client/templates/vue/webpack/dev.env.js.ejs +0 -17
  311. package/generators/client/templates/vue/webpack/env.js.ejs +0 -67
  312. package/generators/client/templates/vue/webpack/loader.conf.js.ejs +0 -20
  313. package/generators/client/templates/vue/webpack/prod.env.js.ejs +0 -15
@@ -1672,14 +1672,14 @@
1672
1672
  "subComponents": {},
1673
1673
  "config": {
1674
1674
  "allowed-protocol-mapper-types": [
1675
- "oidc-full-name-mapper",
1675
+ "oidc-usermodel-property-mapper",
1676
+ "oidc-sha256-pairwise-sub-mapper",
1677
+ "saml-user-attribute-mapper",
1676
1678
  "saml-user-property-mapper",
1677
- "oidc-usermodel-attribute-mapper",
1678
- "saml-role-list-mapper",
1679
1679
  "oidc-address-mapper",
1680
- "saml-user-attribute-mapper",
1681
- "oidc-usermodel-property-mapper",
1682
- "oidc-sha256-pairwise-sub-mapper"
1680
+ "oidc-full-name-mapper",
1681
+ "saml-role-list-mapper",
1682
+ "oidc-usermodel-attribute-mapper"
1683
1683
  ]
1684
1684
  }
1685
1685
  },
@@ -1750,14 +1750,14 @@
1750
1750
  "subComponents": {},
1751
1751
  "config": {
1752
1752
  "allowed-protocol-mapper-types": [
1753
- "oidc-sha256-pairwise-sub-mapper",
1753
+ "oidc-address-mapper",
1754
1754
  "oidc-usermodel-attribute-mapper",
1755
- "oidc-full-name-mapper",
1755
+ "saml-user-property-mapper",
1756
1756
  "saml-user-attribute-mapper",
1757
- "oidc-address-mapper",
1758
- "oidc-usermodel-property-mapper",
1759
1757
  "saml-role-list-mapper",
1760
- "saml-user-property-mapper"
1758
+ "oidc-full-name-mapper",
1759
+ "oidc-usermodel-property-mapper",
1760
+ "oidc-sha256-pairwise-sub-mapper"
1761
1761
  ]
1762
1762
  }
1763
1763
  },
@@ -2488,10 +2488,11 @@
2488
2488
  "oauth2DevicePollingInterval": "5",
2489
2489
  "clientSessionIdleTimeout": "0",
2490
2490
  "clientSessionMaxLifespan": "0",
2491
+ "parRequestUriLifespan": "60",
2491
2492
  "clientOfflineSessionIdleTimeout": "0",
2492
2493
  "cibaInterval": "5"
2493
2494
  },
2494
- "keycloakVersion": "14.0.0",
2495
+ "keycloakVersion": "15.0.2",
2495
2496
  "userManagedAccessAllowed": false,
2496
2497
  "clientProfiles": {
2497
2498
  "profiles": []
@@ -21,8 +21,6 @@ const { JHIPSTER_CONFIG_DIR } = require('../generator-constants');
21
21
  const { SQL } = require('../../jdl/jhipster/database-types');
22
22
  const { GENERATOR_ENTITIES, GENERATOR_ENTITIES_CLIENT, GENERATOR_ENTITY, GENERATOR_DATABASE_CHANGELOG } = require('../generator-list');
23
23
 
24
- let useBlueprints;
25
-
26
24
  module.exports = class extends BaseBlueprintGenerator {
27
25
  constructor(args, options, features) {
28
26
  super(args, options, { unique: 'namespace', ...features });
@@ -75,10 +73,12 @@ module.exports = class extends BaseBlueprintGenerator {
75
73
  defaults: true,
76
74
  hide: true,
77
75
  });
76
+ }
78
77
 
79
- if (this.options.help) return;
80
-
81
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_ENTITIES);
78
+ async _postConstruct() {
79
+ if (!this.fromBlueprint) {
80
+ await this.composeWithBlueprints(GENERATOR_ENTITIES);
81
+ }
82
82
 
83
83
  if (this.options.entitiesToImport) {
84
84
  const entities = this.jhipsterConfig.entities || [];
@@ -123,28 +123,31 @@ module.exports = class extends BaseBlueprintGenerator {
123
123
  }
124
124
 
125
125
  get initializing() {
126
- return useBlueprints ? undefined : this._initializing();
126
+ if (this.delegateToBlueprint) return {};
127
+ return this._initializing();
127
128
  }
128
129
 
129
130
  // Public API method used by the getter and also by Blueprints
130
131
  _composing() {
131
132
  return {
132
- composeEachEntity() {
133
- this.getExistingEntityNames().forEach(entityName => {
134
- if (this.options.composedEntities && this.options.composedEntities.includes(entityName)) return;
135
- const selectedEntity = this.options.entities.includes(entityName);
136
- const { regenerate = !selectedEntity } = this.options;
137
- this.composeWithJHipster(GENERATOR_ENTITY, [entityName], {
138
- skipWriting: !this.options.writeEveryEntity && !selectedEntity,
139
- regenerate,
140
- skipDbChangelog: this.jhipsterConfig.databaseType === SQL || this.options.skipDbChangelog,
141
- skipInstall: true,
142
- skipPrompts: this.options.skipPrompts,
143
- });
144
- });
133
+ async composeEachEntity() {
134
+ return Promise.all(
135
+ this.getExistingEntityNames().map(async entityName => {
136
+ if (this.options.composedEntities && this.options.composedEntities.includes(entityName)) return;
137
+ const selectedEntity = this.options.entities.includes(entityName);
138
+ const { regenerate = !selectedEntity } = this.options;
139
+ await this.composeWithJHipster(GENERATOR_ENTITY, [entityName], {
140
+ skipWriting: !this.options.writeEveryEntity && !selectedEntity,
141
+ regenerate,
142
+ skipDbChangelog: this.jhipsterConfig.databaseType === SQL || this.options.skipDbChangelog,
143
+ skipInstall: true,
144
+ skipPrompts: this.options.skipPrompts,
145
+ });
146
+ })
147
+ );
145
148
  },
146
149
 
147
- databaseChangelog() {
150
+ async databaseChangelog() {
148
151
  if (this.jhipsterConfig.skipServer || this.jhipsterConfig.databaseType !== SQL || this.options.skipDbChangelog) {
149
152
  return;
150
153
  }
@@ -153,19 +156,23 @@ module.exports = class extends BaseBlueprintGenerator {
153
156
  return;
154
157
  }
155
158
 
156
- this.composeWithJHipster(GENERATOR_DATABASE_CHANGELOG, this.options.writeEveryEntity ? existingEntities : this.options.entities);
159
+ await this.composeWithJHipster(
160
+ GENERATOR_DATABASE_CHANGELOG,
161
+ this.options.writeEveryEntity ? existingEntities : this.options.entities
162
+ );
157
163
  },
158
164
  };
159
165
  }
160
166
 
161
167
  get composing() {
162
- return useBlueprints ? undefined : this._composing();
168
+ if (this.delegateToBlueprint) return {};
169
+ return this._composing();
163
170
  }
164
171
 
165
172
  // Public API method used by the getter and also by Blueprints
166
173
  _default() {
167
174
  return {
168
- composeEntitiesClient() {
175
+ async composeEntitiesClient() {
169
176
  if (this.options.entities.length !== this.jhipsterConfig.entities.length) return;
170
177
  const clientEntities = this.getExistingEntityNames()
171
178
  .map(entityName => {
@@ -177,7 +184,7 @@ module.exports = class extends BaseBlueprintGenerator {
177
184
  })
178
185
  .filter(entity => !entity.skipClient);
179
186
  if (clientEntities.length === 0) return;
180
- this.composeWithJHipster(GENERATOR_ENTITIES_CLIENT, clientEntities, {
187
+ await this.composeWithJHipster(GENERATOR_ENTITIES_CLIENT, clientEntities, {
181
188
  skipInstall: this.options.skipInstall,
182
189
  });
183
190
  },
@@ -185,7 +192,8 @@ module.exports = class extends BaseBlueprintGenerator {
185
192
  }
186
193
 
187
194
  get default() {
188
- return useBlueprints ? undefined : this._default();
195
+ if (this.delegateToBlueprint) return {};
196
+ return this._default();
189
197
  }
190
198
 
191
199
  // Public API method used by the getter and also by Blueprints
@@ -194,6 +202,7 @@ module.exports = class extends BaseBlueprintGenerator {
194
202
  }
195
203
 
196
204
  get writing() {
197
- return useBlueprints ? undefined : this._writing();
205
+ if (this.delegateToBlueprint) return {};
206
+ return this._writing();
198
207
  }
199
208
  };
@@ -19,14 +19,17 @@
19
19
  const BaseBlueprintGenerator = require('../generator-base-blueprint');
20
20
  const { GENERATOR_ENTITIES_CLIENT } = require('../generator-list');
21
21
 
22
- let useBlueprints;
23
-
24
22
  module.exports = class extends BaseBlueprintGenerator {
25
23
  constructor(args, options, features) {
26
24
  super(args, options, features);
27
25
  if (this.options.help) return;
28
26
  this.clientEntities = this.options.clientEntities;
29
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_ENTITIES_CLIENT);
27
+ }
28
+
29
+ async _postConstruct() {
30
+ if (!this.fromBlueprint) {
31
+ await this.composeWithBlueprints(GENERATOR_ENTITIES_CLIENT);
32
+ }
30
33
  }
31
34
 
32
35
  // Public API method used by the getter and also by Blueprints
@@ -39,7 +42,7 @@ module.exports = class extends BaseBlueprintGenerator {
39
42
  }
40
43
 
41
44
  get initializing() {
42
- return useBlueprints ? undefined : this._initializing();
45
+ return this.delegateToBlueprint ? undefined : this._initializing();
43
46
  }
44
47
 
45
48
  // Public API method used by the getter and also by Blueprints
@@ -52,7 +55,7 @@ module.exports = class extends BaseBlueprintGenerator {
52
55
  }
53
56
 
54
57
  get loading() {
55
- return useBlueprints ? undefined : this._loading();
58
+ return this.delegateToBlueprint ? undefined : this._loading();
56
59
  }
57
60
 
58
61
  // Public API method used by the getter and also by Blueprints
@@ -67,7 +70,7 @@ module.exports = class extends BaseBlueprintGenerator {
67
70
  }
68
71
 
69
72
  get default() {
70
- return useBlueprints ? undefined : this._default();
73
+ return this.delegateToBlueprint ? undefined : this._default();
71
74
  }
72
75
 
73
76
  // Public API method used by the getter and also by Blueprints
@@ -82,6 +85,6 @@ module.exports = class extends BaseBlueprintGenerator {
82
85
  }
83
86
 
84
87
  get end() {
85
- return useBlueprints ? undefined : this._end();
88
+ return this.delegateToBlueprint ? undefined : this._end();
86
89
  }
87
90
  };
@@ -65,8 +65,6 @@ const SUPPORTED_VALIDATION_RULES = constants.SUPPORTED_VALIDATION_RULES;
65
65
  const ANGULAR = constants.SUPPORTED_CLIENT_FRAMEWORKS.ANGULAR;
66
66
  const JHIPSTER_CONFIG_DIR = constants.JHIPSTER_CONFIG_DIR;
67
67
 
68
- let useBlueprints;
69
-
70
68
  class EntityGenerator extends BaseBlueprintGenerator {
71
69
  constructor(args, options, features) {
72
70
  super(args, options, { unique: 'argument', ...features });
@@ -148,11 +146,9 @@ class EntityGenerator extends BaseBlueprintGenerator {
148
146
  desc: 'Regenerate only a single entity, relationships can be not correctly generated',
149
147
  type: Boolean,
150
148
  });
149
+ }
151
150
 
152
- if (this.options.help) {
153
- return;
154
- }
155
-
151
+ async _postConstruct() {
156
152
  const name = _.upperFirst(this.options.name).replace('.json', '');
157
153
  this.entityStorage = this.getEntityConfig(name, true);
158
154
  this.entityConfig = this.entityStorage.createProxy();
@@ -169,14 +165,15 @@ class EntityGenerator extends BaseBlueprintGenerator {
169
165
  configurationFileExists: this.fs.exists(this.destinationPath(filename)),
170
166
  };
171
167
 
172
- this._setupEntityOptions(this, this, this.context);
173
- useBlueprints =
174
- !this.fromBlueprint &&
175
- this.instantiateBlueprints(GENERATOR_ENTITY, {
168
+ if (!this.fromBlueprint) {
169
+ await this.composeWithBlueprints(GENERATOR_ENTITY, {
176
170
  entityExisted,
177
171
  configExisted,
178
172
  arguments: [name],
179
173
  });
174
+ }
175
+
176
+ this._setupEntityOptions(this, this, this.context);
180
177
  }
181
178
 
182
179
  // Public API method used by the getter and also by Blueprints
@@ -207,7 +204,6 @@ class EntityGenerator extends BaseBlueprintGenerator {
207
204
  const context = this.context;
208
205
 
209
206
  if (this.jhipsterConfig.applicationType === MICROSERVICE) {
210
- context.skipClient = context.skipClient || !this.jhipsterConfig.microfrontend;
211
207
  context.microserviceName = this.entityConfig.microserviceName = this.jhipsterConfig.baseName;
212
208
  if (!this.entityConfig.clientRootFolder) {
213
209
  context.clientRootFolder = this.entityConfig.clientRootFolder = this.entityConfig.microserviceName;
@@ -235,6 +231,13 @@ class EntityGenerator extends BaseBlueprintGenerator {
235
231
  ? ''
236
232
  : this.entityConfig.microserviceName;
237
233
  }
234
+
235
+ if (this.jhipsterConfig.applications && !this.entityConfig.skipClient) {
236
+ const remoteConfig = this.jhipsterConfig.applications[this.entityConfig.microserviceName];
237
+ if (remoteConfig.clientFramework === 'vue') {
238
+ this.entityConfig.skipClient = true;
239
+ }
240
+ }
238
241
  }
239
242
  },
240
243
 
@@ -304,7 +307,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
304
307
  }
305
308
 
306
309
  get initializing() {
307
- if (useBlueprints) return;
310
+ if (this.delegateToBlueprint) return {};
308
311
  return this._initializing();
309
312
  }
310
313
 
@@ -326,7 +329,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
326
329
  }
327
330
 
328
331
  get prompting() {
329
- if (useBlueprints) return;
332
+ if (this.delegateToBlueprint) return {};
330
333
  return this._prompting();
331
334
  }
332
335
 
@@ -456,16 +459,16 @@ class EntityGenerator extends BaseBlueprintGenerator {
456
459
  }
457
460
 
458
461
  get configuring() {
459
- if (useBlueprints) return;
462
+ if (this.delegateToBlueprint) return {};
460
463
  return this._configuring();
461
464
  }
462
465
 
463
466
  // Public API method used by the getter and also by Blueprints
464
467
  _composing() {
465
468
  return {
466
- composeEntities() {
469
+ async composeEntities() {
467
470
  // We need to compose with others entities to update relationships.
468
- this.composeWithJHipster(
471
+ await this.composeWithJHipster(
469
472
  GENERATOR_ENTITIES,
470
473
  {
471
474
  entities: this.options.singleEntity ? [this.context.name] : undefined,
@@ -482,7 +485,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
482
485
  }
483
486
 
484
487
  get composing() {
485
- if (useBlueprints) return;
488
+ if (this.delegateToBlueprint) return {};
486
489
  return this._composing();
487
490
  }
488
491
 
@@ -520,22 +523,22 @@ class EntityGenerator extends BaseBlueprintGenerator {
520
523
  this.configOptions.sharedEntities[this.context.name] = this.context;
521
524
  },
522
525
 
523
- composing() {
526
+ async composing() {
524
527
  if (this.options.skipWriting) return;
525
528
  const context = this.context;
526
529
  if (!context.skipServer) {
527
- this.composeWithJHipster(GENERATOR_ENTITY_SERVER, this.arguments, {
530
+ await this.composeWithJHipster(GENERATOR_ENTITY_SERVER, this.arguments, {
528
531
  context,
529
532
  });
530
533
  }
531
534
 
532
535
  if (!context.skipClient || this.jhipsterConfig.applicationType === GATEWAY) {
533
- this.composeWithJHipster(GENERATOR_ENTITY_CLIENT, this.arguments, {
536
+ await this.composeWithJHipster(GENERATOR_ENTITY_CLIENT, this.arguments, {
534
537
  context,
535
538
  skipInstall: this.options.skipInstall,
536
539
  });
537
540
  if (this.jhipsterConfig.enableTranslation) {
538
- this.composeWithJHipster(GENERATOR_ENTITY_I_18_N, this.arguments, {
541
+ await this.composeWithJHipster(GENERATOR_ENTITY_I_18_N, this.arguments, {
539
542
  context,
540
543
  skipInstall: this.options.skipInstall,
541
544
  });
@@ -546,7 +549,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
546
549
  }
547
550
 
548
551
  get loading() {
549
- if (useBlueprints) return;
552
+ if (this.delegateToBlueprint) return {};
550
553
  return this._loading();
551
554
  }
552
555
 
@@ -587,11 +590,24 @@ class EntityGenerator extends BaseBlueprintGenerator {
587
590
  const entity = this.context;
588
591
  prepareEntityForTemplates(entity, this);
589
592
  },
593
+
594
+ loadDomain() {
595
+ const entity = this.context;
596
+ const { entityPackage, packageName, packageFolder, persistClass } = entity;
597
+ let { entityAbsolutePackage = packageName, entityAbsoluteFolder = packageFolder } = entity;
598
+ if (entityPackage) {
599
+ entityAbsolutePackage = [packageName, entityPackage].join('.');
600
+ entityAbsoluteFolder = path.join(packageFolder, entityPackage.replace(/\./g, '/'));
601
+ }
602
+ entity.entityAbsolutePackage = entityAbsolutePackage;
603
+ entity.entityAbsoluteFolder = entityAbsoluteFolder;
604
+ entity.entityAbsoluteClass = `${entityAbsolutePackage}.domain.${persistClass}`;
605
+ },
590
606
  };
591
607
  }
592
608
 
593
609
  get preparingFields() {
594
- if (useBlueprints) return;
610
+ if (this.delegateToBlueprint) return {};
595
611
  return this._preparingFields();
596
612
  }
597
613
 
@@ -617,7 +633,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
617
633
  }
618
634
 
619
635
  get preparing() {
620
- if (useBlueprints) return;
636
+ if (this.delegateToBlueprint) return {};
621
637
  return this._preparing();
622
638
  }
623
639
 
@@ -724,7 +740,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
724
740
  }
725
741
 
726
742
  get preparingRelationships() {
727
- if (useBlueprints) return;
743
+ if (this.delegateToBlueprint) return {};
728
744
  return this._preparingRelationships();
729
745
  }
730
746
 
@@ -739,6 +755,10 @@ class EntityGenerator extends BaseBlueprintGenerator {
739
755
  this.context.user = this.configOptions.sharedEntities.User;
740
756
  },
741
757
 
758
+ loadOtherEntities() {
759
+ this.context.otherEntities = _.uniq(this.context.relationships.map(rel => rel.otherEntity));
760
+ },
761
+
742
762
  processOtherReferences() {
743
763
  this.context.otherReferences = this.context.otherRelationships.map(relationship => relationship.reference);
744
764
  this.context.allReferences
@@ -821,7 +841,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
821
841
  }
822
842
 
823
843
  get default() {
824
- if (useBlueprints) return;
844
+ if (this.delegateToBlueprint) return {};
825
845
  return this._default();
826
846
  }
827
847
 
@@ -847,7 +867,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
847
867
  }
848
868
 
849
869
  get writing() {
850
- if (useBlueprints) return;
870
+ if (this.delegateToBlueprint) return {};
851
871
  return this._writing();
852
872
  }
853
873
 
@@ -877,7 +897,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
877
897
  }
878
898
 
879
899
  get install() {
880
- if (useBlueprints) return;
900
+ if (this.delegateToBlueprint) return {};
881
901
  return this._install();
882
902
  }
883
903
 
@@ -891,7 +911,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
891
911
  }
892
912
 
893
913
  get end() {
894
- if (useBlueprints) return;
914
+ if (this.delegateToBlueprint) return {};
895
915
  return this._end();
896
916
  }
897
917
 
@@ -437,11 +437,7 @@ function addSampleRegexTestingStrings(generator) {
437
437
  function writeFiles() {
438
438
  return {
439
439
  writeClientFiles() {
440
- if (
441
- this.skipClient ||
442
- (this.jhipsterConfig.microfrontend && this.jhipsterConfig.applicationType === 'gateway' && this.microserviceName)
443
- )
444
- return undefined;
440
+ if (this.skipClient || (this.microfrontend && this.applicationTypeGateway && this.microserviceName)) return undefined;
445
441
  if (this.protractorTests) {
446
442
  addSampleRegexTestingStrings(this);
447
443
  }
@@ -483,7 +479,7 @@ function addToMenu() {
483
479
  if (!this.embedded) {
484
480
  this.addEntityToModule();
485
481
  this.addEntityToMenu(
486
- this.entityStateName,
482
+ this.entityPage,
487
483
  this.enableTranslation,
488
484
  this.clientFramework,
489
485
  this.entityTranslationKeyMenu,
@@ -494,17 +490,12 @@ function addToMenu() {
494
490
 
495
491
  function replaceTranslations() {
496
492
  if (this.clientFramework === VUE && !this.enableTranslation) {
493
+ utils.vueReplaceTranslation(this, [
494
+ `app/entities/${this.entityFolderName}/${this.entityFileName}.vue`,
495
+ `app/entities/${this.entityFolderName}/${this.entityFileName}-details.vue`,
496
+ ]);
497
497
  if (!this.readOnly) {
498
- utils.vueReplaceTranslation(this, [
499
- `app/entities/${this.entityFolderName}/${this.entityFileName}.vue`,
500
- `app/entities/${this.entityFolderName}/${this.entityFileName}-update.vue`,
501
- `app/entities/${this.entityFolderName}/${this.entityFileName}-details.vue`,
502
- ]);
503
- } else {
504
- utils.vueReplaceTranslation(this, [
505
- `app/entities/${this.entityFolderName}/${this.entityFileName}.vue`,
506
- `app/entities/${this.entityFolderName}/${this.entityFileName}-details.vue`,
507
- ]);
498
+ utils.vueReplaceTranslation(this, [`app/entities/${this.entityFolderName}/${this.entityFileName}-update.vue`]);
508
499
  }
509
500
  }
510
501
  }
@@ -19,14 +19,15 @@
19
19
  /* eslint-disable consistent-return */
20
20
  const _ = require('lodash');
21
21
  const { writeFiles, addToMenu, replaceTranslations } = require('./files');
22
+ const { entityClientI18nFiles } = require('../entity-i18n/files');
23
+
22
24
  const utils = require('../utils');
23
25
  const BaseBlueprintGenerator = require('../generator-base-blueprint');
24
26
  const {
25
27
  SUPPORTED_CLIENT_FRAMEWORKS: { ANGULAR, REACT },
26
28
  } = require('../generator-constants');
27
29
  const { GENERATOR_ENTITY_CLIENT } = require('../generator-list');
28
-
29
- let useBlueprints;
30
+ const { POSTGRESQL, MARIADB } = require('../../jdl/jhipster/database-types');
30
31
 
31
32
  module.exports = class extends BaseBlueprintGenerator {
32
33
  constructor(args, options, features) {
@@ -34,8 +35,26 @@ module.exports = class extends BaseBlueprintGenerator {
34
35
 
35
36
  this.entity = this.options.context;
36
37
  this.jhipsterContext = this.options.jhipsterContext || this.options.context;
38
+ }
39
+
40
+ async _postConstruct() {
41
+ if (!this.fromBlueprint) {
42
+ await this.composeWithBlueprints(GENERATOR_ENTITY_CLIENT, { context: this.options.context });
43
+ }
44
+ }
45
+
46
+ // Public API method used by the getter and also by Blueprints
47
+ _preparing() {
48
+ return {
49
+ async loadNativeLanguage() {
50
+ await this._loadEntityClientTranslations(this.entity, this.jhipsterConfig);
51
+ },
52
+ };
53
+ }
37
54
 
38
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_ENTITY_CLIENT, { context: this.options.context });
55
+ get preparing() {
56
+ if (this.delegateToBlueprint) return {};
57
+ return this._preparing();
39
58
  }
40
59
 
41
60
  // Public API method used by the getter and also by Blueprints
@@ -52,11 +71,22 @@ module.exports = class extends BaseBlueprintGenerator {
52
71
  this.tsKeyType = this.getTypescriptKeyType(this.primaryKey.type);
53
72
  }
54
73
  },
74
+
75
+ setupCypress() {
76
+ // Blueprints may disable cypress relationships by setting to false.
77
+ this.cypressBootstrapEntities = true;
78
+
79
+ const entity = this.entity;
80
+ // Reactive with PostgreSQL doesn't allow insertion without data.
81
+ this.workaroundRelationshipReactivePostgress = entity.reactive && entity.prodDatabaseType === POSTGRESQL;
82
+ // Reactive with MariaDB doesn't allow null value at Instant fields.
83
+ this.workaroundInstantReactiveMariaDB = entity.reactive && entity.prodDatabaseType === MARIADB;
84
+ },
55
85
  };
56
86
  }
57
87
 
58
88
  get default() {
59
- if (useBlueprints) return;
89
+ if (this.delegateToBlueprint) return {};
60
90
  return this._default();
61
91
  }
62
92
 
@@ -115,7 +145,7 @@ module.exports = class extends BaseBlueprintGenerator {
115
145
  }
116
146
 
117
147
  get writing() {
118
- if (useBlueprints) return;
148
+ if (this.delegateToBlueprint) return {};
119
149
  return this._writing();
120
150
  }
121
151
 
@@ -127,18 +157,51 @@ module.exports = class extends BaseBlueprintGenerator {
127
157
  },
128
158
 
129
159
  replaceTranslations() {
130
- if (
131
- this.skipClient ||
132
- (this.jhipsterConfig.microfrontend && this.jhipsterConfig.applicationType === 'gateway' && this.microserviceName)
133
- )
134
- return undefined;
160
+ if (this.skipClient || (this.microfrontend && this.applicationTypeGateway && this.microserviceName)) return undefined;
135
161
  return replaceTranslations.call(this);
136
162
  },
137
163
  };
138
164
  }
139
165
 
140
166
  get postWriting() {
141
- if (useBlueprints) return;
167
+ if (this.delegateToBlueprint) return {};
142
168
  return this._postWriting();
143
169
  }
170
+
171
+ /**
172
+ * @experimental
173
+ * Load entity client native translation.
174
+ */
175
+ async _loadEntityClientTranslations(entity, configContext = this) {
176
+ const { frontendAppName = this.getFrontendAppName(), nativeLanguage = 'en' } = configContext;
177
+ entity.entityClientTranslations = entity.entityClientTranslations || {};
178
+ const { entityClientTranslations } = entity;
179
+ const rootTemplatesPath = this.fetchFromInstalledJHipster('entity-i18n/templates/');
180
+ const translationFiles = await this.writeFiles({
181
+ sections: entityClientI18nFiles,
182
+ rootTemplatesPath,
183
+ context: { ...entity, clientSrcDir: '__tmp__', frontendAppName, lang: 'en' },
184
+ });
185
+ if (nativeLanguage && nativeLanguage !== 'en') {
186
+ translationFiles.push(
187
+ ...(await this.writeFiles({
188
+ sections: entityClientI18nFiles,
189
+ rootTemplatesPath,
190
+ context: { ...entity, clientSrcDir: '__tmp__', frontendAppName, lang: nativeLanguage },
191
+ }))
192
+ );
193
+ }
194
+ for (const translationFile of translationFiles) {
195
+ _.merge(entityClientTranslations, this.readDestinationJSON(translationFile));
196
+ delete this.env.sharedFs.get(translationFile).state;
197
+ }
198
+ }
199
+
200
+ /**
201
+ * @experimental
202
+ * Get translation value for a key.
203
+ */
204
+ _getEntityClientTranslation(translationKey) {
205
+ return _.get(this.entityClientTranslations, translationKey, `Translation missing for ${translationKey}`);
206
+ }
144
207
  };