mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Show edit drawer as preview for disabled many to one (#13207)
Fixes #13201
This commit is contained in:
@@ -18,16 +18,16 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="!disabled" #append>
|
||||
<template #append>
|
||||
<template v-if="displayItem">
|
||||
<v-icon v-tooltip="t('edit')" name="open_in_new" class="edit" @click.stop="editModalActive = true" />
|
||||
<v-icon
|
||||
v-if="updateAllowed"
|
||||
v-tooltip="t('edit')"
|
||||
name="open_in_new"
|
||||
class="edit"
|
||||
@click.stop="editModalActive = true"
|
||||
v-if="!disabled"
|
||||
v-tooltip="t('deselect')"
|
||||
name="close"
|
||||
class="deselect"
|
||||
@click.stop="$emit('input', null)"
|
||||
/>
|
||||
<v-icon v-tooltip="t('deselect')" name="close" class="deselect" @click.stop="$emit('input', null)" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-icon
|
||||
@@ -43,13 +43,13 @@
|
||||
</v-input>
|
||||
|
||||
<drawer-item
|
||||
v-if="!disabled"
|
||||
v-model:active="editModalActive"
|
||||
:collection="relationInfo.relatedCollection.collection"
|
||||
:primary-key="currentPrimaryKey"
|
||||
:edits="edits"
|
||||
:circular-field="relationInfo.relation.meta?.one_field ?? undefined"
|
||||
@input="update"
|
||||
:disabled="!updateAllowed || disabled"
|
||||
@input="onDrawerItemInput"
|
||||
/>
|
||||
|
||||
<drawer-collection
|
||||
@@ -175,6 +175,11 @@ function onPreviewClick() {
|
||||
selectModalActive.value = true;
|
||||
}
|
||||
|
||||
function onDrawerItemInput(event: any) {
|
||||
if (props.disabled) return;
|
||||
update(event);
|
||||
}
|
||||
|
||||
const selection = computed<(number | string)[]>(() => {
|
||||
const pkField = relationInfo.value?.relatedPrimaryKeyField.field;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user