Skip to content

Commit

Permalink
Fix boundingbox in form check
Browse files Browse the repository at this point in the history
  • Loading branch information
hvangeffen committed Apr 25, 2024
1 parent 6202e76 commit 1ba4e0b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/workflows/WorkflowsControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,15 @@ watch(
)
// Check whether the bounding box is defined in the form.
const isBoundingBoxInForm = computed(
() =>
(formSchema.value?.properties?.xMin &&
formSchema.value?.properties?.yMin &&
formSchema.value?.properties?.xMax &&
formSchema.value?.properties?.yMax),
)
const isBoundingBoxInForm = computed(() => {
const properties = Object.keys(data.value)
return (
properties.includes('xMin') &&
properties.includes('yMin') &&
properties.includes('xMax') &&
properties.includes('yMax')
)
})
const workflowSelectItems = computed(() => {
return props.secondaryWorkflows?.map((workflow) => {
Expand Down Expand Up @@ -207,6 +209,8 @@ watch(data, () => {
// Update the form when the bounding box is changed (e.g. through clicking).
watch(boundingBox, () => {
if (!isBoundingBoxInForm.value) return
if (boundingBox.value === null) {
data.value.xMin = undefined
data.value.yMin = undefined
Expand Down

0 comments on commit 1ba4e0b

Please sign in to comment.