diff --git a/cli/import-jdl.js b/cli/import-jdl.js index 0bdbe1702d0..ac6c8a979d4 100644 --- a/cli/import-jdl.js +++ b/cli/import-jdl.js @@ -433,8 +433,8 @@ class JDLProcessor { applicationWithEntities.config.applications = Object.fromEntries( relatedApplications.map(([baseName, config]) => { config.gatewayServerPort = gatewayServerPort; - const { serverPort, applicationIndex, devServerPort } = config; - return [baseName, { serverPort, applicationIndex, devServerPort }]; + const { clientFramework, serverPort, applicationIndex, devServerPort } = config; + return [baseName, { clientFramework, serverPort, applicationIndex, devServerPort }]; }) ); } diff --git a/generators/app/index.js b/generators/app/index.js index 9124855c84f..d3101ae90c6 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -373,7 +373,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator { this.configOptions.logo = false; if (this.jhipsterConfig.applicationType === MICROSERVICE) { - this.jhipsterConfig.skipClient = !this.jhipsterConfig.microfrontend; + this.jhipsterConfig.skipClient = !this.jhipsterConfig.clientFramework; this.jhipsterConfig.withAdminUi = false; this.jhipsterConfig.skipUserManagement = true; } diff --git a/generators/bootstrap/index.js b/generators/bootstrap/index.js index 6ddf7fbbe8f..3769fbf0c58 100644 --- a/generators/bootstrap/index.js +++ b/generators/bootstrap/index.js @@ -21,8 +21,8 @@ const _ = require('lodash'); const { createConflicterCheckTransform, createConflicterStatusTransform, - createYoRcTransform, - createYoResolveTransform, + createYoRcTransform: createForceYoRcTransform, + createYoResolveTransform: createApplyYoResolveTransform, patternFilter, patternSpy, } = require('yeoman-environment/transform'); @@ -148,6 +148,9 @@ module.exports = class extends BaseGenerator { * @return {Promise} */ async _commitSharedFs(stream = this.env.sharedFs.stream(), skipPrettier = this.options.skipPrettier) { + const { skipYoResolve } = this.options; + const { withGeneratedFlag } = this.jhipsterConfig; + // JDL writes directly to disk, set the file as modified so prettier will be applied stream = stream.pipe( patternSpy(file => { @@ -170,29 +173,29 @@ module.exports = class extends BaseGenerator { ], }; - const yoResolveTranform = this.options.skipYoResolve ? [] : [createYoResolveTransform(this.env.conflicter)]; - const transformStreams = [ - // multi-step changes the file path, should be executed earlier in the pipeline - new MultiStepTransform(), - ...yoResolveTranform, - createYoRcTransform(), - patternSpy(file => { - file.conflicter = 'force'; - }, '**/.jhipster/*.json').name('jhipster:config-files:force'), - ]; - - if (this.jhipsterConfig.withGeneratedFlag) { - transformStreams.push(generatedAnnotationTransform(this)); - } - - if (!skipPrettier) { + const createApplyPrettierTransform = () => { const prettierOptions = { packageJson: true, java: !this.skipServer && !this.jhipsterConfig.skipServer }; // Prettier is clever, it uses correct rules and correct parser according to file extension. const ignoreErrors = this.options.commandName === 'upgrade' || this.options.ignoreErrors; - transformStreams.push(prettierTransform(prettierOptions, this, ignoreErrors)); - } + return prettierTransform(prettierOptions, this, ignoreErrors); + }; + + const createForceWriteConfigFiles = () => + patternSpy(file => { + file.conflicter = 'force'; + }, '**/.jhipster/*.json').name('jhipster:config-files:force'); - transformStreams.push(createConflicterCheckTransform(this.env.conflicter, conflicterStatus), createConflicterStatusTransform()); + const transformStreams = [ + // multi-step changes the file path, should be executed earlier in the pipeline + new MultiStepTransform(), + ...(skipYoResolve ? [] : [createApplyYoResolveTransform(this.env.conflicter)]), + createForceYoRcTransform(), + createForceWriteConfigFiles(), + ...(withGeneratedFlag ? [generatedAnnotationTransform(this)] : []), + ...(skipPrettier ? [] : [createApplyPrettierTransform()]), + createConflicterCheckTransform(this.env.conflicter, conflicterStatus), + createConflicterStatusTransform(), + ]; await this.env.fs.commit(transformStreams, stream); } diff --git a/generators/client/index.js b/generators/client/index.js index 2c3daa9030a..8e4f0c2108e 100644 --- a/generators/client/index.js +++ b/generators/client/index.js @@ -297,11 +297,11 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator { }, loadEntities() { - if (!this.configOptions.sharedEntities || (this.applicationTypeGateway && this.microfrontend)) { + if (!this.configOptions.sharedEntities) { this.localEntities = []; return; } - this.localEntities = Object.values(this.configOptions.sharedEntities).filter(entity => !entity.builtIn); + this.localEntities = Object.values(this.configOptions.sharedEntities).filter(entity => !entity.builtIn && !entity.skipClient); }, insight() { diff --git a/generators/client/needle-api/needle-client-angular.js b/generators/client/needle-api/needle-client-angular.js index fb50cea1e03..4815602292b 100644 --- a/generators/client/needle-api/needle-client-angular.js +++ b/generators/client/needle-api/needle-client-angular.js @@ -236,7 +236,7 @@ module.exports = class extends needleClientBase { if (!isSpecificEntityAlreadyGenerated) { const modulePath = - this.generator.jhipsterConfig.microfrontend && this.generator.jhipsterConfig.applicationType === 'gateway' && microserviceName + this.generator.microfrontend && this.generator.applicationTypeGateway && microserviceName ? `${microserviceName}/${entityFileName}` : `./${entityFolderName}/${entityFileName}.module`; const moduleName = microserviceName diff --git a/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs b/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs index d89a6064a48..374367349c0 100644 --- a/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs @@ -26,10 +26,10 @@ declare const VERSION: string; declare const I18N_HASH: string; <%_ } _%> <%_ if (applicationTypeGateway && microfrontend) { _%> - <%_ for (const remote of remotes) { _%> + <%_ for (const remote of microfrontends) { _%> declare module '@<%= remote.lowercaseBaseName %>/entities-router' { - const _default: []; + const _default: unknown; export default _default; } diff --git a/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs b/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs index 42e98098f95..0b37c3cc0f8 100644 --- a/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs @@ -5,7 +5,7 @@ import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; import App from './app.vue'; import Vue2Filters from 'vue2-filters'; import { ToastPlugin } from 'bootstrap-vue'; -import router from './router'; +import router<% if (applicationTypeGateway && microfrontend) { %>, { lazyRoutes }<% } %> from './router'; import * as config from './shared/config/config'; import * as bootstrapVueConfig from './shared/config/config-bootstrap-vue'; import JhiItemCountComponent from './shared/jhi-item-count.vue'; @@ -69,13 +69,18 @@ const translationService = new TranslationService(store, i18n); const loginService = new LoginService(); const accountService = new AccountService(store, <%_ if (enableTranslation) { _%>translationService, <%_ } _%><%_ if (authenticationTypeSession || authenticationTypeOauth2) { _%>(Vue).cookie, <%_ } _%><%_ if (communicationSpringWebsocket) { _%>trackerService, <%_ } _%>router); -router.beforeEach((to, from, next) => { - +router.beforeEach(async (to, from, next) => { if (!to.matched.length) { - next('/not-found'); - } +<%_ if (applicationTypeGateway && microfrontend) { _%> + await lazyRoutes; + if (router.match(to.fullPath).matched.length > 0) { + next(to.fullPath); + return; + } - if (to.meta && to.meta.authorities && to.meta.authorities.length > 0) { +<%_ } _%> + next('/not-found'); + } else if (to.meta && to.meta.authorities && to.meta.authorities.length > 0) { accountService.hasAnyAuthorityAndCheckAuth(to.meta.authorities).then(value => { if (!value) { sessionStorage.setItem('requested-url', to.fullPath); diff --git a/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs b/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs index febf10d98c3..4137c4ce1f6 100644 --- a/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs @@ -13,7 +13,7 @@ const <%= entity.entityAngularName %>Details = () => import('@/entities/<%= enti <%_ } _%> // jhipster-needle-add-entity-to-router-import - JHipster will import entities to the router here -export default [ +export default { path: '/<%= applicationTypeMicroservice ? baseName.toLowerCase() : '' %>', component: Entities, @@ -48,5 +48,4 @@ export default [ <%_ } _%> // jhipster-needle-add-entity-to-router - JHipster will add entities to the router here ], - }, -]; + }; diff --git a/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs b/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs index b620771d28d..c02d7774193 100644 --- a/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +++ b/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs @@ -5,7 +5,7 @@ Component.registerHooks([ 'beforeRouteLeave', 'beforeRouteUpdate' // for vue-router 2.2+ ]) -import Router from 'vue-router'; +import Router, { RouteConfig } from 'vue-router'; const Home = () => import('@/core/home/home.vue'); const Error = () => import('@/core/error/error.vue'); @@ -15,17 +15,11 @@ import account from "@/router/account"; import admin from "@/router/admin"; import entities from "@/router/entities"; import pages from "@/router/pages"; -<%_ if (applicationTypeGateway && microfrontend) { _%> - - <%_ for (const remote of remotes) { _%> -const <%= remote.lowercaseBaseName %>Router = await import('@<%= remote.lowercaseBaseName %>/entities-router').then(module => module.default).catch(() => []); - <%_ } _%> -<%_ } _%> Vue.use(Router); // prettier-ignore -export default new Router({ +const router = new Router({ mode: 'history', routes: [ { @@ -49,12 +43,23 @@ export default new Router({ ...account, <%_ } _%> ...admin, - ...entities, -<%_ if (applicationTypeGateway && microfrontend) { _%> - <%_ for (const remote of remotes) { _%> - ...<%= remote.lowercaseBaseName %>Router, - <%_ } _%> -<%_ } _%> + entities, ...pages ] }); + +<%_ if (applicationTypeGateway && microfrontend) { _%> +export const lazyRoutes = Promise.all([ + <%_ for (const remote of microfrontends) { _%> + import('@<%= remote.lowercaseBaseName %>/entities-router') + .then(<%= remote.lowercaseBaseName %>Router => { + router.addRoute(<%= remote.lowercaseBaseName %>Router.default as RouteConfig); + return <%= remote.lowercaseBaseName %>Router.default; + }).catch(() => { + console.log("Error loading <%= remote.lowercaseBaseName %> menus. Make sure it's up."); + }), + <%_ } _%> +]); + +<%_ } _%> +export default router; diff --git a/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs b/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs index 804a7566d1b..8485ad02f0f 100644 --- a/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +++ b/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs @@ -17,8 +17,8 @@ module.exports = { moduleNameMapper: { '^@/(.*)$': '/<%= CLIENT_MAIN_SRC_DIR %>app/$1', ...pathsToModuleNameMapper(paths, { prefix: `/${baseUrl}/` }), -<%_ if (applicationTypeGateway) { _%> - '^@(<%= remotes.map(remote => remote.lowercaseBaseName).join('|') %>)/(.*)$': '/<%= CLIENT_TEST_SRC_DIR %>spec/app/microfrontends/$2', +<%_ if (applicationTypeGateway && microfrontend) { _%> + '^@(<%= microfrontends.map(remote => remote.lowercaseBaseName).join('|') %>)/(.*)$': '/<%= CLIENT_TEST_SRC_DIR %>spec/app/microfrontends/$2', <%_ } _%> }, reporters: [ diff --git a/generators/client/templates/vue/tsconfig.json.ejs b/generators/client/templates/vue/tsconfig.json.ejs index f47a9e545aa..a2cf3f58aef 100644 --- a/generators/client/templates/vue/tsconfig.json.ejs +++ b/generators/client/templates/vue/tsconfig.json.ejs @@ -24,5 +24,5 @@ "include": [ "<%= CLIENT_MAIN_SRC_DIR %>app" ], - "exclude": ["node_modules"<% if (!cypressTests) { %>,"<%= CLIENT_TEST_SRC_DIR %>cypress"<% } %>] + "exclude": ["node_modules"<% if (cypressTests) { %>,"<%= CLIENT_TEST_SRC_DIR %>cypress"<% } %>] } diff --git a/generators/client/templates/vue/tsconfig.spec.json.ejs b/generators/client/templates/vue/tsconfig.spec.json.ejs index 4ff5c0d2825..c49e20e4f49 100644 --- a/generators/client/templates/vue/tsconfig.spec.json.ejs +++ b/generators/client/templates/vue/tsconfig.spec.json.ejs @@ -22,7 +22,7 @@ "outDir": "<%= BUILD_DIR %>out-tsc/spec", <%_ if (microfrontend && applicationTypeGateway) { _%> "paths": { - <%_ for (const remote of remotes) { _%> + <%_ for (const remote of microfrontends) { _%> "@<%= remote.lowercaseBaseName %>/*": ["<%= CLIENT_TEST_SRC_DIR %>spec/app/microfrontends/*"], <%_ } _%> "@/*": ["*"] diff --git a/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs b/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs index 1cc70f53613..b0096b064b5 100644 --- a/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +++ b/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs @@ -24,7 +24,7 @@ const { DefinePlugin } = require('webpack'); <&_ if (fragment.moduleFederationSection) { -&> <%_ if (applicationTypeGateway) { _%> remotes: { - <%_ for (const remote of remotes) { _%> + <%_ for (const remote of microfrontends) { _%> '@<%= remote.lowercaseBaseName %>': `<%= remote.lowercaseBaseName %>@/<%= remote.endpointPrefix %>/remoteEntry.js`, <%_ } _%> }, diff --git a/generators/cypress/templates/cypress.json.ejs b/generators/cypress/templates/cypress.json.ejs index 8851b8b5aab..a2d2e77dc3e 100644 --- a/generators/cypress/templates/cypress.json.ejs +++ b/generators/cypress/templates/cypress.json.ejs @@ -17,7 +17,7 @@ limitations under the License. -%> { - "baseUrl": "http://localhost:<%= serverPort %>/", + "baseUrl": "http://localhost:<%= gatewayServerPort || serverPort %>/", "testFiles": "**/*.spec.ts", "supportFile": "<%= CLIENT_TEST_SRC_DIR %>cypress/support/index.ts", "video": false, diff --git a/generators/entity-client/files.js b/generators/entity-client/files.js index ff8124c4e49..74ab7ec5312 100644 --- a/generators/entity-client/files.js +++ b/generators/entity-client/files.js @@ -437,11 +437,7 @@ function addSampleRegexTestingStrings(generator) { function writeFiles() { return { writeClientFiles() { - if ( - this.skipClient || - (this.jhipsterConfig.microfrontend && this.jhipsterConfig.applicationType === 'gateway' && this.microserviceName) - ) - return undefined; + if (this.skipClient || (this.microfrontend && this.applicationTypeGateway && this.microserviceName)) return undefined; if (this.protractorTests) { addSampleRegexTestingStrings(this); } @@ -483,7 +479,7 @@ function addToMenu() { if (!this.embedded) { this.addEntityToModule(); this.addEntityToMenu( - this.entityStateName, + this.entityPage, this.enableTranslation, this.clientFramework, this.entityTranslationKeyMenu, diff --git a/generators/entity-client/index.js b/generators/entity-client/index.js index 264f0aafb2d..61b8d697159 100644 --- a/generators/entity-client/index.js +++ b/generators/entity-client/index.js @@ -157,11 +157,7 @@ module.exports = class extends BaseBlueprintGenerator { }, replaceTranslations() { - if ( - this.skipClient || - (this.jhipsterConfig.microfrontend && this.jhipsterConfig.applicationType === 'gateway' && this.microserviceName) - ) - return undefined; + if (this.skipClient || (this.microfrontend && this.applicationTypeGateway && this.microserviceName)) return undefined; return replaceTranslations.call(this); }, }; diff --git a/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs b/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs index f46041587e0..f4f10d4540d 100644 --- a/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +++ b/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs @@ -14,7 +14,7 @@ import { } from '../../support/entity'; <%_ -const baseApi = (applicationTypeGateway && locals.microserviceName) ? 'services/' + microserviceName.toLowerCase() + '/api/' : 'api/'; +const baseApi = entityApi + 'api/'; const entityFakeData = generateFakeData('cypress'); const requiredRelationships = relationships.filter(rel => rel.relationshipRequired || rel.id); diff --git a/generators/entity/index.js b/generators/entity/index.js index 4d3b7c511af..206bc2b3fa8 100644 --- a/generators/entity/index.js +++ b/generators/entity/index.js @@ -204,7 +204,6 @@ class EntityGenerator extends BaseBlueprintGenerator { const context = this.context; if (this.jhipsterConfig.applicationType === MICROSERVICE) { - context.skipClient = context.skipClient || !this.jhipsterConfig.microfrontend; context.microserviceName = this.entityConfig.microserviceName = this.jhipsterConfig.baseName; if (!this.entityConfig.clientRootFolder) { context.clientRootFolder = this.entityConfig.clientRootFolder = this.entityConfig.microserviceName; @@ -232,6 +231,13 @@ class EntityGenerator extends BaseBlueprintGenerator { ? '' : this.entityConfig.microserviceName; } + + if (this.jhipsterConfig.applications && !this.entityConfig.skipClient) { + const remoteConfig = this.jhipsterConfig.applications[this.entityConfig.microserviceName]; + if (remoteConfig.clientFramework === 'vue') { + this.entityConfig.skipClient = true; + } + } } }, diff --git a/generators/generator-base.js b/generators/generator-base.js index 51d2814be37..cad1d3789a9 100644 --- a/generators/generator-base.js +++ b/generators/generator-base.js @@ -2666,7 +2666,7 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`; } if (options.microfrontend) { - this.jhipsterConfig.microfrontend = options.microfrontend; + this.warning('Microfrontend option is deprecated.'); } if (options.reactive !== undefined) { @@ -2747,7 +2747,6 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`; dest.pages = config.pages; dest.skipJhipsterDependencies = !!config.skipJhipsterDependencies; dest.withAdminUi = config.withAdminUi; - dest.microfrontend = config.microfrontend; dest.gatewayServerPort = config.gatewayServerPort; dest.capitalizedBaseName = config.capitalizedBaseName; @@ -2777,6 +2776,12 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`; dest.applicationTypeMonolith = dest.applicationType === MONOLITH; dest.applicationTypeMicroservice = dest.applicationType === MICROSERVICE; + if (dest.remotes) { + dest.microfrontends = dest.remotes.filter(r => !r.skipClient); + dest.microfrontend = + (dest.applicationTypeMicroservice && !dest.skipClient) || (dest.applicationTypeGateway && dest.microfrontends.length > 0); + } + // Application name modified, using each technology's conventions if (dest.baseName) { dest.camelizedBaseName = _.camelCase(dest.baseName); diff --git a/generators/server/index.js b/generators/server/index.js index 4a3b0c3a37b..e634bffb15b 100644 --- a/generators/server/index.js +++ b/generators/server/index.js @@ -446,7 +446,7 @@ module.exports = class JHipsterServerGenerator extends BaseBlueprintGenerator { return { packageJsonScripts() { const packageJsonConfigStorage = this.packageJson.createStorage('config').createProxy(); - packageJsonConfigStorage.backend_port = this.serverPort; + packageJsonConfigStorage.backend_port = this.gatewayServerPort || this.serverPort; packageJsonConfigStorage.packaging = this.defaultPackaging; packageJsonConfigStorage.default_environment = this.defaultEnvironment; }, diff --git a/test-integration/jdl-samples/vue-blog-store-microfrontend/blog-store.jdl b/test-integration/jdl-samples/vue-blog-store-microfrontend/blog-store.jdl index b64c1de7626..8ca6b1e0b80 100644 --- a/test-integration/jdl-samples/vue-blog-store-microfrontend/blog-store.jdl +++ b/test-integration/jdl-samples/vue-blog-store-microfrontend/blog-store.jdl @@ -27,8 +27,8 @@ application { clientFramework vue authenticationType oauth2 prodDatabaseType postgresql - searchEngine elasticsearch serverPort 8081 + testFrameworks [cypress] creationTimestamp 1617901618887 jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=" } @@ -42,11 +42,9 @@ application { applicationType microservice clientFramework vue authenticationType oauth2 - databaseType mongodb - devDatabaseType mongodb - prodDatabaseType mongodb - enableHibernateCache false + prodDatabaseType postgresql serverPort 8082 + testFrameworks [cypress] creationTimestamp 1617901618888 jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=" } diff --git a/test/client/__snapshots__/angular.spec.js.snap b/test/client/__snapshots__/angular.spec.js.snap index 0ea4a429f2a..db252967718 100644 --- a/test/client/__snapshots__/angular.spec.js.snap +++ b/test/client/__snapshots__/angular.spec.js.snap @@ -65,9 +65,6 @@ Object { "src/main/webapp/WEB-INF/web.xml": Object { "stateCleared": "modified", }, - "src/main/webapp/app/admin/admin-routing.module.ts": Object { - "stateCleared": "modified", - }, "src/main/webapp/app/admin/configuration/configuration.component.html": Object { "stateCleared": "modified", }, @@ -92,21 +89,6 @@ Object { "src/main/webapp/app/admin/configuration/configuration.service.ts": Object { "stateCleared": "modified", }, - "src/main/webapp/app/admin/docs/docs.component.html": Object { - "stateCleared": "modified", - }, - "src/main/webapp/app/admin/docs/docs.component.scss": Object { - "stateCleared": "modified", - }, - "src/main/webapp/app/admin/docs/docs.component.ts": Object { - "stateCleared": "modified", - }, - "src/main/webapp/app/admin/docs/docs.module.ts": Object { - "stateCleared": "modified", - }, - "src/main/webapp/app/admin/docs/docs.route.ts": Object { - "stateCleared": "modified", - }, "src/main/webapp/app/admin/health/health.component.html": Object { "stateCleared": "modified", }, diff --git a/test/client/__snapshots__/vue.spec.js.snap b/test/client/__snapshots__/vue.spec.js.snap index 121448cb001..52774e79e57 100644 --- a/test/client/__snapshots__/vue.spec.js.snap +++ b/test/client/__snapshots__/vue.spec.js.snap @@ -473,6 +473,9 @@ Object { "src/test/javascript/spec/app/core/ribbon/ribbon.component.spec.ts": Object { "stateCleared": "modified", }, + "src/test/javascript/spec/app/entities/entities-menu.spec.ts": Object { + "stateCleared": "modified", + }, "src/test/javascript/spec/app/microfrontends/entities-menu.component.ts": Object { "stateCleared": "modified", }, diff --git a/test/client/angular.spec.js b/test/client/angular.spec.js index 9b32ffcef51..5e3d87e9c9e 100644 --- a/test/client/angular.spec.js +++ b/test/client/angular.spec.js @@ -2,6 +2,10 @@ const expect = require('expect'); const path = require('path'); const { skipPrettierHelpers: helpers } = require('../utils/utils'); const { OAUTH2 } = require('../../jdl/jhipster/authentication-types'); +const { MICROSERVICE } = require('../../jdl/jhipster/application-types'); +const { ANGULARX } = require('../../jdl/jhipster/client-framework-types'); + +const commonOptions = { clientFramework: ANGULARX }; describe('JHipster angular generator', () => { describe('microfrontend', () => { @@ -12,10 +16,11 @@ describe('JHipster angular generator', () => { .withOptions({ skipInstall: true, auth: OAUTH2, - microfrontend: true, + applicationType: MICROSERVICE, enableTranslation: true, nativeLanguage: 'en', languages: ['fr', 'en'], + ...commonOptions, }) .run(); }); diff --git a/test/client/react.spec.js b/test/client/react.spec.js index a36d25bd5c6..cfd630997ce 100644 --- a/test/client/react.spec.js +++ b/test/client/react.spec.js @@ -2,6 +2,7 @@ const expect = require('expect'); const path = require('path'); const { skipPrettierHelpers: helpers } = require('../utils/utils'); const { OAUTH2 } = require('../../jdl/jhipster/authentication-types'); +const { MICROSERVICE } = require('../../jdl/jhipster/application-types'); const { REACT } = require('../../jdl/jhipster/client-framework-types'); const commonOptions = { clientFramework: REACT }; @@ -15,8 +16,8 @@ describe('JHipster react generator', () => { .withOptions({ skipInstall: true, auth: OAUTH2, - microfrontend: true, enableTranslation: true, + applicationType: MICROSERVICE, nativeLanguage: 'en', languages: ['fr', 'en'], ...commonOptions, diff --git a/test/client/vue.spec.js b/test/client/vue.spec.js index 3c6affb3e75..c9483cc14cb 100644 --- a/test/client/vue.spec.js +++ b/test/client/vue.spec.js @@ -2,6 +2,7 @@ const expect = require('expect'); const path = require('path'); const { skipPrettierHelpers: helpers } = require('../utils/utils'); const { OAUTH2 } = require('../../jdl/jhipster/authentication-types'); +const { MICROSERVICE } = require('../../jdl/jhipster/application-types'); const { VUE } = require('../../jdl/jhipster/client-framework-types'); const commonOptions = { clientFramework: VUE }; @@ -13,9 +14,9 @@ describe('JHipster vue generator', () => { runResult = await helpers .create(path.join(__dirname, '../../generators/client')) .withOptions({ + applicationType: MICROSERVICE, skipInstall: true, auth: OAUTH2, - microfrontend: true, enableTranslation: true, nativeLanguage: 'en', languages: ['fr', 'en'], diff --git a/test/needle-api/needle-client-vue.spec.js b/test/needle-api/needle-client-vue.spec.js index 1df1c28b3ad..acdcd7ea790 100644 --- a/test/needle-api/needle-client-vue.spec.js +++ b/test/needle-api/needle-client-vue.spec.js @@ -124,30 +124,30 @@ const entityNameDetails = () => import('@/entities/entityFolderName/entityFileNa assert.fileContent( `${CLIENT_MAIN_SRC_DIR}app/router/entities.ts`, ` - { - path: 'entityFileName', - name: 'entityName', - component: entityName, - meta: { authorities: [Authority.USER] }, - }, - { - path: 'entityFileName/new', - name: 'entityNameCreate', - component: entityNameUpdate, - meta: { authorities: [Authority.USER] }, - }, - { - path: 'entityFileName/:entityInstanceId/edit', - name: 'entityNameEdit', - component: entityNameUpdate, - meta: { authorities: [Authority.USER] }, - }, - { - path: 'entityFileName/:entityInstanceId/view', - name: 'entityNameView', - component: entityNameDetails, - meta: { authorities: [Authority.USER] }, - }, + { + path: 'entityFileName', + name: 'entityName', + component: entityName, + meta: { authorities: [Authority.USER] }, + }, + { + path: 'entityFileName/new', + name: 'entityNameCreate', + component: entityNameUpdate, + meta: { authorities: [Authority.USER] }, + }, + { + path: 'entityFileName/:entityInstanceId/edit', + name: 'entityNameEdit', + component: entityNameUpdate, + meta: { authorities: [Authority.USER] }, + }, + { + path: 'entityFileName/:entityInstanceId/view', + name: 'entityNameView', + component: entityNameDetails, + meta: { authorities: [Authority.USER] }, + }, ` ); });