diff --git a/libs/dh/globalization/assets-localization/src/assets/i18n/da.json b/libs/dh/globalization/assets-localization/src/assets/i18n/da.json index b784bf3d4f..3130acf640 100644 --- a/libs/dh/globalization/assets-localization/src/assets/i18n/da.json +++ b/libs/dh/globalization/assets-localization/src/assets/i18n/da.json @@ -639,6 +639,10 @@ "drawer": { "edit": "Rediger organisation", "tabs": { + "shared": { + "error": "En fejl opstod", + "noData": "Ingen data" + }, "masterData": { "tabLabel": "Information", "businessRegisterIdentifier": "CVR", diff --git a/libs/dh/globalization/assets-localization/src/assets/i18n/en.json b/libs/dh/globalization/assets-localization/src/assets/i18n/en.json index 4eb17d8aa6..462218836b 100644 --- a/libs/dh/globalization/assets-localization/src/assets/i18n/en.json +++ b/libs/dh/globalization/assets-localization/src/assets/i18n/en.json @@ -646,6 +646,10 @@ "drawer": { "edit": "Edit organisation", "tabs": { + "shared": { + "error": "An error occurred", + "noData": "No data" + }, "masterData": { "tabLabel": "Information", "businessRegisterIdentifier": "Business ID", diff --git a/libs/dh/market-participant/actors/feature-organizations/src/lib/drawer/dh-organization-drawer.component.html b/libs/dh/market-participant/actors/feature-organizations/src/lib/drawer/dh-organization-drawer.component.html index ddd830b356..9360d01c97 100644 --- a/libs/dh/market-participant/actors/feature-organizations/src/lib/drawer/dh-organization-drawer.component.html +++ b/libs/dh/market-participant/actors/feature-organizations/src/lib/drawer/dh-organization-drawer.component.html @@ -32,27 +32,49 @@

{{ organization?.name }}

- + + + + + - + + + + + = new WattTableDataSource([]); @@ -154,10 +169,18 @@ export class DhOrganizationDrawerComponent { .pipe(takeUntil(this.closed)) .subscribe({ next: (result) => { + this.isLoadingOrganization = result.loading; + this.organizationFailedToLoad = + !result.loading && (!!result.error || !!result.errors?.length); + this.organization = result.data?.organizationById ? { ...result.data.organizationById, organizationId: id } : undefined; }, + error: () => { + this.organizationFailedToLoad = true; + this.isLoadingOrganization = false; + }, }); } @@ -170,7 +193,11 @@ export class DhOrganizationDrawerComponent { .pipe(takeUntil(this.closed)) .subscribe({ next: (result) => { + this.isLoadingActors = result.loading; + this.actorsFailedToLoad = !result.loading && (!!result.error || !!result.errors?.length); + const data = result.data?.actorsByOrganizationId; + this.actors.data = data ? [...data] .sort((a, b) => a.name.localeCompare(b.name)) @@ -181,6 +208,10 @@ export class DhOrganizationDrawerComponent { })) : []; }, + error: () => { + this.actorsFailedToLoad = true; + this.isLoadingActors = false; + }, }); } }