generator-jhipster 7.9.0 → 7.9.3
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/environment-builder.js +15 -1
- package/cli/jhipster.js +0 -0
- package/generators/app/index.js +12 -1
- package/generators/bootstrap/index.js +33 -1
- package/generators/ci-cd/templates/circle.yml.ejs +3 -13
- package/generators/client/files-angular.js +1 -1
- package/generators/client/files-react.js +5 -2
- package/generators/client/files-vue.js +3 -2
- package/generators/client/templates/angular/jest.conf.js.ejs +6 -3
- package/generators/client/templates/angular/package.json +18 -18
- package/generators/client/templates/angular/package.json.ejs +3 -7
- package/generators/client/templates/angular/src/main/webapp/app/admin/admin-routing.module.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.model.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.ts.ejs +17 -15
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/user-management.model.ts.ejs +2 -2
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/user-management.route.ts.ejs +4 -4
- package/generators/client/templates/angular/src/main/webapp/app/core/request/request-util.ts.ejs +4 -2
- package/generators/client/templates/angular/src/main/webapp/app/core/util/data-util.service.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/core/util/parse-links.service.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.component.html.ejs +8 -6
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.component.ts.ejs +6 -11
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.model.spec.ts.ejs +227 -25
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.model.ts.ejs +104 -43
- package/generators/client/templates/angular/src/main/webapp/content/scss/global.scss.ejs +8 -0
- package/generators/client/templates/angular/tsconfig.json.ejs +0 -1
- package/generators/client/templates/angular/tsconfig.spec.json.ejs +2 -3
- package/generators/client/templates/angular/webpack/webpack.microfrontend.js.ejs +0 -3
- package/generators/client/templates/common/package.json +4 -4
- package/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs +1 -1
- package/generators/client/templates/react/jest.conf.js.ejs +2 -2
- package/generators/client/templates/react/package.json +24 -24
- package/generators/client/templates/react/package.json.ejs +3 -7
- package/generators/client/templates/react/src/main/webapp/app/config/store.ts.ejs +0 -6
- package/generators/client/templates/react/src/main/webapp/app/index.tsx.ejs +4 -5
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs +7 -7
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs +6 -6
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs +17 -8
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.ts.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs +176 -19
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.ts.ejs +46 -13
- package/generators/client/templates/react/webpack/webpack.microfrontend.js.jhi.react.ejs +1 -1
- package/generators/client/templates/vue/package.json +17 -17
- package/generators/client/templates/vue/package.json.ejs +3 -7
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +2 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +2 -2
- package/generators/client/templates/vue/src/main/webapp/app/router/admin.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/administration-page.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/navbar-page.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +5 -6
- package/generators/client/templates/vue/src/test/javascript/spec/app/account/account.service.spec.ts.ejs +4 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/alert/alert.service.spec.ts.ejs +106 -3
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/axios-interceptor.spec.ts.ejs +12 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/formatter.spec.ts.ejs +6 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/sort/sorts.spec.ts.ejs +10 -0
- package/generators/client/templates/vue/webpack/webpack.common.js.ejs +1 -1
- package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +2 -2
- package/generators/common/files.js +5 -4
- package/generators/common/templates/.husky/pre-commit.ejs +0 -0
- package/generators/common/templates/package.json +1 -1
- package/generators/common/templates/sonar-project.properties.ejs +19 -11
- package/generators/cypress/index.js +1 -1
- package/generators/docker-compose/templates/README-DOCKER-COMPOSE.md.ejs +3 -3
- package/generators/docker-compose/templates/docker-compose.yml.ejs +1 -1
- package/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +32 -14
- package/generators/entity/index.js +4 -3
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.html.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.html.ejs +18 -6
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.spec.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +23 -19
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.spec.ts.ejs +3 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts.ejs +1 -1
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/common/delete_template.ejs +7 -3
- package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +15 -5
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_persistable.ejs +8 -1
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +5 -0
- package/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs +4 -4
- package/generators/entity-server/templates/src/main/java/package/service/EntityService.java.ejs +6 -4
- package/generators/entity-server/templates/src/main/java/package/service/criteria/EntityCriteria.java.ejs +3 -26
- package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +1 -0
- package/generators/entity-server/templates/src/main/java/package/service/impl/EntityServiceImpl.java.ejs +1 -1
- package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +33 -28
- package/generators/generate-blueprint/constants.mjs +46 -6
- package/generators/generate-blueprint/esm.mjs +0 -0
- package/generators/generate-blueprint/files.mjs +7 -5
- package/generators/generate-blueprint/generator.mjs +73 -19
- package/generators/generate-blueprint/templates/cli/cli.mjs.ejs +0 -0
- package/generators/generate-blueprint/templates/generators/generator/generator.spec.mjs.ejs +1 -1
- package/generators/generate-blueprint/templates/generators/generator/templates/template-file.ejs +0 -0
- package/generators/generator-base-blueprint.js +23 -1
- package/generators/generator-base-entities.cjs +5 -1
- package/generators/generator-base.js +82 -15
- package/generators/generator-constants.js +17 -23
- package/generators/init/templates/.husky/pre-commit +0 -0
- package/generators/kubernetes/templates/deployment.yml.ejs +1 -1
- package/generators/kubernetes/templates/ingress.yml.ejs +1 -1
- package/generators/kubernetes/templates/istio/gateway.yml.ejs +1 -1
- package/generators/kubernetes/templates/kubectl-apply.sh.ejs +0 -0
- package/generators/kubernetes/templates/kustomize/kustomization.yml.ejs +1 -1
- package/generators/kubernetes/templates/service.yml.ejs +1 -1
- package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +1 -1
- package/generators/kubernetes-knative/templates/kubectl-apply.sh.ejs +0 -0
- package/generators/kubernetes-knative/templates/service.yml.ejs +3 -3
- package/generators/languages/templates/src/main/webapp/i18n/al/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ar-ly/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/bg/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/bn/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/by/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ca/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/cs/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/da/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/de/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/activate.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/password.json +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/register.json +3 -3
- package/generators/languages/templates/src/main/webapp/i18n/el/tracker.json +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/user-management.json +9 -9
- package/generators/languages/templates/src/main/webapp/i18n/en/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/es/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/et/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fa/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/gl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hu/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hy/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/in/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/it/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ja/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ko/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/mr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/my/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/nl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pa/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pt-br/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pt-pt/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ro/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ru/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/si/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sk/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sv/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ta/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/te/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/th/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/tr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ua/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/vi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/zh-cn/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/zh-tw/health.json.ejs +1 -1
- package/generators/maven/templates/mvnw +0 -0
- package/generators/openshift/templates/deployment.yml.ejs +2 -2
- package/generators/server/cleanup-elasticsearch.js +5 -0
- package/generators/server/files.js +17 -8
- package/generators/server/index.js +0 -2
- package/generators/server/templates/build.gradle.ejs +6 -14
- package/generators/server/templates/gradle/profile_dev.gradle.ejs +1 -1
- package/generators/server/templates/gradle/profile_prod.gradle.ejs +1 -1
- package/generators/server/templates/gradle.properties.ejs +6 -4
- package/generators/server/templates/gradlew +0 -0
- package/generators/server/templates/mvnw +0 -0
- package/generators/server/templates/npmw +0 -0
- package/generators/server/templates/npmw.cmd +31 -29
- package/generators/server/templates/package.json.ejs +2 -2
- package/generators/server/templates/pom.xml.ejs +12 -23
- package/generators/server/templates/sql/common/src/test/java/package/config/MsSqlTestContainer.java.ejs +2 -3
- package/generators/server/templates/src/main/docker/app.yml.ejs +7 -1
- package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +32 -14
- package/generators/server/templates/src/main/docker/jhipster-control-center.yml.ejs +1 -1
- package/generators/server/templates/src/main/docker/prometheus/prometheus.yml.ejs +1 -1
- package/generators/server/templates/src/main/java/package/Application.java.ejs +11 -4
- package/generators/server/templates/src/main/java/package/config/CRLFLogConverter.java.ejs +57 -0
- package/generators/server/templates/src/main/java/package/config/EurekaWorkaroundConfiguration.java.ejs +49 -0
- package/generators/server/templates/src/main/java/package/config/LoggingConfiguration.java.ejs +4 -4
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +17 -18
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +13 -5
- package/generators/server/templates/src/main/java/package/domain/AbstractAuditingEntity.java.ejs +5 -6
- package/generators/server/templates/src/main/java/package/domain/User.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +13 -6
- package/generators/server/templates/src/main/java/package/service/dto/AdminUserDTO.java.ejs +3 -1
- package/generators/server/templates/src/main/java/package/service/dto/PasswordChangeDTO.java.ejs +5 -1
- package/generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs +3 -1
- package/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +15 -42
- package/generators/server/templates/src/main/java/package/web/rest/errors/BadRequestAlertException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/EmailAlreadyUsedException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/InvalidPasswordException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/LoginAlreadyUsedException.java.ejs +1 -0
- package/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +1 -1
- package/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +3 -3
- package/generators/server/templates/src/main/resources/config/application.yml.ejs +4 -2
- package/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs +3 -8
- package/generators/server/templates/src/main/resources/logback-spring.xml.ejs +5 -0
- package/generators/server/templates/src/test/java/package/config/{ElasticsearchReactiveTestConfiguration.java.ejs → ElasticsearchTestConfiguration.java.ejs} +3 -3
- package/generators/server/templates/src/test/java/package/config/ElasticsearchTestContainer.java.ejs +1 -0
- package/generators/server/templates/src/test/java/package/config/JHipsterBlockHoundIntegration.java.ejs +3 -0
- package/generators/server/templates/src/test/java/package/config/TestContainersSpringContextCustomizerFactory.java.ejs +2 -2
- package/generators/sql-constants.js +5 -2
- package/generators/utils.js +43 -3
- package/generators/workspaces/index.js +2 -1
- package/jdl/exporters/jdl-exporter.js +6 -1
- package/jdl/jhipster/application-options.js +2 -1
- package/jdl/jhipster/binary-options.js +2 -2
- package/jdl/jhipster/default-application-options.js +11 -8
- package/jdl/jhipster/entity-options.js +1 -0
- package/jdl/jhipster/search-engine-types.js +1 -0
- package/lib/constants/priorities.cjs +16 -0
- package/lib/constants/priorities.mjs +1 -0
- package/lib/index.js +2 -0
- package/lib/support/base.cjs +2 -1
- package/package.json +7 -6
- package/utils/blueprint.js +10 -0
- package/utils/field.js +9 -9
- package/generators/client/templates/react/src/main/webapp/app/config/translation-middleware.ts.ejs +0 -58
- package/generators/server/templates/.npmrc.ejs +0 -1
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
-%>
|
|
19
19
|
import axios from 'axios';
|
|
20
20
|
import dayjs from 'dayjs';
|
|
21
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
21
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
22
22
|
|
|
23
|
-
import { AppThunk } from 'app/config/store';
|
|
24
23
|
import { TranslatorContext } from 'react-jhipster';
|
|
25
24
|
|
|
26
25
|
const initialState = {
|
|
@@ -28,20 +27,51 @@ const initialState = {
|
|
|
28
27
|
sourcePrefixes: [],
|
|
29
28
|
lastChange: TranslatorContext.context.lastChange,
|
|
30
29
|
loadedKeys: [],
|
|
30
|
+
loadedLocales: [],
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export type LocaleState = Readonly<typeof initialState>;
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const loadLocaleAndRegisterLocaleFile = async (locale: string, prefix: string) => {
|
|
36
36
|
if (prefix || !Object.keys(TranslatorContext.context.translations).includes(locale)) {
|
|
37
37
|
const response = await axios.get(`${prefix}i18n/${locale}.json?_=${I18N_HASH}`, { baseURL: '' });
|
|
38
38
|
TranslatorContext.registerTranslations(locale, response.data);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const setLocale
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
export const setLocale = createAsyncThunk('locale/setLocale', async (locale: string, thunkAPI: any) => {
|
|
43
|
+
const { sourcePrefixes, loadedKeys, loadedLocales } = thunkAPI.getState().locale;
|
|
44
|
+
if (!loadedLocales.includes(locale)) {
|
|
45
|
+
const keys = (
|
|
46
|
+
await Promise.all(
|
|
47
|
+
[''].concat(sourcePrefixes).map(async sourcePrefix => {
|
|
48
|
+
const key = `${sourcePrefix}${locale}`;
|
|
49
|
+
if (loadedKeys.includes(key)) return undefined;
|
|
50
|
+
await loadLocaleAndRegisterLocaleFile(locale, sourcePrefix);
|
|
51
|
+
return key;
|
|
52
|
+
})
|
|
53
|
+
)
|
|
54
|
+
).filter(Boolean);
|
|
55
|
+
thunkAPI.dispatch(loaded({ keys, locale }));
|
|
56
|
+
}
|
|
57
|
+
thunkAPI.dispatch(updateLocale(locale));
|
|
58
|
+
return locale;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const addTranslationSourcePrefix = createAsyncThunk(
|
|
62
|
+
'locale/addTranslationSourcePrefix',
|
|
63
|
+
async (sourcePrefix: string, thunkAPI: any) => {
|
|
64
|
+
const { currentLocale, loadedKeys, sourcePrefixes } = thunkAPI.getState().locale;
|
|
65
|
+
const key = `${sourcePrefix}${currentLocale}`;
|
|
66
|
+
if (!sourcePrefixes.includes(sourcePrefix)) {
|
|
67
|
+
if (!loadedKeys.includes(key)) {
|
|
68
|
+
await loadLocaleAndRegisterLocaleFile(currentLocale, sourcePrefix);
|
|
69
|
+
thunkAPI.dispatch(loaded({ sourcePrefix, keys: [key] }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return key;
|
|
73
|
+
}
|
|
74
|
+
);
|
|
45
75
|
|
|
46
76
|
export const LocaleSlice = createSlice({
|
|
47
77
|
name: 'locale',
|
|
@@ -56,19 +86,22 @@ export const LocaleSlice = createSlice({
|
|
|
56
86
|
state.currentLocale = currentLocale;
|
|
57
87
|
},
|
|
58
88
|
loaded(state, action) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
addTranslationSourcePrefix(state, action) {
|
|
63
|
-
const sourcePrefix = action.payload;
|
|
64
|
-
if (!state.sourcePrefixes.includes(sourcePrefix)) {
|
|
89
|
+
const { keys, locale, sourcePrefix } = action.payload;
|
|
90
|
+
if (sourcePrefix && !state.sourcePrefixes.includes(sourcePrefix)) {
|
|
65
91
|
state.sourcePrefixes = state.sourcePrefixes.concat(sourcePrefix);
|
|
66
92
|
}
|
|
93
|
+
if (locale && !state.loadedLocales.includes(locale)) {
|
|
94
|
+
state.loadedLocales = state.loadedLocales.concat(locale);
|
|
95
|
+
}
|
|
96
|
+
if (keys) {
|
|
97
|
+
state.loadedKeys = state.loadedKeys.concat(keys);
|
|
98
|
+
}
|
|
99
|
+
state.lastChange = TranslatorContext.context.lastChange;
|
|
67
100
|
},
|
|
68
101
|
},
|
|
69
102
|
});
|
|
70
103
|
|
|
71
|
-
export const { updateLocale,
|
|
104
|
+
export const { updateLocale, loaded } = LocaleSlice.actions;
|
|
72
105
|
|
|
73
106
|
// Reducer
|
|
74
107
|
export default LocaleSlice.reducer;
|
|
@@ -36,7 +36,7 @@ const { DefinePlugin } = require('webpack');
|
|
|
36
36
|
},
|
|
37
37
|
<%_ } _%>
|
|
38
38
|
shared: {
|
|
39
|
-
...Object.fromEntries(Object.entries(packageJson.dependencies).map(([module]) => ([module, { singleton: true, shareScope: 'default' }]))),
|
|
39
|
+
...Object.fromEntries(Object.entries(packageJson.dependencies).map(([module, version]) => ([module, { requiredVersion: version, singleton: true, shareScope: 'default' }]))),
|
|
40
40
|
'app/config/constants': {
|
|
41
41
|
singleton: true,
|
|
42
42
|
import: 'app/config/constants',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@fortawesome/fontawesome-svg-core": "6.
|
|
4
|
-
"@fortawesome/free-solid-svg-icons": "6.
|
|
3
|
+
"@fortawesome/fontawesome-svg-core": "6.2.0",
|
|
4
|
+
"@fortawesome/free-solid-svg-icons": "6.2.0",
|
|
5
5
|
"@fortawesome/vue-fontawesome": "2.0.8",
|
|
6
6
|
"axios": "0.27.2",
|
|
7
7
|
"bootstrap": "4.6.2",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"vue-class-component": "7.2.6",
|
|
12
12
|
"vue-cookie": "1.1.4",
|
|
13
13
|
"vue-infinite-loading": "2.4.5",
|
|
14
|
-
"vue-router": "3.
|
|
14
|
+
"vue-router": "3.6.4",
|
|
15
15
|
"vue-i18n": "8.27.2",
|
|
16
16
|
"vue-property-decorator": "9.1.2",
|
|
17
17
|
"vuelidate": "0.7.7",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@rushstack/eslint-patch": "1.1.4",
|
|
23
|
-
"@types/jest": "28.1.
|
|
24
|
-
"@types/node": "16.11.
|
|
23
|
+
"@types/jest": "28.1.8",
|
|
24
|
+
"@types/node": "16.11.56",
|
|
25
25
|
"@types/sinon": "10.0.13",
|
|
26
26
|
"@types/vuelidate": "0.7.15",
|
|
27
27
|
"@vue/eslint-config-prettier": "7.0.0",
|
|
28
28
|
"@vue/eslint-config-typescript": "10.0.0",
|
|
29
|
-
"@vue/vue2-jest": "28.0
|
|
29
|
+
"@vue/vue2-jest": "28.1.0",
|
|
30
30
|
"@vue/test-utils": "1.3.0",
|
|
31
|
-
"axios-mock-adapter": "1.21.
|
|
31
|
+
"axios-mock-adapter": "1.21.2",
|
|
32
32
|
"autoprefixer": "10.4.8",
|
|
33
33
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
34
34
|
"copy-webpack-plugin": "11.0.0",
|
|
@@ -39,31 +39,31 @@
|
|
|
39
39
|
"html-webpack-plugin": "5.5.0",
|
|
40
40
|
"jest": "28.1.3",
|
|
41
41
|
"jest-environment-jsdom": "28.1.3",
|
|
42
|
-
"jest-junit": "14.0.
|
|
42
|
+
"jest-junit": "14.0.1",
|
|
43
43
|
"jest-serializer-vue": "2.0.2",
|
|
44
|
-
"jest-sonar
|
|
44
|
+
"jest-sonar": "0.2.12",
|
|
45
45
|
"jest-vue-preprocessor": "1.7.1",
|
|
46
46
|
"merge-jsons-webpack-plugin": "2.0.1",
|
|
47
47
|
"mini-css-extract-plugin": "2.6.1",
|
|
48
48
|
"numeral": "2.0.6",
|
|
49
|
-
"postcss-import": "
|
|
49
|
+
"postcss-import": "15.0.0",
|
|
50
50
|
"postcss-loader": "7.0.1",
|
|
51
51
|
"postcss-url": "10.1.3",
|
|
52
52
|
"rimraf": "3.0.2",
|
|
53
|
-
"sass": "1.54.
|
|
53
|
+
"sass": "1.54.8",
|
|
54
54
|
"sass-loader": "13.0.2",
|
|
55
55
|
"sinon": "14.0.0",
|
|
56
|
-
"terser-webpack-plugin": "5.3.
|
|
57
|
-
"ts-jest": "28.0.
|
|
56
|
+
"terser-webpack-plugin": "5.3.6",
|
|
57
|
+
"ts-jest": "28.0.8",
|
|
58
58
|
"ts-loader": "9.3.1",
|
|
59
|
-
"eslint": "8.
|
|
59
|
+
"eslint": "8.23.0",
|
|
60
60
|
"eslint-plugin-prettier": "4.2.1",
|
|
61
61
|
"eslint-plugin-vue": "8.7.1",
|
|
62
|
-
"typescript": "4.
|
|
62
|
+
"typescript": "4.8.2",
|
|
63
63
|
"webpack": "5.74.0",
|
|
64
|
-
"webpack-bundle-analyzer": "4.
|
|
64
|
+
"webpack-bundle-analyzer": "4.6.1",
|
|
65
65
|
"webpack-cli": "4.10.0",
|
|
66
|
-
"webpack-dev-server": "4.
|
|
66
|
+
"webpack-dev-server": "4.10.1",
|
|
67
67
|
"webpack-merge": "5.8.0",
|
|
68
68
|
"workbox-webpack-plugin": "6.5.4",
|
|
69
69
|
"vue-jest": "3.0.7",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"jest-environment-jsdom": "<%= dependabotPackageJson.devDependencies['jest-environment-jsdom'] %>",
|
|
93
93
|
"jest-junit": "<%= dependabotPackageJson.devDependencies['jest-junit'] %>",
|
|
94
94
|
"jest-serializer-vue": "<%= dependabotPackageJson.devDependencies['jest-serializer-vue'] %>",
|
|
95
|
-
"jest-sonar
|
|
95
|
+
"jest-sonar": "<%= dependabotPackageJson.devDependencies['jest-sonar'] %>",
|
|
96
96
|
<%_ if (enableTranslation) { _%>
|
|
97
97
|
"folder-hash": "<%= dependabotPackageJson.devDependencies['folder-hash'] %>",
|
|
98
98
|
"merge-jsons-webpack-plugin": "<%= dependabotPackageJson.devDependencies['merge-jsons-webpack-plugin'] %>",
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
"default_environment": "prod"
|
|
145
145
|
},
|
|
146
146
|
"scripts": {
|
|
147
|
-
"prettier:check": "prettier --check \"{,src/**/,webpack
|
|
148
|
-
"prettier:format": "prettier --write \"{,src/**/,webpack
|
|
147
|
+
"prettier:check": "prettier --check \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"",
|
|
148
|
+
"prettier:format": "prettier --write \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"",
|
|
149
149
|
"lint": "eslint . --ext .ts,.vue ",
|
|
150
150
|
"lint:fix": "eslint . --ext .ts,.vue --fix",
|
|
151
151
|
"cleanup": "rimraf <%= DIST_DIR %>",
|
|
@@ -191,10 +191,6 @@
|
|
|
191
191
|
"webpack-dev-server": "webpack serve --config webpack/webpack.common.js",
|
|
192
192
|
"webpack": "webpack --config webpack/webpack.common.js"
|
|
193
193
|
},
|
|
194
|
-
"jestSonar": {
|
|
195
|
-
"reportPath": "<%= BUILD_DIR %>test-results/jest",
|
|
196
|
-
"reportFile": "TESTS-results-sonar.xml"
|
|
197
|
-
},
|
|
198
194
|
"browserslist": [
|
|
199
195
|
"> 1%",
|
|
200
196
|
"last 2 versions",
|
|
@@ -31,7 +31,8 @@ export default class JhiNavbar extends Vue {
|
|
|
31
31
|
|
|
32
32
|
created() {
|
|
33
33
|
<%_ if (enableTranslation) { _%>
|
|
34
|
-
this.
|
|
34
|
+
const currentLanguage = Object.keys(this.languages).includes(navigator.language) ? navigator.language : this.currentLanguage;
|
|
35
|
+
this.translationService().refreshTranslation(currentLanguage);
|
|
35
36
|
<%_ } _%>
|
|
36
37
|
}
|
|
37
38
|
|
package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<font-awesome-icon icon="users-cog" />
|
|
54
54
|
<span class="no-bold" v-text="$t('global.menu.admin.main')">Administration</span>
|
|
55
55
|
</span>
|
|
56
|
-
<%_ if (applicationTypeGateway &&
|
|
56
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
57
57
|
<b-dropdown-item to="/admin/gateway" active-class="active">
|
|
58
58
|
<font-awesome-icon icon="road" />
|
|
59
59
|
<span v-text="$t('global.menu.admin.gateway')">Gateway</span>
|
|
@@ -33,7 +33,7 @@ import '../content/scss/vendor.scss';
|
|
|
33
33
|
<%_ if (enableTranslation) { _%>
|
|
34
34
|
import TranslationService from '@/locale/translation.service';
|
|
35
35
|
<%_ } _%>
|
|
36
|
-
<%_ if (applicationTypeGateway &&
|
|
36
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { %>
|
|
37
37
|
import GatewayService from '@/admin/gateway/gateway.service';
|
|
38
38
|
<%_ } _%>
|
|
39
39
|
<%_ if (communicationSpringWebsocket) { _%>
|
|
@@ -107,7 +107,7 @@ router.beforeEach(async (to, from, next) => {
|
|
|
107
107
|
registerService: () => new RegisterService(),
|
|
108
108
|
userManagementService: () => new UserManagementService(),
|
|
109
109
|
<%_ } _%>
|
|
110
|
-
<%_ if (applicationTypeGateway &&
|
|
110
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { %>
|
|
111
111
|
gatewayService: () => new GatewayService(),
|
|
112
112
|
<%_ } _%>
|
|
113
113
|
<%_ if (withAdminUi) { _%>
|
|
@@ -12,7 +12,7 @@ import {Authority} from "@/shared/security/authority";
|
|
|
12
12
|
const <%= jhiPrefixCapitalized %>LogsComponent = () => import('@/admin/logs/logs.vue');
|
|
13
13
|
const <%= jhiPrefixCapitalized %>MetricsComponent = () => import('@/admin/metrics/metrics.vue');
|
|
14
14
|
<%_ } _%>
|
|
15
|
-
<%_ if (applicationTypeGateway &&
|
|
15
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
16
16
|
const <%= jhiPrefixCapitalized %>GatewayComponent = () => import('@/admin/gateway/gateway.vue');
|
|
17
17
|
<%_ } _%>
|
|
18
18
|
<%_ if (communicationSpringWebsocket) { _%>
|
|
@@ -78,7 +78,7 @@ export default [
|
|
|
78
78
|
meta: { authorities: [Authority.ADMIN] }
|
|
79
79
|
},
|
|
80
80
|
<%_ } _%>
|
|
81
|
-
<%_ if (applicationTypeGateway &&
|
|
81
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
82
82
|
{
|
|
83
83
|
path: '/admin/gateway',
|
|
84
84
|
name: '<%= jhiPrefixCapitalized %>GatewayComponent',
|
|
@@ -30,7 +30,7 @@ describe('Administration', () => {
|
|
|
30
30
|
});
|
|
31
31
|
<%_ } _%>
|
|
32
32
|
|
|
33
|
-
<%_ if (applicationTypeGateway &&
|
|
33
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
34
34
|
it('should load gateway', async () => {
|
|
35
35
|
const gatewayPage = await navBarPage.getGatewayPage();
|
|
36
36
|
expect(await gatewayPage.title.isDisplayed()).to.be.true;
|
|
@@ -88,7 +88,7 @@ export class UserManagementDeletePage {
|
|
|
88
88
|
okButton: ElementFinder = element(by.id('confirm-delete-user'));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
<%_ if (applicationTypeGateway &&
|
|
91
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
92
92
|
export class GatewayPage {
|
|
93
93
|
title: ElementFinder = element(by.id('gateway-page-heading'));
|
|
94
94
|
}
|
package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/navbar-page.ts.ejs
CHANGED
|
@@ -8,7 +8,7 @@ import SettingsPage from './settings-page';
|
|
|
8
8
|
<%_ } _%>
|
|
9
9
|
import {
|
|
10
10
|
ConfigurationsPage,
|
|
11
|
-
<%_ if (applicationTypeGateway &&
|
|
11
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
12
12
|
GatewayPage,
|
|
13
13
|
<%_ } _%>
|
|
14
14
|
HealthPage,
|
|
@@ -155,7 +155,7 @@ async getRegisterPage() {
|
|
|
155
155
|
await waitUntilDisplayed(logsPage.title);
|
|
156
156
|
return logsPage;
|
|
157
157
|
}
|
|
158
|
-
<%_ if (applicationTypeGateway &&
|
|
158
|
+
<%_ if (applicationTypeGateway && serviceDiscoveryAny) { _%>
|
|
159
159
|
|
|
160
160
|
async getGatewayPage() {
|
|
161
161
|
await this.clickOnAdminMenuItem('gateway');
|
|
@@ -24,10 +24,13 @@ module.exports = {
|
|
|
24
24
|
},
|
|
25
25
|
reporters: [
|
|
26
26
|
'default',
|
|
27
|
-
[
|
|
27
|
+
['jest-junit', { outputDirectory: './<%= BUILD_DIR %>test-results/', outputName: 'TESTS-results-jest.xml' }],
|
|
28
|
+
['jest-sonar', { outputDirectory: './<%= BUILD_DIR %>test-results/jest', outputName: 'TESTS-results-sonar.xml' }],
|
|
28
29
|
],
|
|
29
|
-
testResultsProcessor: 'jest-sonar-reporter',
|
|
30
30
|
testMatch: ['<rootDir>/<%= CLIENT_TEST_SRC_DIR %>spec/**/@(*.)@(spec.ts)'],
|
|
31
|
+
testEnvironmentOptions: {
|
|
32
|
+
url: 'https://jhipster.tech',
|
|
33
|
+
},
|
|
31
34
|
snapshotSerializers: ['jest-serializer-vue'],
|
|
32
35
|
globals: {
|
|
33
36
|
<%_ if (enableTranslation) { _%>
|
|
@@ -42,11 +45,7 @@ module.exports = {
|
|
|
42
45
|
coverageThreshold: {
|
|
43
46
|
global: {
|
|
44
47
|
statements: 80,
|
|
45
|
-
<%_ if (microfrontend) { _%>
|
|
46
|
-
branches: 57,
|
|
47
|
-
<%_ } else { _%>
|
|
48
48
|
branches: 60,
|
|
49
|
-
<%_ } _%>
|
|
50
49
|
functions: 70,
|
|
51
50
|
lines: 80,
|
|
52
51
|
},
|
|
@@ -88,6 +88,8 @@ describe('Account Service test suite', () => {
|
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
it('should init service and check for authority after retrieving account', async () => {
|
|
91
|
+
const reqUrl = 'requrl';
|
|
92
|
+
sessionStorage.setItem('requested-url', reqUrl);
|
|
91
93
|
<%_ if (authenticationTypeJwt) { _%>
|
|
92
94
|
localStorage.setItem('<%=jhiPrefixDashed %>-authenticationToken', 'token');
|
|
93
95
|
<%_ } %>
|
|
@@ -95,6 +97,8 @@ describe('Account Service test suite', () => {
|
|
|
95
97
|
accountService = await new AccountService(store, <%_ if (enableTranslation) { _%>new TranslationService(store, i18n),<%_ } %><%_ if (authenticationTypeSession || authenticationTypeOauth2) { _%>mockedCookie,<%_ } %> router);
|
|
96
98
|
|
|
97
99
|
return accountService.hasAnyAuthorityAndCheckAuth('USER').then((value: boolean) => {
|
|
100
|
+
expect((<any>router).history.current.fullPath).toBe(`/${reqUrl}`);
|
|
101
|
+
expect(sessionStorage.getItem('requested-url')).toBe(null);
|
|
98
102
|
expect(value).toBe(true);
|
|
99
103
|
});
|
|
100
104
|
});
|
|
@@ -40,7 +40,7 @@ describe('Alert Service test suite', () => {
|
|
|
40
40
|
// WHEN
|
|
41
41
|
alertService.showError((<any>vueInstance) as Vue, <% if (enableTranslation) { %>translationKey<%} else {%>message<% } %>);
|
|
42
42
|
|
|
43
|
-
//THEN
|
|
43
|
+
// THEN
|
|
44
44
|
<%_ if (enableTranslation) { _%>
|
|
45
45
|
expect(translationStub.withArgs(translationKey).callCount).toEqual(1);
|
|
46
46
|
<%_ } _%>
|
|
@@ -71,7 +71,7 @@ describe('Alert Service test suite', () => {
|
|
|
71
71
|
// WHEN
|
|
72
72
|
alertService.showHttpError((<any>vueInstance) as Vue, httpErrorResponse);
|
|
73
73
|
|
|
74
|
-
//THEN
|
|
74
|
+
// THEN
|
|
75
75
|
<%_ if (enableTranslation) { _%>
|
|
76
76
|
expect(translationStub.withArgs(translationKey).callCount).toEqual(1);
|
|
77
77
|
<%_ } _%>
|
|
@@ -107,7 +107,7 @@ describe('Alert Service test suite', () => {
|
|
|
107
107
|
// WHEN
|
|
108
108
|
alertService.showHttpError((<any>vueInstance) as Vue, httpErrorResponse);
|
|
109
109
|
|
|
110
|
-
//THEN
|
|
110
|
+
// THEN
|
|
111
111
|
<%_ if (enableTranslation) { _%>
|
|
112
112
|
expect(translationStub.withArgs(translationKey, { entityName: 'DummyEntity' }).callCount).toEqual(1);
|
|
113
113
|
<%_ } _%>
|
|
@@ -121,4 +121,107 @@ describe('Alert Service test suite', () => {
|
|
|
121
121
|
})
|
|
122
122
|
).toBeTruthy();
|
|
123
123
|
});
|
|
124
|
+
|
|
125
|
+
it('should show error toast with data.message when http status = 400 and entity headers', async () => {
|
|
126
|
+
const message = 'Validation error';
|
|
127
|
+
const httpErrorResponse = {
|
|
128
|
+
status: 400,
|
|
129
|
+
headers: {
|
|
130
|
+
'x-jhipsterapp-error400': 'error',
|
|
131
|
+
'x-jhipsterapp-params400': 'dummyEntity',
|
|
132
|
+
},
|
|
133
|
+
data: {
|
|
134
|
+
message,
|
|
135
|
+
fieldErrors: {
|
|
136
|
+
'field1': 'error1',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
<%_ if (enableTranslation) { _%>
|
|
142
|
+
// GIVEN
|
|
143
|
+
translationStub.withArgs(message).returns(message);
|
|
144
|
+
<%_ } _%>
|
|
145
|
+
|
|
146
|
+
// WHEN
|
|
147
|
+
alertService.showHttpError((<any>vueInstance) as Vue, httpErrorResponse);
|
|
148
|
+
|
|
149
|
+
// THEN
|
|
150
|
+
<%_ if (enableTranslation) { _%>
|
|
151
|
+
expect(translationStub.withArgs(message).callCount).toEqual(1);
|
|
152
|
+
<%_ } _%>
|
|
153
|
+
expect(
|
|
154
|
+
toastStub.calledOnceWith(message, {
|
|
155
|
+
toaster: 'b-toaster-top-center',
|
|
156
|
+
title: 'Error',
|
|
157
|
+
variant: 'danger',
|
|
158
|
+
solid: true,
|
|
159
|
+
autoHideDelay: 5000,
|
|
160
|
+
})
|
|
161
|
+
).toBeTruthy();
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('should show error toast when http status = 404', async () => {
|
|
165
|
+
<%_ if (enableTranslation) { _%>
|
|
166
|
+
const translationKey = 'error.http.404';
|
|
167
|
+
<%_ } _%>
|
|
168
|
+
const message = 'Not found';
|
|
169
|
+
const httpErrorResponse = {
|
|
170
|
+
status: 404,
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
<%_ if (enableTranslation) { _%>
|
|
174
|
+
// GIVEN
|
|
175
|
+
translationStub.withArgs(translationKey).returns(message);
|
|
176
|
+
<%_ } _%>
|
|
177
|
+
|
|
178
|
+
// WHEN
|
|
179
|
+
alertService.showHttpError((<any>vueInstance) as Vue, httpErrorResponse);
|
|
180
|
+
|
|
181
|
+
// THEN
|
|
182
|
+
<%_ if (enableTranslation) { _%>
|
|
183
|
+
expect(translationStub.withArgs(translationKey).callCount).toEqual(1);
|
|
184
|
+
<%_ } _%>
|
|
185
|
+
expect(
|
|
186
|
+
toastStub.calledOnceWith(message, {
|
|
187
|
+
toaster: 'b-toaster-top-center',
|
|
188
|
+
title: 'Error',
|
|
189
|
+
variant: 'danger',
|
|
190
|
+
solid: true,
|
|
191
|
+
autoHideDelay: 5000,
|
|
192
|
+
})
|
|
193
|
+
).toBeTruthy();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('should show error toast when http status != 400,404', async () => {
|
|
197
|
+
const message = 'Error 500';
|
|
198
|
+
const httpErrorResponse = {
|
|
199
|
+
status: 500,
|
|
200
|
+
data: {
|
|
201
|
+
message,
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
<%_ if (enableTranslation) { _%>
|
|
206
|
+
// GIVEN
|
|
207
|
+
translationStub.withArgs(message).returns(message);
|
|
208
|
+
<%_ } _%>
|
|
209
|
+
|
|
210
|
+
// WHEN
|
|
211
|
+
alertService.showHttpError((<any>vueInstance) as Vue, httpErrorResponse);
|
|
212
|
+
|
|
213
|
+
// THEN
|
|
214
|
+
<%_ if (enableTranslation) { _%>
|
|
215
|
+
expect(translationStub.withArgs(message).callCount).toEqual(1);
|
|
216
|
+
<%_ } _%>
|
|
217
|
+
expect(
|
|
218
|
+
toastStub.calledOnceWith(message, {
|
|
219
|
+
toaster: 'b-toaster-top-center',
|
|
220
|
+
title: 'Error',
|
|
221
|
+
variant: 'danger',
|
|
222
|
+
solid: true,
|
|
223
|
+
autoHideDelay: 5000,
|
|
224
|
+
})
|
|
225
|
+
).toBeTruthy();
|
|
226
|
+
});
|
|
124
227
|
});
|
|
@@ -56,5 +56,17 @@ describe('Axios errors interceptor', () => {
|
|
|
56
56
|
expect(callback.called).toBeTruthy();
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
+
it('should not use callback for errors different 50x, 401, 403', async () => {
|
|
60
|
+
const callback = sinon.spy();
|
|
61
|
+
|
|
62
|
+
setupAxiosConfig.setupAxiosInterceptors(() => {}, callback);
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
mock.onGet().reply(402);
|
|
66
|
+
await axios('/api/test');
|
|
67
|
+
} catch {
|
|
68
|
+
expect(callback.called).toBeFalsy();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
59
71
|
});
|
|
60
72
|
|
|
@@ -12,4 +12,10 @@ describe('Formatter i18n', () => {
|
|
|
12
12
|
|
|
13
13
|
expect(result[0]).toBe('val1');
|
|
14
14
|
});
|
|
15
|
+
|
|
16
|
+
it('should not interpolate message without values', () => {
|
|
17
|
+
const result = formatter.interpolate('this is a text', undefined);
|
|
18
|
+
|
|
19
|
+
expect(result[0]).toBe('this is a text');
|
|
20
|
+
});
|
|
15
21
|
});
|
|
@@ -156,7 +156,7 @@ module.exports = async (env, options) => {
|
|
|
156
156
|
globOptions: { ignore: ['**/index.html'] },
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
|
-
from: require.resolve('axios/dist/axios.min.js'),
|
|
159
|
+
from: require.resolve('axios/dist/axios.min.js'),
|
|
160
160
|
to: 'swagger-ui/',
|
|
161
161
|
},
|
|
162
162
|
{ from: './<%= CLIENT_MAIN_SRC_DIR %>swagger-ui/', to: 'swagger-ui/' },
|
|
@@ -31,8 +31,8 @@ module.exports = (env, options) => {
|
|
|
31
31
|
// cheap-module-eval-source-map is faster for development
|
|
32
32
|
devtool: config.dev.devtool,
|
|
33
33
|
output: {
|
|
34
|
-
filename: 'app/[contenthash].bundle.js',
|
|
35
|
-
chunkFilename: 'app/[id].chunk.js'
|
|
34
|
+
filename: 'app/[name].[contenthash].bundle.js',
|
|
35
|
+
chunkFilename: 'app/[id].[chunkhash].chunk.js'
|
|
36
36
|
},
|
|
37
37
|
optimization: {
|
|
38
38
|
moduleIds: 'named',
|
|
@@ -46,13 +46,14 @@ const commonFiles = {
|
|
|
46
46
|
file: 'editorconfig',
|
|
47
47
|
renameTo: () => '.editorconfig',
|
|
48
48
|
},
|
|
49
|
-
{
|
|
50
|
-
file: 'sonar-project.properties',
|
|
51
|
-
renameTo: () => 'sonar-project.properties',
|
|
52
|
-
},
|
|
53
49
|
],
|
|
54
50
|
},
|
|
55
51
|
],
|
|
52
|
+
sonar: [
|
|
53
|
+
{
|
|
54
|
+
templates: ['sonar-project.properties'],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
56
57
|
commitHooks: [
|
|
57
58
|
{
|
|
58
59
|
condition: generator => !generator.skipCommitHook,
|
|
File without changes
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
sonar.projectKey=<%= baseName %>
|
|
2
2
|
sonar.projectName=<%= baseName %> generated by jhipster
|
|
3
|
-
sonar.projectVersion=1.0
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
# Typescript tests files must be inside sources and tests, othewise `INFO: Test execution data ignored for 80 unknown files, including:` is shown.
|
|
5
|
+
sonar.sources=src
|
|
6
|
+
sonar.tests=src
|
|
6
7
|
sonar.host.url=http://localhost:9001
|
|
7
8
|
|
|
8
|
-
<%_ if (
|
|
9
|
+
<%_ if (clientFrameworkAny) { _%>
|
|
10
|
+
<%_ if (clientFrameworkAngular) { _%>
|
|
9
11
|
sonar.test.inclusions=<%= TEST_DIR %>**/*.*, <%= CLIENT_MAIN_SRC_DIR %>app/**/*.spec.ts
|
|
10
|
-
<%_ } else if (
|
|
12
|
+
<%_ } else if (clientFrameworkReact) { _%>
|
|
11
13
|
sonar.test.inclusions=<%= TEST_DIR %>**/*.*, <%= CLIENT_MAIN_SRC_DIR %>app/**/*.spec.ts, <%= CLIENT_MAIN_SRC_DIR %>app/**/*.spec.tsx
|
|
14
|
+
<%_ } else { _%>
|
|
15
|
+
sonar.test.inclusions=<%= TEST_DIR %>**/*.*
|
|
16
|
+
<%_ } _%>
|
|
12
17
|
<%_ } else { _%>
|
|
13
|
-
sonar.
|
|
18
|
+
sonar.test.inclusions=<%= TEST_DIR %>**/*.*
|
|
14
19
|
<%_ } _%>
|
|
15
20
|
<%_ if (!skipServer) { _%>
|
|
16
21
|
<%_ if (buildToolMaven) { _%>
|
|
@@ -33,21 +38,24 @@ sonar.javascript.lcov.reportPaths=<%_ if (buildToolMaven) { _%>target<%_ } else
|
|
|
33
38
|
sonar.sourceEncoding=UTF-8
|
|
34
39
|
sonar.exclusions=<%= CLIENT_MAIN_SRC_DIR %>content/**/*.*, <%= CLIENT_MAIN_SRC_DIR %>i18n/*.js, <%= CLIENT_DIST_DIR %>**/*.*
|
|
35
40
|
|
|
36
|
-
sonar.issue.ignore.multicriteria=<%_ if (!skipServer) { _%>S3437,<% if (authenticationTypeJwt) { %>S4502,<% } %>S4684,UndocumentedApi<%_ } _%>
|
|
41
|
+
sonar.issue.ignore.multicriteria=<%_ if (!skipServer) { _%>S3437,<% if (authenticationTypeJwt) { %>S4502,<% } %>S4684,S5145,UndocumentedApi<%_ } _%>
|
|
37
42
|
|
|
38
43
|
<%_ if (!skipServer) { _%>
|
|
39
44
|
# Rule https://rules.sonarsource.com/java/RSPEC-3437 is ignored, as a JPA-managed field cannot be transient
|
|
40
45
|
sonar.issue.ignore.multicriteria.S3437.resourceKey=<%= MAIN_DIR %>java/**/*
|
|
41
46
|
sonar.issue.ignore.multicriteria.S3437.ruleKey=squid:S3437
|
|
42
|
-
|
|
43
|
-
sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey=<%= MAIN_DIR %>java/**/*
|
|
44
|
-
sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey=squid:UndocumentedApi
|
|
45
|
-
<%_ if (authenticationTypeJwt) { _%>
|
|
47
|
+
<%_ if (authenticationTypeJwt) { _%>
|
|
46
48
|
# Rule https://rules.sonarsource.com/java/RSPEC-4502 is ignored, as for JWT tokens we are not subject to CSRF attack
|
|
47
49
|
sonar.issue.ignore.multicriteria.S4502.resourceKey=<%= MAIN_DIR %>java/**/*
|
|
48
50
|
sonar.issue.ignore.multicriteria.S4502.ruleKey=java:S4502
|
|
49
|
-
<%_ } _%>
|
|
51
|
+
<%_ } _%>
|
|
50
52
|
# Rule https://rules.sonarsource.com/java/RSPEC-4684
|
|
51
53
|
sonar.issue.ignore.multicriteria.S4684.resourceKey=<%= MAIN_DIR %>java/**/*
|
|
52
54
|
sonar.issue.ignore.multicriteria.S4684.ruleKey=java:S4684
|
|
55
|
+
# Rule https://rules.sonarsource.com/java/RSPEC-5145 log filter is applied
|
|
56
|
+
sonar.issue.ignore.multicriteria.S5145.resourceKey=<%= MAIN_DIR %>java/**/*
|
|
57
|
+
sonar.issue.ignore.multicriteria.S5145.ruleKey=javasecurity:S5145
|
|
58
|
+
# Rule https://rules.sonarsource.com/java/RSPEC-1176 is ignored, as we want to follow "clean code" guidelines and classes, methods and arguments names should be self-explanatory
|
|
59
|
+
sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey=<%= MAIN_DIR %>java/**/*
|
|
60
|
+
sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey=squid:UndocumentedApi
|
|
53
61
|
<%_ } _%>
|