relationships: make sort field null if empty (#9735)

This commit is contained in:
José Varela
2021-11-11 19:41:38 +00:00
committed by GitHub
parent 0835c3fc22
commit f0e9e4a60a
4 changed files with 14 additions and 3 deletions

View File

@@ -62,7 +62,12 @@
<div class="sort-field">
<v-divider large :inline-title="false">{{ t('sort_field') }}</v-divider>
<related-field-select v-model="sortField" :collection="junctionCollection" :placeholder="t('add_sort_field')" />
<related-field-select
v-model="sortField"
:collection="junctionCollection"
:placeholder="t('add_sort_field')"
:nullable="true"
/>
</div>
<div class="relational-triggers">

View File

@@ -72,6 +72,7 @@
v-model="sortField"
:collection="junctionCollection"
:placeholder="t('add_sort_field') + '...'"
:nullable="true"
/>
</div>

View File

@@ -25,6 +25,7 @@
v-model="sortField"
:collection="relatedCollection"
:placeholder="t('add_sort_field') + '...'"
:nullable="true"
/>
</div>

View File

@@ -2,11 +2,11 @@
<v-input
:model-value="modelValue"
db-safe
:nullable="false"
:nullable="nullable"
:disabled="disabled"
:placeholder="placeholder"
:class="{ matches: fieldExists }"
@update:model-value="$emit('update:modelValue', $event)"
@update:model-value="$emit('update:modelValue', $event.length ? $event : null)"
>
<template v-if="fields && fields.length > 0 && !disabled" #append>
<v-menu show-arrow placement="bottom-end">
@@ -65,6 +65,10 @@ export default defineComponent({
type: String,
default: () => i18n.global.t('foreign_key') + '...',
},
nullable: {
type: Boolean,
default: false,
},
},
emits: ['update:modelValue'],
setup(props) {