diff --git a/src/views/admin/components/metadata-types/compound/Compound.vue b/src/views/admin/components/metadata-types/compound/Compound.vue
index 76dfa84fa..501019c40 100644
--- a/src/views/admin/components/metadata-types/compound/Compound.vue
+++ b/src/views/admin/components/metadata-types/compound/Compound.vue
@@ -70,6 +70,14 @@
{{ $i18n.get('label_remove_value') }}
+
- {{ $i18n.get('label_add_value') }} - - - + {{ $i18n.get('label_add_value') }} @@ -209,7 +214,6 @@ } currentChildItemMetadataGroups.push(existingChildItemMetadata) } - } } diff --git a/src/views/admin/js/store/modules/item/mutations.js b/src/views/admin/js/store/modules/item/mutations.js index e9e90425e..f65154031 100644 --- a/src/views/admin/js/store/modules/item/mutations.js +++ b/src/views/admin/js/store/modules/item/mutations.js @@ -94,9 +94,9 @@ export const setSingleMetadatum = (state, itemMetadatum) => { }); if (currentChildMetadataGroupIndex >= 0) { - let currrentChildMetadatumIndex = currentParentValues[currentChildMetadataGroupIndex].findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id); - if (currrentChildMetadatumIndex >= 0) - currentParentValues[currentChildMetadataGroupIndex].splice(currrentChildMetadatumIndex, 1, childMetadatumValue); + let currentChildMetadatumIndex = currentParentValues[currentChildMetadataGroupIndex].findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id); + if (currentChildMetadatumIndex >= 0) + currentParentValues[currentChildMetadataGroupIndex].splice(currentChildMetadatumIndex, 1, childMetadatumValue); else currentParentValues[currentChildMetadataGroupIndex].push(childMetadatumValue); } else { @@ -104,9 +104,10 @@ export const setSingleMetadatum = (state, itemMetadatum) => { } } else { - let currrentChildMetadatumIndex = currentParentValues.findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id); - if (currrentChildMetadatumIndex >= 0) - currentParentValues.splice(currrentChildMetadatumIndex, 1, childMetadatumValue); + let currentChildMetadatumIndex = currentParentValues.findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id); + + if (currentChildMetadatumIndex >= 0) + currentParentValues.splice(currentChildMetadatumIndex, 1, childMetadatumValue); else currentParentValues.push(childMetadatumValue); }