diff --git a/dmp-frontend/src/app/core/model/configuration-models/extended-internal-status.model.ts b/dmp-frontend/src/app/core/model/configuration-models/extended-internal-status.model.ts new file mode 100644 index 000000000..674b419c2 --- /dev/null +++ b/dmp-frontend/src/app/core/model/configuration-models/extended-internal-status.model.ts @@ -0,0 +1,46 @@ +import { InternalStatus } from "@annotation-service/core/enum/internal-status.enum"; + +export class ExtendedInternalStatus { + + private _extendedInternalStatustems: ExtendedInternalStatusItem[]; + get extendedInternalStatustems(): ExtendedInternalStatusItem[] { + return this._extendedInternalStatustems; + } + + public static parseValue(value: any): ExtendedInternalStatus { + const extendedInternalStatusObj: ExtendedInternalStatus = new ExtendedInternalStatus(); + + extendedInternalStatusObj._extendedInternalStatustems = []; + for (let item of value) { + const extendedInternalStatusItemObj: ExtendedInternalStatusItem = ExtendedInternalStatusItem.parseValue(item); + extendedInternalStatusObj._extendedInternalStatustems.push(extendedInternalStatusItemObj); + } + + return extendedInternalStatusObj; + } + + getIcon(status?: InternalStatus): string { + const extendedInternalStatus = this.extendedInternalStatustems?.find(s => s.InternalStatus == status); + + return extendedInternalStatus?.icon == null || extendedInternalStatus?.icon == '' ? 'animation' : extendedInternalStatus?.icon; + } +} + +export class ExtendedInternalStatusItem { + private _internalStatus: InternalStatus; + get InternalStatus(): InternalStatus { + return this._internalStatus; + } + + private _icon: string; + get icon(): string { + return this._icon; + } + + public static parseValue(value: any): ExtendedInternalStatusItem { + const obj: ExtendedInternalStatusItem = new ExtendedInternalStatusItem(); + obj._internalStatus = value.internalStatus; + obj._icon = value.icon; + return obj; + } +} diff --git a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts index d1dc26236..19a0e8689 100644 --- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts +++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts @@ -13,6 +13,7 @@ import { AuthProviders } from '@app/core/model/configuration-models/auth-provide import { AnalyticsProviders } from '@app/core/model/configuration-models/analytics-providers.model'; import { CssColorsTenantConfiguration } from '@app/core/model/tenant-configuaration/tenant-configuration'; import { Sidebar } from '@app/core/model/configuration-models/sidebar.model'; +import { ExtendedInternalStatus } from '@app/core/model/configuration-models/extended-internal-status.model'; @Injectable({ providedIn: 'root', @@ -121,6 +122,11 @@ export class ConfigurationService extends BaseComponent { get notificationServiceEnabled(): boolean { return this._notificationServiceEnabled; } + + private _extendedInternalStatus: ExtendedInternalStatus; + get extendedInternalStatus(): ExtendedInternalStatus { + return this._extendedInternalStatus; + } private _annotationServiceAddress: string; get annotationServiceAddress(): string { @@ -263,6 +269,7 @@ export class ConfigurationService extends BaseComponent { if (config.annotation_service) { this._annotationServiceEnabled = config.annotation_service.enabled; this._annotationServiceAddress = config.annotation_service.address; + this._extendedInternalStatus = ExtendedInternalStatus.parseValue(config.annotation_service.extendedInternalStatus); } this._inAppNotificationsCountInterval = config.inAppNotificationsCountInterval; this._newReleaseNotificationExpires = config.newReleaseNotification?.expires; diff --git a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html index f81bd6022..7a69df663 100644 --- a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html +++ b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html @@ -81,7 +81,7 @@