mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fixed issue with form field losing confidence value
This commit is contained in:
@@ -60,23 +60,31 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom
|
|||||||
initValue$ = initEntry$.pipe(map((initEntry: VocabularyEntry) => {
|
initValue$ = initEntry$.pipe(map((initEntry: VocabularyEntry) => {
|
||||||
if (isNotEmpty(initEntry)) {
|
if (isNotEmpty(initEntry)) {
|
||||||
// Integrate FormFieldMetadataValueObject with retrieved information
|
// Integrate FormFieldMetadataValueObject with retrieved information
|
||||||
return Object.assign(new FormFieldMetadataValueObject(), this.model.value, {
|
return new FormFieldMetadataValueObject(
|
||||||
value: initEntry.value,
|
initEntry.value,
|
||||||
authority: initEntry.authority,
|
null,
|
||||||
display: initEntry.display,
|
initEntry.authority,
|
||||||
otherInformation: initEntry.otherInformation || null
|
initEntry.display,
|
||||||
});
|
null,
|
||||||
|
null,
|
||||||
|
initEntry.otherInformation || null
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return this.model.value as any;
|
return this.model.value as any;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
} else if (isNotEmpty(this.model.value) && (this.model.value instanceof VocabularyEntry)) {
|
} else if (isNotEmpty(this.model.value) && (this.model.value instanceof VocabularyEntry)) {
|
||||||
initValue$ = observableOf(Object.assign(new FormFieldMetadataValueObject(), this.model.value, {
|
initValue$ = observableOf(
|
||||||
value: this.model.value.value,
|
new FormFieldMetadataValueObject(
|
||||||
authority: this.model.value.authority,
|
this.model.value.value,
|
||||||
display: this.model.value.display,
|
null,
|
||||||
otherInformation: this.model.value.otherInformation || null
|
this.model.value.authority,
|
||||||
}));
|
this.model.value.display,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.model.value.otherInformation || null
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
initValue$ = observableOf(new FormFieldMetadataValueObject(this.model.value));
|
initValue$ = observableOf(new FormFieldMetadataValueObject(this.model.value));
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ export class FormFieldMetadataValueObject implements MetadataValueInterface {
|
|||||||
this.display = display || value;
|
this.display = display || value;
|
||||||
|
|
||||||
this.confidence = confidence;
|
this.confidence = confidence;
|
||||||
if (authority != null && isEmpty(confidence)) {
|
if (authority != null && (isEmpty(confidence) || confidence === -1)) {
|
||||||
this.confidence = ConfidenceType.CF_ACCEPTED;
|
this.confidence = ConfidenceType.CF_ACCEPTED;
|
||||||
} else if (isNotEmpty(confidence)) {
|
} else if (isNotEmpty(confidence)) {
|
||||||
this.confidence = confidence;
|
this.confidence = confidence;
|
||||||
|
Reference in New Issue
Block a user