mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Ignore required field validation for booleans
This commit is contained in:
parent
dbfb1780f1
commit
ea4b435ea7
@ -12,7 +12,13 @@ function BaseInputController (strings) {
|
||||
|
||||
scope.state._touched = false;
|
||||
scope.state._required = scope.state.required || false;
|
||||
scope.state._isValid = scope.state._isValid || false;
|
||||
|
||||
if (scope.state.type === 'boolean') {
|
||||
scope.state._isValid = scope.state._isValid || true;
|
||||
} else {
|
||||
scope.state._isValid = scope.state._isValid || false;
|
||||
}
|
||||
|
||||
scope.state._disabled = scope.state._disabled || false;
|
||||
scope.state._activeModel = scope.state._activeModel || '_value';
|
||||
|
||||
@ -59,6 +65,10 @@ function BaseInputController (strings) {
|
||||
scope.state._touched = true;
|
||||
}
|
||||
|
||||
if (scope.state.type === 'boolean') {
|
||||
return { isValid, message };
|
||||
}
|
||||
|
||||
if (scope.state._required && (!scope.state._value || !scope.state._value[0]) &&
|
||||
!scope.state._displayValue) {
|
||||
isValid = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user