Fix automation creation form (#2349)
Bug: You couldn't proceed from step 2 if the function didn't have any parameters.
This commit is contained in:
committed by
GitHub
parent
83d045a5b2
commit
c29b4f2aac
@@ -481,8 +481,8 @@ const onDialogSubmit = async (e: SubmitEvent) => {
|
||||
if (enumStep.value === AutomationCreateSteps.AutomationDetails) {
|
||||
await onDetailsSubmit(e)
|
||||
} else if (enumStep.value === AutomationCreateSteps.FunctionParameters) {
|
||||
const validationResult = await parametersStep.value?.submit()
|
||||
if (validationResult && !hasJsonFormErrors(validationResult)) {
|
||||
const validationResult = (await parametersStep.value?.submit()) || {}
|
||||
if (!hasJsonFormErrors(validationResult)) {
|
||||
step.value++
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { MaybeNullOrUndefined } from '@speckle/shared'
|
||||
import { formatJsonFormSchemaInputs } from '~/lib/automate/helpers/jsonSchema'
|
||||
|
||||
export const hasJsonFormErrors = (event: JsonFormsChangeEvent) =>
|
||||
(event.errors?.length || 0) > 0
|
||||
event?.errors?.length > 0
|
||||
|
||||
export const useJsonFormsChangeHandler = (params: {
|
||||
schema: MaybeRef<MaybeNullOrUndefined<JsonSchema>>
|
||||
|
||||
Reference in New Issue
Block a user