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
5 changes: 4 additions & 1 deletion src/dispatch/static/dispatch/src/components/AppToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default {
name: "AppToolbar",
data: () => ({
organizations: [],
query: "",
}),
components: {
OrganizationCreateEditDialog,
Expand All @@ -171,6 +172,7 @@ export default {
queryString: {
set(query) {
this.$store.dispatch("search/setQuery", query)
this.query = query
},
get() {
return this.$store.state.query.q
Expand All @@ -185,8 +187,9 @@ export default {
Util.toggleFullScreen()
},
performSearch() {
let query = this.query
this.$store.dispatch("search/getResults", this.$store.state.query)
this.$router.push({ name: "GlobalSearch" })
this.$router.push({ name: "ResultList", query: { q: query } })
},
toggleDarkTheme() {
this.$vuetify.theme.dark = !this.$vuetify.theme.dark
Expand Down
3 changes: 2 additions & 1 deletion src/dispatch/static/dispatch/src/router/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,10 @@ export const protectedRoute = [
children: [
{
path: "results",
name: "ResultList",
meta: { name: "Results" },
component: () => import("@/search/ResultList.vue"),
name: "ResultList",
props: true,
},
],
},
Expand Down
19 changes: 19 additions & 0 deletions src/dispatch/static/dispatch/src/search/ResultList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

<script>
import { mapState } from "vuex"
import { mapActions } from "vuex"
import IncidentSummaryTable from "@/incident/IncidentSummaryTable.vue"
import CaseSummaryTable from "@/case/CaseSummaryTable.vue"
import TaskSummaryTable from "@/task/TaskSummaryTable.vue"
Expand All @@ -76,9 +77,27 @@ export default {
data() {
return {}
},
created() {
this.fetchDetails()
},
watch: {
query: function (q) {
// update URL in browser and search for new query
this.$router.push({ name: "ResultList", query: { q: q } })
this.setQuery(q)
this.getResults()
},
},

computed: {
...mapState("search", ["results", "query", "loading"]),
},
methods: {
fetchDetails() {
this.setQuery(this.$route.query.q)
this.getResults()
},
...mapActions("search", ["setQuery", "getResults"]),
},
}
</script>