Skip to content

Commit 2dc751e

Browse files
committed
fixes incorrect v-model binding
1 parent 8bc0cce commit 2dc751e

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

frontend/src/features/admin/automation/RuleBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<!-- Select input -->
104104
<div v-if="inputType(index) === 'select'">
105105
<SelectComboBox
106-
v-model="componentField"
106+
v-model="rule.value"
107107
:items="getFieldOptions(rule.field, rule.field_type)"
108108
@select="handleValueChange($event, index)"
109109
:type="rule.field === 'assigned_user' ? 'user' : 'team'"

frontend/src/features/admin/macros/ActionBuilder.vue

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
<h3 class="text-sm font-medium text-foreground mb-2">
1212
{{ $t('globals.messages.no', { name: $t('globals.terms.action', 2).toLowerCase() }) }}
1313
</h3>
14-
<Button @click="add" variant="outline" size="sm" class="inline-flex items-center gap-2">
14+
<Button
15+
@click.prevent="add"
16+
variant="outline"
17+
size="sm"
18+
class="inline-flex items-center gap-2"
19+
>
1520
<Plus class="w-4 h-4" />
1621
{{ config.addButtonText }}
1722
</Button>
@@ -70,13 +75,20 @@
7075
/>
7176

7277
<SelectComboBox
73-
v-if="action.type === 'assign_team'"
78+
v-else-if="action.type === 'assign_team'"
7479
v-model="action.value[0]"
7580
:items="config.actions[action.type].options"
7681
:placeholder="config.valuePlaceholder"
7782
@update:modelValue="(value) => updateValue(value, index)"
7883
type="team"
7984
/>
85+
<SelectComboBox
86+
v-else
87+
v-model="action.value[0]"
88+
:items="config.actions[action.type].options"
89+
:placeholder="config.valuePlaceholder"
90+
@update:modelValue="(value) => updateValue(value, index)"
91+
/>
8092
</div>
8193
</div>
8294

@@ -85,7 +97,7 @@
8597
v-if="action.type && config.actions[action.type]?.type === 'tag'"
8698
class="max-w-md"
8799
>
88-
<label class="block text-sm font-medium mb-2">Tags</label>
100+
<label class="block text-sm font-medium mb-2">{{ $t('globals.terms.tag') }}</label>
89101
<SelectTag
90102
v-model="action.value"
91103
:items="tagsStore.tagNames.map((tag) => ({ label: tag, value: tag }))"
@@ -95,15 +107,7 @@
95107
</div>
96108

97109
<!-- Remove Button -->
98-
<Button
99-
variant="ghost"
100-
size="sm"
101-
@click="remove(index)"
102-
class="text-gray-400 dark:text-gray-500 hover:text-gray-600 hover:bg-gray-100 dark:hover:bg-gray-800 w-8 h-8 p-0"
103-
>
104-
<X class="w-4 h-4" />
105-
<span class="sr-only">Remove action</span>
106-
</Button>
110+
<CloseButton :onClose="() => remove(index)" />
107111
</div>
108112
</div>
109113
</div>
@@ -126,7 +130,7 @@
126130

127131
<script setup>
128132
import { Button } from '@/components/ui/button'
129-
import { X, Plus } from 'lucide-vue-next'
133+
import { Plus } from 'lucide-vue-next'
130134
import {
131135
Select,
132136
SelectContent,
@@ -135,6 +139,7 @@ import {
135139
SelectTrigger,
136140
SelectValue
137141
} from '@/components/ui/select'
142+
import CloseButton from '@/components/button/CloseButton.vue'
138143
import { SelectTag } from '@/components/ui/select'
139144
import { useTagStore } from '@/stores/tag'
140145
import SelectComboBox from '@/components/combobox/SelectCombobox.vue'

0 commit comments

Comments
 (0)