1
0
Fork 0
mirror of synced 2024-07-01 04:21:06 +12:00

Update validate form action to be able to only validate the current form step

This commit is contained in:
Andrew Kingston 2021-08-19 12:52:50 +01:00
parent 9e24a76810
commit 3fa5b3b571
2 changed files with 15 additions and 4 deletions

View file

@ -1,5 +1,5 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { Select, Label, Checkbox } from "@budibase/bbui"
import { currentAsset, store } from "builderStore"
import { getActionProviderComponents } from "builderStore/dataBinding"
@ -20,6 +20,11 @@
getOptionLabel={x => x._instanceName}
getOptionValue={x => x._id}
/>
<div />
<Checkbox
text="Validate only current step"
bind:value={parameters.onlyCurrentStep}
/>
</div>
<style>

View file

@ -64,10 +64,15 @@ const queryExecutionHandler = async action => {
})
}
const executeActionHandler = async (context, componentId, actionType) => {
const executeActionHandler = async (
context,
componentId,
actionType,
params
) => {
const fn = context[`${componentId}_${actionType}`]
if (fn) {
return await fn()
return await fn(params)
}
}
@ -75,7 +80,8 @@ const validateFormHandler = async (action, context) => {
return await executeActionHandler(
context,
action.parameters.componentId,
ActionTypes.ValidateForm
ActionTypes.ValidateForm,
action.parameters.onlyCurrentStep
)
}