diff --git a/src/app/features/registry/components/registry-statuses/registry-statuses.component.html b/src/app/features/registry/components/registry-statuses/registry-statuses.component.html index 016932507..6fa7ed144 100644 --- a/src/app/features/registry/components/registry-statuses/registry-statuses.component.html +++ b/src/app/features/registry/components/registry-statuses/registry-statuses.component.html @@ -1,18 +1,15 @@ -

{{ 'registry.overview.statuses.' + registry()?.status + '.text' | translate }}

+

{{ statusTranslations().text | translate }}

-

{{ 'registry.overview.statuses.' + registry()?.status + '.short' | translate }}

+

{{ statusTranslations().short | translate }}

- {{ - 'registry.overview.statuses.' + registry()?.status + '.long' - | translate: { embargoEndDate: embargoEndDate(), email: supportEmail } - }} + {{ statusTranslations().long | translate: { embargoEndDate: embargoEndDate(), email: supportEmail } }} @if (isAccepted()) { diff --git a/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts b/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts index abf8b81e9..85e9e8497 100644 --- a/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts +++ b/src/app/features/registry/components/registry-statuses/registry-statuses.component.ts @@ -55,6 +55,20 @@ export class RegistryStatusesComponent { return date ? new Date(date).toDateString() : null; }); + statusTranslations = computed(() => { + const defaultStatusKey = 'registry.overview.endEmbargo'; + + const status = this.registry()?.status; + const basePath = + !status || status === RegistryStatus.None ? defaultStatusKey : `registry.overview.statuses.${status}`; + + return { + text: `${basePath}.text`, + short: `${basePath}.short`, + long: `${basePath}.long`, + }; + }); + openWithdrawDialog(): void { const registry = this.registry();