diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index f45cf86f1c08..4bbb95877b30 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -8,7 +8,7 @@ jobs:
# Minimum code coverage per file
COVERAGE_SINGLE: 50
# Minimum total code coverage
- COVERAGE_TOTAL: 56
+ COVERAGE_TOTAL: 55
runs-on: ubuntu-latest
services:
postgres:
diff --git a/src/dispatch/static/dispatch/src/case/DetailsTab.vue b/src/dispatch/static/dispatch/src/case/DetailsTab.vue
index b216d2d19186..6873d90c9038 100644
--- a/src/dispatch/static/dispatch/src/case/DetailsTab.vue
+++ b/src/dispatch/static/dispatch/src/case/DetailsTab.vue
@@ -62,7 +62,7 @@
/>
-
+
diff --git a/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue b/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue
index ecbc78c6b2dd..47fb41115fe8 100644
--- a/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue
+++ b/src/dispatch/static/dispatch/src/case/priority/CasePrioritySelect.vue
@@ -140,22 +140,8 @@ export default {
},
watch: {
- project: {
- handler(newProject) {
- if (newProject?.id !== this.lastProjectId) {
- // Check if we're moving to a valid project (not null)
- if (this.lastProjectId) {
- this.lastProjectId = newProject.id
- this.resetSelection()
- this.fetchData()
- } else {
- // If new project is null/undefined, just update lastProjectId
- this.lastProjectId = null
- }
- }
- this.validatePriority()
- },
- deep: true,
+ project() {
+ this.fetchData()
},
},
diff --git a/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue b/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue
index ce9693799055..dcf695fa1f6d 100644
--- a/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue
+++ b/src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue
@@ -130,7 +130,7 @@ export default {
}
}
- filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions })
+ filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }, "CaseType")
CaseTypeApi.getAll(filterOptions)
.then((response) => {
@@ -169,22 +169,9 @@ export default {
},
watch: {
- project: {
- handler(newProject) {
- if (newProject?.id !== this.lastProjectId) {
- // Check if we're moving to a valid project (not null)
- if (this.lastProjectId) {
- this.lastProjectId = newProject.id
- this.resetSelection()
- this.fetchData()
- } else {
- // If new project is null/undefined, just update lastProjectId
- this.lastProjectId = null
- }
- }
- this.validateType()
- },
- deep: true,
+ project() {
+ this.validateType()
+ this.fetchData()
},
},
diff --git a/src/dispatch/static/dispatch/src/incident/DetailsTab.vue b/src/dispatch/static/dispatch/src/incident/DetailsTab.vue
index 945b18d96c0e..ac05614ad7e7 100644
--- a/src/dispatch/static/dispatch/src/incident/DetailsTab.vue
+++ b/src/dispatch/static/dispatch/src/incident/DetailsTab.vue
@@ -56,7 +56,7 @@
/>
-
+
diff --git a/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue b/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue
index 9feb7e5e4353..a14387ae925a 100644
--- a/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue
+++ b/src/dispatch/static/dispatch/src/incident/priority/IncidentPrioritySelect.vue
@@ -130,23 +130,9 @@ export default {
},
watch: {
- project: {
- handler(newProject) {
- if (newProject?.id !== this.lastProjectId) {
- // Check if we're moving to a valid project (not null)
- if (this.lastProjectId) {
- this.lastProjectId = newProject.id
- this.resetSelection()
- this.fetchData()
- } else {
- // If new project is null/undefined, just update lastProjectId
- this.lastProjectId = null
- }
- }
-
- this.validatePriority()
- },
- deep: true,
+ project() {
+ this.validatePriority()
+ this.fetchData()
},
status() {
this.validatePriority()
diff --git a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue
index 5040af7002bb..e51c9fa58a4a 100644
--- a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue
+++ b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue
@@ -7,7 +7,7 @@
:label="label"
return-object
:loading="loading"
- :rules="[validationRule]"
+ :rules="[is_type_in_project]"
>
@@ -61,46 +61,51 @@ export default {
numItems: 5,
total: 0,
lastProjectId: null,
+ error: null,
+ is_type_in_project: () => {
+ this.validateType()
+ return this.error
+ },
}
},
computed: {
selectedIncidentType: {
get() {
- return this.modelValue || null
+ if (!this.modelValue) return null
+ if (this.modelValue.id) {
+ return this.items.find((item) => item.id === this.modelValue.id) || null
+ }
+ // If we only have a name (e.g., from URL params), find by name
+ if (this.modelValue.name) {
+ return this.items.find((item) => item.name === this.modelValue.name) || null
+ }
+ return null
},
set(value) {
this.$emit("update:modelValue", value)
+ this.validateType()
},
},
- isTypeValid() {
- const project_id = this.project?.id || 0
- return this.selectedIncidentType?.project?.id == project_id
- },
- validationRule() {
- return this.isTypeValid || "Only types in selected project are allowed"
- },
},
watch: {
- project: {
- handler(newProject) {
- if (newProject?.id !== this.lastProjectId) {
- // Check if we're moving to a valid project (not null)
- if (this.lastProjectId) {
- this.lastProjectId = newProject.id
- this.resetSelection()
- this.fetchData()
- } else {
- // If new project is null/undefined, just update lastProjectId
- this.lastProjectId = null
- }
- }
- },
+ project() {
+ this.validateType()
+ this.fetchData()
},
},
methods: {
+ validateType() {
+ const project_id = this.project?.id || 0
+ const in_project = this.selectedIncidentType?.project?.id == project_id
+ if (in_project) {
+ this.error = true
+ } else {
+ this.error = "Only types in selected project are allowed"
+ }
+ },
clearSelection() {
this.selectedIncidentType = null
},
@@ -124,7 +129,10 @@ export default {
}
}
- filterOptions = SearchUtils.createParametersFromTableOptions(filterOptions)
+ filterOptions = SearchUtils.createParametersFromTableOptions(
+ { ...filterOptions },
+ "IncidentType"
+ )
IncidentTypeApi.getAll(filterOptions)
.then((response) => {