Remove checkbox. Always validate current step.
This commit is contained in:
parent
5d8efe40eb
commit
40ef719f2f
|
@ -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>
|
||||||
|
|
|
@ -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
|
|
||||||
if (onlyCurrentStep) {
|
|
||||||
validationFields = fields.filter(f => get(f).step === get(currentStep))
|
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 => {
|
||||||
|
|
|
@ -180,7 +180,6 @@ const validateFormHandler = async (action, context) => {
|
||||||
context,
|
context,
|
||||||
action.parameters.componentId,
|
action.parameters.componentId,
|
||||||
ActionTypes.ValidateForm,
|
ActionTypes.ValidateForm,
|
||||||
action.parameters.onlyCurrentStep
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue