mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Added a type to OtherInformation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user