Don't allow singletons to be selected in m2a context

Closes #4406
This commit is contained in:
rijkvanzanten
2021-04-15 12:04:02 -04:00
parent f6a1043c6f
commit d43c88095e
2 changed files with 11 additions and 4 deletions

View File

@@ -62,6 +62,7 @@
:inputValue="value || []"
:label="item.text"
:value="item.value"
:disabled="item.disabled"
@change="$emit('input', $event.length > 0 ? $event : null)"
/>
</v-list-item-content>
@@ -121,6 +122,7 @@
import { defineComponent, PropType, computed, toRefs, Ref } from '@vue/composition-api';
import i18n from '@/lang';
import { useCustomSelection, useCustomSelectionMultiple } from '@/composables/use-custom-selection';
import { get } from 'lodash';
type ItemsRaw = (string | any)[];
type InputValue = string[] | string;
@@ -143,6 +145,10 @@ export default defineComponent({
type: String,
default: null,
},
itemDisabled: {
type: String,
default: 'disabled',
},
value: {
type: [Array, String, Number, Boolean] as PropType<InputValue>,
default: null,
@@ -218,10 +224,10 @@ export default defineComponent({
if (item.divider === true) return { divider: true };
return {
text: item[props.itemText],
value: item[props.itemValue],
icon: item[props.itemIcon],
disabled: item.disabled,
text: get(item, props.itemText),
value: get(item, props.itemValue),
icon: get(item, props.itemIcon),
disabled: get(item, props.itemDisabled),
};
});

View File

@@ -66,6 +66,7 @@
:items="availableCollections"
item-value="collection"
item-text="name"
item-disabled="meta.singleton"
multiple
v-model="relations[1].one_allowed_collections"
:multiple-preview-threshold="0"