generator-jhipster 7.3.1 → 7.4.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.
- package/cli/jhipster-command.js +2 -2
- package/cli/program.js +31 -29
- package/generators/app/index.js +30 -25
- package/generators/aws/index.js +8 -8
- package/generators/aws/lib/eb.js +1 -1
- package/generators/azure-app-service/index.js +13 -9
- package/generators/azure-spring-cloud/index.js +13 -9
- package/generators/bootstrap/index.js +49 -59
- package/generators/ci-cd/index.js +10 -8
- package/generators/client/files-common.js +6 -2
- package/generators/client/files-react.js +10 -1
- package/generators/client/files-vue.js +40 -1
- package/generators/client/index.js +42 -31
- package/generators/client/needle-api/needle-client-vue.js +1 -1
- package/generators/client/templates/angular/.eslintrc.json.ejs +1 -0
- package/generators/client/templates/angular/package.json +14 -14
- package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.component.html.ejs +2 -2
- package/generators/client/templates/common/package.json +3 -3
- package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +56 -0
- package/generators/client/templates/react/.eslintrc.json.ejs +1 -0
- package/generators/client/templates/react/package.json +44 -43
- package/generators/client/templates/react/package.json.ejs +3 -0
- package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +0 -3
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/gateway/gateway.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +6 -6
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +8 -8
- package/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +3 -3
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +7 -7
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-components.tsx.ejs +1 -1
- package/generators/client/templates/react/webpack/webpack.dev.js.ejs +17 -1
- package/generators/client/templates/react/webpack/webpack.prod.js.ejs +13 -1
- package/generators/client/templates/vue/.eslintrc.js.ejs +8 -5
- package/generators/client/templates/vue/package.json +31 -38
- package/generators/client/templates/vue/package.json.ejs +8 -10
- package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +1 -2
- package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs +7 -1
- package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.vue.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +12 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +6 -0
- package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +41 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs +34 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.vue.ejs +13 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +12 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities.vue.ejs +5 -0
- package/generators/client/templates/vue/src/main/webapp/app/index.ts.ejs +19 -0
- package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs +25 -8
- package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +9 -4
- package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +44 -1
- package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +11 -0
- package/generators/client/templates/vue/src/main/webapp/app/shims-vue.d.ts.ejs +0 -10
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +19 -8
- package/generators/client/templates/vue/src/test/javascript/spec/app/entities/entities-menu.spec.ts.ejs +52 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.component.ts.ejs +4 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.vue.ejs +7 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-router.ts.ejs +1 -0
- package/generators/client/templates/vue/tsconfig.json.ejs +5 -9
- package/generators/client/templates/vue/tsconfig.spec.json.ejs +37 -0
- package/generators/client/templates/vue/webpack/config.js.ejs +2 -0
- package/generators/client/templates/vue/webpack/vue.utils.js.ejs +13 -12
- package/generators/client/templates/vue/webpack/webpack.common.js.ejs +64 -50
- package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +17 -68
- package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +77 -0
- package/generators/client/templates/vue/webpack/webpack.prod.js.ejs +1 -30
- package/generators/cloudfoundry/index.js +9 -9
- package/generators/common/index.js +12 -10
- package/generators/common/templates/package.json +4 -4
- package/generators/cypress/index.js +12 -9
- package/generators/cypress/templates/cypress.json.ejs +3 -0
- package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +3 -3
- package/generators/cypress/templates/src/test/javascript/cypress/support/entity.ts.ejs +2 -2
- package/generators/database-changelog/index.js +33 -22
- package/generators/database-changelog-liquibase/index.js +12 -8
- package/generators/docker-compose/index.js +11 -12
- package/generators/entities/index.js +35 -26
- package/generators/entities-client/index.js +10 -7
- package/generators/entity/index.js +25 -28
- package/generators/entity-client/files.js +6 -11
- package/generators/entity-client/index.js +9 -7
- package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +4 -4
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +1 -1
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +7 -7
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -1
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs +2 -6
- package/generators/entity-i18n/index.js +7 -4
- package/generators/entity-server/index.js +11 -8
- package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +39 -41
- package/generators/gae/index.js +10 -10
- package/generators/generator-base-blueprint.js +7 -44
- package/generators/generator-base.js +7 -0
- package/generators/generator-constants.js +20 -18
- package/generators/generator-transforms.js +27 -23
- package/generators/heroku/index.js +12 -10
- package/generators/init/constants.cjs +1 -1
- package/generators/kubernetes/files.js +3 -0
- package/generators/kubernetes/index.js +10 -10
- package/generators/kubernetes/templates/db/couchbase.yml.ejs +1 -1
- package/generators/kubernetes/templates/deployment.yml.ejs +8 -3
- package/generators/kubernetes/templates/istio/destination-rule.yml.ejs +1 -1
- package/generators/kubernetes/templates/istio/gateway/grafana-gateway.yml.ejs +5 -2
- package/generators/kubernetes/templates/istio/gateway/jhipster-grafana-gateway.yml.ejs +5 -2
- package/generators/kubernetes/templates/istio/gateway/kiali-gateway.yml.ejs +10 -8
- package/generators/kubernetes/templates/istio/gateway/zipkin-gateway.yml.ejs +5 -2
- package/generators/kubernetes/templates/istio/gateway.yml.ejs +7 -5
- package/generators/kubernetes/templates/secret/couchbase-secret.yml.ejs +9 -0
- package/generators/kubernetes-base.js +1 -0
- package/generators/kubernetes-helm/files.js +3 -8
- package/generators/kubernetes-helm/index.js +10 -10
- package/generators/kubernetes-helm/templates/README-KUBERNETES-HELM.md.ejs +0 -1
- package/generators/kubernetes-helm/templates/app/Chart.yml.ejs +5 -0
- package/generators/kubernetes-helm/templates/app/helpers.tpl.ejs +0 -11
- package/generators/kubernetes-helm/templates/app/requirements.yml.ejs +5 -0
- package/generators/kubernetes-helm/templates/app/values.yml.ejs +68 -5
- package/generators/kubernetes-helm/templates/csvc/Chart.yml.ejs +1 -1
- package/generators/kubernetes-helm/templates/csvc/requirements.yml.ejs +1 -1
- package/generators/kubernetes-knative/index.js +10 -10
- package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +6 -4
- package/generators/kubernetes-knative/templates/service.yml.ejs +1 -1
- package/generators/languages/index.js +13 -13
- package/generators/openapi-client/index.js +13 -10
- package/generators/openshift/index.js +10 -11
- package/generators/openshift/templates/deployment.yml.ejs +1 -1
- package/generators/page/index.js +12 -10
- package/generators/server/__snapshots__/generator.spec.mjs.snap +12 -0
- package/generators/server/files.js +12 -0
- package/generators/server/index.js +32 -18
- package/generators/server/templates/gradle.properties.ejs +10 -10
- package/generators/server/templates/pom.xml.ejs +6 -6
- package/generators/server/templates/src/main/docker/app.yml.ejs +1 -1
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +2 -2
- package/generators/server/templates/src/main/java/package/config/WebConfigurer.java.ejs +0 -1
- package/generators/server/templates/src/main/java/package/management/SecurityMetersService.java.ejs +68 -0
- package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +29 -4
- package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +21 -9
- package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +13 -5
- package/generators/server/templates/src/main/resources/static/microservices_index.html.ejs +1 -1
- package/generators/server/templates/src/test/java/package/management/SecurityMetersServiceTests.java.ejs +113 -0
- package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +6 -1
- package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderSecurityMetersTests.java.ejs +198 -0
- package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderTest.java.ejs +13 -3
- package/generators/server/templates/src/test/java/package/security/oauth2/AuthorizationHeaderUtilTest.java.ejs +16 -2
- package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +63 -0
- package/generators/spring-controller/index.js +9 -7
- package/generators/spring-service/index.js +10 -7
- package/generators/upgrade/index.js +3 -4
- package/generators/utils.js +2 -2
- package/generators/workspaces/index.js +16 -7
- package/jdl/jhipster/default-application-options.js +9 -7
- package/package.json +15 -15
- package/utils/entity.js +14 -0
- package/utils/multi-step-transform/index.js +8 -8
|
@@ -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
|
-
|
|
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
|
-
|
|
173
|
-
|
|
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
|
|
@@ -304,7 +301,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
304
301
|
}
|
|
305
302
|
|
|
306
303
|
get initializing() {
|
|
307
|
-
if (
|
|
304
|
+
if (this.delegateToBlueprint) return {};
|
|
308
305
|
return this._initializing();
|
|
309
306
|
}
|
|
310
307
|
|
|
@@ -326,7 +323,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
326
323
|
}
|
|
327
324
|
|
|
328
325
|
get prompting() {
|
|
329
|
-
if (
|
|
326
|
+
if (this.delegateToBlueprint) return {};
|
|
330
327
|
return this._prompting();
|
|
331
328
|
}
|
|
332
329
|
|
|
@@ -456,16 +453,16 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
456
453
|
}
|
|
457
454
|
|
|
458
455
|
get configuring() {
|
|
459
|
-
if (
|
|
456
|
+
if (this.delegateToBlueprint) return {};
|
|
460
457
|
return this._configuring();
|
|
461
458
|
}
|
|
462
459
|
|
|
463
460
|
// Public API method used by the getter and also by Blueprints
|
|
464
461
|
_composing() {
|
|
465
462
|
return {
|
|
466
|
-
composeEntities() {
|
|
463
|
+
async composeEntities() {
|
|
467
464
|
// We need to compose with others entities to update relationships.
|
|
468
|
-
this.composeWithJHipster(
|
|
465
|
+
await this.composeWithJHipster(
|
|
469
466
|
GENERATOR_ENTITIES,
|
|
470
467
|
{
|
|
471
468
|
entities: this.options.singleEntity ? [this.context.name] : undefined,
|
|
@@ -482,7 +479,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
482
479
|
}
|
|
483
480
|
|
|
484
481
|
get composing() {
|
|
485
|
-
if (
|
|
482
|
+
if (this.delegateToBlueprint) return {};
|
|
486
483
|
return this._composing();
|
|
487
484
|
}
|
|
488
485
|
|
|
@@ -520,22 +517,22 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
520
517
|
this.configOptions.sharedEntities[this.context.name] = this.context;
|
|
521
518
|
},
|
|
522
519
|
|
|
523
|
-
composing() {
|
|
520
|
+
async composing() {
|
|
524
521
|
if (this.options.skipWriting) return;
|
|
525
522
|
const context = this.context;
|
|
526
523
|
if (!context.skipServer) {
|
|
527
|
-
this.composeWithJHipster(GENERATOR_ENTITY_SERVER, this.arguments, {
|
|
524
|
+
await this.composeWithJHipster(GENERATOR_ENTITY_SERVER, this.arguments, {
|
|
528
525
|
context,
|
|
529
526
|
});
|
|
530
527
|
}
|
|
531
528
|
|
|
532
529
|
if (!context.skipClient || this.jhipsterConfig.applicationType === GATEWAY) {
|
|
533
|
-
this.composeWithJHipster(GENERATOR_ENTITY_CLIENT, this.arguments, {
|
|
530
|
+
await this.composeWithJHipster(GENERATOR_ENTITY_CLIENT, this.arguments, {
|
|
534
531
|
context,
|
|
535
532
|
skipInstall: this.options.skipInstall,
|
|
536
533
|
});
|
|
537
534
|
if (this.jhipsterConfig.enableTranslation) {
|
|
538
|
-
this.composeWithJHipster(GENERATOR_ENTITY_I_18_N, this.arguments, {
|
|
535
|
+
await this.composeWithJHipster(GENERATOR_ENTITY_I_18_N, this.arguments, {
|
|
539
536
|
context,
|
|
540
537
|
skipInstall: this.options.skipInstall,
|
|
541
538
|
});
|
|
@@ -546,7 +543,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
546
543
|
}
|
|
547
544
|
|
|
548
545
|
get loading() {
|
|
549
|
-
if (
|
|
546
|
+
if (this.delegateToBlueprint) return {};
|
|
550
547
|
return this._loading();
|
|
551
548
|
}
|
|
552
549
|
|
|
@@ -604,7 +601,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
604
601
|
}
|
|
605
602
|
|
|
606
603
|
get preparingFields() {
|
|
607
|
-
if (
|
|
604
|
+
if (this.delegateToBlueprint) return {};
|
|
608
605
|
return this._preparingFields();
|
|
609
606
|
}
|
|
610
607
|
|
|
@@ -630,7 +627,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
630
627
|
}
|
|
631
628
|
|
|
632
629
|
get preparing() {
|
|
633
|
-
if (
|
|
630
|
+
if (this.delegateToBlueprint) return {};
|
|
634
631
|
return this._preparing();
|
|
635
632
|
}
|
|
636
633
|
|
|
@@ -737,7 +734,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
737
734
|
}
|
|
738
735
|
|
|
739
736
|
get preparingRelationships() {
|
|
740
|
-
if (
|
|
737
|
+
if (this.delegateToBlueprint) return {};
|
|
741
738
|
return this._preparingRelationships();
|
|
742
739
|
}
|
|
743
740
|
|
|
@@ -838,7 +835,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
838
835
|
}
|
|
839
836
|
|
|
840
837
|
get default() {
|
|
841
|
-
if (
|
|
838
|
+
if (this.delegateToBlueprint) return {};
|
|
842
839
|
return this._default();
|
|
843
840
|
}
|
|
844
841
|
|
|
@@ -864,7 +861,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
864
861
|
}
|
|
865
862
|
|
|
866
863
|
get writing() {
|
|
867
|
-
if (
|
|
864
|
+
if (this.delegateToBlueprint) return {};
|
|
868
865
|
return this._writing();
|
|
869
866
|
}
|
|
870
867
|
|
|
@@ -894,7 +891,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
894
891
|
}
|
|
895
892
|
|
|
896
893
|
get install() {
|
|
897
|
-
if (
|
|
894
|
+
if (this.delegateToBlueprint) return {};
|
|
898
895
|
return this._install();
|
|
899
896
|
}
|
|
900
897
|
|
|
@@ -908,7 +905,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
908
905
|
}
|
|
909
906
|
|
|
910
907
|
get end() {
|
|
911
|
-
if (
|
|
908
|
+
if (this.delegateToBlueprint) return {};
|
|
912
909
|
return this._end();
|
|
913
910
|
}
|
|
914
911
|
|
|
@@ -478,7 +478,7 @@ function writeFiles() {
|
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
function addToMenu() {
|
|
481
|
-
if (this.skipClient) return;
|
|
481
|
+
if (this.skipClient || this.clientFrameworkVue) return;
|
|
482
482
|
|
|
483
483
|
if (!this.embedded) {
|
|
484
484
|
this.addEntityToModule();
|
|
@@ -494,17 +494,12 @@ function addToMenu() {
|
|
|
494
494
|
|
|
495
495
|
function replaceTranslations() {
|
|
496
496
|
if (this.clientFramework === VUE && !this.enableTranslation) {
|
|
497
|
+
utils.vueReplaceTranslation(this, [
|
|
498
|
+
`app/entities/${this.entityFolderName}/${this.entityFileName}.vue`,
|
|
499
|
+
`app/entities/${this.entityFolderName}/${this.entityFileName}-details.vue`,
|
|
500
|
+
]);
|
|
497
501
|
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
|
-
]);
|
|
502
|
+
utils.vueReplaceTranslation(this, [`app/entities/${this.entityFolderName}/${this.entityFileName}-update.vue`]);
|
|
508
503
|
}
|
|
509
504
|
}
|
|
510
505
|
}
|
|
@@ -29,16 +29,18 @@ const {
|
|
|
29
29
|
const { GENERATOR_ENTITY_CLIENT } = require('../generator-list');
|
|
30
30
|
const { POSTGRESQL, MARIADB } = require('../../jdl/jhipster/database-types');
|
|
31
31
|
|
|
32
|
-
let useBlueprints;
|
|
33
|
-
|
|
34
32
|
module.exports = class extends BaseBlueprintGenerator {
|
|
35
33
|
constructor(args, options, features) {
|
|
36
34
|
super(args, options, features);
|
|
37
35
|
|
|
38
36
|
this.entity = this.options.context;
|
|
39
37
|
this.jhipsterContext = this.options.jhipsterContext || this.options.context;
|
|
38
|
+
}
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
async _postConstruct() {
|
|
41
|
+
if (!this.fromBlueprint) {
|
|
42
|
+
await this.composeWithBlueprints(GENERATOR_ENTITY_CLIENT, { context: this.options.context });
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
// Public API method used by the getter and also by Blueprints
|
|
@@ -51,7 +53,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
get preparing() {
|
|
54
|
-
if (
|
|
56
|
+
if (this.delegateToBlueprint) return {};
|
|
55
57
|
return this._preparing();
|
|
56
58
|
}
|
|
57
59
|
|
|
@@ -84,7 +86,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
get default() {
|
|
87
|
-
if (
|
|
89
|
+
if (this.delegateToBlueprint) return {};
|
|
88
90
|
return this._default();
|
|
89
91
|
}
|
|
90
92
|
|
|
@@ -143,7 +145,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
get writing() {
|
|
146
|
-
if (
|
|
148
|
+
if (this.delegateToBlueprint) return {};
|
|
147
149
|
return this._writing();
|
|
148
150
|
}
|
|
149
151
|
|
|
@@ -166,7 +168,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
get postWriting() {
|
|
169
|
-
if (
|
|
171
|
+
if (this.delegateToBlueprint) return {};
|
|
170
172
|
return this._postWriting();
|
|
171
173
|
}
|
|
172
174
|
|
|
@@ -40,8 +40,8 @@ _%>
|
|
|
40
40
|
|
|
41
41
|
describe('<%= entityClass %> e2e test', () => {
|
|
42
42
|
|
|
43
|
-
const <%= entityInstance %>PageUrl = '/<%=
|
|
44
|
-
const <%= entityInstance %>PageUrlPattern = new RegExp('/<%=
|
|
43
|
+
const <%= entityInstance %>PageUrl = '/<%= entityPage %>';
|
|
44
|
+
const <%= entityInstance %>PageUrlPattern = new RegExp('/<%= entityPage %>(\\?.*)?$');
|
|
45
45
|
const username = Cypress.env('E2E_USERNAME') ?? 'admin';
|
|
46
46
|
const password = Cypress.env('E2E_PASSWORD') ?? 'admin';
|
|
47
47
|
const <%= entityInstance %>Sample = <%- JSON.stringify(generateTestEntity(sampleFields.map(field => field.reference))) %>;
|
|
@@ -164,7 +164,7 @@ describe('<%= entityClass %> e2e test', () => {
|
|
|
164
164
|
|
|
165
165
|
it('<%= entityClassPlural %> menu should load <%= entityClassPlural %> page', () => {
|
|
166
166
|
cy.visit('/');
|
|
167
|
-
cy.clickOnEntityMenuItem('<%=
|
|
167
|
+
cy.clickOnEntityMenuItem('<%= entityPage %>');
|
|
168
168
|
cy.wait('@entitiesRequest').then(({ response }) => {
|
|
169
169
|
if (response!.body.length === 0) {
|
|
170
170
|
cy.get(entityTableSelector).should('not.exist');
|
|
@@ -186,7 +186,7 @@ describe('<%= entityClass %> e2e test', () => {
|
|
|
186
186
|
|
|
187
187
|
it('should load create <%= entityClass %> page', () => {
|
|
188
188
|
cy.get(entityCreateButtonSelector).click({force: true});
|
|
189
|
-
cy.url().should('match', new RegExp('/<%=
|
|
189
|
+
cy.url().should('match', new RegExp('/<%= entityPage %>/new$'));
|
|
190
190
|
cy.getEntityCreateUpdateHeading('<%= entityClass %>');
|
|
191
191
|
cy.get(entityCreateSaveButtonSelector).should('exist');
|
|
192
192
|
cy.get(entityCreateCancelButtonSelector).click({force: true});
|
package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs
CHANGED
|
@@ -278,7 +278,7 @@ _%>
|
|
|
278
278
|
{<%= _.lowerFirst(fieldType) %>Values.map(<%= _.lowerFirst(fieldType) %> => (
|
|
279
279
|
<option value={<%= _.lowerFirst(fieldType) %>} key={<%= _.lowerFirst(fieldType) %>}>
|
|
280
280
|
<%_ if (enableTranslation) { _%>
|
|
281
|
-
{translate("<%= enumPrefix
|
|
281
|
+
{translate("<%= enumPrefix %>."+<%= _.lowerFirst(fieldType) %>)}
|
|
282
282
|
<%_ } else { _%>
|
|
283
283
|
{<%= _.lowerFirst(fieldType) %>}
|
|
284
284
|
<%_ } _%>
|
package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs
CHANGED
|
@@ -21,7 +21,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
21
21
|
import InfiniteScroll from 'react-infinite-scroller';
|
|
22
22
|
<%_ } _%>
|
|
23
23
|
import { Link, RouteComponentProps } from 'react-router-dom';
|
|
24
|
-
import { Button, <% if (searchEngine) { %>Input, InputGroup, FormGroup, Form
|
|
24
|
+
import { Button, <% if (searchEngine) { %>Input, InputGroup, FormGroup, Form, Row, Col, <% } %>Table } from 'reactstrap';
|
|
25
25
|
import {
|
|
26
26
|
<%_ if (blobFields.length > 0) { _%>
|
|
27
27
|
<%_ if (fieldsContainBlobOrImage) { _%>
|
|
@@ -289,7 +289,7 @@ export const <%= entityReactName %> = (props: RouteComponentProps<{url: string}>
|
|
|
289
289
|
<h2 id="<%= entityFileName %>-heading" data-cy="<%= entityClass %>Heading">
|
|
290
290
|
<Translate contentKey="<%= i18nKeyPrefix %>.home.title"><%= entityClassPluralHumanized %></Translate>
|
|
291
291
|
<div className="d-flex justify-content-end">
|
|
292
|
-
<Button className="
|
|
292
|
+
<Button className="me-2" color="info" onClick={handleSyncList} disabled={loading}>
|
|
293
293
|
<FontAwesomeIcon icon="sync" spin={loading} /> <Translate contentKey="<%= i18nKeyPrefix %>.home.refreshListLabel">Refresh List</Translate>
|
|
294
294
|
</Button>
|
|
295
295
|
<%_ if (!readOnly) { _%>
|
|
@@ -446,7 +446,7 @@ _%>
|
|
|
446
446
|
</td>
|
|
447
447
|
<%_ } _%>
|
|
448
448
|
<%_ } _%>
|
|
449
|
-
<td className="text-
|
|
449
|
+
<td className="text-end">
|
|
450
450
|
<div className="btn-group flex-btn-group-container">
|
|
451
451
|
<Button tag={Link} to={`${match.url}/${<%= entityInstance %>.<%= primaryKey.name %>}`} color="info" size="sm" data-cy="entityDetailsButton">
|
|
452
452
|
<FontAwesomeIcon icon="eye" /> <span className="d-none d-md-inline" ><Translate contentKey="entity.action.view">View</Translate></span>
|
|
@@ -481,15 +481,15 @@ _%>
|
|
|
481
481
|
<%_ if (!databaseTypeCassandra) { _%>
|
|
482
482
|
<%_ if (paginationPagination) { _%>
|
|
483
483
|
{ totalItems ? (<div className={ <%= entityInstance %>List && <%= entityInstance %>List.length > 0 ? '' : 'd-none' }>
|
|
484
|
-
<
|
|
484
|
+
<div className="justify-content-center d-flex">
|
|
485
485
|
<JhiItemCount
|
|
486
486
|
page={paginationState.activePage}
|
|
487
487
|
total={totalItems}
|
|
488
488
|
itemsPerPage={paginationState.itemsPerPage}
|
|
489
489
|
<% { if (enableTranslation) { %>i18nEnabled<% }} %>
|
|
490
490
|
/>
|
|
491
|
-
</
|
|
492
|
-
<
|
|
491
|
+
</div>
|
|
492
|
+
<div className="justify-content-center d-flex">
|
|
493
493
|
<JhiPagination
|
|
494
494
|
activePage={paginationState.activePage}
|
|
495
495
|
onSelect={handlePagination}
|
|
@@ -497,7 +497,7 @@ _%>
|
|
|
497
497
|
itemsPerPage={paginationState.itemsPerPage}
|
|
498
498
|
totalItems={totalItems}
|
|
499
499
|
/>
|
|
500
|
-
</
|
|
500
|
+
</div>
|
|
501
501
|
</div>) : '' }
|
|
502
502
|
<% } _%>
|
|
503
503
|
<%_ } _%>
|
package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
<%_ if (fieldsContainBlob || paginationInfiniteScroll) { -%>
|
|
1
2
|
import { mixins } from 'vue-class-component';
|
|
2
|
-
|
|
3
|
+
<%_ } -%>
|
|
3
4
|
import { Component, Vue, Inject } from 'vue-property-decorator';
|
|
4
5
|
import Vue2Filters from 'vue2-filters';
|
|
5
6
|
import { I<%= entityAngularName %> } from '@/shared/model/<%= entityModelFileName %>.model';
|
package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs
CHANGED
|
@@ -4,13 +4,9 @@ import buildPaginationQueryOpts from '@/shared/sort/sorts';
|
|
|
4
4
|
<% } %>
|
|
5
5
|
import { I<%= entityAngularName %> } from '@/shared/model/<%= entityModelFileName %>.model';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
const baseApi = (applicationTypeGateway && locals.microserviceName) ? 'services/' + microserviceName.toLowerCase() + '/api/' : 'api/';
|
|
9
|
-
_%>
|
|
10
|
-
|
|
11
|
-
const baseApiUrl = '<%= baseApi + entityApiUrl %>';
|
|
7
|
+
const baseApiUrl = '<%= entityApi %>api/<%= entityApiUrl %>';
|
|
12
8
|
<%_ if (searchEngine) { _%>
|
|
13
|
-
const baseSearchApiUrl = '<%=
|
|
9
|
+
const baseSearchApiUrl = '<%= entityApi %>api/_search/<%= entityApiUrl %>?query=';
|
|
14
10
|
<%_ } _%>
|
|
15
11
|
|
|
16
12
|
export default class <%= entityAngularName %>Service {
|
|
@@ -23,7 +23,6 @@ const { GENERATOR_ENTITY_I_18_N } = require('../generator-list');
|
|
|
23
23
|
const BaseBlueprintGenerator = require('../generator-base-blueprint');
|
|
24
24
|
|
|
25
25
|
/* constants used throughout */
|
|
26
|
-
let useBlueprints;
|
|
27
26
|
|
|
28
27
|
module.exports = class extends BaseBlueprintGenerator {
|
|
29
28
|
constructor(args, options, features) {
|
|
@@ -31,8 +30,12 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
31
30
|
|
|
32
31
|
this.entity = this.options.context;
|
|
33
32
|
this.jhipsterContext = this.options.jhipsterContext || this.options.context;
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
async _postConstruct() {
|
|
36
|
+
if (!this.fromBlueprint) {
|
|
37
|
+
await this.composeWithBlueprints(GENERATOR_ENTITY_I_18_N, { context: this.options.context });
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
// Public API method used by the getter and also by Blueprints
|
|
@@ -47,7 +50,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
get default() {
|
|
50
|
-
if (
|
|
53
|
+
if (this.delegateToBlueprint) return {};
|
|
51
54
|
return this._default();
|
|
52
55
|
}
|
|
53
56
|
|
|
@@ -57,7 +60,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
get writing() {
|
|
60
|
-
if (
|
|
63
|
+
if (this.delegateToBlueprint) return {};
|
|
61
64
|
return this._writing();
|
|
62
65
|
}
|
|
63
66
|
};
|
|
@@ -27,7 +27,6 @@ const { SQL } = require('../../jdl/jhipster/database-types');
|
|
|
27
27
|
const { isReservedTableName } = require('../../jdl/jhipster/reserved-keywords');
|
|
28
28
|
|
|
29
29
|
/* constants used throughout */
|
|
30
|
-
let useBlueprints;
|
|
31
30
|
|
|
32
31
|
module.exports = class extends BaseBlueprintGenerator {
|
|
33
32
|
constructor(args, options, features) {
|
|
@@ -36,8 +35,12 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
36
35
|
this.entity = this.options.context;
|
|
37
36
|
|
|
38
37
|
this.jhipsterContext = this.options.jhipsterContext || this.options.context;
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
async _postConstruct() {
|
|
41
|
+
if (!this.fromBlueprint) {
|
|
42
|
+
await this.composeWithBlueprints(GENERATOR_ENTITY_SERVER, { context: this.options.context });
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
// Public API method used by the getter and also by Blueprints
|
|
@@ -51,7 +54,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
get initializing() {
|
|
54
|
-
if (
|
|
57
|
+
if (this.delegateToBlueprint) return {};
|
|
55
58
|
return this._initializing();
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -69,7 +72,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
get preparing() {
|
|
72
|
-
if (
|
|
75
|
+
if (this.delegateToBlueprint) return {};
|
|
73
76
|
return this._preparing();
|
|
74
77
|
}
|
|
75
78
|
|
|
@@ -98,7 +101,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
get preparingFields() {
|
|
101
|
-
if (
|
|
104
|
+
if (this.delegateToBlueprint) return {};
|
|
102
105
|
return this._preparingFields();
|
|
103
106
|
}
|
|
104
107
|
|
|
@@ -165,7 +168,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
get default() {
|
|
168
|
-
if (
|
|
171
|
+
if (this.delegateToBlueprint) return {};
|
|
169
172
|
return this._default();
|
|
170
173
|
}
|
|
171
174
|
|
|
@@ -178,7 +181,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
get writing() {
|
|
181
|
-
if (
|
|
184
|
+
if (this.delegateToBlueprint) return {};
|
|
182
185
|
return this._writing();
|
|
183
186
|
}
|
|
184
187
|
|
|
@@ -192,7 +195,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
get postWriting() {
|
|
195
|
-
if (
|
|
198
|
+
if (this.delegateToBlueprint) return {};
|
|
196
199
|
return this._postWriting();
|
|
197
200
|
}
|
|
198
201
|
|
package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs
CHANGED
|
@@ -20,14 +20,6 @@ package <%= entityAbsolutePackage %>.web.rest;
|
|
|
20
20
|
|
|
21
21
|
<%_
|
|
22
22
|
const viaService = !serviceNo;
|
|
23
|
-
|
|
24
|
-
let manyToManyWithUser = false;
|
|
25
|
-
for (const relationship of relationships) {
|
|
26
|
-
if (relationship.otherEntityUser && relationship.relationshipManyToMany) {
|
|
27
|
-
manyToManyWithUser = true;
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
23
|
_%>
|
|
32
24
|
<%_ if (!dtoMapstruct || serviceNo) { _%>
|
|
33
25
|
import <%= entityAbsolutePackage %>.domain.<%= persistClass %>;
|
|
@@ -177,17 +169,19 @@ public class <%= entityClass %>Resource {
|
|
|
177
169
|
throw new BadRequestAlertException("A new <%= entityInstance %> cannot already have an ID", ENTITY_NAME, "idexists");
|
|
178
170
|
}
|
|
179
171
|
<%_ if (saveUserSnapshot) { _%>
|
|
180
|
-
<%
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
172
|
+
<% for (const userRelationship of relationships.filter(rel => rel.otherEntity.builtInUser)) { %>
|
|
173
|
+
<%_ if (userRelationship.collection) { _%>
|
|
174
|
+
if (<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalizedPlural %>() != null) {
|
|
175
|
+
// Save users in case they are new and only exist in gateway
|
|
176
|
+
userRepository.saveAll(<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalizedPlural %>());
|
|
177
|
+
}
|
|
178
|
+
<%_ } else { _%>
|
|
179
|
+
if (<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalized %>() != null) {
|
|
180
|
+
// Save user in case it's new and only exists in gateway
|
|
181
|
+
userRepository.save(<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalized %>());
|
|
182
|
+
}
|
|
183
|
+
<%_ } _%>
|
|
184
|
+
<% } %>
|
|
191
185
|
<%_ } _%>
|
|
192
186
|
<%_ for (field of primaryKey.fields.filter(f => f.autoGenerateByService)) { _%>
|
|
193
187
|
<%= instanceName %>.set<%= field.fieldNameCapitalized %>(UUID.randomUUID());
|
|
@@ -245,17 +239,19 @@ public class <%= entityClass %>Resource {
|
|
|
245
239
|
<%_ } _%>
|
|
246
240
|
|
|
247
241
|
<%_ if (saveUserSnapshot) { _%>
|
|
248
|
-
<%
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
242
|
+
<% for (const userRelationship of relationships.filter(rel => rel.otherEntity.builtInUser)) { %>
|
|
243
|
+
<%_ if (userRelationship.collection) { _%>
|
|
244
|
+
if (<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalizedPlural %>() != null) {
|
|
245
|
+
// Save users in case they are new and only exist in gateway
|
|
246
|
+
userRepository.saveAll(<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalizedPlural %>());
|
|
247
|
+
}
|
|
248
|
+
<%_ } else { _%>
|
|
249
|
+
if (<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalized %>() != null) {
|
|
250
|
+
// Save user in case it's new and only exists in gateway
|
|
251
|
+
userRepository.save(<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalized %>());
|
|
252
|
+
}
|
|
253
|
+
<%_ } _%>
|
|
254
|
+
<% } %>
|
|
259
255
|
<%_ } _%>
|
|
260
256
|
<%- include('/partials/save_template', {asEntity, asDto, viaService: viaService, returnDirectly: false, isUsingMapsId: false, mapsIdAssoc: mapsIdAssoc}); -%>
|
|
261
257
|
<%_ if (!reactive) { _%>
|
|
@@ -308,17 +304,19 @@ public class <%= entityClass %>Resource {
|
|
|
308
304
|
<%_ } _%>
|
|
309
305
|
|
|
310
306
|
<%_ if (saveUserSnapshot) { _%>
|
|
311
|
-
<%
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
307
|
+
<% for (const userRelationship of relationships.filter(rel => rel.otherEntity.builtInUser)) { %>
|
|
308
|
+
<%_ if (userRelationship.collection) { _%>
|
|
309
|
+
if (<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalizedPlural %>() != null) {
|
|
310
|
+
// Save users in case they are new and only exist in gateway
|
|
311
|
+
userRepository.saveAll(<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalizedPlural %>());
|
|
312
|
+
}
|
|
313
|
+
<%_ } else { _%>
|
|
314
|
+
if (<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalized %>() != null) {
|
|
315
|
+
// Save user in case it's new and only exists in gateway
|
|
316
|
+
userRepository.save(<%= instanceName %>.get<%= userRelationship.relationshipNameCapitalized %>());
|
|
317
|
+
}
|
|
318
|
+
<%_ } _%>
|
|
319
|
+
<% } %>
|
|
322
320
|
<%_ } _%>
|
|
323
321
|
|
|
324
322
|
<%- include('../../common/patch_template', {asEntity, asDto, isService: false, viaService: viaService}); -%>
|