Skip to content

Commit 77c3a50

Browse files
committed
feat: add local-setup message for new ogranization
1 parent 2db27d7 commit 77c3a50

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

projects/wc/src/app/components/organization-management/organization-management.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export class OrganizationManagementComponent implements OnInit {
9191
this.organizations.set(
9292
result['Accounts']
9393
.map((o) => o.metadata.name)
94-
.filter((o) => o !== this.context().organization),
9594
);
9695
},
9796
});
@@ -122,7 +121,7 @@ export class OrganizationManagementComponent implements OnInit {
122121
this.organizationToSwitch.set(this.newOrganization);
123122
this.newOrganization = '';
124123
this.LuigiClient().uxManager().showAlert({
125-
text: 'New organization has been created, select it from the list to switch to it.',
124+
text: this.getMessageForOrganizationCreation(this.organizationToSwitch()),
126125
type: 'info',
127126
});
128127
},
@@ -137,6 +136,18 @@ export class OrganizationManagementComponent implements OnInit {
137136
});
138137
}
139138

139+
private getMessageForOrganizationCreation(orgName: string) {
140+
if(this.isLocalSetup()) {
141+
return `A new organization has just been onboarded. Since the portal runs on localhost, you need to add the organization to your machine's hosts file in order to switch to it. Add the following entry to your hosts configuration: 127.0.0.1 ${orgName}.portal.dev.local`
142+
}
143+
144+
return 'New organization has been created, select it from the list to switch to it.';
145+
}
146+
147+
private isLocalSetup() {
148+
return window.location.hostname.includes('localhost') || window.location.hostname.includes('portal.dev.local');
149+
}
150+
140151
private readTranslations() {
141152
return {
142153
explanation: this.i18nService.getTranslation(

0 commit comments

Comments
 (0)