Skip to content

Commit

Permalink
Merge pull request #22659 from mshima/skip_ci-remotes
Browse files Browse the repository at this point in the history
don't try to detect microfrontends.
  • Loading branch information
DanielFran authored Jun 24, 2023
2 parents d5a7623 + 9dfce33 commit 7a670c5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import { UserRouteAccessService } from 'app/core/auth/user-route-access.service'
path: '<%= applicationTypeMicroservice ? lowercaseBaseName : '' %>',
loadChildren: () => import(`./entities/entity-routing.module`).then(({ EntityRoutingModule }) => EntityRoutingModule),
},
<%_ if (applicationTypeGateway) { _%>
<%_ if (applicationTypeGateway && microfrontend) { _%>
<%_ for (const remote of microfrontends) { _%>
{
path: '<%= remote.lowercaseBaseName %>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</span>
</a>
<ul class="dropdown-menu" ngbDropdownMenu aria-labelledby="entity-menu">
<%_ if (applicationTypeGateway) { _%>
<%_ if (applicationTypeGateway && microfrontend) { _%>
<%_ for (const remote of microfrontends) { _%>
<li *ngIf="<%= remote.lowercaseBaseName %>EntityNavbarItems.length === 0">
<span class="dropdown-item">Failed to load <%= remote.lowercaseBaseName %> entities</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class NavbarComponent implements OnInit {
version = '';
account: Account | null = null;
entitiesNavbarItems: NavbarItem[] = [];
<%_ if (applicationTypeGateway) { _%>
<%_ if (applicationTypeGateway && microfrontend) { _%>
<%_ for (const remote of microfrontends) { _%>
<%= remote.lowercaseBaseName %>EntityNavbarItems: NavbarItem[] = [];
<%_ } _%>
Expand Down
11 changes: 4 additions & 7 deletions generators/app/__snapshots__/generator.spec.mts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ exports[`generator - app with default config should match snapshot 1`] = `
"messageBrokerKafka": false,
"messageBrokerPulsar": false,
"microfrontend": false,
"microfrontends": [],
"microfrontends": undefined,
"nativeLanguage": "en",
"nativeLanguageDefinition": {
"angularLocale": "en",
Expand Down Expand Up @@ -560,7 +560,6 @@ exports[`generator - app with default config should match snapshot 1`] = `
"projectVersion": "0.0.1-SNAPSHOT",
"reactive": false,
"rememberMeKey": undefined,
"remotes": [],
"searchEngine": "no",
"searchEngineAny": false,
"searchEngineCouchbase": false,
Expand Down Expand Up @@ -956,8 +955,8 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"messageBrokerAny": false,
"messageBrokerKafka": false,
"messageBrokerPulsar": false,
"microfrontend": false,
"microfrontends": [],
"microfrontend": undefined,
"microfrontends": undefined,
"nativeLanguage": "en",
"nativeLanguageDefinition": {
"angularLocale": "en",
Expand Down Expand Up @@ -1098,7 +1097,6 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"projectVersion": "0.0.1-SNAPSHOT",
"reactive": true,
"rememberMeKey": undefined,
"remotes": [],
"searchEngine": "no",
"searchEngineAny": false,
"searchEngineCouchbase": false,
Expand Down Expand Up @@ -1493,7 +1491,7 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"messageBrokerKafka": false,
"messageBrokerPulsar": false,
"microfrontend": false,
"microfrontends": [],
"microfrontends": undefined,
"nativeLanguage": "en",
"nativeLanguageDefinition": {
"angularLocale": "en",
Expand Down Expand Up @@ -1579,7 +1577,6 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"projectVersion": "0.0.1-SNAPSHOT",
"reactive": false,
"rememberMeKey": undefined,
"remotes": [],
"searchEngine": "no",
"searchEngineAny": false,
"searchEngineCouchbase": false,
Expand Down
2 changes: 1 addition & 1 deletion generators/app/prompts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function askForApplicationType({ control }) {
type: 'confirm',
name: 'microfrontend',
message: `Do you want to enable ${chalk.yellow('*microfrontends*')}?`,
default: config.microfrontend,
default: config.microfrontend ?? false,
},
{
when: answers => {
Expand Down
10 changes: 3 additions & 7 deletions generators/base/generator-base-todo.mts
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,6 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;

dest.testFrameworks = config.testFrameworks || [];

dest.remotes =
Object.entries(config.applications || {}).map(([baseName, remoteConfig]) => ({ baseName, ...(remoteConfig as any) })) || [];

dest.gatlingTests = dest.testFrameworks.includes(GATLING);
dest.cucumberTests = dest.testFrameworks.includes(CUCUMBER);
dest.cypressTests = dest.testFrameworks.includes(CYPRESS);
Expand Down Expand Up @@ -946,9 +943,8 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
microfrontend.capitalizedBaseName = _.upperFirst(baseName);
microfrontend.endpointPrefix = `services/${microfrontend.lowercaseBaseName}`;
});
} else if ((!dest.microfrontends || dest.microfrontends.length === 0) && dest.remotes) {
dest.remotes.forEach(app => (this as any).loadDerivedAppConfig(app));
dest.microfrontends = dest.remotes.filter(r => r.clientFramework && r.clientFramework !== CLIENT_FRAMEWORK_NO);
} else if (dest.microfrontend) {
dest.microfrontends = [];
}
dest.microfrontend =
dest.microfrontend ||
Expand Down Expand Up @@ -1008,7 +1004,7 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
if (dest.applicationTypeMicroservice) {
dest.microfrontend = dest.clientFrameworkAny;
} else if (dest.applicationTypeGateway) {
dest.microfrontend = dest.microfrontends.length > 0;
dest.microfrontend = dest.microfrontends && dest.microfrontends.length > 0;
}
}
dest.clientThemeNone = dest.clientTheme === 'none';
Expand Down

0 comments on commit 7a670c5

Please sign in to comment.