From edaf189c32def5ce10ee8d80f743db8df6195db3 Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Wed, 20 Nov 2024 17:33:40 -0800 Subject: [PATCH 1/4] fix(ui): fixes edit pane on case type --- .../static/dispatch/src/case/type/NewEditSheet.vue | 7 ++++++- .../dispatch/src/incident/type/IncidentTypeSelect.vue | 2 +- src/dispatch/static/dispatch/src/service/ServiceSelect.vue | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue index 6c30938c06e1..d4c64f568158 100644 --- a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue +++ b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue @@ -163,6 +163,8 @@ import PluginMetadataInput from "@/plugin/PluginMetadataInput.vue" import ServiceSelect from "@/service/ServiceSelect.vue" import ProjectSelect from "@/project/ProjectSelect.vue" import TemplateSelect from "@/document/template/TemplateSelect.vue" +import ProjectApi from "@/project/api" + export default { setup() { @@ -221,7 +223,10 @@ export default { created() { if (this.$route.query.project) { this.project = { name: this.$route.query.project } - this.incidentProject = this.project + ProjectApi.getAll({ q: this.$route.query.project }).then((response) => { + this.incidentProject = response.data.items[0] + this.project = response.data.items[0] + }) } }, } diff --git a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue index 0182b9d0d27c..48c44f4e41f9 100644 --- a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue +++ b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue @@ -124,7 +124,7 @@ export default { if (this.project) { filterOptions.filters = { - project: [this.project], + project_id: this.project_id, enabled: ["true"], } } diff --git a/src/dispatch/static/dispatch/src/service/ServiceSelect.vue b/src/dispatch/static/dispatch/src/service/ServiceSelect.vue index dd180aab9a29..820ac94c4efc 100644 --- a/src/dispatch/static/dispatch/src/service/ServiceSelect.vue +++ b/src/dispatch/static/dispatch/src/service/ServiceSelect.vue @@ -113,14 +113,14 @@ export default { } if (this.project) { - filterOptions.filters.project_id = this.project.map((p) => p.id) + filterOptions.filters.project_id = this.project.id } if (this.healthMetrics) { filterOptions.filters.health_metrics = ["true"] } - filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }) + filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }, "Service") ServiceApi.getAll(filterOptions).then((response) => { this.items = response.data.items From e1bcd6a1c0205752d5cb9f333b1c63f46b552607 Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Wed, 20 Nov 2024 17:45:40 -0800 Subject: [PATCH 2/4] removing extra line --- src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue index d4c64f568158..e3a957b75f1c 100644 --- a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue +++ b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue @@ -165,7 +165,6 @@ import ProjectSelect from "@/project/ProjectSelect.vue" import TemplateSelect from "@/document/template/TemplateSelect.vue" import ProjectApi from "@/project/api" - export default { setup() { return { From daec39a43322396f441b0707e61e6a683dde6a92 Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:29:17 -0800 Subject: [PATCH 3/4] Update src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue Co-authored-by: Offiong Aniekanabasi Signed-off-by: David Whittaker <84562015+whitdog47@users.noreply.github.com> --- src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue index e3a957b75f1c..b4c9fdeeb12e 100644 --- a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue +++ b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue @@ -221,7 +221,6 @@ export default { }, created() { if (this.$route.query.project) { - this.project = { name: this.$route.query.project } ProjectApi.getAll({ q: this.$route.query.project }).then((response) => { this.incidentProject = response.data.items[0] this.project = response.data.items[0] From 40d3e925929f454599ef77eeea31fd06e77c79b4 Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Tue, 3 Dec 2024 14:07:48 -0800 Subject: [PATCH 4/4] putting back project.name --- src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue index b4c9fdeeb12e..fb8ffe7ba56d 100644 --- a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue +++ b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue @@ -221,6 +221,8 @@ export default { }, created() { if (this.$route.query.project) { + // required for plugin metadata + this.project = { name: this.$route.query.project } ProjectApi.getAll({ q: this.$route.query.project }).then((response) => { this.incidentProject = response.data.items[0] this.project = response.data.items[0]