generator-jhipster 7.7.0 → 7.8.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/README.md +1 -2
- package/generators/app/index.js +10 -0
- package/generators/ci-cd/index.js +1 -1
- package/generators/ci-cd/templates/github-actions.yml.ejs +4 -4
- package/generators/client/files-common.js +1 -2
- package/generators/client/files-react.js +25 -2
- package/generators/client/index.js +1 -1
- package/generators/client/needle-api/needle-client-react.js +11 -8
- package/generators/client/templates/angular/angular.json.ejs +1 -9
- package/generators/client/templates/angular/jest.conf.js.ejs +1 -1
- package/generators/client/templates/angular/package.json +17 -18
- package/generators/client/templates/angular/package.json.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.ts.ejs +1 -1
- 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/webpack/webpack.custom.js.ejs +12 -1
- package/generators/client/templates/common/package.json +7 -6
- package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +2 -3
- package/generators/client/templates/react/.eslintrc.json.ejs +1 -1
- package/generators/client/templates/react/jest.conf.js.ejs +1 -1
- package/generators/client/templates/react/package.json +30 -31
- package/generators/client/templates/react/package.json.ejs +1 -0
- package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/config/store.ts.ejs +53 -6
- package/generators/client/templates/react/src/main/webapp/app/config/translation-middleware.ts.ejs +58 -0
- package/generators/client/templates/react/src/main/webapp/app/entities/menu.tsx.ejs +45 -0
- package/generators/client/templates/react/src/main/webapp/app/entities/reducers.ts.ejs +25 -0
- package/generators/client/templates/react/src/main/webapp/app/entities/routes.tsx.ejs +47 -0
- package/generators/client/templates/react/src/main/webapp/app/index.tsx.ejs +7 -7
- package/generators/client/templates/react/src/main/webapp/app/main.tsx.ejs +19 -0
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/logs/logs.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +2 -1
- package/generators/client/templates/react/src/main/webapp/app/modules/login/login-modal.tsx.ejs +5 -1
- package/generators/client/templates/react/src/main/webapp/app/routes.tsx.ejs +24 -7
- package/generators/client/templates/react/src/main/webapp/app/shared/error/error-loading.tsx.ejs +15 -0
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/entities.tsx.ejs +34 -6
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/index.ts.ejs +9 -2
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs +9 -3
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.ts.ejs +21 -5
- package/generators/client/templates/react/src/main/webapp/app/typings.d.ts.ejs +15 -0
- package/generators/client/templates/react/src/main/webapp/microfrontends/entities-menu.tsx.ejs +3 -0
- package/generators/client/templates/react/src/main/webapp/microfrontends/entities-routes.tsx.ejs +3 -0
- package/generators/client/templates/react/tsconfig.json.ejs +3 -3
- package/generators/client/templates/react/tsconfig.test.json.ejs +9 -1
- package/generators/client/templates/react/webpack/webpack.common.js.ejs +6 -13
- package/generators/client/templates/react/webpack/webpack.dev.js.ejs +7 -8
- package/generators/client/templates/react/webpack/webpack.microfrontend.js.jhi.react.ejs +99 -0
- package/generators/client/templates/react/webpack/webpack.prod.js.ejs +31 -21
- package/generators/client/templates/vue/package.json +16 -17
- package/generators/client/templates/vue/package.json.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +1 -0
- package/generators/client/templates/vue/src/main/webapp/app/shared/data/data-utils.service.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +2 -2
- package/generators/client/templates/vue/tsconfig.json.ejs +0 -3
- package/generators/client/templates/vue/webpack/webpack.common.js.ejs +6 -2
- package/generators/common/templates/package.json +2 -2
- package/generators/docker-compose/index.js +9 -5
- package/generators/entity/index.js +34 -19
- package/generators/entity-client/index.js +8 -0
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.ts.ejs +1 -1
- package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +1 -0
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-delete-dialog.tsx.ejs +3 -3
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-detail.tsx.ejs +5 -4
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +19 -18
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs +2 -2
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +21 -20
- package/generators/entity-i18n/templates/i18n/entity_fr.json.ejs +1 -1
- package/generators/entity-server/files.js +30 -10
- package/generators/entity-server/index.js +19 -1
- package/generators/entity-server/templates/couchbase/src/main/java/package/domain/Entity.java.jhi.spring_data_couchbase.ejs +1 -1
- package/generators/entity-server/templates/couchbase/src/main/java/package/repository/EntityRepository.java.ejs +31 -8
- package/generators/entity-server/templates/partials/update_template.ejs +77 -0
- package/generators/entity-server/templates/reactive/partials/save_template.ejs +1 -1
- package/generators/entity-server/templates/reactive/partials/update_template.ejs +41 -0
- package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +5 -5
- package/generators/entity-server/templates/src/main/java/package/common/get_template.ejs +1 -1
- package/generators/entity-server/templates/src/main/java/package/common/inject_template.ejs +13 -4
- package/generators/entity-server/templates/src/main/java/package/common/patch_template.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +2 -1
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.javax_lifecycle_events.ejs +31 -0
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_persistable.ejs +54 -0
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_reactive.ejs +1 -1
- package/generators/entity-server/templates/src/main/java/package/domain/EntityCallback.java.ejs +43 -0
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository.java.ejs +6 -6
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +13 -16
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryWithBagRelationshipsImpl.java.ejs +4 -3
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository_reactive.java.ejs +15 -23
- package/generators/entity-server/templates/src/main/java/package/repository/EntitySqlHelper_reactive.java.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/repository/rowmapper/EntityRowMapper.java.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/repository/search/EntitySearchRepository.java.ejs +12 -25
- package/generators/entity-server/templates/src/main/java/package/service/EntityService.java.ejs +10 -2
- package/generators/entity-server/templates/src/main/java/package/service/impl/EntityServiceImpl.java.ejs +21 -5
- package/generators/entity-server/templates/src/main/java/package/service/mapper/EntityMapper.java.ejs +61 -90
- package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +6 -4
- package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +28 -15
- package/generators/generator-base-private.js +1 -1
- package/generators/generator-base.js +29 -0
- package/generators/generator-constants.js +5 -5
- package/generators/generator-transforms.js +0 -1
- package/generators/gradle/constants.cjs +1 -1
- package/generators/maven/files.cjs +0 -1
- package/generators/maven/templates/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/generators/maven/templates/.mvn/wrapper/maven-wrapper.properties +18 -2
- package/generators/maven/templates/mvnw +13 -7
- package/generators/maven/templates/mvnw.cmd +19 -13
- package/generators/maven/templates/pom.xml.jhi.ejs +1 -1
- package/generators/server/cleanup.js +19 -3
- package/generators/server/files.js +101 -17
- package/generators/server/index.js +11 -5
- package/generators/server/needle-api/needle-server-gradle.js +38 -0
- package/generators/server/templates/.mvn/jvm.config +1 -0
- package/generators/server/templates/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/generators/server/templates/.mvn/wrapper/maven-wrapper.properties +18 -2
- package/generators/server/templates/build.gradle.ejs +7 -5
- package/generators/server/templates/couchbase/src/main/java/package/repository/JHipsterCouchbaseRepository.java.ejs +24 -1
- package/generators/server/templates/devcontainer/Dockerfile.ejs +25 -0
- package/generators/server/templates/devcontainer/devcontainer.json.ejs +64 -0
- package/generators/server/templates/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/generators/server/templates/gradle.properties.ejs +4 -4
- package/generators/server/templates/mvnw +13 -7
- package/generators/server/templates/mvnw.cmd +19 -13
- package/generators/server/templates/pom.xml.ejs +19 -17
- package/generators/server/templates/settings.gradle.ejs +6 -4
- package/generators/server/templates/src/main/docker/app.yml.ejs +2 -6
- package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +2 -1
- package/generators/server/templates/src/main/docker/mysql.yml.ejs +1 -0
- package/generators/server/templates/src/main/java/package/config/AsyncConfiguration.java.ejs +6 -0
- package/generators/{client/templates/react/src/main/webapp/app/entities/index.tsx.ejs → server/templates/src/main/java/package/config/KafkaSseConsumer.java.ejs} +8 -14
- package/generators/server/templates/src/main/java/package/config/KafkaSseProducer.java.ejs +30 -0
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +12 -10
- package/generators/server/templates/src/main/java/package/repository/EntityManager.java.ejs +3 -3
- package/generators/server/templates/src/main/java/package/security/jwt/JWTFilter.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/web/rest/KafkaResource.java.ejs +60 -108
- package/generators/server/templates/src/main/java/package/web/rest/KafkaResource_reactive.java.ejs +74 -0
- package/generators/server/templates/src/main/resources/config/application.yml.ejs +26 -22
- package/generators/server/templates/src/test/java/package/CassandraKeyspaceIT.java.ejs +3 -4
- package/generators/server/templates/src/test/java/package/IntegrationTest.java.ejs +9 -3
- package/generators/server/templates/src/test/java/package/TechnicalStructureTest.java.ejs +0 -3
- package/generators/server/templates/src/test/java/package/config/CassandraTestContainer.java.ejs +122 -0
- package/generators/server/templates/src/test/java/package/config/EmbeddedCassandra.java.ejs +11 -0
- package/generators/server/templates/src/test/java/package/config/EmbeddedKafka.java.ejs +11 -0
- package/generators/server/templates/src/test/java/package/config/EmbeddedMongo.java.ejs +11 -0
- package/generators/server/templates/src/test/java/package/config/KafkaTestContainer.java.ejs +38 -0
- package/generators/server/templates/src/test/java/package/config/MongoDbTestContainer.java.ejs +67 -0
- package/generators/server/templates/src/test/java/package/config/TestContainersSpringContextCustomizerFactory.java.ejs +114 -0
- package/generators/server/templates/src/test/java/package/cucumber/CucumberIT.java.ejs +3 -10
- package/generators/server/templates/src/test/java/package/security/DomainUserDetailsServiceIT.java.ejs +1 -4
- package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +5 -5
- package/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs +2 -4
- package/generators/server/templates/src/test/java/package/service/UserServiceIT.java.ejs +1 -4
- package/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs +3 -3
- package/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT_oauth2.java.ejs +1 -4
- package/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT_skipUserManagement.java.ejs +1 -4
- package/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT.java.ejs +52 -123
- package/generators/server/templates/src/test/java/package/web/rest/KafkaResourceIT_reactive.java.ejs +99 -0
- package/generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs +7 -10
- package/generators/server/templates/src/test/java/package/web/rest/UserJWTControllerIT.java.ejs +1 -4
- package/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs +2 -5
- package/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT.java.ejs +1 -4
- package/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT_reactive.java.ejs +1 -4
- package/generators/server/templates/src/test/resources/META-INF/spring.factories.ejs +1 -1
- package/generators/server/templates/src/test/resources/config/application.yml.ejs +21 -20
- package/generators/server/templates/src/test/resources/testcontainers.properties.ejs +1 -0
- package/generators/workspaces/index.js +2 -1
- package/package.json +15 -15
- package/utils/entity.js +2 -0
- package/utils/field.js +8 -3
- package/utils/relationship.js +10 -1
- package/generators/entity-server/templates/src/main/java/package/repository/search/SortToSortBuilderListConverter.java.ejs +0 -25
- package/generators/maven/templates/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/generators/server/templates/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/generators/server/templates/src/main/java/package/config/KafkaProperties.java.ejs +0 -68
- package/generators/server/templates/src/test/java/package/AbstractCassandraTest.java.ejs +0 -125
- package/generators/server/templates/src/test/java/package/MongoDbTestContainerExtension.java.ejs +0 -37
- package/generators/server/templates/src/test/java/package/TestContainersSpringContextCustomizerFactory.java.ejs +0 -24
|
@@ -18,8 +18,16 @@
|
|
|
18
18
|
-%>
|
|
19
19
|
{
|
|
20
20
|
"extends": "./tsconfig",
|
|
21
|
+
"include": ["<%= MAIN_SRC_DIR %>app", "<%= MAIN_SRC_DIR %>microfrontend"],
|
|
21
22
|
"compilerOptions": {
|
|
22
|
-
"
|
|
23
|
+
"paths": {
|
|
24
|
+
<%_ if (microfrontend && applicationTypeGateway) { _%>
|
|
25
|
+
<%_ for (const remote of microfrontends) { _%>
|
|
26
|
+
"@<%= remote.lowercaseBaseName %>/*": ["<%= CLIENT_MAIN_SRC_DIR %>microfrontends/*"],
|
|
27
|
+
<%_ } _%>
|
|
28
|
+
<%_ } _%>
|
|
29
|
+
"app/*": ["<%= CLIENT_MAIN_SRC_DIR %>app/*"]
|
|
30
|
+
},
|
|
23
31
|
"types": ["jest", "webpack-env"]
|
|
24
32
|
}
|
|
25
33
|
}
|
|
@@ -113,17 +113,6 @@ return merge(
|
|
|
113
113
|
stats: {
|
|
114
114
|
children: false
|
|
115
115
|
},
|
|
116
|
-
optimization: {
|
|
117
|
-
splitChunks: {
|
|
118
|
-
cacheGroups: {
|
|
119
|
-
commons: {
|
|
120
|
-
test: /[\\/]node_modules[\\/]/,
|
|
121
|
-
name: 'vendors',
|
|
122
|
-
chunks: 'all'
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
116
|
plugins: [
|
|
128
117
|
new webpack.EnvironmentPlugin({
|
|
129
118
|
// react-jhipster requires LOG_LEVEL config.
|
|
@@ -145,12 +134,16 @@ return merge(
|
|
|
145
134
|
patterns: [
|
|
146
135
|
<%_ if (applicationTypeGateway || applicationTypeMonolith) { _%>
|
|
147
136
|
{
|
|
148
|
-
|
|
137
|
+
// https://github.com/swagger-api/swagger-ui/blob/v4.6.1/swagger-ui-dist-package/README.md
|
|
138
|
+
context: require('swagger-ui-dist').getAbsoluteFSPath(),
|
|
149
139
|
from: '*.{js,css,html,png}',
|
|
150
140
|
to: 'swagger-ui/',
|
|
151
141
|
globOptions: { ignore: ['**/index.html'] },
|
|
152
142
|
},
|
|
153
|
-
{
|
|
143
|
+
{
|
|
144
|
+
from: require.resolve('axios/dist/axios.min.js'),
|
|
145
|
+
to: 'swagger-ui/',
|
|
146
|
+
},
|
|
154
147
|
{ from: './<%= MAIN_SRC_DIR %>swagger-ui/', to: 'swagger-ui/' },
|
|
155
148
|
<%_ } _%>
|
|
156
149
|
{ from: './<%= MAIN_SRC_DIR %>content/', to: 'content/' },
|
|
@@ -36,12 +36,12 @@ module.exports = async (options) => webpackMerge(await commonConfig({ env: ENV }
|
|
|
36
36
|
devtool: 'cheap-module-source-map', // https://reactjs.org/docs/cross-origin-errors.html
|
|
37
37
|
mode: ENV,
|
|
38
38
|
entry: [
|
|
39
|
-
'./<%= CLIENT_MAIN_SRC_DIR %>app
|
|
39
|
+
'./<%= CLIENT_MAIN_SRC_DIR %>app/<%= microfrontend ? 'main' : 'index' %>'
|
|
40
40
|
],
|
|
41
41
|
output: {
|
|
42
42
|
path: utils.root('<%= DIST_DIR %>'),
|
|
43
|
-
filename: '
|
|
44
|
-
chunkFilename: '
|
|
43
|
+
filename: '[name].[contenthash:8].js',
|
|
44
|
+
chunkFilename: '[name].[chunkhash:8].chunk.js'
|
|
45
45
|
},
|
|
46
46
|
optimization: {
|
|
47
47
|
moduleIds: 'named',
|
|
@@ -72,7 +72,7 @@ module.exports = async (options) => webpackMerge(await commonConfig({ env: ENV }
|
|
|
72
72
|
]
|
|
73
73
|
},
|
|
74
74
|
devServer: {
|
|
75
|
-
hot:
|
|
75
|
+
hot: <%= !microfrontend %>,
|
|
76
76
|
static: {
|
|
77
77
|
directory: './<%= DIST_DIR %>',
|
|
78
78
|
},
|
|
@@ -88,14 +88,14 @@ module.exports = async (options) => webpackMerge(await commonConfig({ env: ENV }
|
|
|
88
88
|
'/login',<% } %>
|
|
89
89
|
'/auth'
|
|
90
90
|
],
|
|
91
|
-
target: `http${options.tls ? 's' : ''}://localhost:<%= serverPort %>`,
|
|
91
|
+
target: `http${options.tls ? 's' : ''}://localhost:<%= applicationTypeMicroservice ? gatewayServerPort : serverPort %>`,
|
|
92
92
|
secure: false,
|
|
93
93
|
changeOrigin: options.tls
|
|
94
94
|
}<% if (communicationSpringWebsocket) { %>,{
|
|
95
95
|
context: [
|
|
96
96
|
'/websocket'
|
|
97
97
|
],
|
|
98
|
-
target: 'ws://127.0.0.1:<%= serverPort %>',
|
|
98
|
+
target: 'ws://127.0.0.1:<%= applicationTypeMicroservice ? gatewayServerPort : serverPort %>',
|
|
99
99
|
ws: true
|
|
100
100
|
}<% } %>],
|
|
101
101
|
https: options.tls,
|
|
@@ -114,7 +114,7 @@ module.exports = async (options) => webpackMerge(await commonConfig({ env: ENV }
|
|
|
114
114
|
host: 'localhost',
|
|
115
115
|
port: 9000,
|
|
116
116
|
proxy: {
|
|
117
|
-
target: `http${options.tls ? 's' : ''}://localhost
|
|
117
|
+
target: `http${options.tls ? 's' : ''}://localhost:${options.watch ? '<%= this.applicationTypeMicroservice ? gatewayServerPort : serverPort %>' : '<%= devServerPort %>'}`,
|
|
118
118
|
ws: true,
|
|
119
119
|
proxyOptions: {
|
|
120
120
|
changeOrigin: false //pass the Host header to the backend unchanged https://github.com/Browsersync/browser-sync/issues/430
|
|
@@ -135,7 +135,6 @@ module.exports = async (options) => webpackMerge(await commonConfig({ env: ENV }
|
|
|
135
135
|
}, {
|
|
136
136
|
reload: false
|
|
137
137
|
}),
|
|
138
|
-
new webpack.HotModuleReplacementPlugin(),
|
|
139
138
|
new WebpackNotifierPlugin({
|
|
140
139
|
title: '<%= humanizedBaseName %>',
|
|
141
140
|
contentImage: path.join(__dirname, 'logo-jhipster.png')
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
<&_ if (fragment.importsSection) { -&>
|
|
20
|
+
<%_ if (applicationTypeMicroservice) { _%>
|
|
21
|
+
const { DefinePlugin } = require('webpack');
|
|
22
|
+
<%_ } _%>
|
|
23
|
+
<&_ } -&>
|
|
24
|
+
<&_ if (fragment.moduleFederationSection) { -&>
|
|
25
|
+
<%_ if (applicationTypeGateway) { _%>
|
|
26
|
+
remotes: {
|
|
27
|
+
<%_ for (const remote of remotes) { _%>
|
|
28
|
+
'@<%= remote.lowercaseBaseName %>': `<%= remote.lowercaseBaseName %>@/<%= remote.endpointPrefix %>/remoteEntry.js`,
|
|
29
|
+
<%_ } _%>
|
|
30
|
+
},
|
|
31
|
+
<%_ } _%>
|
|
32
|
+
<%_ if (applicationTypeMicroservice) { _%>
|
|
33
|
+
exposes: {
|
|
34
|
+
'./entities-menu': './<%= CLIENT_MAIN_SRC_DIR %>app/entities/menu',
|
|
35
|
+
'./entities-routes': './<%= CLIENT_MAIN_SRC_DIR %>app/entities/routes',
|
|
36
|
+
},
|
|
37
|
+
<%_ } _%>
|
|
38
|
+
shared: {
|
|
39
|
+
...Object.fromEntries(Object.entries(packageJson.dependencies).map(([module]) => ([module, { singleton: true, shareScope: 'default' }]))),
|
|
40
|
+
'app/config/constants': {
|
|
41
|
+
singleton: true,
|
|
42
|
+
import: 'app/config/constants',
|
|
43
|
+
requiredVersion: appVersion,
|
|
44
|
+
},
|
|
45
|
+
'app/config/store': {
|
|
46
|
+
singleton: true,
|
|
47
|
+
import: 'app/config/store',
|
|
48
|
+
requiredVersion: appVersion,
|
|
49
|
+
},
|
|
50
|
+
'app/shared/error/error-boundary-route': {
|
|
51
|
+
singleton: true,
|
|
52
|
+
import: 'app/shared/error/error-boundary-route',
|
|
53
|
+
requiredVersion: appVersion,
|
|
54
|
+
},
|
|
55
|
+
'app/shared/layout/menus/menu-components': {
|
|
56
|
+
singleton: true,
|
|
57
|
+
import: 'app/shared/layout/menus/menu-components',
|
|
58
|
+
requiredVersion: appVersion,
|
|
59
|
+
},
|
|
60
|
+
'app/shared/layout/menus/menu-item': {
|
|
61
|
+
singleton: true,
|
|
62
|
+
import: 'app/shared/layout/menus/menu-item',
|
|
63
|
+
requiredVersion: appVersion,
|
|
64
|
+
},
|
|
65
|
+
'app/shared/reducers': {
|
|
66
|
+
singleton: true,
|
|
67
|
+
import: 'app/shared/reducers',
|
|
68
|
+
requiredVersion: appVersion,
|
|
69
|
+
},
|
|
70
|
+
'app/shared/reducers/locale': {
|
|
71
|
+
singleton: true,
|
|
72
|
+
import: 'app/shared/reducers/locale',
|
|
73
|
+
requiredVersion: appVersion,
|
|
74
|
+
},
|
|
75
|
+
'app/shared/reducers/reducer.utils': {
|
|
76
|
+
singleton: true,
|
|
77
|
+
import: 'app/shared/reducers/reducer.utils',
|
|
78
|
+
requiredVersion: appVersion,
|
|
79
|
+
},
|
|
80
|
+
'app/shared/util/date-utils': {
|
|
81
|
+
singleton: true,
|
|
82
|
+
import: 'app/shared/util/date-utils',
|
|
83
|
+
requiredVersion: appVersion,
|
|
84
|
+
},
|
|
85
|
+
'app/shared/util/entity-utils': {
|
|
86
|
+
singleton: true,
|
|
87
|
+
import: 'app/shared/util/entity-utils',
|
|
88
|
+
requiredVersion: appVersion,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
<&_ } -&>
|
|
92
|
+
<&_ if (fragment.pluginsSection) { -&>
|
|
93
|
+
<%_ if (applicationTypeMicroservice) { _%>
|
|
94
|
+
new DefinePlugin({
|
|
95
|
+
<%= _.upperCase(baseName) %>_I18N_RESOURCES_PREFIX: JSON.stringify(''),
|
|
96
|
+
}),
|
|
97
|
+
<%_ } _%>
|
|
98
|
+
<&_ } -&>
|
|
99
|
+
|
|
@@ -36,12 +36,12 @@ module.exports = async () => webpackMerge(await commonConfig({ env: ENV }), {
|
|
|
36
36
|
// devtool: 'source-map', // Enable source maps. Please note that this will slow down the build
|
|
37
37
|
mode: ENV,
|
|
38
38
|
entry: {
|
|
39
|
-
main: './<%= MAIN_SRC_DIR %>app
|
|
39
|
+
main: './<%= MAIN_SRC_DIR %>app/<%= microfrontend ? 'main' : 'index' %>'
|
|
40
40
|
},
|
|
41
41
|
output: {
|
|
42
42
|
path: utils.root('<%= DIST_DIR %>'),
|
|
43
|
-
filename: '
|
|
44
|
-
chunkFilename: '
|
|
43
|
+
filename: '[name].[contenthash:8].js',
|
|
44
|
+
chunkFilename: '[name].[chunkhash:8].chunk.js'
|
|
45
45
|
},
|
|
46
46
|
module: {
|
|
47
47
|
rules: [
|
|
@@ -77,30 +77,40 @@ module.exports = async () => webpackMerge(await commonConfig({ env: ENV }), {
|
|
|
77
77
|
runtimeChunk: false,
|
|
78
78
|
minimizer: [
|
|
79
79
|
new TerserPlugin({
|
|
80
|
-
parallel: true,
|
|
81
|
-
// sourceMap: true, // Enable source maps. Please note that this will slow down the build
|
|
82
80
|
terserOptions: {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
parse: {
|
|
82
|
+
// We want terser to parse ecma 8 code. However, we don't want it
|
|
83
|
+
// to apply any minification steps that turns valid ecma 5 code
|
|
84
|
+
// into invalid ecma 5 code. This is why the 'compress' and 'output'
|
|
85
|
+
// sections only apply transformations that are ecma 5 safe
|
|
86
|
+
// https://github.com/facebook/create-react-app/pull/4234
|
|
87
|
+
ecma: 8,
|
|
88
|
+
},
|
|
86
89
|
compress: {
|
|
90
|
+
ecma: 5,
|
|
87
91
|
warnings: false,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
// Disabled because of an issue with Uglify breaking seemingly valid code:
|
|
93
|
+
// https://github.com/facebook/create-react-app/issues/2376
|
|
94
|
+
// Pending further investigation:
|
|
95
|
+
// https://github.com/mishoo/UglifyJS2/issues/2011
|
|
96
|
+
comparisons: false,
|
|
97
|
+
// Disabled because of an issue with Terser breaking valid code:
|
|
98
|
+
// https://github.com/facebook/create-react-app/issues/5250
|
|
99
|
+
// Pending further investigation:
|
|
100
|
+
// https://github.com/terser-js/terser/issues/120
|
|
101
|
+
inline: 2,
|
|
102
|
+
},
|
|
103
|
+
mangle: {
|
|
104
|
+
safari10: true,
|
|
91
105
|
},
|
|
92
106
|
output: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
107
|
+
ecma: 5,
|
|
108
|
+
comments: false,
|
|
109
|
+
// Turned on because emoji and regex is not minified properly using default
|
|
110
|
+
// https://github.com/facebook/create-react-app/issues/2488
|
|
111
|
+
ascii_only: true,
|
|
97
112
|
},
|
|
98
|
-
|
|
99
|
-
keep_fnames: true,
|
|
100
|
-
module: true,
|
|
101
|
-
toplevel: true
|
|
102
|
-
}
|
|
103
|
-
}
|
|
113
|
+
},
|
|
104
114
|
}),
|
|
105
115
|
new CssMinimizerPlugin({
|
|
106
116
|
parallel: true,
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@fortawesome/fontawesome-svg-core": "1.
|
|
4
|
-
"@fortawesome/free-solid-svg-icons": "6.
|
|
3
|
+
"@fortawesome/fontawesome-svg-core": "6.1.1",
|
|
4
|
+
"@fortawesome/free-solid-svg-icons": "6.1.1",
|
|
5
5
|
"@fortawesome/vue-fontawesome": "2.0.6",
|
|
6
|
-
"axios": "0.26.
|
|
6
|
+
"axios": "0.26.1",
|
|
7
7
|
"bootstrap": "4.6.1",
|
|
8
8
|
"bootstrap-vue": "2.21.2",
|
|
9
9
|
"bootswatch": "5.1.3",
|
|
10
|
-
"swagger-ui-dist": "4.5.2",
|
|
11
10
|
"vue": "2.6.14",
|
|
12
11
|
"vue-class-component": "7.2.6",
|
|
13
12
|
"vue-cookie": "1.1.4",
|
|
14
13
|
"vue-infinite-loading": "2.4.5",
|
|
15
14
|
"vue-router": "3.5.3",
|
|
16
|
-
"vue-i18n": "8.27.
|
|
15
|
+
"vue-i18n": "8.27.1",
|
|
17
16
|
"vue-property-decorator": "9.1.2",
|
|
18
17
|
"vuelidate": "0.7.7",
|
|
19
18
|
"vuex": "3.6.2",
|
|
20
19
|
"vue2-filters": "0.14.0"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@rushstack/eslint-patch": "1.1.
|
|
22
|
+
"@rushstack/eslint-patch": "1.1.1",
|
|
24
23
|
"@types/jest": "27.4.1",
|
|
25
24
|
"@types/node": "16.11.26",
|
|
26
25
|
"@types/sinon": "10.0.11",
|
|
@@ -30,10 +29,10 @@
|
|
|
30
29
|
"@vue/vue2-jest": "27.0.0-alpha.3",
|
|
31
30
|
"@vue/test-utils": "1.3.0",
|
|
32
31
|
"axios-mock-adapter": "1.20.0",
|
|
33
|
-
"autoprefixer": "10.4.
|
|
32
|
+
"autoprefixer": "10.4.4",
|
|
34
33
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
35
34
|
"copy-webpack-plugin": "10.2.4",
|
|
36
|
-
"css-loader": "6.
|
|
35
|
+
"css-loader": "6.7.1",
|
|
37
36
|
"css-minimizer-webpack-plugin": "3.4.1",
|
|
38
37
|
"folder-hash": "4.0.2",
|
|
39
38
|
"fork-ts-checker-webpack-plugin": "7.2.1",
|
|
@@ -44,28 +43,28 @@
|
|
|
44
43
|
"jest-sonar-reporter": "2.0.0",
|
|
45
44
|
"jest-vue-preprocessor": "1.7.1",
|
|
46
45
|
"merge-jsons-webpack-plugin": "2.0.1",
|
|
47
|
-
"mini-css-extract-plugin": "2.
|
|
46
|
+
"mini-css-extract-plugin": "2.6.0",
|
|
48
47
|
"numeral": "2.0.6",
|
|
49
|
-
"postcss-import": "14.0
|
|
48
|
+
"postcss-import": "14.1.0",
|
|
50
49
|
"postcss-loader": "6.2.1",
|
|
51
50
|
"postcss-url": "10.1.3",
|
|
52
51
|
"rimraf": "3.0.2",
|
|
53
|
-
"sass": "1.49.
|
|
52
|
+
"sass": "1.49.10",
|
|
54
53
|
"sass-loader": "12.6.0",
|
|
55
54
|
"sinon": "13.0.1",
|
|
56
55
|
"terser-webpack-plugin": "5.3.1",
|
|
57
|
-
"ts-jest": "27.1.
|
|
58
|
-
"ts-loader": "9.2.
|
|
59
|
-
"eslint": "8.
|
|
56
|
+
"ts-jest": "27.1.4",
|
|
57
|
+
"ts-loader": "9.2.8",
|
|
58
|
+
"eslint": "8.12.0",
|
|
60
59
|
"eslint-plugin-prettier": "4.0.0",
|
|
61
60
|
"eslint-plugin-vue": "8.5.0",
|
|
62
|
-
"typescript": "4.
|
|
63
|
-
"webpack": "5.
|
|
61
|
+
"typescript": "4.6.3",
|
|
62
|
+
"webpack": "5.70.0",
|
|
64
63
|
"webpack-bundle-analyzer": "4.5.0",
|
|
65
64
|
"webpack-cli": "4.9.2",
|
|
66
65
|
"webpack-dev-server": "4.7.4",
|
|
67
66
|
"webpack-merge": "5.8.0",
|
|
68
|
-
"workbox-webpack-plugin": "6.5.
|
|
67
|
+
"workbox-webpack-plugin": "6.5.2",
|
|
69
68
|
"vue-jest": "3.0.7",
|
|
70
69
|
"vue-loader": "15.9.8"
|
|
71
70
|
}
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"bootswatch": "<%= dependabotPackageJson.dependencies['bootswatch'] %>",
|
|
37
37
|
<%_ } _%>
|
|
38
38
|
"dayjs": "<%= dependabotPackageJson.dependencies['dayjs'] %>",
|
|
39
|
-
"swagger-ui-dist": "<%= dependabotPackageJson.dependencies['swagger-ui-dist'] %>",
|
|
40
39
|
<%_ if (communicationSpringWebsocket) { _%>
|
|
41
40
|
"sockjs-client": "1.5.2",
|
|
42
41
|
"@stomp/rx-stomp": "1.1.4",
|
|
@@ -115,6 +114,7 @@
|
|
|
115
114
|
"sass": "<%= dependabotPackageJson.devDependencies['sass'] %>",
|
|
116
115
|
"sass-loader": "<%= dependabotPackageJson.devDependencies['sass-loader'] %>",
|
|
117
116
|
"sinon": "<%= dependabotPackageJson.devDependencies['sinon'] %>",
|
|
117
|
+
"swagger-ui-dist": "<%= dependabotPackageJson.devDependencies['swagger-ui-dist'] %>",
|
|
118
118
|
"terser-webpack-plugin": "<%= dependabotPackageJson.devDependencies['terser-webpack-plugin'] %>",
|
|
119
119
|
"ts-jest": "<%= dependabotPackageJson.devDependencies['ts-jest'] %>",
|
|
120
120
|
"ts-loader": "<%= dependabotPackageJson.devDependencies['ts-loader'] %>",
|
|
@@ -58,6 +58,7 @@ export default class JhiNavbar extends Vue {
|
|
|
58
58
|
return this.loginService().logout().then(response => {
|
|
59
59
|
this.$store.commit('logout');
|
|
60
60
|
<%_ if (authenticationTypeOauth2) { _%>
|
|
61
|
+
window.location.href = response.data.logoutUrl;
|
|
61
62
|
const next = response.data?.logoutUrl ?? '/';
|
|
62
63
|
if (this.$route.path !== next) {
|
|
63
64
|
return this.$router.push(next);
|
package/generators/client/templates/vue/src/main/webapp/app/shared/data/data-utils.service.ts.ejs
CHANGED
|
@@ -67,7 +67,7 @@ export default class JhiDataUtils extends Vue {
|
|
|
67
67
|
const fileReader = new FileReader();
|
|
68
68
|
fileReader.readAsDataURL(file);
|
|
69
69
|
fileReader.onload = (e: any) => {
|
|
70
|
-
const base64Data = e.target.result.
|
|
70
|
+
const base64Data = e.target.result.substring(e.target.result.indexOf('base64,') + 'base64,'.length);
|
|
71
71
|
cb(base64Data);
|
|
72
72
|
};
|
|
73
73
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { pathsToModuleNameMapper } = require('ts-jest
|
|
1
|
+
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
2
2
|
const config = require('../../../webpack/config');
|
|
3
3
|
const { compilerOptions: { paths = {}, baseUrl = './' } } = require('../../../tsconfig.json');
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ module.exports = {
|
|
|
27
27
|
],
|
|
28
28
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
29
29
|
testMatch: ['<rootDir>/<%= CLIENT_TEST_SRC_DIR %>spec/**/@(*.)@(spec.ts)'],
|
|
30
|
-
snapshotSerializers: ['
|
|
30
|
+
snapshotSerializers: ['jest-serializer-vue'],
|
|
31
31
|
globals: {
|
|
32
32
|
<%_ if (enableTranslation) { _%>
|
|
33
33
|
I18N_HASH: 'generated_hash',
|
|
@@ -149,12 +149,16 @@ module.exports = async (env, options) => {
|
|
|
149
149
|
new CopyWebpackPlugin({
|
|
150
150
|
patterns: [
|
|
151
151
|
{
|
|
152
|
-
|
|
152
|
+
// https://github.com/swagger-api/swagger-ui/blob/v4.6.1/swagger-ui-dist-package/README.md
|
|
153
|
+
context: require('swagger-ui-dist').getAbsoluteFSPath(),
|
|
153
154
|
from: '*.{js,css,html,png}',
|
|
154
155
|
to: 'swagger-ui/',
|
|
155
156
|
globOptions: { ignore: ['**/index.html'] },
|
|
156
157
|
},
|
|
157
|
-
{
|
|
158
|
+
{
|
|
159
|
+
from: require.resolve('axios/dist/axios.min.js'),
|
|
160
|
+
to: 'swagger-ui/',
|
|
161
|
+
},
|
|
158
162
|
{ from: './<%= CLIENT_MAIN_SRC_DIR %>swagger-ui/', to: 'swagger-ui/' },
|
|
159
163
|
{ from: './<%= CLIENT_MAIN_SRC_DIR %>content/', to: 'content/' },
|
|
160
164
|
{ from: './<%= CLIENT_MAIN_SRC_DIR %>favicon.ico', to: 'favicon.ico' },
|
|
@@ -20,6 +20,7 @@ const chalk = require('chalk');
|
|
|
20
20
|
const shelljs = require('shelljs');
|
|
21
21
|
const jsyaml = require('js-yaml');
|
|
22
22
|
const pathjs = require('path');
|
|
23
|
+
const normalize = require('normalize-path');
|
|
23
24
|
|
|
24
25
|
const BaseDockerGenerator = require('../generator-base-docker');
|
|
25
26
|
const { INITIALIZING_PRIORITY, PROMPTING_PRIORITY, CONFIGURING_PRIORITY, LOADING_PRIORITY, PREPARING_PRIORITY, WRITING_PRIORITY } =
|
|
@@ -29,7 +30,7 @@ const writeFiles = require('./files').writeFiles;
|
|
|
29
30
|
const { GATEWAY, MONOLITH } = require('../../jdl/jhipster/application-types');
|
|
30
31
|
const { PROMETHEUS } = require('../../jdl/jhipster/monitoring-types');
|
|
31
32
|
const { EUREKA } = require('../../jdl/jhipster/service-discovery-types');
|
|
32
|
-
const { CASSANDRA, COUCHBASE,
|
|
33
|
+
const { CASSANDRA, COUCHBASE, MONGODB, ORACLE } = require('../../jdl/jhipster/database-types');
|
|
33
34
|
const { ELASTICSEARCH } = require('../../jdl/jhipster/search-engine-types');
|
|
34
35
|
const { KAFKA } = require('../../jdl/jhipster/message-broker-types');
|
|
35
36
|
const { MEMCACHED, REDIS } = require('../../jdl/jhipster/cache-types');
|
|
@@ -175,11 +176,12 @@ module.exports = class extends BaseDockerGenerator {
|
|
|
175
176
|
// Add database configuration
|
|
176
177
|
const database = appConfig.prodDatabaseType;
|
|
177
178
|
if (database !== NO_DATABASE && database !== ORACLE) {
|
|
178
|
-
const relativePath = pathjs.relative(this.destinationRoot(), `${path}/src/main/docker`);
|
|
179
|
+
const relativePath = normalize(pathjs.relative(this.destinationRoot(), `${path}/src/main/docker`));
|
|
179
180
|
const databaseYaml = jsyaml.load(this.fs.read(`${path}/src/main/docker/${database}.yml`));
|
|
180
181
|
const databaseServiceName = `${lowercaseBaseName}-${database}`;
|
|
181
182
|
let databaseYamlConfig = databaseYaml.services[databaseServiceName];
|
|
182
|
-
|
|
183
|
+
// Don't export database ports
|
|
184
|
+
delete databaseYamlConfig.ports;
|
|
183
185
|
|
|
184
186
|
if (database === CASSANDRA) {
|
|
185
187
|
// node config
|
|
@@ -191,9 +193,11 @@ module.exports = class extends BaseDockerGenerator {
|
|
|
191
193
|
const cassandraMigrationYaml = jsyaml.load(this.fs.read(`${path}/src/main/docker/cassandra-migration.yml`));
|
|
192
194
|
const cassandraMigrationConfig = cassandraMigrationYaml.services[`${databaseServiceName}-migration`];
|
|
193
195
|
cassandraMigrationConfig.build.context = relativePath;
|
|
194
|
-
const createKeyspaceScript = cassandraClusterYaml.services[`${databaseServiceName}-migration`].environment
|
|
196
|
+
const createKeyspaceScript = cassandraClusterYaml.services[`${databaseServiceName}-migration`].environment.find(envVariable =>
|
|
197
|
+
envVariable.includes('CREATE_KEYSPACE_SCRIPT')
|
|
198
|
+
);
|
|
195
199
|
cassandraMigrationConfig.environment.push(createKeyspaceScript);
|
|
196
|
-
const cqlFilesRelativePath = pathjs.relative(this.destinationRoot(), `${path}/src/main/resources/config/cql`);
|
|
200
|
+
const cqlFilesRelativePath = normalize(pathjs.relative(this.destinationRoot(), `${path}/src/main/resources/config/cql`));
|
|
197
201
|
cassandraMigrationConfig.volumes[0] = `${cqlFilesRelativePath}:/cql:ro`;
|
|
198
202
|
|
|
199
203
|
parentConfiguration[`${databaseServiceName}-migration`] = cassandraMigrationConfig;
|
|
@@ -72,16 +72,14 @@ const { IMAGE, TEXT } = BlobTypes;
|
|
|
72
72
|
|
|
73
73
|
const { PaginationTypes, ServiceTypes } = require('../../jdl/jhipster/entity-options');
|
|
74
74
|
|
|
75
|
-
const {
|
|
76
|
-
const
|
|
77
|
-
const NO_SERVICE = ServiceTypes.NO;
|
|
75
|
+
const { NO: NO_PAGINATION } = PaginationTypes;
|
|
76
|
+
const { NO: NO_SERVICE } = ServiceTypes;
|
|
78
77
|
|
|
79
78
|
const { MAX, MIN, MAXLENGTH, MINLENGTH, MAXBYTES, MINBYTES, PATTERN } = require('../../jdl/jhipster/validations');
|
|
80
79
|
|
|
81
80
|
/* constants used throughout */
|
|
82
|
-
const SUPPORTED_VALIDATION_RULES = constants
|
|
81
|
+
const { SUPPORTED_VALIDATION_RULES, JHIPSTER_CONFIG_DIR } = constants;
|
|
83
82
|
const ANGULAR = constants.SUPPORTED_CLIENT_FRAMEWORKS.ANGULAR;
|
|
84
|
-
const JHIPSTER_CONFIG_DIR = constants.JHIPSTER_CONFIG_DIR;
|
|
85
83
|
|
|
86
84
|
class EntityGenerator extends BaseBlueprintGenerator {
|
|
87
85
|
constructor(args, options, features) {
|
|
@@ -810,6 +808,12 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
810
808
|
this.context.otherEntities = _.uniq(this.context.relationships.map(rel => rel.otherEntity));
|
|
811
809
|
},
|
|
812
810
|
|
|
811
|
+
checkUpdatableEntity() {
|
|
812
|
+
this.context.updatableEntity =
|
|
813
|
+
this.context.fields.some(field => !field.id && !field.transient) ||
|
|
814
|
+
this.context.relationships.some(relationship => !relationship.id && relationship.ownerSide);
|
|
815
|
+
},
|
|
816
|
+
|
|
813
817
|
processOtherReferences() {
|
|
814
818
|
this.context.otherReferences = this.context.otherRelationships.map(relationship => relationship.reference);
|
|
815
819
|
this.context.allReferences
|
|
@@ -837,6 +841,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
837
841
|
processEntityPrimaryKeysDerivedProperties() {
|
|
838
842
|
if (!this.context.primaryKey) return;
|
|
839
843
|
derivedPrimaryKeyProperties(this.context.primaryKey);
|
|
844
|
+
this._checkPersistableInterfaceRequirement();
|
|
840
845
|
},
|
|
841
846
|
|
|
842
847
|
processPrimaryKeyTypesForRelations() {
|
|
@@ -852,24 +857,30 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
852
857
|
* Process relationships that should be loaded eagerly.
|
|
853
858
|
*/
|
|
854
859
|
processEagerLoadRelationships() {
|
|
855
|
-
this.context.relationships
|
|
856
|
-
|
|
857
|
-
|
|
860
|
+
this.context.relationships.forEach(relationship => {
|
|
861
|
+
if (relationship.otherEntity.embedded) {
|
|
862
|
+
relationship.bagRelationship = false;
|
|
863
|
+
relationship.relationshipEagerLoad = false;
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
relationship.bagRelationship = relationship.ownerSide && relationship.collection;
|
|
867
|
+
if (relationship.relationshipEagerLoad === undefined) {
|
|
858
868
|
relationship.relationshipEagerLoad =
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
// Neo4j & Couchbase eagerly loads relations by default
|
|
866
|
-
![NEO4J, COUCHBASE, CASSANDRA].includes(this.context.databaseType);
|
|
867
|
-
relationship.bagRelationship = relationship.relationshipEagerLoad && relationship.collection;
|
|
868
|
-
});
|
|
869
|
+
relationship.bagRelationship ||
|
|
870
|
+
this.context.eagerLoad ||
|
|
871
|
+
// Fetch relationships if otherEntityField differs otherwise the id is enough
|
|
872
|
+
(relationship.ownerSide && relationship.otherEntity.primaryKey.name !== relationship.otherEntityField);
|
|
873
|
+
}
|
|
874
|
+
});
|
|
869
875
|
this.context.relationshipsContainEagerLoad = this.context.relationships.some(relationship => relationship.relationshipEagerLoad);
|
|
876
|
+
this.context.containsBagRelationships = this.context.relationships.some(relationship => relationship.bagRelationship);
|
|
877
|
+
this.context.implementsEagerLoadApis = // Cassandra doesn't provides *WithEagerReationships apis
|
|
878
|
+
![CASSANDRA, COUCHBASE].includes(this.context.databaseType) &&
|
|
879
|
+
// Only sql and mongodb provides *WithEagerReationships apis for imperative implementation
|
|
880
|
+
(this.context.reactive || [SQL, MONGODB].includes(this.context.databaseType)) &&
|
|
881
|
+
this.context.relationshipsContainEagerLoad;
|
|
870
882
|
this.context.eagerRelations = this.context.relationships.filter(rel => rel.relationshipEagerLoad);
|
|
871
883
|
this.context.regularEagerRelations = this.context.eagerRelations.filter(rel => rel.id !== true);
|
|
872
|
-
this.context.containsBagRelationships = this.context.relationships.some(relationship => relationship.bagRelationship);
|
|
873
884
|
|
|
874
885
|
this.context.reactiveEagerRelations = this.context.relationships.filter(
|
|
875
886
|
rel => rel.relationshipType === 'many-to-one' || (rel.relationshipType === 'one-to-one' && rel.ownerSide === true)
|
|
@@ -1142,6 +1153,10 @@ class EntityGenerator extends BaseBlueprintGenerator {
|
|
|
1142
1153
|
_derivedCompositePrimaryKeyProperties(types) {
|
|
1143
1154
|
this.context.otherEntityPrimaryKeyTypesIncludesUUID = types.includes(UUID);
|
|
1144
1155
|
}
|
|
1156
|
+
|
|
1157
|
+
_checkPersistableInterfaceRequirement() {
|
|
1158
|
+
this.context.requiresPersistableImplementation = this.context.fields.some(field => field.requiresPersistableImplementation);
|
|
1159
|
+
}
|
|
1145
1160
|
}
|
|
1146
1161
|
|
|
1147
1162
|
module.exports = EntityGenerator;
|
|
@@ -53,6 +53,13 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
53
53
|
async loadNativeLanguage() {
|
|
54
54
|
await this._loadEntityClientTranslations(this.entity, this.jhipsterConfig);
|
|
55
55
|
},
|
|
56
|
+
async prepareReact() {
|
|
57
|
+
const entity = this.entity;
|
|
58
|
+
if (!entity.clientFrameworkReact) return;
|
|
59
|
+
entity.entityReactState = entity.applicationTypeMonolith
|
|
60
|
+
? entity.entityInstance
|
|
61
|
+
: `${entity.lowercaseBaseName}.${entity.entityInstance}`;
|
|
62
|
+
},
|
|
56
63
|
};
|
|
57
64
|
}
|
|
58
65
|
|
|
@@ -157,6 +164,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
157
164
|
_postWriting() {
|
|
158
165
|
return {
|
|
159
166
|
addToMenu() {
|
|
167
|
+
if (this.skipClient || (this.microfrontend && this.applicationTypeGateway && this.microserviceName)) return undefined;
|
|
160
168
|
return addToMenu.call(this);
|
|
161
169
|
},
|
|
162
170
|
|
|
@@ -63,7 +63,7 @@ export class <%= entityAngularName %>Component implements OnInit {
|
|
|
63
63
|
<%_ } _%>
|
|
64
64
|
|
|
65
65
|
<%_ if (primaryKey) { _%>
|
|
66
|
-
track<%= primaryKey.nameCapitalized %>(
|
|
66
|
+
track<%= primaryKey.nameCapitalized %>(_index: number, item: I<%= entityAngularName %>): <%= primaryKey.tsType %> {
|
|
67
67
|
return item.<%= primaryKey.name %>!;
|
|
68
68
|
}
|
|
69
69
|
|