Skip to content

Commit 439739a

Browse files
committed
Add support for MetadataValue class to AuthorityConfidenceStateDirective
1 parent c596c6e commit 439739a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/app/shared/form/directives/authority-confidence-state.directive.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { isNotEmpty, isNull } from '../../empty.util';
2828
import { ConfidenceIconConfig } from '../../../../config/submission-config.interface';
2929
import { environment } from '../../../../environments/environment';
3030
import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
31+
import { MetadataValue } from '../../../core/shared/metadata.models';
3132

3233
/**
3334
* 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
4041
/**
4142
* The metadata value
4243
*/
43-
@Input() authorityValue: VocabularyEntry | FormFieldMetadataValueObject | string;
44+
@Input() authorityValue: VocabularyEntry | FormFieldMetadataValueObject | MetadataValue | string;
4445

4546
/**
4647
* A boolean representing if to show html icon if authority value is empty
@@ -131,6 +132,10 @@ export class AuthorityConfidenceStateDirective implements OnChanges, AfterViewIn
131132
confidence = value.confidence;
132133
}
133134

135+
if (isNotEmpty(value) && value instanceof MetadataValue) {
136+
confidence = value.confidence;
137+
}
138+
134139
return confidence;
135140
}
136141

0 commit comments

Comments
 (0)