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
|
@@ -66,27 +66,21 @@
|
|
|
66
66
|
"ts-node": "8.10.1",
|
|
67
67
|
"webdriver-manager": "12.1.8",
|
|
68
68
|
<%_ } _%>
|
|
69
|
-
"babel-core": "<%= dependabotPackageJson.devDependencies['babel-core'] %>",
|
|
70
69
|
"@types/jest": "<%= dependabotPackageJson.devDependencies['@types/jest'] %>",
|
|
71
70
|
"@types/node": "<%= dependabotPackageJson.devDependencies['@types/node'] %>",
|
|
72
71
|
"@types/sinon": "<%= dependabotPackageJson.devDependencies['@types/sinon'] %>",
|
|
73
72
|
"@types/vuelidate": "<%= dependabotPackageJson.devDependencies['@types/vuelidate'] %>",
|
|
74
73
|
"@typescript-eslint/eslint-plugin": "<%= dependabotPackageJson.devDependencies['@typescript-eslint/eslint-plugin'] %>",
|
|
75
74
|
"@typescript-eslint/parser": "<%= dependabotPackageJson.devDependencies['@typescript-eslint/parser'] %>",
|
|
76
|
-
"@vue/cli-plugin-eslint": "<%= dependabotPackageJson.devDependencies['@vue/cli-plugin-eslint'] %>",
|
|
77
|
-
"@vue/cli-plugin-typescript": "<%= dependabotPackageJson.devDependencies['@vue/cli-plugin-typescript'] %>",
|
|
78
|
-
"@vue/cli-service": "<%= dependabotPackageJson.devDependencies['@vue/cli-service'] %>",
|
|
79
75
|
"@vue/eslint-config-prettier": "<%= dependabotPackageJson.devDependencies['@vue/eslint-config-prettier'] %>",
|
|
80
76
|
"@vue/eslint-config-typescript": "<%= dependabotPackageJson.devDependencies['@vue/eslint-config-typescript'] %>",
|
|
81
77
|
"@vue/test-utils": "<%= dependabotPackageJson.devDependencies['@vue/test-utils'] %>",
|
|
82
78
|
"axios-mock-adapter": "<%= dependabotPackageJson.devDependencies['axios-mock-adapter'] %>",
|
|
83
79
|
"autoprefixer": "<%= dependabotPackageJson.devDependencies['autoprefixer'] %>",
|
|
84
|
-
"browser-sync": "<%= dependabotPackageJson.devDependencies['browser-sync'] %>",
|
|
85
80
|
"browser-sync-webpack-plugin": "<%= dependabotPackageJson.devDependencies['browser-sync-webpack-plugin'] %>",
|
|
86
81
|
"copy-webpack-plugin": "<%= dependabotPackageJson.devDependencies['copy-webpack-plugin'] %>",
|
|
87
82
|
"css-loader": "<%= dependabotPackageJson.devDependencies['css-loader'] %>",
|
|
88
83
|
"css-minimizer-webpack-plugin": "<%= dependabotPackageJson.devDependencies['css-minimizer-webpack-plugin'] %>",
|
|
89
|
-
"file-loader": "<%= dependabotPackageJson.devDependencies['file-loader'] %>",
|
|
90
84
|
"fork-ts-checker-webpack-plugin": "<%= dependabotPackageJson.devDependencies['fork-ts-checker-webpack-plugin'] %>",
|
|
91
85
|
<%_ if (!skipJhipsterDependencies) { _%>
|
|
92
86
|
"generator-jhipster": "<%= packagejs.version %>",
|
|
@@ -106,7 +100,6 @@
|
|
|
106
100
|
<%_ } _%>
|
|
107
101
|
"mini-css-extract-plugin": "<%= dependabotPackageJson.devDependencies['mini-css-extract-plugin'] %>",
|
|
108
102
|
"numeral": "<%= dependabotPackageJson.devDependencies['numeral'] %>",
|
|
109
|
-
"postcss": "<%= dependabotPackageJson.devDependencies['postcss'] %>",
|
|
110
103
|
"postcss-import": "<%= dependabotPackageJson.devDependencies['postcss-import'] %>",
|
|
111
104
|
"postcss-loader": "<%= dependabotPackageJson.devDependencies['postcss-loader'] %>",
|
|
112
105
|
"postcss-url": "<%= dependabotPackageJson.devDependencies['postcss-url'] %>",
|
|
@@ -129,8 +122,11 @@
|
|
|
129
122
|
"eslint-plugin-prettier": "<%= dependabotPackageJson.devDependencies['eslint-plugin-prettier'] %>",
|
|
130
123
|
"eslint-plugin-vue": "<%= dependabotPackageJson.devDependencies['eslint-plugin-vue'] %>",
|
|
131
124
|
"typescript": "<%= dependabotPackageJson.devDependencies['typescript'] %>",
|
|
132
|
-
|
|
125
|
+
<%_ if (microfrontend) { _%>
|
|
126
|
+
"@vue/vue2-jest": "<%= dependabotPackageJson.devDependencies['@vue/vue2-jest'] %>",
|
|
127
|
+
<%_ } else { _%>
|
|
133
128
|
"vue-jest": "<%= dependabotPackageJson.devDependencies['vue-jest'] %>",
|
|
129
|
+
<%_ } _%>
|
|
134
130
|
"vue-loader": "<%= dependabotPackageJson.devDependencies['vue-loader'] %>",
|
|
135
131
|
"vue-template-compiler": "<%= dependabotPackageJson.dependencies['vue'] %>",
|
|
136
132
|
"webpack": "<%= dependabotPackageJson.devDependencies['webpack'] %>",
|
|
@@ -150,14 +146,15 @@
|
|
|
150
146
|
"scripts": {
|
|
151
147
|
"prettier:check": "prettier --check \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"",
|
|
152
148
|
"prettier:format": "prettier --write \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"",
|
|
153
|
-
"lint": "
|
|
154
|
-
"lint:fix": "vue
|
|
149
|
+
"lint": "eslint . --ext .ts,.vue ",
|
|
150
|
+
"lint:fix": "eslint . --ext .ts,.vue --fix",
|
|
155
151
|
"cleanup": "rimraf <%= DIST_DIR %>",
|
|
156
152
|
"clean-www": "rimraf <%= DIST_DIR %>app/{src,<%= BUILD_DIR %>}",
|
|
157
153
|
"start": "<%= clientPackageManager %> run webapp:dev --",
|
|
158
154
|
"start-tls": "<%= clientPackageManager %> run webapp:dev -- --env.tls",
|
|
159
155
|
"serve": "<%= clientPackageManager %> run start --",
|
|
160
156
|
"build": "<%= clientPackageManager %> run webapp:prod --",
|
|
157
|
+
"build-watch": "concurrently 'npm run webapp:build:dev -- --watch'<% if(!skipServer) { %> npm:backend:start<% } %>",
|
|
161
158
|
<%_ if (protractorTests && !cypressTests) { _%>
|
|
162
159
|
"e2e": "<%= clientPackageManager %> run e2e:protractor --",
|
|
163
160
|
"e2e:headless": "<%= clientPackageManager %> run e2e:protractor:headless --",
|
|
@@ -184,6 +181,7 @@
|
|
|
184
181
|
"test": "<%= clientPackageManager %> run jest --",
|
|
185
182
|
"test-ci": "<%= clientPackageManager %> run lint && <%= clientPackageManager %> run jest:update --",
|
|
186
183
|
"test:watch": "<%= clientPackageManager %> run jest -- --watch",
|
|
184
|
+
"watch": "concurrently npm:start<% if(!skipServer) { %> npm:backend:start<% } %>",
|
|
187
185
|
"webapp:build": "<%= clientPackageManager %> run clean-www && <%= clientPackageManager %> run webapp:build:dev --",
|
|
188
186
|
"webapp:build:dev": "<%= clientPackageManager %> run webpack -- --mode development --progress=profile --env stats=minimal",
|
|
189
187
|
"webapp:build:prod": "<%= clientPackageManager %> run webpack -- --mode production --progress=profile --env stats=minimal",
|
|
@@ -88,9 +88,8 @@ export default class AccountService {
|
|
|
88
88
|
const token = <%_ if (authenticationTypeJwt) { _%> localStorage.getItem('<%=jhiPrefixDashed %>-authenticationToken') || sessionStorage.getItem('<%=jhiPrefixDashed %>-authenticationToken'); <%_ } else { _%> this.cookie.get('JSESSIONID') || this.cookie.get('XSRF-TOKEN'); <%_ } _%>
|
|
89
89
|
if (!this.store.getters.account && !this.store.getters.logon && token) {
|
|
90
90
|
return this.retrieveAccount();
|
|
91
|
-
} else {
|
|
92
|
-
return Promise.resolve(false);
|
|
93
91
|
}
|
|
92
|
+
return Promise.resolve(false);
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
for (const authority of authorities) {
|
package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
<div class="row justify-content-center">
|
|
4
4
|
<div class="col-md-8 toastify-container">
|
|
5
5
|
<h2 v-if="username" id="settings-title">
|
|
6
|
-
<span v-html="$t('settings.title', { 'username': username })">
|
|
6
|
+
<span v-html="$t('settings.title', { 'username': username })">
|
|
7
|
+
User settings for [
|
|
8
|
+
<strong>
|
|
9
|
+
{{username}}
|
|
10
|
+
</strong>
|
|
11
|
+
]
|
|
12
|
+
</span>
|
|
7
13
|
</h2>
|
|
8
14
|
|
|
9
15
|
<div class="alert alert-success" role="alert" v-if="success" v-html="$t('settings.messages.success')">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</tr>
|
|
18
18
|
</thead>
|
|
19
19
|
<tbody>
|
|
20
|
-
<tr v-for="entry in orderBy(filterBy(configuration, filtered), orderProp, reverse
|
|
20
|
+
<tr v-for="entry in orderBy(filterBy(configuration, filtered), orderProp, reverse ? 1 : -1)"
|
|
21
21
|
:key="entry.prefix">
|
|
22
22
|
<td>
|
|
23
23
|
<span>{{ entry.prefix }}</span>
|
package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs
CHANGED
|
@@ -107,7 +107,7 @@ export default class <%=jhiPrefixCapitalized%>Metrics extends Vue {
|
|
|
107
107
|
} else {
|
|
108
108
|
plural = '';
|
|
109
109
|
}
|
|
110
|
-
time_string += Math.floor(ms / times[key])
|
|
110
|
+
time_string += `${Math.floor(ms / times[key])} ${key}${plural} `;
|
|
111
111
|
ms = ms - times[key] * Math.floor(ms / times[key]);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -5,7 +5,18 @@ import AccountService from '@/account/account.service';
|
|
|
5
5
|
import TranslationService from '@/locale/translation.service';
|
|
6
6
|
<%_ } %>
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import EntitiesMenu from '@/entities/entities-menu.vue';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
components: {
|
|
12
|
+
'entities-menu': EntitiesMenu,
|
|
13
|
+
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
14
|
+
<%_ for (const remote of remotes) { _%>
|
|
15
|
+
'<%= remote.lowercaseBaseName %>-menu': () => import('@<%= remote.lowercaseBaseName %>/entities-menu'),
|
|
16
|
+
<%_ } _%>
|
|
17
|
+
<%_ } _%>
|
|
18
|
+
},
|
|
19
|
+
})
|
|
9
20
|
export default class JhiNavbar extends Vue {
|
|
10
21
|
@Inject('loginService')
|
|
11
22
|
private loginService: () => LoginService;
|
package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs
CHANGED
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
<font-awesome-icon icon="th-list" />
|
|
34
34
|
<span class="no-bold" v-text="$t('global.menu.entities.main')">Entities</span>
|
|
35
35
|
</span>
|
|
36
|
+
<entities-menu></entities-menu>
|
|
37
|
+
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
38
|
+
<%_ for (const remote of remotes) { _%>
|
|
39
|
+
<<%= remote.lowercaseBaseName %>-menu></<%= remote.lowercaseBaseName %>-menu>
|
|
40
|
+
<%_ } _%>
|
|
41
|
+
<%_ } _%>
|
|
36
42
|
<!-- jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here -->
|
|
37
43
|
</b-nav-item-dropdown>
|
|
38
44
|
<b-nav-item-dropdown
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
Copyright 2013-2021 the original author or authors from the JHipster project.
|
|
3
|
+
|
|
4
|
+
This file is part of the JHipster project, see https://www.jhipster.tech/
|
|
5
|
+
for more information.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
-%>
|
|
19
|
+
// These constants are injected via webpack environment variables.
|
|
20
|
+
// You can add more variables in webpack.common.js or in profile specific webpack.<dev|prod>.js files.
|
|
21
|
+
// If you change the values in the webpack config files, you need to re run webpack to update the application
|
|
22
|
+
|
|
23
|
+
declare const SERVER_API_URL: string;
|
|
24
|
+
declare const VERSION: string;
|
|
25
|
+
<%_ if (enableTranslation) { _%>
|
|
26
|
+
declare const I18N_HASH: string;
|
|
27
|
+
<%_ } _%>
|
|
28
|
+
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
29
|
+
<%_ for (const remote of remotes) { _%>
|
|
30
|
+
|
|
31
|
+
declare module '@<%= remote.lowercaseBaseName %>/entities-router' {
|
|
32
|
+
const _default: [];
|
|
33
|
+
export default _default;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare module '@<%= remote.lowercaseBaseName %>/entities-menu' {
|
|
37
|
+
const _default: unknown;
|
|
38
|
+
export default _default;
|
|
39
|
+
}
|
|
40
|
+
<%_ } _%>
|
|
41
|
+
<%_ } _%>
|
package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
Inject,
|
|
4
|
+
Vue,
|
|
5
|
+
<%_ if (enableTranslation && applicationTypeMicroservice) { _%>
|
|
6
|
+
Watch,
|
|
7
|
+
<%_ } _%>
|
|
8
|
+
} from 'vue-property-decorator';
|
|
9
|
+
<%_ if (enableTranslation && applicationTypeMicroservice) { _%>
|
|
10
|
+
import TranslationService from '@/locale/translation.service';
|
|
11
|
+
<%_ } _%>
|
|
12
|
+
|
|
13
|
+
@Component
|
|
14
|
+
export default class EntitiesMenu extends Vue {
|
|
15
|
+
<%_ if (enableTranslation && applicationTypeMicroservice) { _%>
|
|
16
|
+
@Inject({ default: true }) private readonly microfrontendI18n!: boolean;
|
|
17
|
+
@Inject('translationService') private translationService: () => TranslationService;
|
|
18
|
+
|
|
19
|
+
@Watch('$i18n.locale')
|
|
20
|
+
onLocaleChanged() {
|
|
21
|
+
this.loadLanguage();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
created(): void {
|
|
25
|
+
this.loadLanguage();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private loadLanguage() {
|
|
29
|
+
if (this.microfrontendI18n) {
|
|
30
|
+
this.translationService().loadTranslations('<%= frontendAppName %>', '<%= endpointPrefix %>/', I18N_HASH);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
<%_ } _%>
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
4
|
+
<b-dropdown-item to="/<%= entity.entityPage %>">
|
|
5
|
+
<font-awesome-icon icon="asterisk" />
|
|
6
|
+
<span v-text="$t('global.menu.entities.<%= entity.entityTranslationKeyMenu %>')"><%= entity.entityClassHumanized %></span>
|
|
7
|
+
</b-dropdown-item>
|
|
8
|
+
<%_ } _%>
|
|
9
|
+
<!-- jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here -->
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" src="./entities-menu.component.ts"></script>
|
package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component, Provide, Vue } from 'vue-property-decorator';
|
|
2
|
+
|
|
3
|
+
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
4
|
+
import <%= entity.entityAngularName %>Service from './<%= entity.entityFolderName %>/<%= entity.entityFileName %>.service';
|
|
5
|
+
<%_ } _%>
|
|
6
|
+
|
|
7
|
+
@Component
|
|
8
|
+
export default class Entities extends Vue {
|
|
9
|
+
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
10
|
+
@Provide('<%= entity.entityInstance %>Service') private <%= entity.entityInstance %>Service = () => new <%= entity.entityAngularName %>Service();
|
|
11
|
+
<%_ } _%>
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
Copyright 2013-2021 the original author or authors from the JHipster project.
|
|
3
|
+
|
|
4
|
+
This file is part of the JHipster project, see https://www.jhipster.tech/
|
|
5
|
+
for more information.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
-%>
|
|
19
|
+
import('./main');
|
package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs
CHANGED
|
@@ -11,6 +11,19 @@ export default class TranslationService {
|
|
|
11
11
|
this.store = store;
|
|
12
12
|
this.i18n = i18n;
|
|
13
13
|
}
|
|
14
|
+
<%_ if (microfrontend) { _%>
|
|
15
|
+
|
|
16
|
+
public loadTranslations(appKey: string, urlPrefix: string, hash: string) {
|
|
17
|
+
const currentLanguage = this.store.getters.currentLanguage;
|
|
18
|
+
if (!this.i18n) return;
|
|
19
|
+
|
|
20
|
+
axios.get(`${urlPrefix}i18n/${currentLanguage}.json?_=${hash}`).then((res: any) => {
|
|
21
|
+
if (res.data) {
|
|
22
|
+
this.i18n.mergeLocaleMessage(currentLanguage, res.data);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
<%_ } _%>
|
|
14
27
|
|
|
15
28
|
public refreshTranslation(newLanguage: string) {
|
|
16
29
|
let currentLanguage = this.store.getters.currentLanguage;
|
|
@@ -19,23 +32,27 @@ export default class TranslationService {
|
|
|
19
32
|
this.i18n.setLocaleMessage(currentLanguage, {});
|
|
20
33
|
axios.get(`i18n/${currentLanguage}.json?_=${I18N_HASH}`).then((res: any) => {
|
|
21
34
|
if (res.data) {
|
|
22
|
-
dayjs.locale(currentLanguage);
|
|
23
35
|
this.i18n.setLocaleMessage(currentLanguage, res.data);
|
|
24
|
-
this.
|
|
25
|
-
this.store.commit('currentLanguage', currentLanguage);
|
|
36
|
+
this.setLocale(currentLanguage);
|
|
26
37
|
}
|
|
27
38
|
});
|
|
28
39
|
} else if (this.i18n) {
|
|
29
|
-
|
|
30
|
-
this.i18n.locale = currentLanguage;
|
|
31
|
-
this.store.commit('currentLanguage', currentLanguage);
|
|
40
|
+
this.setLocale(currentLanguage);
|
|
32
41
|
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private setLocale(lang: string) {
|
|
45
|
+
dayjs.locale(lang);
|
|
46
|
+
this.i18n.locale = lang;
|
|
47
|
+
this.store.commit('currentLanguage', lang);
|
|
48
|
+
axios.defaults.headers.common['Accept-Language'] = lang;
|
|
49
|
+
document.querySelector('html').setAttribute('lang', lang);
|
|
33
50
|
<%_ if (enableI18nRTL) { _%>
|
|
34
|
-
|
|
51
|
+
this.updatePageDirection(lang);
|
|
35
52
|
<%_ } _%>
|
|
36
53
|
}
|
|
37
|
-
|
|
38
54
|
<%_ if (enableI18nRTL) { _%>
|
|
55
|
+
|
|
39
56
|
private isRTL(lang: string): boolean {
|
|
40
57
|
const languages = this.store.getters.languages;
|
|
41
58
|
return languages[lang] && languages[lang].rtl;
|
|
@@ -26,6 +26,7 @@ import LoginService from './account/login.service';
|
|
|
26
26
|
import AccountService from './account/account.service';
|
|
27
27
|
import AlertService from './shared/alert/alert.service';
|
|
28
28
|
|
|
29
|
+
import '../content/scss/global.scss';
|
|
29
30
|
import '../content/scss/vendor.scss';
|
|
30
31
|
<%_ if (enableTranslation) { _%>
|
|
31
32
|
import TranslationService from '@/locale/translation.service';
|
|
@@ -122,9 +123,13 @@ new Vue({
|
|
|
122
123
|
<%_ } _%>
|
|
123
124
|
// jhipster-needle-add-entity-service-to-main - JHipster will import entities services here
|
|
124
125
|
accountService: () => accountService,
|
|
125
|
-
alertService: () => new AlertService()
|
|
126
|
-
|
|
126
|
+
alertService: () => new AlertService(),
|
|
127
|
+
<%_ if (applicationTypeMicroservice && microfrontend) { _%>
|
|
128
|
+
microfrontendI18n: false,
|
|
129
|
+
<%_ } _%>
|
|
127
130
|
},
|
|
128
|
-
<%_ if (enableTranslation) { _%>
|
|
129
|
-
|
|
131
|
+
<%_ if (enableTranslation) { _%>
|
|
132
|
+
i18n,
|
|
133
|
+
<%_ } _%>
|
|
134
|
+
store,
|
|
130
135
|
});
|
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
import {Authority} from "@/shared/security/authority";
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
// prettier-ignore
|
|
4
|
+
const Entities = () => import('@/entities/entities.vue');
|
|
4
5
|
|
|
6
|
+
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
7
|
+
const <%= entity.entityAngularName %> = () => import('@/entities/<%= entity.entityFolderName %>/<%= entity.entityFileName %>.vue');
|
|
8
|
+
<%_ if (!entity.readOnly) { _%>
|
|
9
|
+
const <%= entity.entityAngularName %>Update = () => import('@/entities/<%= entity.entityFolderName %>/<%= entity.entityFileName %>-update.vue');
|
|
10
|
+
<%_ } _%>
|
|
11
|
+
const <%= entity.entityAngularName %>Details = () => import('@/entities/<%= entity.entityFolderName %>/<%= entity.entityFileName %>-details.vue');
|
|
12
|
+
|
|
13
|
+
<%_ } _%>
|
|
5
14
|
// jhipster-needle-add-entity-to-router-import - JHipster will import entities to the router here
|
|
6
15
|
|
|
7
16
|
export default [
|
|
8
|
-
|
|
17
|
+
{
|
|
18
|
+
path: '/<%= applicationTypeMicroservice ? baseName.toLowerCase() : '' %>',
|
|
19
|
+
component: Entities,
|
|
20
|
+
children: [
|
|
21
|
+
<%_ for (entity of this.localEntities.filter(entity => !entity.embedded)) { _%>
|
|
22
|
+
{
|
|
23
|
+
path: '<%= entity.entityFileName %>',
|
|
24
|
+
name: '<%= entity.entityAngularName %>',
|
|
25
|
+
component: <%= entity.entityAngularName %>,
|
|
26
|
+
meta: { authorities: [Authority.USER] },
|
|
27
|
+
},
|
|
28
|
+
<%_ if (!entity.readOnly) { _%>
|
|
29
|
+
{
|
|
30
|
+
path: '<%= entity.entityFileName %>/new',
|
|
31
|
+
name: '<%= entity.entityAngularName %>Create',
|
|
32
|
+
component: <%= entity.entityAngularName %>Update,
|
|
33
|
+
meta: { authorities: [Authority.USER] },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
path: '<%= entity.entityFileName %>/:<%= entity.entityInstance %>Id/edit',
|
|
37
|
+
name: '<%= entity.entityAngularName %>Edit',
|
|
38
|
+
component: <%= entity.entityAngularName %>Update,
|
|
39
|
+
meta: { authorities: [Authority.USER] },
|
|
40
|
+
},
|
|
41
|
+
<%_ } _%>
|
|
42
|
+
{
|
|
43
|
+
path: '<%= entity.entityFileName %>/:<%= entity.entityInstance %>Id/view',
|
|
44
|
+
name: '<%= entity.entityAngularName %>View',
|
|
45
|
+
component: <%= entity.entityAngularName %>Details,
|
|
46
|
+
meta: { authorities: [Authority.USER] },
|
|
47
|
+
},
|
|
48
|
+
<%_ } _%>
|
|
49
|
+
// jhipster-needle-add-entity-to-router - JHipster will add entities to the router here
|
|
50
|
+
],
|
|
51
|
+
},
|
|
9
52
|
];
|
|
@@ -15,6 +15,12 @@ import account from "@/router/account";
|
|
|
15
15
|
import admin from "@/router/admin";
|
|
16
16
|
import entities from "@/router/entities";
|
|
17
17
|
import pages from "@/router/pages";
|
|
18
|
+
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
19
|
+
|
|
20
|
+
<%_ for (const remote of remotes) { _%>
|
|
21
|
+
const <%= remote.lowercaseBaseName %>Router = await import('@<%= remote.lowercaseBaseName %>/entities-router').then(module => module.default).catch(() => []);
|
|
22
|
+
<%_ } _%>
|
|
23
|
+
<%_ } _%>
|
|
18
24
|
|
|
19
25
|
Vue.use(Router);
|
|
20
26
|
|
|
@@ -44,6 +50,11 @@ export default new Router({
|
|
|
44
50
|
<%_ } _%>
|
|
45
51
|
...admin,
|
|
46
52
|
...entities,
|
|
53
|
+
<%_ if (applicationTypeGateway && microfrontend) { _%>
|
|
54
|
+
<%_ for (const remote of remotes) { _%>
|
|
55
|
+
...<%= remote.lowercaseBaseName %>Router,
|
|
56
|
+
<%_ } _%>
|
|
57
|
+
<%_ } _%>
|
|
47
58
|
...pages
|
|
48
59
|
]
|
|
49
60
|
});
|
|
@@ -16,16 +16,6 @@
|
|
|
16
16
|
See the License for the specific language governing permissions and
|
|
17
17
|
limitations under the License.
|
|
18
18
|
-%>
|
|
19
|
-
// These constants are injected via webpack environment variables.
|
|
20
|
-
// You can add more variables in webpack.common.js or in profile specific webpack.<dev|prod>.js files.
|
|
21
|
-
// If you change the values in the webpack config files, you need to re run webpack to update the application
|
|
22
|
-
|
|
23
|
-
declare const SERVER_API_URL: string;
|
|
24
|
-
declare const VERSION: string;
|
|
25
|
-
<%_ if (enableTranslation) { _%>
|
|
26
|
-
declare const I18N_HASH: string;
|
|
27
|
-
<%_ } _%>
|
|
28
|
-
|
|
29
19
|
declare module '*.vue' {
|
|
30
20
|
import Vue from 'vue';
|
|
31
21
|
export default Vue;
|
|
@@ -1,38 +1,49 @@
|
|
|
1
|
+
const { pathsToModuleNameMapper } = require('ts-jest/utils');
|
|
1
2
|
const config = require('../../../webpack/config');
|
|
3
|
+
const { compilerOptions: { paths = {}, baseUrl = './' } } = require('../../../tsconfig.json');
|
|
2
4
|
|
|
3
5
|
module.exports = {
|
|
6
|
+
rootDir: '../../../',
|
|
7
|
+
roots: ['<rootDir>', `<rootDir>/${baseUrl}`, `<rootDir>/<%= CLIENT_TEST_SRC_DIR %>spec/app/`],
|
|
8
|
+
preset: 'ts-jest',
|
|
4
9
|
testEnvironment: 'jsdom',
|
|
5
10
|
coverageDirectory: '<rootDir>/<%= BUILD_DIR %>test-results/',
|
|
6
11
|
coveragePathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/<%= CLIENT_TEST_SRC_DIR %>', '<rootDir>/<%= CLIENT_MAIN_SRC_DIR %>app/router', '.*.json'],
|
|
7
12
|
moduleFileExtensions: ['js', 'json', 'ts', 'vue'],
|
|
8
13
|
transform: {
|
|
9
|
-
'.*\\.(vue)$': 'vue-jest',
|
|
10
|
-
'^.+\\.tsx?$': 'ts-jest'
|
|
14
|
+
'.*\\.(vue)$': '<%= microfrontend ? '@vue/vue2-jest' : 'vue-jest' %>',
|
|
15
|
+
'^.+\\.tsx?$': 'ts-jest',
|
|
11
16
|
},
|
|
12
17
|
moduleNameMapper: {
|
|
13
|
-
'^@/(.*)$': '<rootDir>/<%= CLIENT_MAIN_SRC_DIR %>app/$1'
|
|
18
|
+
'^@/(.*)$': '<rootDir>/<%= CLIENT_MAIN_SRC_DIR %>app/$1',
|
|
19
|
+
...pathsToModuleNameMapper(paths, { prefix: `<rootDir>/${baseUrl}/` }),
|
|
20
|
+
<%_ if (applicationTypeGateway) { _%>
|
|
21
|
+
'^@(<%= remotes.map(remote => remote.lowercaseBaseName).join('|') %>)/(.*)$': '<rootDir>/<%= CLIENT_TEST_SRC_DIR %>spec/app/microfrontends/$2',
|
|
22
|
+
<%_ } _%>
|
|
14
23
|
},
|
|
15
24
|
reporters: [
|
|
16
25
|
'default',
|
|
17
|
-
[ 'jest-junit', { outputDirectory: './<%= BUILD_DIR %>test-results/', outputName: 'TESTS-results-jest.xml' } ]
|
|
26
|
+
[ 'jest-junit', { outputDirectory: './<%= BUILD_DIR %>test-results/', outputName: 'TESTS-results-jest.xml' } ],
|
|
18
27
|
],
|
|
19
28
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
20
29
|
testMatch: ['<rootDir>/<%= CLIENT_TEST_SRC_DIR %>spec/**/@(*.)@(spec.ts)'],
|
|
21
30
|
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
|
22
|
-
rootDir: '../../../',
|
|
23
31
|
globals: {
|
|
24
32
|
<%_ if (enableTranslation) { _%>
|
|
25
33
|
I18N_HASH: 'generated_hash',
|
|
26
34
|
<%_ } _%>
|
|
27
35
|
SERVER_API_URL: config.serverApiUrl,
|
|
28
36
|
VERSION: config.version,
|
|
37
|
+
'ts-jest': {
|
|
38
|
+
tsconfig: '<rootDir>/tsconfig.spec.json',
|
|
39
|
+
},
|
|
29
40
|
},
|
|
30
41
|
coverageThreshold: {
|
|
31
42
|
global: {
|
|
32
43
|
statements: 80,
|
|
33
44
|
branches: 60,
|
|
34
45
|
functions: 70,
|
|
35
|
-
lines: 80
|
|
36
|
-
}
|
|
37
|
-
}
|
|
46
|
+
lines: 80,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
38
49
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createLocalVue, shallowMount, Wrapper } from '@vue/test-utils';
|
|
2
|
+
import EntitiesMenu from '@/entities/entities-menu.vue';
|
|
3
|
+
import EntitiesMenuClass from '@/entities/entities-menu.component';
|
|
4
|
+
import * as config from '@/shared/config/config';
|
|
5
|
+
|
|
6
|
+
const localVue = createLocalVue();
|
|
7
|
+
config.initVueApp(localVue);
|
|
8
|
+
const i18n = config.initI18N(localVue);
|
|
9
|
+
localVue.component('b-dropdown-item', {});
|
|
10
|
+
localVue.component('font-awesome-icon', {});
|
|
11
|
+
|
|
12
|
+
describe('EntitiesMenu', () => {
|
|
13
|
+
let translationService;
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
translationService = { loadTranslations: jest.fn() };
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('using microfrontendI18n', () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
shallowMount<EntitiesMenuClass>(EntitiesMenu, {
|
|
22
|
+
i18n,
|
|
23
|
+
localVue,
|
|
24
|
+
provide: {
|
|
25
|
+
translationService: () => translationService,
|
|
26
|
+
microfrontendI18n: true,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should load translations', () => {
|
|
32
|
+
expect(translationService.loadTranslations).toHaveBeenCalled();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('not using microfrontendI18n', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
shallowMount<EntitiesMenuClass>(EntitiesMenu, {
|
|
39
|
+
i18n,
|
|
40
|
+
localVue,
|
|
41
|
+
provide: {
|
|
42
|
+
translationService: () => translationService,
|
|
43
|
+
microfrontendI18n: false,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should not load translations', () => {
|
|
49
|
+
expect(translationService.loadTranslations).not.toHaveBeenCalled();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default [];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"baseUrl": "<%= CLIENT_MAIN_SRC_DIR %>app",
|
|
4
|
+
"outDir": "<%= BUILD_DIR %>out-tsc/dist",
|
|
3
5
|
"target": "es5",
|
|
4
6
|
"esModuleInterop": true,
|
|
5
7
|
"allowSyntheticDefaultImports": true,
|
|
@@ -8,25 +10,19 @@
|
|
|
8
10
|
"sourceMap": true,
|
|
9
11
|
"emitDecoratorMetadata": true,
|
|
10
12
|
"experimentalDecorators": true,
|
|
11
|
-
"removeComments": false,
|
|
12
|
-
"noImplicitAny": false,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"suppressImplicitAnyIndexErrors": true,
|
|
15
|
-
"outDir": "<%= DIST_DIR %>app",
|
|
16
13
|
"lib": ["es7", "dom"],
|
|
17
14
|
"typeRoots": [
|
|
18
15
|
"node_modules/@types"
|
|
19
16
|
],
|
|
20
|
-
"baseUrl": "./",
|
|
21
17
|
"paths": {
|
|
22
|
-
"@/*": ["
|
|
18
|
+
"@/*": ["*"]
|
|
23
19
|
},
|
|
20
|
+
types: ["node"],
|
|
24
21
|
"importHelpers": false,
|
|
25
22
|
"allowJs": true
|
|
26
23
|
},
|
|
27
24
|
"include": [
|
|
28
|
-
"<%= CLIENT_MAIN_SRC_DIR %>app"
|
|
29
|
-
"<%= CLIENT_TEST_SRC_DIR %>spec"
|
|
25
|
+
"<%= CLIENT_MAIN_SRC_DIR %>app"
|
|
30
26
|
],
|
|
31
27
|
"exclude": ["node_modules"<% if (!cypressTests) { %>,"<%= CLIENT_TEST_SRC_DIR %>cypress"<% } %>]
|
|
32
28
|
}
|