Fixes bug where more than one child metadata child of the same type could not be inserted in compound.
This commit is contained in:
parent
2d71ceee9e
commit
ff8058bfc9
|
@ -11,7 +11,7 @@
|
|||
</h3>
|
||||
<sortable
|
||||
:list="availableMetadataTypes"
|
||||
item-key="id"
|
||||
item-key="component"
|
||||
:options="{
|
||||
group: {
|
||||
name: 'metadata',
|
||||
|
@ -25,7 +25,7 @@
|
|||
}">
|
||||
<template #item="{ element: metadatum }">
|
||||
<div
|
||||
:id="metadatum.component"
|
||||
:data-metadatum-type="metadatum.component"
|
||||
class="available-metadatum-item"
|
||||
:class="{ 'highlighted-metadatum' : highlightedMetadatum == metadatum.name, 'inherited-metadatum': metadatum.inherited || isRepositoryLevel }"
|
||||
@click.prevent="addMetadatumViaButton(metadatum)">
|
||||
|
|
|
@ -452,13 +452,13 @@
|
|||
this.updateMetadataOrder();
|
||||
},
|
||||
isAvailableChildMetadata(to, from, item) {
|
||||
if (!item || !item.id)
|
||||
if (!item || !item.dataset || !item.dataset.metadatumType)
|
||||
return false;
|
||||
|
||||
if (from.el && from.el.className === 'active-metadata-area')
|
||||
return false;
|
||||
|
||||
return !['tainacan-compound', 'tainacan-taxonomy'].includes(item.id);
|
||||
|
||||
return !['tainacan-compound', 'tainacan-taxonomy'].includes(item.dataset.metadatumType);
|
||||
},
|
||||
isCollapseOpen(metadatumId) {
|
||||
return this.collapses[metadatumId] == true;
|
||||
|
|
Loading…
Reference in New Issue