D4310 new input section (#427)
* wip: validation condition input * form custom validation condition * Default message on form condition validation * field validation condition test * fix linting * update tests, add pass test * Polish UI * Re-order validation + fix logic issue * Move custom validation after default validation --------- Co-authored-by: Frank <csskfaves@gmail.com>
This commit is contained in:
@@ -87,11 +87,6 @@ class AnswerFormRequest extends FormRequest
|
||||
$rules[] = 'nullable';
|
||||
}
|
||||
|
||||
// User custom validation
|
||||
if(!(Str::of($property['type'])->startsWith('nf-')) && isset($property['validation'])) {
|
||||
$rules[] = (new CustomFieldValidationRule($property['validation'], $data));
|
||||
}
|
||||
|
||||
// Clean id to escape "."
|
||||
$propertyId = $property['id'];
|
||||
if (in_array($property['type'], ['multi_select'])) {
|
||||
@@ -101,6 +96,11 @@ class AnswerFormRequest extends FormRequest
|
||||
$rules = array_merge($rules, $this->getPropertyRules($property));
|
||||
}
|
||||
|
||||
// User custom validation
|
||||
if(!(Str::of($property['type'])->startsWith('nf-')) && isset($property['validation'])) {
|
||||
$rules[] = (new CustomFieldValidationRule($property['validation'], $data));
|
||||
}
|
||||
|
||||
$this->requestRules[$propertyId] = $rules;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user