Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dispatch/static/dispatch/src/case/DetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
show-copy
:showGenAISuggestions="true"
modelType="case"
:validate-required-tags="true"
/>
</v-col>
<v-col cols="12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
label="Tags"
model="case"
:project="project"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
label="Tags"
model="case"
:project="local_project"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
label="Tags"
model="case"
:project="filters.project"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
label="Tags"
model="incident"
:project="filters.project"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:project="project"
model="query"
:model-id="id"
:validate-required-tags="true"
/>
</v-col>
</v-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
label="Tags"
model="query"
:project="local_project"
:validate-exclusive-tags="false"
/>
</v-list-item>
</v-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
model="source"
:project="project"
:model-id="id"
:validate-required-tags="true"
/>
</v-col>
<v-col cols="12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
label="Tags"
model="source"
:project="local_project"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
1 change: 1 addition & 0 deletions src/dispatch/static/dispatch/src/incident/DetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
show-copy
:showGenAISuggestions="true"
modelType="incident"
:validate-required-tags="true"
/>
</v-col>
<v-col cols="12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
v-model="tags"
label="Tags"
model="incident"
:validate-required-tags="true"
/>
</v-col>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
v-model="tags"
label="Tags"
model="incident"
:validate-required-tags="true"
/>
</v-col>
</v-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
label="Tags"
model="incident"
:project="project"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
label="Tags"
model="incident"
:project="local_project"
:validate-exclusive-tags="false"
/>
</v-list-item>
</v-card>
Expand All @@ -60,6 +61,7 @@
label="Tags"
model="incident"
:project="local_project"
:validate-exclusive-tags="false"
/>
</v-list-item>
</v-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
:project="project"
v-model="policy.tags"
model="incident"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
v-model="filters.tag"
label="Tags"
model="incident"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down Expand Up @@ -83,6 +84,7 @@
:project="project"
v-model="filters.tag"
label="Tags"
:validate-exclusive-tags="false"
/>
</v-list-item>
<v-list-item>
Expand Down
1 change: 1 addition & 0 deletions src/dispatch/static/dispatch/src/signal/NewEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
:model-id="id"
:project="project"
show-copy
:validate-required-tags="true"
/>
</v-col>
</v-row>
Expand Down
52 changes: 40 additions & 12 deletions src/dispatch/static/dispatch/src/tag/TagPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,18 @@
class="tag-type-icon"
/>
<strong v-text="group.label" />
<span v-show="group.isRequired" class="tag-group-rule">Required</span>
<span v-show="group.isExclusive" class="tag-group-rule">Exclusive</span>
<span
v-show="group.isRequired && props.validateRequiredTags"
class="tag-group-rule"
>
Required
</span>
<span
v-show="group.isExclusive && props.validateExclusiveTags"
class="tag-group-rule"
>
Exclusive
</span>
<span class="tag-group-icon-down"><v-icon>mdi-chevron-down</v-icon></span>
<v-icon class="tag-group-icon-up">mdi-chevron-up</v-icon>
</span>
Expand All @@ -229,6 +239,7 @@
class="tag-group-rule-desc"
v-show="
group.isExclusive &&
props.validateExclusiveTags &&
selectedItems.some((item) => item.tag_type.id === group.id)
"
>
Expand All @@ -246,7 +257,11 @@
v-model="selectedItems"
:id="item.id"
:value="item"
:disabled="group.isExclusive && isItemDisabled(group, item)"
:disabled="
group.isExclusive &&
props.validateExclusiveTags &&
isItemDisabled(group, item)
"
class="checkbox-item-box"
/>
{{ item.name }}
Expand Down Expand Up @@ -316,6 +331,14 @@ const props = defineProps({
type: String,
default: "incident", // "incident" or "case"
},
validateRequiredTags: {
type: Boolean,
default: false,
},
validateExclusiveTags: {
type: Boolean,
default: true,
},
})

// Computed properties from store
Expand Down Expand Up @@ -384,15 +407,20 @@ function validateTags(value) {
})

if (all_tags_in_projects) {
const requiredSelected = are_required_tags_selected(value)

if (!requiredSelected) {
const required_tag_types = Object.values(groups.value)
.filter((tag_type) => tag_type.isRequired)
.map((tag_type) => tag_type.label)
error.value = `Please select at least one tag from each required category (${required_tag_types.join(
", "
)})`
// Only validate required tags if validateRequiredTags prop is true
if (props.validateRequiredTags) {
const requiredSelected = are_required_tags_selected(value)

if (!requiredSelected) {
const required_tag_types = Object.values(groups.value)
.filter((tag_type) => tag_type.isRequired)
.map((tag_type) => tag_type.label)
error.value = `Please select at least one tag from each required category (${required_tag_types.join(
", "
)})`
} else {
error.value = null
}
} else {
error.value = null
}
Expand Down
Loading