Remove checkbox. Always validate current step.

This commit is contained in:
Mel O'Hagan 2022-07-20 09:56:02 +01:00
parent 5d8efe40eb
commit 40ef719f2f
3 changed files with 3 additions and 11 deletions

View File

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

View File

@ -202,14 +202,11 @@
return fieldInfo return fieldInfo
}, },
validate: (onlyCurrentStep = false) => { validate: () => {
let valid = true let valid = true
let validationFields = fields let validationFields = fields
// Reduce fields to only the current step if required validationFields = fields.filter(f => get(f).step === get(currentStep))
if (onlyCurrentStep) {
validationFields = fields.filter(f => get(f).step === get(currentStep))
}
// Validate fields and check if any are invalid // Validate fields and check if any are invalid
validationFields.forEach(field => { validationFields.forEach(field => {

View File

@ -180,7 +180,6 @@ const validateFormHandler = async (action, context) => {
context, context,
action.parameters.componentId, action.parameters.componentId,
ActionTypes.ValidateForm, ActionTypes.ValidateForm,
action.parameters.onlyCurrentStep
) )
} }