generator-jhipster 7.3.0 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/cli/import-jdl.js +3 -2
  2. package/cli/jhipster-command.js +2 -2
  3. package/cli/program.js +32 -29
  4. package/generators/app/index.js +46 -27
  5. package/generators/aws/index.js +8 -8
  6. package/generators/aws/lib/eb.js +1 -1
  7. package/generators/azure-app-service/index.js +16 -9
  8. package/generators/azure-app-service/templates/github/workflows/azure-app-service.yml.ejs +2 -2
  9. package/generators/azure-spring-cloud/index.js +16 -9
  10. package/generators/azure-spring-cloud/templates/github/workflows/azure-spring-cloud.yml.ejs +2 -2
  11. package/generators/bootstrap/index.js +57 -62
  12. package/generators/ci-cd/index.js +11 -8
  13. package/generators/ci-cd/templates/github-actions.yml.ejs +1 -1
  14. package/generators/ci-cd/templates/travis.yml.ejs +9 -4
  15. package/generators/cleanup.js +27 -171
  16. package/generators/client/files-angular.js +12 -1
  17. package/generators/client/files-common.js +6 -2
  18. package/generators/client/files-react.js +13 -2
  19. package/generators/client/files-vue.js +59 -7
  20. package/generators/client/index.js +46 -32
  21. package/generators/client/needle-api/needle-client-angular.js +1 -1
  22. package/generators/client/needle-api/needle-client-vue.js +57 -7
  23. package/generators/client/templates/angular/.eslintrc.json.ejs +1 -0
  24. package/generators/client/templates/angular/angular.json.ejs +5 -0
  25. package/generators/client/templates/angular/jest.conf.js.ejs +2 -0
  26. package/generators/client/templates/angular/package.json +29 -29
  27. package/generators/client/templates/angular/package.json.ejs +3 -1
  28. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.component.spec.ts.ejs +52 -54
  29. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.component.ts.ejs +4 -4
  30. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.service.spec.ts.ejs +65 -0
  31. package/generators/client/templates/angular/src/main/webapp/app/account/password/password-strength-bar/password-strength-bar.component.spec.ts.ejs +35 -37
  32. package/generators/client/templates/angular/src/main/webapp/app/account/password/password-strength-bar/password-strength-bar.component.ts.ejs +1 -1
  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.component.ts.ejs +4 -4
  35. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.service.spec.ts.ejs +41 -0
  36. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.spec.ts.ejs +73 -75
  37. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts.ejs +4 -4
  38. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.spec.ts.ejs +62 -0
  39. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.component.spec.ts.ejs +44 -46
  40. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.service.spec.ts.ejs +61 -0
  41. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.component.spec.ts.ejs +122 -123
  42. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.component.ts.ejs +1 -1
  43. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.service.spec.ts.ejs +66 -0
  44. package/generators/client/templates/angular/src/main/webapp/app/account/sessions/sessions.component.spec.ts.ejs +75 -77
  45. package/generators/client/templates/angular/src/main/webapp/app/account/settings/settings.component.spec.ts.ejs +80 -80
  46. package/generators/client/templates/angular/src/main/webapp/app/admin/configuration/configuration.component.spec.ts.ejs +48 -50
  47. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.spec.ts.ejs +45 -47
  48. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.ts.ejs +4 -4
  49. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.service.spec.ts.ejs +66 -0
  50. package/generators/client/templates/angular/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.ejs +99 -101
  51. package/generators/client/templates/angular/src/main/webapp/app/admin/logs/logs.component.spec.ts.ejs +61 -63
  52. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.component.html.ejs +2 -2
  53. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/metrics.component.spec.ts.ejs +28 -30
  54. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.spec.ts.ejs +35 -37
  55. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/detail/user-management-detail.component.spec.ts.ejs +40 -42
  56. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.spec.ts.ejs +89 -91
  57. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.ts.ejs +4 -4
  58. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.spec.ts.ejs +81 -83
  59. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.ts.ejs +8 -8
  60. package/generators/client/templates/angular/src/main/webapp/app/app-routing.module.ts.ejs +14 -3
  61. package/generators/client/templates/angular/src/main/webapp/app/app.module.ts.ejs +8 -29
  62. package/generators/client/templates/angular/src/main/webapp/app/config/datepicker-adapter.ts.ejs +1 -1
  63. package/generators/client/templates/angular/src/main/webapp/app/config/dayjs.ts.ejs +4 -4
  64. package/generators/client/templates/angular/src/main/webapp/app/core/auth/account.service.spec.ts.ejs +14 -9
  65. package/generators/client/templates/angular/src/main/webapp/app/core/tracker/tracker.service.ts.ejs +6 -6
  66. package/generators/client/templates/angular/src/main/webapp/app/core/util/parse-links.service.ts.ejs +1 -1
  67. package/generators/client/templates/angular/src/main/webapp/app/entities/entity-navbar-items.ts.ejs +29 -0
  68. package/generators/client/templates/angular/src/main/webapp/app/home/home.component.spec.ts.ejs +106 -98
  69. package/generators/client/templates/angular/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs +166 -168
  70. package/generators/client/templates/angular/src/main/webapp/app/layouts/main/main.component.ts.ejs +1 -1
  71. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +20 -0
  72. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts.ejs +74 -70
  73. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.ts.ejs +41 -2
  74. package/generators/client/templates/angular/src/main/webapp/app/layouts/profiles/page-ribbon.component.spec.ts.ejs +27 -29
  75. package/generators/client/templates/angular/src/main/webapp/app/login/login.component.spec.ts.ejs +114 -115
  76. package/generators/client/templates/angular/src/main/webapp/app/login/login.component.ts.ejs +4 -4
  77. package/generators/client/templates/angular/src/main/webapp/app/shared/alert/alert-error.component.spec.ts.ejs +132 -134
  78. package/generators/client/templates/angular/src/main/webapp/app/shared/alert/alert.component.spec.ts.ejs +29 -31
  79. package/generators/client/templates/angular/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs +4 -4
  80. package/generators/client/templates/angular/src/main/webapp/app/shared/date/duration.pipe.ts.ejs +1 -1
  81. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-date.pipe.spec.ts.ejs +1 -1
  82. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-date.pipe.ts.ejs +1 -1
  83. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-datetime.pipe.spec.ts.ejs +1 -1
  84. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-datetime.pipe.ts.ejs +1 -1
  85. package/generators/client/templates/angular/src/main/webapp/app/shared/language/translate.directive.ts.ejs +6 -6
  86. package/generators/client/templates/angular/src/main/webapp/app/shared/language/translation.module.ts.ejs +83 -0
  87. package/generators/client/templates/angular/src/main/webapp/declarations.d.ts.ejs +16 -2
  88. package/generators/client/templates/angular/tsconfig.json.ejs +2 -0
  89. package/generators/client/templates/angular/tsconfig.spec.json.ejs +0 -1
  90. package/generators/client/templates/angular/webpack/proxy.conf.js.ejs +0 -2
  91. package/generators/client/templates/angular/webpack/webpack.custom.js.ejs +0 -16
  92. package/generators/client/templates/angular/webpack/webpack.microfrontend.js.ejs +12 -5
  93. package/generators/client/templates/common/package.json +6 -6
  94. package/generators/client/templates/common/src/main/webapp/robots.txt.ejs +0 -1
  95. package/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs +86 -56
  96. package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +56 -0
  97. package/generators/client/templates/react/.eslintrc.json.ejs +1 -0
  98. package/generators/client/templates/react/package.json +54 -53
  99. package/generators/client/templates/react/package.json.ejs +6 -1
  100. package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +0 -3
  101. package/generators/client/templates/react/src/main/webapp/app/config/axios-interceptor.spec.ts.ejs +3 -2
  102. package/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs +2 -2
  103. package/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +2 -2
  104. package/generators/client/templates/react/src/main/webapp/app/modules/administration/gateway/gateway.tsx.ejs +2 -2
  105. package/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +6 -6
  106. package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +8 -8
  107. package/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
  108. package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.scss.ejs +9 -0
  109. package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +2 -2
  110. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +3 -3
  111. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +7 -7
  112. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-components.tsx.ejs +1 -1
  113. package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs +1 -1
  114. package/generators/client/templates/react/webpack/webpack.dev.js.ejs +17 -3
  115. package/generators/client/templates/react/webpack/webpack.prod.js.ejs +13 -1
  116. package/generators/client/templates/vue/.eslintrc.js.ejs +8 -5
  117. package/generators/client/templates/vue/package.json +40 -49
  118. package/generators/client/templates/vue/package.json.ejs +13 -17
  119. package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +23 -12
  120. package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs +7 -1
  121. package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.vue.ejs +1 -1
  122. package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs +1 -1
  123. package/generators/client/templates/vue/src/main/webapp/app/constants.ts.ejs +16 -6
  124. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +27 -8
  125. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +6 -0
  126. package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +41 -0
  127. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs +34 -0
  128. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.vue.ejs +13 -0
  129. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +20 -0
  130. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.vue.ejs +5 -0
  131. package/generators/client/templates/vue/src/main/webapp/app/entities/user/{user.oauth2.service.ts.ejs → user.service.ts.ejs} +1 -1
  132. package/generators/client/templates/vue/{webpack/utils.js.ejs → src/main/webapp/app/index.ts.ejs} +1 -12
  133. package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs +26 -9
  134. package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +20 -18
  135. package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +45 -3
  136. package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +19 -3
  137. package/generators/client/templates/vue/src/main/webapp/app/shared/config/axios-interceptor.ts.ejs +0 -2
  138. package/generators/client/templates/vue/src/main/webapp/app/shared/data/data-utils.service.ts.ejs +3 -1
  139. package/generators/client/templates/vue/src/main/webapp/app/shims-vue.d.ts.ejs +17 -3
  140. package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +25 -10
  141. package/generators/client/templates/vue/src/test/javascript/spec/app/account/login-form/login-form.component.spec.ts.ejs +2 -2
  142. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management-edit.component.spec.ts.ejs +6 -4
  143. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs +4 -2
  144. package/generators/client/templates/vue/src/test/javascript/spec/app/core/jhi-navbar/jhi-navbar.component.spec.ts.ejs +10 -4
  145. package/generators/client/templates/vue/src/test/javascript/spec/app/entities/entities-menu.spec.ts.ejs +52 -0
  146. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.component.ts.ejs +4 -0
  147. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.vue.ejs +7 -0
  148. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-router.ts.ejs +1 -0
  149. package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/axios-interceptor.spec.ts.ejs +0 -1
  150. package/generators/client/templates/vue/tsconfig.json.ejs +6 -10
  151. package/generators/client/templates/vue/tsconfig.spec.json.ejs +37 -0
  152. package/generators/client/templates/vue/webpack/config.js.ejs +50 -0
  153. package/generators/client/templates/vue/webpack/vue.utils.js.ejs +33 -32
  154. package/generators/client/templates/vue/webpack/webpack.common.js.ejs +150 -126
  155. package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +19 -76
  156. package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +77 -0
  157. package/generators/client/templates/vue/webpack/webpack.prod.js.ejs +5 -41
  158. package/generators/cloudfoundry/index.js +9 -9
  159. package/generators/common/index.js +12 -10
  160. package/generators/common/templates/.prettierrc.ejs +1 -1
  161. package/generators/common/templates/README.md.jhi.ejs +19 -0
  162. package/generators/common/templates/package.json +4 -4
  163. package/generators/cypress/index.js +12 -9
  164. package/generators/cypress/templates/cypress.json.ejs +16 -2
  165. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/login-page.spec.ts.ejs +3 -14
  166. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/password-page.spec.ts.ejs +33 -39
  167. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/register-page.spec.ts.ejs +52 -62
  168. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/reset-password-page.spec.ts.ejs +2 -10
  169. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/settings-page.spec.ts.ejs +25 -34
  170. package/generators/cypress/templates/src/test/javascript/cypress/integration/administration/administration.spec.ts.ejs +1 -22
  171. package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +4 -4
  172. package/generators/cypress/templates/src/test/javascript/cypress/support/commands.ts.ejs +67 -7
  173. package/generators/cypress/templates/src/test/javascript/cypress/support/entity.ts.ejs +4 -4
  174. package/generators/cypress/templates/src/test/javascript/cypress/support/index.ts.ejs +1 -6
  175. package/generators/cypress/templates/src/test/javascript/cypress/support/management.ts.ejs +1 -1
  176. package/generators/cypress/templates/src/test/javascript/cypress/support/navbar.ts.ejs +8 -8
  177. package/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs +0 -9
  178. package/generators/database-changelog/index.js +33 -22
  179. package/generators/database-changelog-liquibase/index.js +12 -8
  180. package/generators/database-changelog-liquibase/templates/src/main/resources/config/liquibase/changelog/updated_entity_constraints.xml.ejs +1 -1
  181. package/generators/docker-compose/index.js +11 -12
  182. package/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +1 -1
  183. package/generators/entities/index.js +35 -26
  184. package/generators/entities-client/index.js +10 -7
  185. package/generators/entity/index.js +81 -32
  186. package/generators/entity-client/files.js +7 -16
  187. package/generators/entity-client/index.js +22 -12
  188. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/delete/entity-management-delete-dialog.component.spec.ts.ejs +42 -44
  189. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.html.ejs +1 -1
  190. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.spec.ts.ejs +58 -60
  191. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.module.ts.ejs +1 -35
  192. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity.model.ts.ejs +1 -1
  193. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.html.ejs +4 -4
  194. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.spec.ts.ejs +110 -112
  195. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +9 -2
  196. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/infinite-scroll-template.ejs +8 -8
  197. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/no-pagination-template.ejs +8 -8
  198. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/pagination-template.ejs +8 -8
  199. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/route/entity-management-routing-resolve.service.spec.ts.ejs +15 -6
  200. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/route/entity-management-routing.module.ts.ejs +1 -1
  201. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.spec.ts.ejs +1 -1
  202. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.ts.ejs +1 -1
  203. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.spec.ts.ejs +203 -198
  204. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.ts.ejs +5 -5
  205. package/generators/entity-client/templates/angular/src/test/javascript/e2e/entities/entity.spec.ts.ejs +1 -1
  206. package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +264 -127
  207. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +17 -14
  208. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs +5 -4
  209. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +11 -13
  210. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.component.ts.ejs +32 -25
  211. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.vue.ejs +6 -9
  212. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -1
  213. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.model.ts.ejs +1 -1
  214. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs +2 -6
  215. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity-update.component.spec.ts.ejs +10 -7
  216. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.component.spec.ts.ejs +5 -1
  217. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.service.spec.ts.ejs +1 -1
  218. package/generators/entity-i18n/index.js +7 -4
  219. package/generators/entity-server/files.js +14 -0
  220. package/generators/entity-server/index.js +12 -8
  221. package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +2 -2
  222. package/generators/entity-server/templates/src/main/java/package/common/search_template.ejs +1 -1
  223. package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +9 -8
  224. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +16 -29
  225. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository_reactive.java.ejs +3 -3
  226. package/generators/entity-server/templates/src/main/java/package/repository/EntitySqlHelper_reactive.java.ejs +46 -0
  227. package/generators/entity-server/templates/src/main/java/package/repository/rowmapper/EntityRowMapper.java.ejs +1 -1
  228. package/generators/entity-server/templates/src/main/java/package/repository/search/EntitySearchRepository.java.ejs +18 -2
  229. package/generators/entity-server/templates/src/main/java/package/repository/search/SortToFieldSortBuilderConverter.java.ejs +24 -0
  230. package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +8 -6
  231. package/generators/entity-server/templates/src/main/java/package/service/mapper/EntityMapper.java.ejs +5 -1
  232. package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +41 -43
  233. package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +3 -3
  234. package/generators/gae/index.js +10 -10
  235. package/generators/generator-base-blueprint.js +14 -46
  236. package/generators/generator-base-private.js +44 -23
  237. package/generators/generator-base.js +58 -18
  238. package/generators/generator-constants.js +30 -23
  239. package/generators/generator-transforms.js +39 -27
  240. package/generators/heroku/index.js +14 -33
  241. package/generators/init/constants.cjs +1 -1
  242. package/generators/java/constants.cjs +1 -1
  243. package/generators/kubernetes/files.js +3 -0
  244. package/generators/kubernetes/index.js +10 -10
  245. package/generators/kubernetes/templates/db/couchbase.yml.ejs +1 -1
  246. package/generators/kubernetes/templates/deployment.yml.ejs +8 -3
  247. package/generators/kubernetes/templates/istio/destination-rule.yml.ejs +1 -1
  248. package/generators/kubernetes/templates/istio/gateway/grafana-gateway.yml.ejs +5 -2
  249. package/generators/kubernetes/templates/istio/gateway/jhipster-grafana-gateway.yml.ejs +5 -2
  250. package/generators/kubernetes/templates/istio/gateway/kiali-gateway.yml.ejs +10 -8
  251. package/generators/kubernetes/templates/istio/gateway/zipkin-gateway.yml.ejs +5 -2
  252. package/generators/kubernetes/templates/istio/gateway.yml.ejs +7 -5
  253. package/generators/kubernetes/templates/secret/couchbase-secret.yml.ejs +9 -0
  254. package/generators/kubernetes-base.js +1 -0
  255. package/generators/kubernetes-helm/files.js +3 -8
  256. package/generators/kubernetes-helm/index.js +10 -10
  257. package/generators/kubernetes-helm/templates/README-KUBERNETES-HELM.md.ejs +0 -1
  258. package/generators/kubernetes-helm/templates/app/Chart.yml.ejs +5 -0
  259. package/generators/kubernetes-helm/templates/app/helpers.tpl.ejs +0 -11
  260. package/generators/kubernetes-helm/templates/app/requirements.yml.ejs +5 -0
  261. package/generators/kubernetes-helm/templates/app/values.yml.ejs +68 -5
  262. package/generators/kubernetes-helm/templates/csvc/Chart.yml.ejs +1 -1
  263. package/generators/kubernetes-helm/templates/csvc/requirements.yml.ejs +1 -1
  264. package/generators/kubernetes-knative/index.js +10 -10
  265. package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +6 -4
  266. package/generators/kubernetes-knative/templates/service.yml.ejs +1 -1
  267. package/generators/languages/index.js +13 -13
  268. package/generators/languages/templates/src/main/webapp/i18n/vi/login.json +1 -1
  269. package/generators/openapi-client/index.js +13 -10
  270. package/generators/openshift/index.js +10 -11
  271. package/generators/openshift/templates/deployment.yml.ejs +1 -1
  272. package/generators/page/index.js +12 -10
  273. package/generators/server/__snapshots__/generator.spec.mjs.snap +28 -15
  274. package/generators/server/cleanup.js +151 -0
  275. package/generators/server/files-sql.js +52 -0
  276. package/generators/server/files.js +31 -14
  277. package/generators/server/index.js +86 -33
  278. package/generators/server/templates/build.gradle.ejs +231 -189
  279. package/generators/server/templates/gradle.properties.ejs +12 -12
  280. package/generators/server/templates/npmw +8 -6
  281. package/generators/server/templates/npmw.cmd +13 -8
  282. package/generators/server/templates/pom.xml.ejs +425 -217
  283. package/generators/server/templates/sql/reactive/src/main/java/package/repository/UserSqlHelper.java.ejs +48 -0
  284. package/generators/server/templates/src/main/docker/app.yml.ejs +1 -1
  285. package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +2 -2
  286. package/generators/server/templates/src/main/java/package/config/LocaleConfiguration.java.ejs +3 -2
  287. package/generators/server/templates/src/main/java/package/config/OpenApiConfiguration.java.ejs +17 -54
  288. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +5 -5
  289. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +4 -6
  290. package/generators/server/templates/src/main/java/package/config/WebConfigurer.java.ejs +0 -3
  291. package/generators/server/templates/src/main/java/package/config/neo4j/Neo4jMigrations.java.ejs +19 -9
  292. package/generators/server/templates/src/main/java/package/management/SecurityMetersService.java.ejs +68 -0
  293. package/generators/server/templates/src/main/java/package/repository/AuthorityRepository.java.ejs +2 -2
  294. package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +0 -25
  295. package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +31 -4
  296. package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +23 -11
  297. package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +16 -8
  298. package/generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs +6 -6
  299. package/generators/server/templates/src/main/java/package/web/filter/ModifyServersOpenApiFilter.java.ejs +3 -2
  300. package/generators/server/templates/src/main/java/package/web/filter/SpaWebFilter.java.ejs +1 -1
  301. package/generators/server/templates/src/main/java/package/web/rest/PublicUserResource.java.ejs +2 -2
  302. package/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +2 -2
  303. package/generators/server/templates/src/main/resources/config/application.yml.ejs +22 -8
  304. package/generators/server/templates/src/main/resources/logback-spring.xml.ejs +1 -2
  305. package/generators/server/templates/src/main/resources/static/microservices_index.html.ejs +1 -1
  306. package/generators/server/templates/src/test/java/package/cucumber/CucumberIT.java.ejs +2 -6
  307. package/generators/server/templates/src/test/java/package/cucumber/CucumberTestContextConfiguration.java.ejs +2 -3
  308. package/generators/server/templates/src/test/java/package/cucumber/stepdefs/UserStepDefs.java.ejs +41 -6
  309. package/generators/server/templates/src/test/java/package/management/SecurityMetersServiceTests.java.ejs +113 -0
  310. package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +6 -1
  311. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderSecurityMetersTests.java.ejs +198 -0
  312. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderTest.java.ejs +13 -3
  313. package/generators/server/templates/src/test/java/package/security/oauth2/AuthorizationHeaderUtilTest.java.ejs +17 -3
  314. package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +63 -0
  315. package/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs +1 -1
  316. package/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs +2 -3
  317. package/generators/server/templates/src/test/java/package/web/rest/ClientForwardControllerTest.java.ejs +9 -0
  318. package/generators/server/templates/src/test/resources/junit-platform.properties.ejs +2 -0
  319. package/generators/server/templates/src/test/resources/logback.xml.ejs +1 -1
  320. package/generators/server/templates/src/test/{features → resources/package/features}/gitkeep +0 -0
  321. package/generators/server/templates/src/test/{features → resources/package/features}/user/user.feature.ejs +0 -0
  322. package/generators/spring-controller/index.js +9 -7
  323. package/generators/spring-controller/templates/src/test/java/package/web/rest/ResourceIT.java.ejs +1 -1
  324. package/generators/spring-service/index.js +10 -7
  325. package/generators/upgrade/index.js +4 -5
  326. package/generators/utils.js +2 -2
  327. package/generators/workspaces/index.js +16 -7
  328. package/jdl/jhipster/default-application-options.js +9 -7
  329. package/package.json +22 -22
  330. package/utils/entity.js +17 -4
  331. package/utils/field.js +11 -1
  332. package/utils/multi-step-transform/index.js +8 -8
  333. package/generators/client/templates/react/.npmrc.ejs +0 -1
  334. package/generators/client/templates/vue/webpack/dev.env.js.ejs +0 -17
  335. package/generators/client/templates/vue/webpack/env.js.ejs +0 -67
  336. package/generators/client/templates/vue/webpack/loader.conf.js.ejs +0 -20
  337. package/generators/client/templates/vue/webpack/prod.env.js.ejs +0 -15
  338. package/generators/server/templates/src/main/java/package/config/apidocs/GatewaySwaggerResourcesProvider.java.ejs +0 -91
  339. package/generators/server/templates/src/test/java/package/config/apidocs/GatewaySwaggerResourcesProviderTest.java.ejs +0 -79
  340. package/generators/server/templates/src/test/resources/cucumber.properties.ejs +0 -1
@@ -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
  };
@@ -38,6 +38,8 @@ const { prepareFieldForTemplates, fieldIsEnum } = require('../../utils/field');
38
38
  const { prepareRelationshipForTemplates } = require('../../utils/relationship');
39
39
  const { stringify } = require('../../utils');
40
40
  const { GATEWAY, MICROSERVICE } = require('../../jdl/jhipster/application-types');
41
+ const { NO: CLIENT_FRAMEWORK_NO } = require('../../jdl/jhipster/client-framework-types');
42
+ const { NO: SEARCH_ENGINE_NO } = require('../../jdl/jhipster/search-engine-types');
41
43
  const { CASSANDRA, COUCHBASE, MONGODB, NEO4J, ORACLE, SQL } = require('../../jdl/jhipster/database-types');
42
44
  const {
43
45
  GENERATOR_ENTITIES,
@@ -65,8 +67,6 @@ const SUPPORTED_VALIDATION_RULES = constants.SUPPORTED_VALIDATION_RULES;
65
67
  const ANGULAR = constants.SUPPORTED_CLIENT_FRAMEWORKS.ANGULAR;
66
68
  const JHIPSTER_CONFIG_DIR = constants.JHIPSTER_CONFIG_DIR;
67
69
 
68
- let useBlueprints;
69
-
70
70
  class EntityGenerator extends BaseBlueprintGenerator {
71
71
  constructor(args, options, features) {
72
72
  super(args, options, { unique: 'argument', ...features });
@@ -148,11 +148,9 @@ class EntityGenerator extends BaseBlueprintGenerator {
148
148
  desc: 'Regenerate only a single entity, relationships can be not correctly generated',
149
149
  type: Boolean,
150
150
  });
151
+ }
151
152
 
152
- if (this.options.help) {
153
- return;
154
- }
155
-
153
+ async _postConstruct() {
156
154
  const name = _.upperFirst(this.options.name).replace('.json', '');
157
155
  this.entityStorage = this.getEntityConfig(name, true);
158
156
  this.entityConfig = this.entityStorage.createProxy();
@@ -169,14 +167,15 @@ class EntityGenerator extends BaseBlueprintGenerator {
169
167
  configurationFileExists: this.fs.exists(this.destinationPath(filename)),
170
168
  };
171
169
 
172
- this._setupEntityOptions(this, this, this.context);
173
- useBlueprints =
174
- !this.fromBlueprint &&
175
- this.instantiateBlueprints(GENERATOR_ENTITY, {
170
+ if (!this.fromBlueprint) {
171
+ await this.composeWithBlueprints(GENERATOR_ENTITY, {
176
172
  entityExisted,
177
173
  configExisted,
178
174
  arguments: [name],
179
175
  });
176
+ }
177
+
178
+ this._setupEntityOptions(this, this, this.context);
180
179
  }
181
180
 
182
181
  // Public API method used by the getter and also by Blueprints
@@ -207,7 +206,6 @@ class EntityGenerator extends BaseBlueprintGenerator {
207
206
  const context = this.context;
208
207
 
209
208
  if (this.jhipsterConfig.applicationType === MICROSERVICE) {
210
- context.skipClient = context.skipClient || !this.jhipsterConfig.microfrontend;
211
209
  context.microserviceName = this.entityConfig.microserviceName = this.jhipsterConfig.baseName;
212
210
  if (!this.entityConfig.clientRootFolder) {
213
211
  context.clientRootFolder = this.entityConfig.clientRootFolder = this.entityConfig.microserviceName;
@@ -235,6 +233,15 @@ class EntityGenerator extends BaseBlueprintGenerator {
235
233
  ? ''
236
234
  : this.entityConfig.microserviceName;
237
235
  }
236
+
237
+ if (this.jhipsterConfig.applications && !this.entityConfig.skipClient) {
238
+ const remoteConfig = this.jhipsterConfig.applications[this.entityConfig.microserviceName];
239
+ if (remoteConfig && remoteConfig.clientFramework && remoteConfig.clientFramework !== CLIENT_FRAMEWORK_NO) {
240
+ // Gateway requires entities to discover a microfrontend.
241
+ // Microfrontends is generated at the microservice side, so skip it at gateway side.
242
+ this.entityConfig.skipClient = true;
243
+ }
244
+ }
238
245
  }
239
246
  },
240
247
 
@@ -304,7 +311,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
304
311
  }
305
312
 
306
313
  get initializing() {
307
- if (useBlueprints) return;
314
+ if (this.delegateToBlueprint) return {};
308
315
  return this._initializing();
309
316
  }
310
317
 
@@ -326,7 +333,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
326
333
  }
327
334
 
328
335
  get prompting() {
329
- if (useBlueprints) return;
336
+ if (this.delegateToBlueprint) return {};
330
337
  return this._prompting();
331
338
  }
332
339
 
@@ -356,8 +363,34 @@ class EntityGenerator extends BaseBlueprintGenerator {
356
363
  throw new Error(validation);
357
364
  }
358
365
 
366
+ if (this.entityConfig.searchEngine === undefined) {
367
+ const backendOnlyMicroservice =
368
+ context.applicationType === MICROSERVICE && (!context.clientFramework || context.clientFramework === CLIENT_FRAMEWORK_NO);
369
+ if (backendOnlyMicroservice && context.searchEngine && context.searchEngine !== SEARCH_ENGINE_NO && !context.entityExisted) {
370
+ // Propagate searchEngine to the entity, it's opt-in and should be propagated to gateway
371
+ this.entityConfig.searchEngine = true;
372
+ }
373
+ } else if (
374
+ (!context.searchEngine || context.searchEngine === SEARCH_ENGINE_NO) &&
375
+ (context.applicationType !== GATEWAY || !this.entityConfig.microserviceName)
376
+ ) {
377
+ if (this.entityConfig.searchEngine === SEARCH_ENGINE_NO) {
378
+ // Convert to boolean.
379
+ this.entityConfig.searchEngine = false;
380
+ }
381
+ // If search engine is disabled at application, and unless it's a gateway publishing a microservice entity.
382
+ if (this.entityConfig.searchEngine) {
383
+ this.warning('Search engine disabled at application, cannot be enabled at entity, disabling');
384
+ this.entityConfig.searchEngine = false;
385
+ }
386
+ }
387
+
359
388
  this.entityConfig.name = this.entityConfig.name || context.name;
360
- if (![SQL, MONGODB, COUCHBASE, NEO4J].includes(context.databaseType)) {
389
+ // disable pagination if there is no database, unless it’s a microservice entity published by a gateway
390
+ if (
391
+ ![SQL, MONGODB, COUCHBASE, NEO4J].includes(context.databaseType) &&
392
+ (context.applicationType !== GATEWAY || !this.entityConfig.microserviceName)
393
+ ) {
361
394
  this.entityConfig.pagination = NO_PAGINATION;
362
395
  }
363
396
 
@@ -456,16 +489,16 @@ class EntityGenerator extends BaseBlueprintGenerator {
456
489
  }
457
490
 
458
491
  get configuring() {
459
- if (useBlueprints) return;
492
+ if (this.delegateToBlueprint) return {};
460
493
  return this._configuring();
461
494
  }
462
495
 
463
496
  // Public API method used by the getter and also by Blueprints
464
497
  _composing() {
465
498
  return {
466
- composeEntities() {
499
+ async composeEntities() {
467
500
  // We need to compose with others entities to update relationships.
468
- this.composeWithJHipster(
501
+ await this.composeWithJHipster(
469
502
  GENERATOR_ENTITIES,
470
503
  {
471
504
  entities: this.options.singleEntity ? [this.context.name] : undefined,
@@ -482,7 +515,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
482
515
  }
483
516
 
484
517
  get composing() {
485
- if (useBlueprints) return;
518
+ if (this.delegateToBlueprint) return {};
486
519
  return this._composing();
487
520
  }
488
521
 
@@ -490,13 +523,25 @@ class EntityGenerator extends BaseBlueprintGenerator {
490
523
  _loading() {
491
524
  return {
492
525
  loadEntity() {
526
+ loadRequiredConfigIntoEntity(this.context, this.jhipsterConfig);
493
527
  // Update current context with config from file.
494
528
  Object.assign(this.context, this.entityStorage.getAll());
495
529
  this.loadDerivedAppConfig(this.context);
530
+
531
+ // Entity searchEngine support should opt-in instead of opt-out for gateway/microservice.
532
+ // The entity definition should take precedence so frontend and backend are in sync.
533
+ // Doesn't apply to microfrontends.
534
+ if (
535
+ this.entityConfig.searchEngine === undefined &&
536
+ !this.context.microfrontend &&
537
+ (this.context.applicationTypeMicroservice || (this.entityConfig.microserviceName && this.context.applicationTypeGateway))
538
+ ) {
539
+ this.info(`searchEngine is missing in .jhipster/${this.entityConfig.name}.json, should opt-in for gateway/microservice entities`);
540
+ this.context.searchEngine = false;
541
+ }
496
542
  this.loadDerivedClientConfig(this.context);
497
543
  this.loadDerivedServerConfig(this.context);
498
544
  this.loadDerivedPlatformConfig(this.context);
499
- loadRequiredConfigIntoEntity(this.context, this.jhipsterConfig);
500
545
  if (this.context.fields) {
501
546
  this.context.fields
502
547
  .filter(field => field.options)
@@ -520,22 +565,22 @@ class EntityGenerator extends BaseBlueprintGenerator {
520
565
  this.configOptions.sharedEntities[this.context.name] = this.context;
521
566
  },
522
567
 
523
- composing() {
568
+ async composing() {
524
569
  if (this.options.skipWriting) return;
525
570
  const context = this.context;
526
571
  if (!context.skipServer) {
527
- this.composeWithJHipster(GENERATOR_ENTITY_SERVER, this.arguments, {
572
+ await this.composeWithJHipster(GENERATOR_ENTITY_SERVER, this.arguments, {
528
573
  context,
529
574
  });
530
575
  }
531
576
 
532
577
  if (!context.skipClient || this.jhipsterConfig.applicationType === GATEWAY) {
533
- this.composeWithJHipster(GENERATOR_ENTITY_CLIENT, this.arguments, {
578
+ await this.composeWithJHipster(GENERATOR_ENTITY_CLIENT, this.arguments, {
534
579
  context,
535
580
  skipInstall: this.options.skipInstall,
536
581
  });
537
582
  if (this.jhipsterConfig.enableTranslation) {
538
- this.composeWithJHipster(GENERATOR_ENTITY_I_18_N, this.arguments, {
583
+ await this.composeWithJHipster(GENERATOR_ENTITY_I_18_N, this.arguments, {
539
584
  context,
540
585
  skipInstall: this.options.skipInstall,
541
586
  });
@@ -546,7 +591,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
546
591
  }
547
592
 
548
593
  get loading() {
549
- if (useBlueprints) return;
594
+ if (this.delegateToBlueprint) return {};
550
595
  return this._loading();
551
596
  }
552
597
 
@@ -594,7 +639,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
594
639
  let { entityAbsolutePackage = packageName, entityAbsoluteFolder = packageFolder } = entity;
595
640
  if (entityPackage) {
596
641
  entityAbsolutePackage = [packageName, entityPackage].join('.');
597
- entityAbsoluteFolder = path.join(packageFolder, entityPackage);
642
+ entityAbsoluteFolder = path.join(packageFolder, entityPackage.replace(/\./g, '/'));
598
643
  }
599
644
  entity.entityAbsolutePackage = entityAbsolutePackage;
600
645
  entity.entityAbsoluteFolder = entityAbsoluteFolder;
@@ -604,7 +649,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
604
649
  }
605
650
 
606
651
  get preparingFields() {
607
- if (useBlueprints) return;
652
+ if (this.delegateToBlueprint) return {};
608
653
  return this._preparingFields();
609
654
  }
610
655
 
@@ -630,7 +675,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
630
675
  }
631
676
 
632
677
  get preparing() {
633
- if (useBlueprints) return;
678
+ if (this.delegateToBlueprint) return {};
634
679
  return this._preparing();
635
680
  }
636
681
 
@@ -737,7 +782,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
737
782
  }
738
783
 
739
784
  get preparingRelationships() {
740
- if (useBlueprints) return;
785
+ if (this.delegateToBlueprint) return {};
741
786
  return this._preparingRelationships();
742
787
  }
743
788
 
@@ -752,6 +797,10 @@ class EntityGenerator extends BaseBlueprintGenerator {
752
797
  this.context.user = this.configOptions.sharedEntities.User;
753
798
  },
754
799
 
800
+ loadOtherEntities() {
801
+ this.context.otherEntities = _.uniq(this.context.relationships.map(rel => rel.otherEntity));
802
+ },
803
+
755
804
  processOtherReferences() {
756
805
  this.context.otherReferences = this.context.otherRelationships.map(relationship => relationship.reference);
757
806
  this.context.allReferences
@@ -834,7 +883,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
834
883
  }
835
884
 
836
885
  get default() {
837
- if (useBlueprints) return;
886
+ if (this.delegateToBlueprint) return {};
838
887
  return this._default();
839
888
  }
840
889
 
@@ -860,7 +909,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
860
909
  }
861
910
 
862
911
  get writing() {
863
- if (useBlueprints) return;
912
+ if (this.delegateToBlueprint) return {};
864
913
  return this._writing();
865
914
  }
866
915
 
@@ -890,7 +939,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
890
939
  }
891
940
 
892
941
  get install() {
893
- if (useBlueprints) return;
942
+ if (this.delegateToBlueprint) return {};
894
943
  return this._install();
895
944
  }
896
945
 
@@ -904,7 +953,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
904
953
  }
905
954
 
906
955
  get end() {
907
- if (useBlueprints) return;
956
+ if (this.delegateToBlueprint) return {};
908
957
  return this._end();
909
958
  }
910
959
 
@@ -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
  }
@@ -27,8 +27,7 @@ const {
27
27
  SUPPORTED_CLIENT_FRAMEWORKS: { ANGULAR, REACT },
28
28
  } = require('../generator-constants');
29
29
  const { GENERATOR_ENTITY_CLIENT } = require('../generator-list');
30
-
31
- let useBlueprints;
30
+ const { POSTGRESQL, MARIADB } = require('../../jdl/jhipster/database-types');
32
31
 
33
32
  module.exports = class extends BaseBlueprintGenerator {
34
33
  constructor(args, options, features) {
@@ -36,8 +35,12 @@ module.exports = class extends BaseBlueprintGenerator {
36
35
 
37
36
  this.entity = this.options.context;
38
37
  this.jhipsterContext = this.options.jhipsterContext || this.options.context;
38
+ }
39
39
 
40
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_ENTITY_CLIENT, { context: this.options.context });
40
+ async _postConstruct() {
41
+ if (!this.fromBlueprint) {
42
+ await this.composeWithBlueprints(GENERATOR_ENTITY_CLIENT, { context: this.options.context });
43
+ }
41
44
  }
42
45
 
43
46
  // Public API method used by the getter and also by Blueprints
@@ -50,7 +53,7 @@ module.exports = class extends BaseBlueprintGenerator {
50
53
  }
51
54
 
52
55
  get preparing() {
53
- if (useBlueprints) return;
56
+ if (this.delegateToBlueprint) return {};
54
57
  return this._preparing();
55
58
  }
56
59
 
@@ -68,11 +71,22 @@ module.exports = class extends BaseBlueprintGenerator {
68
71
  this.tsKeyType = this.getTypescriptKeyType(this.primaryKey.type);
69
72
  }
70
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
+ },
71
85
  };
72
86
  }
73
87
 
74
88
  get default() {
75
- if (useBlueprints) return;
89
+ if (this.delegateToBlueprint) return {};
76
90
  return this._default();
77
91
  }
78
92
 
@@ -131,7 +145,7 @@ module.exports = class extends BaseBlueprintGenerator {
131
145
  }
132
146
 
133
147
  get writing() {
134
- if (useBlueprints) return;
148
+ if (this.delegateToBlueprint) return {};
135
149
  return this._writing();
136
150
  }
137
151
 
@@ -143,18 +157,14 @@ module.exports = class extends BaseBlueprintGenerator {
143
157
  },
144
158
 
145
159
  replaceTranslations() {
146
- if (
147
- this.skipClient ||
148
- (this.jhipsterConfig.microfrontend && this.jhipsterConfig.applicationType === 'gateway' && this.microserviceName)
149
- )
150
- return undefined;
160
+ if (this.skipClient || (this.microfrontend && this.applicationTypeGateway && this.microserviceName)) return undefined;
151
161
  return replaceTranslations.call(this);
152
162
  },
153
163
  };
154
164
  }
155
165
 
156
166
  get postWriting() {
157
- if (useBlueprints) return;
167
+ if (this.delegateToBlueprint) return {};
158
168
  return this._postWriting();
159
169
  }
160
170