generator-jhipster 7.4.0 → 7.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/import-jdl.js +3 -2
- package/cli/program.js +1 -0
- package/generators/app/index.js +5 -1
- package/generators/bootstrap/index.js +24 -20
- package/generators/client/files-common.js +1 -1
- package/generators/client/files-react.js +3 -1
- package/generators/client/index.js +2 -2
- package/generators/client/needle-api/needle-client-angular.js +1 -1
- package/generators/client/needle-api/needle-client-vue.js +56 -6
- package/generators/client/templates/angular/package.json +7 -7
- package/generators/client/templates/common/package.json +2 -2
- package/generators/client/templates/react/package.json +20 -20
- package/generators/client/templates/react/package.json.ejs +1 -1
- package/generators/client/templates/vue/package.json +13 -13
- package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +3 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +14 -5
- package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +2 -2
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +2 -0
- package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +11 -6
- package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +2 -3
- package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +19 -14
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/spec/app/account/login-form/login-form.component.spec.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management-edit.component.spec.ts.ejs +2 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs +2 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/core/jhi-navbar/jhi-navbar.component.spec.ts.ejs +10 -4
- package/generators/client/templates/vue/tsconfig.json.ejs +1 -1
- package/generators/client/templates/vue/tsconfig.spec.json.ejs +1 -1
- package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +1 -1
- package/generators/common/templates/README.md.jhi.ejs +21 -0
- package/generators/common/templates/package.json +1 -1
- package/generators/cypress/templates/cypress.json.ejs +1 -1
- package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +1 -1
- package/generators/entity/index.js +7 -1
- package/generators/entity-client/files.js +3 -7
- package/generators/entity-client/index.js +1 -5
- package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +9 -3
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +4 -6
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.component.ts.ejs +1 -5
- package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity-update.component.spec.ts.ejs +6 -1
- package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.component.spec.ts.ejs +5 -1
- package/generators/generator-base-blueprint.js +7 -2
- package/generators/generator-base.js +31 -14
- package/generators/generator-constants.js +1 -1
- package/generators/generator-transforms.js +12 -4
- package/generators/languages/templates/src/main/webapp/i18n/vi/login.json +1 -1
- package/generators/server/index.js +9 -1
- package/generators/server/templates/src/main/resources/config/application.yml.ejs +5 -5
- package/generators/upgrade/index.js +1 -1
- package/package.json +7 -7
- package/generators/client/templates/react/.npmrc.ejs +0 -1
package/cli/import-jdl.js
CHANGED
|
@@ -158,6 +158,7 @@ function runGenerator(command, { cwd, fork, env }, generatorOptions = {}) {
|
|
|
158
158
|
forceNoFiltering: undefined,
|
|
159
159
|
unidirectionalRelationships: undefined,
|
|
160
160
|
localConfigOnly: undefined,
|
|
161
|
+
commandName: undefined,
|
|
161
162
|
fromJdl: true,
|
|
162
163
|
};
|
|
163
164
|
|
|
@@ -432,8 +433,8 @@ class JDLProcessor {
|
|
|
432
433
|
applicationWithEntities.config.applications = Object.fromEntries(
|
|
433
434
|
relatedApplications.map(([baseName, config]) => {
|
|
434
435
|
config.gatewayServerPort = gatewayServerPort;
|
|
435
|
-
const { serverPort, applicationIndex, devServerPort } = config;
|
|
436
|
-
return [baseName, { serverPort, applicationIndex, devServerPort }];
|
|
436
|
+
const { clientFramework, serverPort, applicationIndex, devServerPort } = config;
|
|
437
|
+
return [baseName, { clientFramework, serverPort, applicationIndex, devServerPort }];
|
|
437
438
|
})
|
|
438
439
|
);
|
|
439
440
|
}
|
package/cli/program.js
CHANGED
package/generators/app/index.js
CHANGED
|
@@ -29,6 +29,7 @@ const { GENERATOR_APP } = require('../generator-list');
|
|
|
29
29
|
const { JHIPSTER_CONFIG_DIR, GENERATOR_JHIPSTER } = require('../generator-constants');
|
|
30
30
|
const { MICROSERVICE } = require('../../jdl/jhipster/application-types');
|
|
31
31
|
const { OptionNames } = require('../../jdl/jhipster/application-options');
|
|
32
|
+
const { NO: CLIENT_FRAMEWORK_NO } = require('../../jdl/jhipster/client-framework-types');
|
|
32
33
|
|
|
33
34
|
const { JHI_PREFIX, BASE_NAME, JWT_SECRET_KEY, PACKAGE_NAME, PACKAGE_FOLDER, REMEMBER_ME_KEY } = OptionNames;
|
|
34
35
|
const {
|
|
@@ -373,7 +374,10 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
373
374
|
|
|
374
375
|
this.configOptions.logo = false;
|
|
375
376
|
if (this.jhipsterConfig.applicationType === MICROSERVICE) {
|
|
376
|
-
this.jhipsterConfig.skipClient =
|
|
377
|
+
this.jhipsterConfig.skipClient =
|
|
378
|
+
this.jhipsterConfig.skipClient ||
|
|
379
|
+
!this.jhipsterConfig.clientFramework ||
|
|
380
|
+
this.jhipsterConfig.clientFramework === CLIENT_FRAMEWORK_NO;
|
|
377
381
|
this.jhipsterConfig.withAdminUi = false;
|
|
378
382
|
this.jhipsterConfig.skipUserManagement = true;
|
|
379
383
|
}
|
|
@@ -21,8 +21,8 @@ const _ = require('lodash');
|
|
|
21
21
|
const {
|
|
22
22
|
createConflicterCheckTransform,
|
|
23
23
|
createConflicterStatusTransform,
|
|
24
|
-
createYoRcTransform,
|
|
25
|
-
createYoResolveTransform,
|
|
24
|
+
createYoRcTransform: createForceYoRcTransform,
|
|
25
|
+
createYoResolveTransform: createApplyYoResolveTransform,
|
|
26
26
|
patternFilter,
|
|
27
27
|
patternSpy,
|
|
28
28
|
} = require('yeoman-environment/transform');
|
|
@@ -148,6 +148,9 @@ module.exports = class extends BaseGenerator {
|
|
|
148
148
|
* @return {Promise}
|
|
149
149
|
*/
|
|
150
150
|
async _commitSharedFs(stream = this.env.sharedFs.stream(), skipPrettier = this.options.skipPrettier) {
|
|
151
|
+
const { skipYoResolve } = this.options;
|
|
152
|
+
const { withGeneratedFlag } = this.jhipsterConfig;
|
|
153
|
+
|
|
151
154
|
// JDL writes directly to disk, set the file as modified so prettier will be applied
|
|
152
155
|
stream = stream.pipe(
|
|
153
156
|
patternSpy(file => {
|
|
@@ -170,29 +173,30 @@ module.exports = class extends BaseGenerator {
|
|
|
170
173
|
],
|
|
171
174
|
};
|
|
172
175
|
|
|
173
|
-
const
|
|
176
|
+
const createApplyPrettierTransform = () => {
|
|
177
|
+
const prettierOptions = { packageJson: true, java: !this.skipServer && !this.jhipsterConfig.skipServer };
|
|
178
|
+
// Prettier is clever, it uses correct rules and correct parser according to file extension.
|
|
179
|
+
const ignoreErrors = this.options.commandName === 'upgrade' || this.options.ignoreErrors;
|
|
180
|
+
return prettierTransform(prettierOptions, this, ignoreErrors);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const createForceWriteConfigFiles = () =>
|
|
184
|
+
patternSpy(file => {
|
|
185
|
+
file.conflicter = 'force';
|
|
186
|
+
}, '**/.jhipster/*.json').name('jhipster:config-files:force');
|
|
187
|
+
|
|
174
188
|
const transformStreams = [
|
|
175
189
|
// multi-step changes the file path, should be executed earlier in the pipeline
|
|
176
190
|
new MultiStepTransform(),
|
|
177
|
-
...
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
191
|
+
...(skipYoResolve ? [] : [createApplyYoResolveTransform(this.env.conflicter)]),
|
|
192
|
+
createForceYoRcTransform(),
|
|
193
|
+
createForceWriteConfigFiles(),
|
|
194
|
+
...(withGeneratedFlag ? [generatedAnnotationTransform(this)] : []),
|
|
195
|
+
...(skipPrettier ? [] : [createApplyPrettierTransform()]),
|
|
196
|
+
createConflicterCheckTransform(this.env.conflicter, conflicterStatus),
|
|
197
|
+
createConflicterStatusTransform(),
|
|
182
198
|
];
|
|
183
199
|
|
|
184
|
-
if (this.jhipsterConfig.withGeneratedFlag) {
|
|
185
|
-
transformStreams.push(generatedAnnotationTransform(this));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (!skipPrettier) {
|
|
189
|
-
const prettierOptions = { packageJson: true, java: !this.skipServer && !this.jhipsterConfig.skipServer };
|
|
190
|
-
// Prettier is clever, it uses correct rules and correct parser according to file extension.
|
|
191
|
-
transformStreams.push(prettierTransform(prettierOptions, this, this.options.ignoreErrors));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
transformStreams.push(createConflicterCheckTransform(this.env.conflicter, conflicterStatus), createConflicterStatusTransform());
|
|
195
|
-
|
|
196
200
|
await this.env.fs.commit(transformStreams, stream);
|
|
197
201
|
}
|
|
198
202
|
|
|
@@ -67,7 +67,7 @@ const commonFiles = {
|
|
|
67
67
|
templates: ['content/scss/rtl.scss'],
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
|
-
condition: generator => generator.microfrontend,
|
|
70
|
+
condition: generator => generator.microfrontend && generator.clientFrameworkVue,
|
|
71
71
|
templates: ['webpack/webpack.microfrontend.js.jhi'],
|
|
72
72
|
},
|
|
73
73
|
],
|
|
@@ -31,7 +31,6 @@ const files = {
|
|
|
31
31
|
common: [
|
|
32
32
|
{
|
|
33
33
|
templates: [
|
|
34
|
-
'.npmrc',
|
|
35
34
|
'package.json',
|
|
36
35
|
'.eslintrc.json',
|
|
37
36
|
'tsconfig.json',
|
|
@@ -347,6 +346,9 @@ function cleanup() {
|
|
|
347
346
|
if (this.isJhipsterVersionLessThan('7.4.0') && this.enableI18nRTL) {
|
|
348
347
|
this.removeFile(`${CLIENT_MAIN_SRC_DIR}content/scss/rtl.scss`);
|
|
349
348
|
}
|
|
349
|
+
if (this.isJhipsterVersionLessThan('7.4.1')) {
|
|
350
|
+
this.removeFile('.npmrc');
|
|
351
|
+
}
|
|
350
352
|
}
|
|
351
353
|
|
|
352
354
|
function writeFiles() {
|
|
@@ -297,11 +297,11 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
|
|
|
297
297
|
},
|
|
298
298
|
|
|
299
299
|
loadEntities() {
|
|
300
|
-
if (!this.configOptions.sharedEntities
|
|
300
|
+
if (!this.configOptions.sharedEntities) {
|
|
301
301
|
this.localEntities = [];
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
304
|
-
this.localEntities = Object.values(this.configOptions.sharedEntities).filter(entity => !entity.builtIn);
|
|
304
|
+
this.localEntities = Object.values(this.configOptions.sharedEntities).filter(entity => !entity.builtIn && !entity.skipClient);
|
|
305
305
|
},
|
|
306
306
|
|
|
307
307
|
insight() {
|
|
@@ -236,7 +236,7 @@ module.exports = class extends needleClientBase {
|
|
|
236
236
|
|
|
237
237
|
if (!isSpecificEntityAlreadyGenerated) {
|
|
238
238
|
const modulePath =
|
|
239
|
-
this.generator.
|
|
239
|
+
this.generator.microfrontend && this.generator.applicationTypeGateway && microserviceName
|
|
240
240
|
? `${microserviceName}/${entityFileName}`
|
|
241
241
|
: `./${entityFolderName}/${entityFileName}.module`;
|
|
242
242
|
const moduleName = microserviceName
|
|
@@ -25,6 +25,16 @@ module.exports = class extends needleClientBase {
|
|
|
25
25
|
addEntityToMenu(routerName, enableTranslation, entityTranslationKeyMenu, entityTranslationValue = _.startCase(routerName)) {
|
|
26
26
|
const errorMessage = `${chalk.yellow('Reference to ') + routerName} ${chalk.yellow('not added to menu.\n')}`;
|
|
27
27
|
const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/entities/entities-menu.vue`;
|
|
28
|
+
|
|
29
|
+
const isSpecificEntityAlreadyGenerated = jhipsterUtils.checkStringInFile(
|
|
30
|
+
filePath,
|
|
31
|
+
`<b-dropdown-item to="/${routerName}">`,
|
|
32
|
+
this.generator
|
|
33
|
+
);
|
|
34
|
+
if (isSpecificEntityAlreadyGenerated) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
const menuI18nTitle = enableTranslation ? ` v-text="$t('global.menu.entities.${entityTranslationKeyMenu}')"` : '';
|
|
29
39
|
const entityEntry =
|
|
30
40
|
// prettier-ignore
|
|
@@ -41,6 +51,16 @@ module.exports = class extends needleClientBase {
|
|
|
41
51
|
addEntityToRouterImport(entityName, fileName, folderName, readOnly) {
|
|
42
52
|
const errorMessage = `${chalk.yellow('Reference to entity ') + entityName} ${chalk.yellow('not added to router entities import.\n')}`;
|
|
43
53
|
const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/router/entities.ts`;
|
|
54
|
+
|
|
55
|
+
const isSpecificEntityAlreadyGenerated = jhipsterUtils.checkStringInFile(
|
|
56
|
+
filePath,
|
|
57
|
+
`import('@/entities/${folderName}/${fileName}.vue');`,
|
|
58
|
+
this.generator
|
|
59
|
+
);
|
|
60
|
+
if (isSpecificEntityAlreadyGenerated) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
let entityEntry;
|
|
45
65
|
if (!readOnly) {
|
|
46
66
|
// prettier-ignore
|
|
@@ -70,8 +90,7 @@ module.exports = class extends needleClientBase {
|
|
|
70
90
|
const errorMessage = `${chalk.yellow('Reference to entity ') + entityName} ${chalk.yellow('not added to router entities.\n')}`;
|
|
71
91
|
const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/router/entities.ts`;
|
|
72
92
|
|
|
73
|
-
const isSpecificEntityAlreadyGenerated = jhipsterUtils.checkStringInFile(filePath, `path: '
|
|
74
|
-
|
|
93
|
+
const isSpecificEntityAlreadyGenerated = jhipsterUtils.checkStringInFile(filePath, `path: '${entityFileName}'`, this.generator);
|
|
75
94
|
if (isSpecificEntityAlreadyGenerated) {
|
|
76
95
|
return;
|
|
77
96
|
}
|
|
@@ -81,25 +100,25 @@ module.exports = class extends needleClientBase {
|
|
|
81
100
|
// prettier-ignore
|
|
82
101
|
entityEntry = this.generator.stripMargin(
|
|
83
102
|
`|{
|
|
84
|
-
| path: '
|
|
103
|
+
| path: '${entityFileName}',
|
|
85
104
|
| name: '${entityName}',
|
|
86
105
|
| component: ${entityName},
|
|
87
106
|
| meta: { authorities: [Authority.USER] }
|
|
88
107
|
| },
|
|
89
108
|
| {
|
|
90
|
-
| path: '
|
|
109
|
+
| path: '${entityFileName}/new',
|
|
91
110
|
| name: '${entityName}Create',
|
|
92
111
|
| component: ${entityName}Update,
|
|
93
112
|
| meta: { authorities: [Authority.USER] }
|
|
94
113
|
| },
|
|
95
114
|
| {
|
|
96
|
-
| path: '
|
|
115
|
+
| path: '${entityFileName}/:${entityInstance}Id/edit',
|
|
97
116
|
| name: '${entityName}Edit',
|
|
98
117
|
| component: ${entityName}Update,
|
|
99
118
|
| meta: { authorities: [Authority.USER] }
|
|
100
119
|
| },
|
|
101
120
|
| {
|
|
102
|
-
| path: '
|
|
121
|
+
| path: '${entityFileName}/:${entityInstance}Id/view',
|
|
103
122
|
| name: '${entityName}View',
|
|
104
123
|
| component: ${entityName}Details,
|
|
105
124
|
| meta: { authorities: [Authority.USER] }
|
|
@@ -124,6 +143,7 @@ module.exports = class extends needleClientBase {
|
|
|
124
143
|
}
|
|
125
144
|
|
|
126
145
|
const rewriteFileModel = this.generateFileModel(filePath, 'jhipster-needle-add-entity-to-router', entityEntry);
|
|
146
|
+
rewriteFileModel.prettierAware = true;
|
|
127
147
|
this.addBlockContentToFile(rewriteFileModel, errorMessage);
|
|
128
148
|
}
|
|
129
149
|
|
|
@@ -152,4 +172,34 @@ module.exports = class extends needleClientBase {
|
|
|
152
172
|
const rewriteFileModel = this.generateFileModel(filePath, 'jhipster-needle-add-entity-service-to-main', entityEntry);
|
|
153
173
|
this.addBlockContentToFile(rewriteFileModel, errorMessage);
|
|
154
174
|
}
|
|
175
|
+
|
|
176
|
+
addEntityServiceToEntitiesComponentImport(entityName, entityClass, entityFileName, entityFolderName) {
|
|
177
|
+
const errorMessage = `${chalk.yellow('Reference to entity ') + entityClass} ${chalk.yellow(
|
|
178
|
+
'not added to import in entities component.\n'
|
|
179
|
+
)}`;
|
|
180
|
+
const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/entities/entities.component.ts`;
|
|
181
|
+
|
|
182
|
+
// prettier-ignore
|
|
183
|
+
const entityEntry = `import ${entityName}Service from './${entityFolderName}/${entityFileName}.service';`;
|
|
184
|
+
|
|
185
|
+
const rewriteFileModel = this.generateFileModel(
|
|
186
|
+
filePath,
|
|
187
|
+
'jhipster-needle-add-entity-service-to-entities-component-import',
|
|
188
|
+
entityEntry
|
|
189
|
+
);
|
|
190
|
+
this.addBlockContentToFile(rewriteFileModel, errorMessage);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
addEntityServiceToEntitiesComponent(entityInstance, entityName) {
|
|
194
|
+
const errorMessage = `${chalk.yellow('Reference to entity ') + entityName} ${chalk.yellow(
|
|
195
|
+
'not added to service in entities component.\n'
|
|
196
|
+
)}`;
|
|
197
|
+
const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/entities/entities.component.ts`;
|
|
198
|
+
|
|
199
|
+
// prettier-ignore
|
|
200
|
+
const entityEntry = `@Provide('${entityInstance}Service') private ${entityInstance}Service = () => new ${entityName}Service();`;
|
|
201
|
+
|
|
202
|
+
const rewriteFileModel = this.generateFileModel(filePath, 'jhipster-needle-add-entity-service-to-entities-component', entityEntry);
|
|
203
|
+
this.addBlockContentToFile(rewriteFileModel, errorMessage);
|
|
204
|
+
}
|
|
155
205
|
};
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"@ng-bootstrap/ng-bootstrap": "10.0.0",
|
|
9
9
|
"@ngx-translate/core": "13.0.0",
|
|
10
10
|
"@ngx-translate/http-loader": "6.0.0",
|
|
11
|
-
"ngx-cookie-service": "
|
|
11
|
+
"ngx-cookie-service": "12.0.3",
|
|
12
12
|
"ngx-infinite-scroll": "10.0.1",
|
|
13
13
|
"ngx-webstorage": "8.0.0",
|
|
14
14
|
"rxjs": "6.6.7",
|
|
15
|
-
"swagger-ui-dist": "4.1.
|
|
15
|
+
"swagger-ui-dist": "4.1.2",
|
|
16
16
|
"tslib": "2.3.1",
|
|
17
17
|
"zone.js": "0.11.4"
|
|
18
18
|
},
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"@angular/cli": "12.2.12",
|
|
21
21
|
"@angular-builders/custom-webpack": "12.1.3",
|
|
22
22
|
"@angular-builders/jest": "12.1.2",
|
|
23
|
-
"@angular-eslint/eslint-plugin": "12.
|
|
24
|
-
"@types/node": "16.11.
|
|
23
|
+
"@angular-eslint/eslint-plugin": "12.7.0",
|
|
24
|
+
"@types/node": "16.11.11",
|
|
25
25
|
"@types/jest": "27.0.3",
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "5.5.0",
|
|
27
27
|
"browser-sync": "2.27.7",
|
|
28
28
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
29
29
|
"copy-webpack-plugin": "10.0.0",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"eslint-config-prettier": "8.3.0",
|
|
32
32
|
"eslint-webpack-plugin": "3.1.1",
|
|
33
33
|
"folder-hash": "4.0.1",
|
|
34
|
-
"jest": "27.3
|
|
34
|
+
"jest": "27.4.3",
|
|
35
35
|
"jest-preset-angular": "10.1.0",
|
|
36
36
|
"jest-date-mock": "1.0.8",
|
|
37
37
|
"jest-junit": "13.0.0",
|
|
38
38
|
"jest-sonar-reporter": "2.0.0",
|
|
39
|
-
"merge-jsons-webpack-plugin": "
|
|
39
|
+
"merge-jsons-webpack-plugin": "2.0.1",
|
|
40
40
|
"rimraf": "3.0.2",
|
|
41
41
|
"ts-jest": "27.0.7",
|
|
42
42
|
"typescript": "4.3.5",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"devDependencies": {
|
|
3
|
-
"@cypress/code-coverage": "3.9.
|
|
3
|
+
"@cypress/code-coverage": "3.9.12",
|
|
4
4
|
"babel-loader": "8.2.3",
|
|
5
5
|
"babel-plugin-istanbul": "6.1.1",
|
|
6
6
|
"cypress": "9.0.0",
|
|
7
7
|
"eslint-plugin-cypress": "2.12.1",
|
|
8
8
|
"cypress-audit": "1.1.0",
|
|
9
|
-
"lighthouse": "9.
|
|
9
|
+
"lighthouse": "9.1.0",
|
|
10
10
|
"nyc": "15.1.0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"path-browserify": "1.0.1",
|
|
12
12
|
"react": "17.0.2",
|
|
13
13
|
"react-dom": "17.0.2",
|
|
14
|
-
"react-hook-form": "7.
|
|
14
|
+
"react-hook-form": "7.20.5",
|
|
15
15
|
"react-jhipster": "0.18.0",
|
|
16
16
|
"react-loadable": "5.5.0",
|
|
17
17
|
"react-redux": "7.2.6",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"react-transition-group": "4.4.2",
|
|
22
22
|
"reactstrap": "9.0.1",
|
|
23
23
|
"redux": "4.1.2",
|
|
24
|
-
"redux-thunk": "2.4.
|
|
24
|
+
"redux-thunk": "2.4.1",
|
|
25
25
|
"sonar-scanner": "3.1.0",
|
|
26
26
|
"tslib": "2.3.1",
|
|
27
27
|
"uuid": "8.3.2"
|
|
@@ -30,58 +30,58 @@
|
|
|
30
30
|
"@testing-library/react": "12.1.2",
|
|
31
31
|
"@types/jest": "27.0.3",
|
|
32
32
|
"@types/lodash": "4.14.177",
|
|
33
|
-
"@types/node": "16.11.
|
|
34
|
-
"@types/react": "17.0.
|
|
33
|
+
"@types/node": "16.11.11",
|
|
34
|
+
"@types/react": "17.0.37",
|
|
35
35
|
"@types/react-dom": "17.0.11",
|
|
36
36
|
"@types/react-redux": "7.1.20",
|
|
37
37
|
"@types/react-router-dom": "5.3.2",
|
|
38
38
|
"@types/redux": "3.6.31",
|
|
39
39
|
"@types/webpack-env": "1.16.3",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
41
|
-
"@typescript-eslint/parser": "5.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "5.5.0",
|
|
41
|
+
"@typescript-eslint/parser": "5.5.0",
|
|
42
42
|
"autoprefixer": "10.4.0",
|
|
43
43
|
"browser-sync": "2.27.7",
|
|
44
44
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
45
|
-
"copy-webpack-plugin": "
|
|
46
|
-
"core-js": "3.19.
|
|
45
|
+
"copy-webpack-plugin": "10.0.0",
|
|
46
|
+
"core-js": "3.19.2",
|
|
47
47
|
"cross-env": "7.0.3",
|
|
48
48
|
"css-loader": "6.5.1",
|
|
49
|
-
"css-minimizer-webpack-plugin": "3.
|
|
50
|
-
"eslint": "8.
|
|
49
|
+
"css-minimizer-webpack-plugin": "3.2.0",
|
|
50
|
+
"eslint": "8.3.0",
|
|
51
51
|
"eslint-config-prettier": "8.3.0",
|
|
52
|
-
"eslint-plugin-react": "7.27.
|
|
52
|
+
"eslint-plugin-react": "7.27.1",
|
|
53
53
|
"eslint-webpack-plugin": "3.1.1",
|
|
54
54
|
"folder-hash": "4.0.1",
|
|
55
|
-
"fork-ts-checker-webpack-plugin": "6.
|
|
55
|
+
"fork-ts-checker-webpack-plugin": "6.5.0",
|
|
56
56
|
"html-webpack-plugin": "5.5.0",
|
|
57
57
|
"identity-obj-proxy": "3.0.0",
|
|
58
|
-
"jest": "27.3
|
|
58
|
+
"jest": "27.4.3",
|
|
59
59
|
"jest-junit": "13.0.0",
|
|
60
60
|
"jest-sonar-reporter": "2.0.0",
|
|
61
61
|
"json-loader": "0.5.7",
|
|
62
|
-
"merge-jsons-webpack-plugin": "
|
|
62
|
+
"merge-jsons-webpack-plugin": "2.0.1",
|
|
63
63
|
"mini-css-extract-plugin": "2.4.5",
|
|
64
|
-
"postcss-loader": "6.2.
|
|
64
|
+
"postcss-loader": "6.2.1",
|
|
65
65
|
"postcss-rtlcss": "3.5.0",
|
|
66
|
-
"react-infinite-
|
|
66
|
+
"react-infinite-scroll-component": "6.1.0",
|
|
67
67
|
"redux-mock-store": "1.5.4",
|
|
68
68
|
"rimraf": "3.0.2",
|
|
69
|
-
"sass": "1.
|
|
69
|
+
"sass": "1.44.0",
|
|
70
70
|
"sass-loader": "12.3.0",
|
|
71
71
|
"simple-progress-webpack-plugin": "2.0.0",
|
|
72
72
|
"sinon": "12.0.1",
|
|
73
73
|
"source-map-loader": "3.0.0",
|
|
74
74
|
"sourcemap-istanbul-instrumenter-loader": "0.2.0",
|
|
75
75
|
"style-loader": "3.3.1",
|
|
76
|
-
"swagger-ui-dist": "4.1.
|
|
76
|
+
"swagger-ui-dist": "4.1.2",
|
|
77
77
|
"terser-webpack-plugin": "5.2.5",
|
|
78
78
|
"thread-loader": "3.0.4",
|
|
79
79
|
"ts-jest": "27.0.7",
|
|
80
80
|
"ts-loader": "9.2.6",
|
|
81
81
|
"typescript": "4.5.2",
|
|
82
|
-
"webpack": "5.64.
|
|
82
|
+
"webpack": "5.64.4",
|
|
83
83
|
"webpack-cli": "4.9.1",
|
|
84
|
-
"webpack-dev-server": "4.
|
|
84
|
+
"webpack-dev-server": "4.6.0",
|
|
85
85
|
"webpack-merge": "5.8.0",
|
|
86
86
|
"webpack-notifier": "1.14.1",
|
|
87
87
|
"workbox-webpack-plugin": "6.4.1"
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<%_ if (protractorTests) { _%>
|
|
135
135
|
"protractor": "7.0.0",
|
|
136
136
|
<%_ } _%>
|
|
137
|
-
"react-infinite-
|
|
137
|
+
"react-infinite-scroll-component": "<%= dependabotPackageJson.devDependencies['react-infinite-scroll-component'] %>",
|
|
138
138
|
"redux-mock-store": "<%= dependabotPackageJson.devDependencies['redux-mock-store'] %>",
|
|
139
139
|
"rimraf": "<%= dependabotPackageJson.devDependencies['rimraf'] %>",
|
|
140
140
|
"sass": "<%= dependabotPackageJson.devDependencies['sass'] %>",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"bootstrap": "4.6.1",
|
|
8
8
|
"bootstrap-vue": "2.21.2",
|
|
9
9
|
"bootswatch": "5.1.3",
|
|
10
|
-
"swagger-ui-dist": "4.1.
|
|
10
|
+
"swagger-ui-dist": "4.1.2",
|
|
11
11
|
"vue": "2.6.14",
|
|
12
12
|
"vue-class-component": "7.2.6",
|
|
13
13
|
"vue-cookie": "1.1.4",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/jest": "27.0.3",
|
|
24
|
-
"@types/node": "16.11.
|
|
24
|
+
"@types/node": "16.11.11",
|
|
25
25
|
"@types/sinon": "10.0.6",
|
|
26
26
|
"@types/vuelidate": "0.7.15",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
28
|
-
"@typescript-eslint/parser": "5.
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "5.5.0",
|
|
28
|
+
"@typescript-eslint/parser": "5.5.0",
|
|
29
29
|
"@vue/eslint-config-prettier": "6.0.0",
|
|
30
30
|
"@vue/eslint-config-typescript": "9.1.0",
|
|
31
31
|
"@vue/vue2-jest": "27.0.0-alpha.3",
|
|
@@ -35,36 +35,36 @@
|
|
|
35
35
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
36
36
|
"copy-webpack-plugin": "10.0.0",
|
|
37
37
|
"css-loader": "6.5.1",
|
|
38
|
-
"css-minimizer-webpack-plugin": "3.
|
|
38
|
+
"css-minimizer-webpack-plugin": "3.2.0",
|
|
39
39
|
"folder-hash": "4.0.1",
|
|
40
|
-
"fork-ts-checker-webpack-plugin": "6.
|
|
40
|
+
"fork-ts-checker-webpack-plugin": "6.5.0",
|
|
41
41
|
"html-webpack-plugin": "5.5.0",
|
|
42
|
-
"jest": "27.3
|
|
42
|
+
"jest": "27.4.3",
|
|
43
43
|
"jest-junit": "13.0.0",
|
|
44
44
|
"jest-serializer-vue": "2.0.2",
|
|
45
45
|
"jest-sonar-reporter": "2.0.0",
|
|
46
46
|
"jest-vue-preprocessor": "1.7.1",
|
|
47
|
-
"merge-jsons-webpack-plugin": "
|
|
47
|
+
"merge-jsons-webpack-plugin": "2.0.1",
|
|
48
48
|
"mini-css-extract-plugin": "2.4.5",
|
|
49
49
|
"numeral": "2.0.6",
|
|
50
50
|
"postcss-import": "14.0.2",
|
|
51
|
-
"postcss-loader": "6.2.
|
|
51
|
+
"postcss-loader": "6.2.1",
|
|
52
52
|
"postcss-url": "10.1.3",
|
|
53
53
|
"rimraf": "3.0.2",
|
|
54
|
-
"sass": "1.
|
|
54
|
+
"sass": "1.44.0",
|
|
55
55
|
"sass-loader": "12.3.0",
|
|
56
56
|
"sinon": "12.0.1",
|
|
57
57
|
"terser-webpack-plugin": "5.2.5",
|
|
58
58
|
"ts-jest": "27.0.7",
|
|
59
59
|
"ts-loader": "9.2.6",
|
|
60
|
-
"eslint": "8.
|
|
60
|
+
"eslint": "8.3.0",
|
|
61
61
|
"eslint-plugin-prettier": "3.4.1",
|
|
62
62
|
"eslint-plugin-vue": "8.1.1",
|
|
63
63
|
"typescript": "4.5.2",
|
|
64
|
-
"webpack": "5.64.
|
|
64
|
+
"webpack": "5.64.4",
|
|
65
65
|
"webpack-bundle-analyzer": "4.5.0",
|
|
66
66
|
"webpack-cli": "4.9.1",
|
|
67
|
-
"webpack-dev-server": "4.
|
|
67
|
+
"webpack-dev-server": "4.6.0",
|
|
68
68
|
"webpack-merge": "5.8.0",
|
|
69
69
|
"workbox-webpack-plugin": "6.4.1",
|
|
70
70
|
"vue-jest": "3.0.7",
|
|
@@ -65,7 +65,9 @@ export default class AccountService {
|
|
|
65
65
|
<%_ } _%>
|
|
66
66
|
} else {
|
|
67
67
|
this.store.commit('logout');
|
|
68
|
-
this.router.
|
|
68
|
+
if (this.router.currentRoute.path !== '/') {
|
|
69
|
+
this.router.push('/');
|
|
70
|
+
}
|
|
69
71
|
sessionStorage.removeItem("requested-url");
|
|
70
72
|
}
|
|
71
73
|
<%_ if (enableTranslation) { _%>
|
|
@@ -53,21 +53,30 @@ export default class JhiNavbar extends Vue {
|
|
|
53
53
|
}
|
|
54
54
|
<%_ } _%>
|
|
55
55
|
|
|
56
|
-
public logout() :
|
|
56
|
+
public logout() : Promise<any> {
|
|
57
57
|
<%_ if (!authenticationTypeJwt) { _%>
|
|
58
|
-
this.loginService().logout().then(response => {
|
|
58
|
+
return this.loginService().logout().then(response => {
|
|
59
59
|
this.$store.commit('logout');
|
|
60
|
-
this.$router.push('/');
|
|
61
60
|
<%_ if (authenticationTypeOauth2) { _%>
|
|
62
|
-
|
|
61
|
+
const next = response.data?.logoutUrl ?? '/';
|
|
62
|
+
if (this.$route.path !== next) {
|
|
63
|
+
return this.$router.push(next);
|
|
64
|
+
}
|
|
65
|
+
<%_ } else { _%>
|
|
66
|
+
if (this.$route.path !== '/') {
|
|
67
|
+
return this.$router.push('/');
|
|
68
|
+
}
|
|
63
69
|
<%_ } _%>
|
|
64
70
|
});
|
|
65
71
|
<%_ } else { _%>
|
|
66
72
|
localStorage.removeItem('<%=jhiPrefixDashed %>-authenticationToken');
|
|
67
73
|
sessionStorage.removeItem('<%=jhiPrefixDashed %>-authenticationToken');
|
|
68
74
|
this.$store.commit('logout');
|
|
69
|
-
this.$
|
|
75
|
+
if (this.$route.path !== '/') {
|
|
76
|
+
return this.$router.push('/');
|
|
77
|
+
}
|
|
70
78
|
<%_ } _%>
|
|
79
|
+
return Promise.resolve(this.$router.currentRoute);
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
public openLogin() : void {
|
|
@@ -26,10 +26,10 @@ declare const VERSION: string;
|
|
|
26
26
|
declare const I18N_HASH: string;
|
|
27
27
|
<%_ } _%>
|
|
28
28
|
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
29
|
-
<%_ for (const remote of
|
|
29
|
+
<%_ for (const remote of microfrontends) { _%>
|
|
30
30
|
|
|
31
31
|
declare module '@<%= remote.lowercaseBaseName %>/entities-router' {
|
|
32
|
-
const _default:
|
|
32
|
+
const _default: unknown;
|
|
33
33
|
export default _default;
|
|
34
34
|
}
|
|
35
35
|
|
package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs
CHANGED
|
@@ -3,10 +3,12 @@ import { Component, Provide, Vue } from 'vue-property-decorator';
|
|
|
3
3
|
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
4
4
|
import <%= entity.entityAngularName %>Service from './<%= entity.entityFolderName %>/<%= entity.entityFileName %>.service';
|
|
5
5
|
<%_ } _%>
|
|
6
|
+
// jhipster-needle-add-entity-service-to-entities-component-import - JHipster will import entities services here
|
|
6
7
|
|
|
7
8
|
@Component
|
|
8
9
|
export default class Entities extends Vue {
|
|
9
10
|
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
10
11
|
@Provide('<%= entity.entityInstance %>Service') private <%= entity.entityInstance %>Service = () => new <%= entity.entityAngularName %>Service();
|
|
11
12
|
<%_ } _%>
|
|
13
|
+
// jhipster-needle-add-entity-service-to-entities-component - JHipster will import entities services here
|
|
12
14
|
}
|
|
@@ -5,7 +5,7 @@ import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome';
|
|
|
5
5
|
import App from './app.vue';
|
|
6
6
|
import Vue2Filters from 'vue2-filters';
|
|
7
7
|
import { ToastPlugin } from 'bootstrap-vue';
|
|
8
|
-
import router from './router';
|
|
8
|
+
import router<% if (applicationTypeGateway && microfrontend) { %>, { lazyRoutes }<% } %> from './router';
|
|
9
9
|
import * as config from './shared/config/config';
|
|
10
10
|
import * as bootstrapVueConfig from './shared/config/config-bootstrap-vue';
|
|
11
11
|
import JhiItemCountComponent from './shared/jhi-item-count.vue';
|
|
@@ -69,13 +69,18 @@ const translationService = new TranslationService(store, i18n);
|
|
|
69
69
|
const loginService = new LoginService();
|
|
70
70
|
const accountService = new AccountService(store, <%_ if (enableTranslation) { _%>translationService, <%_ } _%><%_ if (authenticationTypeSession || authenticationTypeOauth2) { _%>(<any>Vue).cookie, <%_ } _%><%_ if (communicationSpringWebsocket) { _%>trackerService, <%_ } _%>router);
|
|
71
71
|
|
|
72
|
-
router.beforeEach((to, from, next) => {
|
|
73
|
-
|
|
72
|
+
router.beforeEach(async (to, from, next) => {
|
|
74
73
|
if (!to.matched.length) {
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
75
|
+
await lazyRoutes;
|
|
76
|
+
if (router.match(to.fullPath).matched.length > 0) {
|
|
77
|
+
next(to.fullPath);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
77
80
|
|
|
78
|
-
|
|
81
|
+
<%_ } _%>
|
|
82
|
+
next('/not-found');
|
|
83
|
+
} else if (to.meta && to.meta.authorities && to.meta.authorities.length > 0) {
|
|
79
84
|
accountService.hasAnyAuthorityAndCheckAuth(to.meta.authorities).then(value => {
|
|
80
85
|
if (!value) {
|
|
81
86
|
sessionStorage.setItem('requested-url', to.fullPath);
|