mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Add support for MetadataValue class to AuthorityConfidenceStateDirective
This commit is contained in:
@@ -28,6 +28,7 @@ import { isNotEmpty, isNull } from '../../empty.util';
|
|||||||
import { ConfidenceIconConfig } from '../../../../config/submission-config.interface';
|
import { ConfidenceIconConfig } from '../../../../config/submission-config.interface';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||||
|
import { MetadataValue } from '../../../core/shared/metadata.models';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directive to add to the element a bootstrap utility class based on metadata confidence value
|
* Directive to add to the element a bootstrap utility class based on metadata confidence value
|
||||||
@@ -40,7 +41,7 @@ export class AuthorityConfidenceStateDirective implements OnChanges, AfterViewIn
|
|||||||
/**
|
/**
|
||||||
* The metadata value
|
* The metadata value
|
||||||
*/
|
*/
|
||||||
@Input() authorityValue: VocabularyEntry | FormFieldMetadataValueObject | string;
|
@Input() authorityValue: VocabularyEntry | FormFieldMetadataValueObject | MetadataValue | string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean representing if to show html icon if authority value is empty
|
* A boolean representing if to show html icon if authority value is empty
|
||||||
@@ -131,6 +132,10 @@ export class AuthorityConfidenceStateDirective implements OnChanges, AfterViewIn
|
|||||||
confidence = value.confidence;
|
confidence = value.confidence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNotEmpty(value) && value instanceof MetadataValue) {
|
||||||
|
confidence = value.confidence;
|
||||||
|
}
|
||||||
|
|
||||||
return confidence;
|
return confidence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user