mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Ignore required field validation for booleans
This commit is contained in:
@@ -12,7 +12,13 @@ function BaseInputController (strings) {
|
|||||||
|
|
||||||
scope.state._touched = false;
|
scope.state._touched = false;
|
||||||
scope.state._required = scope.state.required || 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._disabled = scope.state._disabled || false;
|
||||||
scope.state._activeModel = scope.state._activeModel || '_value';
|
scope.state._activeModel = scope.state._activeModel || '_value';
|
||||||
|
|
||||||
@@ -59,6 +65,10 @@ function BaseInputController (strings) {
|
|||||||
scope.state._touched = true;
|
scope.state._touched = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scope.state.type === 'boolean') {
|
||||||
|
return { isValid, message };
|
||||||
|
}
|
||||||
|
|
||||||
if (scope.state._required && (!scope.state._value || !scope.state._value[0]) &&
|
if (scope.state._required && (!scope.state._value || !scope.state._value[0]) &&
|
||||||
!scope.state._displayValue) {
|
!scope.state._displayValue) {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user