mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
64503: Metadata Format resetting to initial state fix
This commit is contained in:
@@ -284,9 +284,12 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
this.updateSub = this.update$.subscribe((update: FieldUpdate) => {
|
this.updateSub = this.update$.subscribe((update: FieldUpdate) => {
|
||||||
if (update) {
|
if (update) {
|
||||||
const field = update.field as ContentSource;
|
const field = update.field as ContentSource;
|
||||||
let defaultConfigId;
|
let configId;
|
||||||
if (hasValue(this.contentSource) && isNotEmpty(this.contentSource.metadataConfigs)) {
|
if (hasValue(this.contentSource) && isNotEmpty(this.contentSource.metadataConfigs)) {
|
||||||
defaultConfigId = this.contentSource.metadataConfigs[0].id;
|
configId = this.contentSource.metadataConfigs[0].id;
|
||||||
|
}
|
||||||
|
if (hasValue(field) && hasValue(field.metadataConfigId)) {
|
||||||
|
configId = field.metadataConfigId;
|
||||||
}
|
}
|
||||||
if (hasValue(field)) {
|
if (hasValue(field)) {
|
||||||
this.formGroup.patchValue({
|
this.formGroup.patchValue({
|
||||||
@@ -295,7 +298,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
},
|
},
|
||||||
oaiSetContainer: {
|
oaiSetContainer: {
|
||||||
oaiSetId: field.oaiSetId,
|
oaiSetId: field.oaiSetId,
|
||||||
metadataConfigId: field.metadataConfigId || defaultConfigId
|
metadataConfigId: configId
|
||||||
},
|
},
|
||||||
harvestTypeContainer: {
|
harvestTypeContainer: {
|
||||||
harvestType: field.harvestType
|
harvestType: field.harvestType
|
||||||
@@ -303,7 +306,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
});
|
});
|
||||||
this.contentSource = cloneDeep(field);
|
this.contentSource = cloneDeep(field);
|
||||||
}
|
}
|
||||||
this.contentSource.metadataConfigId = defaultConfigId;
|
this.contentSource.metadataConfigId = configId;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user