Skip to content

Commit

Permalink
Merge pull request #538 from appuio/country-list-missing
Browse files Browse the repository at this point in the history
Graceful degradation of empty country list
  • Loading branch information
ccremer authored Apr 18, 2023
2 parents 726b035 + 8bcf9f9 commit e5c8d49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/app-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface AppConfig {
zoneURLLabels: { [key: string]: string };
consoleUrlKey: string;
};
countries: { code?: string; name: string }[];
countries?: { code?: string; name: string }[];
}

export interface ZoneConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
filterBy="name"
[required]="true"
placeholder="Select Country"
emptyMessage="No results found, please try a hard reload of the page"
i18n-placeholder
i18n-emptyMessage
[styleClass]="'mb-2'"
/>
<small i18n>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class BillingEntityFormComponent implements OnInit {
) {}

ngOnInit(): void {
this.countryOptions = this.appConfig.getConfiguration().countries;
this.countryOptions = this.appConfig.getConfiguration().countries ?? [];
this.billingEntity = structuredClone(this.billingEntity); // make fields writable if editing existing BE.
const spec = this.billingEntity.spec;
const companyEmails = spec.emails?.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' })) ?? [];
Expand Down

0 comments on commit e5c8d49

Please sign in to comment.