1
0
Fork 0
mirror of synced 2024-10-01 17:47:46 +13: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> <script>
import { Select, Label } from "@budibase/bbui" import { Select, Label, Checkbox } from "@budibase/bbui"
import { currentAsset, store } from "builderStore" import { currentAsset, store } from "builderStore"
import { getActionProviderComponents } from "builderStore/dataBinding" import { getActionProviderComponents } from "builderStore/dataBinding"
@ -20,6 +20,11 @@
getOptionLabel={x => x._instanceName} getOptionLabel={x => x._instanceName}
getOptionValue={x => x._id} getOptionValue={x => x._id}
/> />
<div />
<Checkbox
text="Validate only current step"
bind:value={parameters.onlyCurrentStep}
/>
</div> </div>
<style> <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}`] const fn = context[`${componentId}_${actionType}`]
if (fn) { if (fn) {
return await fn() return await fn(params)
} }
} }
@ -75,7 +80,8 @@ const validateFormHandler = async (action, context) => {
return await executeActionHandler( return await executeActionHandler(
context, context,
action.parameters.componentId, action.parameters.componentId,
ActionTypes.ValidateForm ActionTypes.ValidateForm,
action.parameters.onlyCurrentStep
) )
} }