Skip to content

Commit

Permalink
Fixing selects when not yet loaded (#5380)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss authored Oct 23, 2024
1 parent 6651c01 commit 0997901
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,15 @@ export default {
project: {
handler(newProject) {
if (newProject?.id !== this.lastProjectId) {
this.lastProjectId = newProject?.id
this.resetSelection()
this.fetchData()
// 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()
},
Expand Down
12 changes: 9 additions & 3 deletions src/dispatch/static/dispatch/src/case/type/CaseTypeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,15 @@ export default {
project: {
handler(newProject) {
if (newProject?.id !== this.lastProjectId) {
this.lastProjectId = newProject?.id
this.resetSelection()
this.fetchData()
// 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()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,17 @@ export default {
project: {
handler(newProject) {
if (newProject?.id !== this.lastProjectId) {
this.lastProjectId = newProject?.id
this.resetSelection()
this.fetchData()
// 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,15 @@ export default {
project: {
handler(newProject) {
if (newProject?.id !== this.lastProjectId) {
this.lastProjectId = newProject?.id
this.clearSelection()
this.fetchData()
// 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
}
}
},
},
Expand Down

0 comments on commit 0997901

Please sign in to comment.