add logical 'or' to field conditions

This commit is contained in:
Alex Turchyn
2024-11-27 21:47:53 +02:00
committed by Pete Matsyburka
parent 36c64d1de4
commit 75683631f0
7 changed files with 293 additions and 58 deletions
@@ -29,15 +29,26 @@
>{{ t('available_in_pro') }}</a>
</div>
<form @submit.prevent="validateSaveAndClose">
<div class="my-4 space-y-5">
<div class="my-4">
<div
v-for="(condition, cindex) in conditions"
:key="cindex"
class="space-y-4 relative"
>
<div
v-if="cindex > 0"
class="divider -mb-2 mx-1"
>
<button
class="btn btn-xs btn-primary w-24"
@click.prevent="condition.operation === 'or' ? delete condition.operation : condition.operation = 'or'"
>
{{ condition.operation === 'or' ? t('or') : t('and') }}
</button>
</div>
<div
v-if="conditions.length > 1"
class="flex justify-between border-b mx-1 -mb-1 pb-1"
class="flex justify-between mx-1"
>
<span class="text-sm">
{{ t('condition') }} {{ cindex + 1 }}