mirror of
https://github.com/directus/directus.git
synced 2026-02-07 04:45:26 -05:00
Filter UI tweaks (#10951)
* Make AND/OR language consistent in Filter UI * tweaks * use em-dash as separator * prevent and/or group disappearing for UX
This commit is contained in:
@@ -58,9 +58,19 @@
|
||||
<v-icon name="drag_indicator" class="drag-handle" small />
|
||||
<div class="logic-type" :class="{ or: filterInfo[index].name === '_or' }">
|
||||
<span class="key" @click="toggleLogic(index)">
|
||||
{{ filterInfo[index].name === '_and' ? t('interfaces.filter.all') : t('interfaces.filter.any') }}
|
||||
{{
|
||||
filterInfo[index].name === '_and'
|
||||
? t('interfaces.filter.logic_type_and')
|
||||
: t('interfaces.filter.logic_type_or')
|
||||
}}
|
||||
</span>
|
||||
<span class="text">
|
||||
{{
|
||||
`— ${filterInfo[index].name === '_and' ? t('interfaces.filter.all') : t('interfaces.filter.any')} ${t(
|
||||
'interfaces.filter.of_the_following'
|
||||
)}`
|
||||
}}
|
||||
</span>
|
||||
<span class="text">{{ t('interfaces.filter.of_the_following') }}</span>
|
||||
</div>
|
||||
<span class="delete">
|
||||
<v-icon
|
||||
|
||||
@@ -111,16 +111,10 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
set(newVal) {
|
||||
switch (newVal.length) {
|
||||
case 0:
|
||||
emit('input', null);
|
||||
break;
|
||||
case 1:
|
||||
emit('input', newVal[0]);
|
||||
break;
|
||||
default:
|
||||
emit('input', { _and: newVal });
|
||||
break;
|
||||
if (newVal.length === 0) {
|
||||
emit('input', null);
|
||||
} else {
|
||||
emit('input', { _and: newVal });
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1254,6 +1254,8 @@ interfaces:
|
||||
add_filter: Add Filter
|
||||
add_group: And / Or group
|
||||
add_value: Add Value
|
||||
logic_type_and: AND
|
||||
logic_type_or: OR
|
||||
all: All
|
||||
any: Any
|
||||
and: and
|
||||
|
||||
Reference in New Issue
Block a user