diff --git a/src/app/core/integration/models/authority.value.ts b/src/app/core/integration/models/authority.value.ts index 269407d2c5..3b5ddd68ab 100644 --- a/src/app/core/integration/models/authority.value.ts +++ b/src/app/core/integration/models/authority.value.ts @@ -1,41 +1,32 @@ import { IntegrationModel } from './integration.model'; -import { autoserialize } from 'cerialize'; import { isNotEmpty } from '../../../shared/empty.util'; import { PLACEHOLDER_PARENT_METADATA } from '../../../shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; +import { OtherInformation } from '../../../shared/form/builder/models/form-field-metadata-value.model'; export class AuthorityValue extends IntegrationModel { - @autoserialize id: string; - @autoserialize display: string; - @autoserialize value: string; - @autoserialize - otherInformation: any; + otherInformation: OtherInformation; - @autoserialize language: string; - @autoserialize hasAuthority(): boolean { return isNotEmpty(this.id); } - @autoserialize hasValue(): boolean { return isNotEmpty(this.value); } - @autoserialize hasOtherInformation(): boolean { return isNotEmpty(this.otherInformation); } - @autoserialize hasPlaceholder() { return this.hasValue() && this.value === PLACEHOLDER_PARENT_METADATA; } diff --git a/src/app/shared/form/builder/models/form-field-metadata-value.model.ts b/src/app/shared/form/builder/models/form-field-metadata-value.model.ts index 10b3667676..a98b2d7d52 100644 --- a/src/app/shared/form/builder/models/form-field-metadata-value.model.ts +++ b/src/app/shared/form/builder/models/form-field-metadata-value.model.ts @@ -2,6 +2,10 @@ import { isEmpty, isNotEmpty, isNotNull } from '../../../empty.util'; import { ConfidenceType } from '../../../../core/integration/models/confidence-type'; import { PLACEHOLDER_PARENT_METADATA } from '../ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; +export interface OtherInformation { + [name: string]: string +} + export class FormFieldMetadataValueObject { metadata?: string; value: any; @@ -12,7 +16,7 @@ export class FormFieldMetadataValueObject { place: number; closed: boolean; label: string; - otherInformation: any; + otherInformation: OtherInformation; constructor(value: any = null, language: any = null,