Skip to content

Commit

Permalink
Ensuring that the tag picker reloads on project selection (#4287)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Jan 25, 2024
1 parent 3efda94 commit 5297949
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 11 deletions.
8 changes: 7 additions & 1 deletion src/dispatch/static/dispatch/src/case/DetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@
</v-row>
</v-col>
<v-col cols="12">
<tag-filter-auto-complete label="Tags" v-model="tags" model="case" :model-id="id" />
<tag-filter-auto-complete
label="Tags"
v-model="tags"
model="case"
:model-id="id"
:project="project"
/>
</v-col>
<v-col cols="12">
<case-filter-combobox label="Related" v-model="related" :project="project" />
Expand Down
7 changes: 6 additions & 1 deletion src/dispatch/static/dispatch/src/case/TableExportDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
<project-combobox v-model="project" label="Projects" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="tag" label="Tags" model="case" />
<tag-filter-auto-complete
v-model="tag"
label="Tags"
model="case"
:project="project"
/>
</v-list-item>
<v-list-item>
<tag-type-filter-combobox v-model="tag_type" label="Tag Types" />
Expand Down
7 changes: 6 additions & 1 deletion src/dispatch/static/dispatch/src/case/TableFilterDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
<tag-type-filter-combobox v-model="local_tag_type" label="Tag Types" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="local_tag" label="Tags" model="case" />
<tag-filter-auto-complete
v-model="local_tag"
label="Tags"
model="case"
:project="local_project"
/>
</v-list-item>
</v-list>
<v-card-actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
<project-combobox v-model="filters.project" label="Projects" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="filters.tag" label="Tags" model="case" />
<tag-filter-auto-complete
v-model="filters.tag"
label="Tags"
model="case"
:project="filters.project"
/>
</v-list-item>
<v-list-item>
<case-type-combobox v-model="filters.case_type" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
<project-combobox v-model="filters.project" label="Projects" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="filters.tag" label="Tags" model="incident" />
<tag-filter-auto-complete
v-model="filters.tag"
label="Tags"
model="incident"
:project="filters.project"
/>
</v-list-item>
<v-list-item>
<incident-type-combobox v-model="filters.incident_type" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
<tag-type-filter-combobox v-model="local_tag_type" label="Tag Types" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="local_tag" label="Tags" model="query" />
<tag-filter-auto-complete
v-model="local_tag"
label="Tags"
model="query"
:project="local_project"
/>
</v-list-item>
</v-list>
<v-card-actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
<project-combobox v-model="local_project" label="Projects" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="local_tag" label="Tags" model="source" />
<tag-filter-auto-complete
v-model="local_tag"
label="Tags"
model="source"
:project="local_project"
/>
</v-list-item>
<v-list-item>
<tag-type-filter-combobox v-model="local_tag_type" label="Tag Types" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
<project-combobox v-model="project" label="Projects" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="tag" label="Tags" model="incident" />
<tag-filter-auto-complete
v-model="tag"
label="Tags"
model="incident"
:project="project"
/>
</v-list-item>
<v-list-item>
<tag-type-filter-combobox v-model="tag_type" label="Tag Types" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
<tag-type-filter-combobox v-model="local_tag_type" label="Tag Types" />
</v-list-item>
<v-list-item>
<tag-filter-auto-complete v-model="local_tag" label="Tags" model="incident" />
<tag-filter-auto-complete
v-model="local_tag"
label="Tags"
model="incident"
:project="local_project"
/>
</v-list-item>
<v-list-item>
<v-card class="mx-auto">
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 @@ -108,6 +108,7 @@
v-model="tags"
model="signal"
:model-id="id"
:project="project"
/>
</v-col>
</v-row>
Expand Down
17 changes: 15 additions & 2 deletions src/dispatch/static/dispatch/src/tag/TagPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</template>

<script setup>
import { ref, computed, onMounted } from "vue"
import { ref, computed, onMounted, watch } from "vue"
import { cloneDeep } from "lodash"
import SearchUtils from "@/search/utils"
import TagApi from "@/tag/api"
Expand Down Expand Up @@ -165,6 +165,13 @@ const props = defineProps({
},
})
watch(
() => props.project,
() => {
fetchData()
}
)
const fetchData = () => {
loading.value = true
Expand All @@ -178,7 +185,13 @@ const fetchData = () => {
let filters = {}
if (props.project) {
filters["project"] = [props.project]
if (Array.isArray(props.project)) {
if (props.project.length > 0) {
filters["project"] = props.project
}
} else {
filters["project"] = [props.project]
}
}
// add a filter to only retrun discoverable tags
Expand Down

0 comments on commit 5297949

Please sign in to comment.