Field Logic Error Handling - frontend (#162)
* Field Logic Error Handling - frontend * Fix test case * fix expected_type for multi select * fix variable --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
17
resources/js/mixins/forms/fieldsLogic.js
vendored
Normal file
17
resources/js/mixins/forms/fieldsLogic.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import FormPropertyLogicRule from '../../forms/FormPropertyLogicRule.js'
|
||||
export default {
|
||||
methods: {
|
||||
validateFieldsLogic (properties) {
|
||||
properties.forEach((field) => {
|
||||
const isValid = (new FormPropertyLogicRule(field)).isValid()
|
||||
if(!isValid){
|
||||
field.logic = {
|
||||
conditions: null,
|
||||
actions: []
|
||||
}
|
||||
}
|
||||
})
|
||||
return properties
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user