diff --git a/src/views/admin/components/lists/collection-metadata-list.vue b/src/views/admin/components/lists/collection-metadata-list.vue index 076e7c2b9..f3b32337e 100644 --- a/src/views/admin/components/lists/collection-metadata-list.vue +++ b/src/views/admin/components/lists/collection-metadata-list.vue @@ -223,7 +223,7 @@ term.value) else currentValues = this.values; - + if (Array.isArray(currentValues)) { for (let value of currentValues) { let foundIndex = this.itemMetadatum.value.findIndex(element => value == element.id); @@ -338,7 +339,6 @@ return; } } - // If none is the case, the value is update request is sent to the API this.$emit('input', { itemId: this.itemMetadatum.item.id, diff --git a/src/views/admin/js/item-metadata-mixin.js b/src/views/admin/js/item-metadata-mixin.js index b283d6830..d79ef6ec8 100644 --- a/src/views/admin/js/item-metadata-mixin.js +++ b/src/views/admin/js/item-metadata-mixin.js @@ -3,9 +3,11 @@ import { mapActions } from 'vuex'; export const itemMetadataMixin = { created() { this.$emitter.on('removeCompoundGroup', this.removeItemMetadataGroup); + this.$emitter.on('updateValueFromCompound', this.updateItemMetadataValue); }, beforeDestroy() { this.$emitter.off('removeCompoundGroup', this.removeItemMetadataGroup); + this.$emitter.off('updateValueFromCompound', this.updateItemMetadataValue); }, data () { return { @@ -33,11 +35,11 @@ export const itemMetadataMixin = { 'deleteItemMetadataGroup', 'deleteGroupFromItemSubmissionMetadatum' ]), - updateItemMetadataValue({ itemId, metadatumId, values, parentMetaId, parentId }){ + updateItemMetadataValue({ itemId, metadatumId, values, parentMetaId, parentId }) { if (itemId) { - this.isUpdatingValues = true;; + this.isUpdatingValues = true; if (values.length > 0 && values[0] && values[0].value) { let onlyValues = values.map((aValueObject) => aValueObject.value); @@ -94,7 +96,7 @@ export const itemMetadataMixin = { // In the item submission, we don't want to block submission or clear errors before a re-submission is performed, // as the validation depends on a single server-side request. Thus, we do not update error arary here. - this.isUpdatingValues = false;; + this.isUpdatingValues = false; } /** @@ -115,7 +117,7 @@ export const itemMetadataMixin = { }, removeItemMetadataGroup({ itemId, metadatumId, parentMetaId, parentMetadatum }) { - this.isUpdatingValues = true;; + this.isUpdatingValues = true; if (itemId && metadatumId && parentMetaId) { diff --git a/src/views/admin/scss/_tainacan-form.scss b/src/views/admin/scss/_tainacan-form.scss index e53115ad8..37c646724 100644 --- a/src/views/admin/scss/_tainacan-form.scss +++ b/src/views/admin/scss/_tainacan-form.scss @@ -49,7 +49,7 @@ background-color: var(--tainacan-red1); } } - a[disabled] { + a[disabled="true"] { opacity: 0.5; user-select: none; pointer-events: none;