mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
make selects work with ng required
This commit is contained in:
parent
3bcc48402c
commit
f99792e604
@ -49,7 +49,8 @@ function BaseInputController (strings) {
|
||||
scope.state._touched = true;
|
||||
}
|
||||
|
||||
if (scope.state._required && !scope.state._value && !scope.state._displayValue) {
|
||||
if (scope.state._required && (!scope.state._value || !scope.state._value[0]) &&
|
||||
!scope.state._displayValue) {
|
||||
isValid = false;
|
||||
message = vm.strings.get('message.REQUIRED_INPUT_MISSING');
|
||||
} else if (scope.state._validate) {
|
||||
|
||||
@ -2,7 +2,7 @@ let Base;
|
||||
|
||||
function createFormSchema (method, config) {
|
||||
function mungeSelectFromOptions (configObj, value) {
|
||||
configObj.choices = [['', '']].concat(configObj.choices);
|
||||
configObj.choices = [[null, '']].concat(configObj.choices);
|
||||
configObj._data = configObj.choices;
|
||||
configObj._exp = 'choice[1] for choice in state._data';
|
||||
configObj._format = 'selectFromOptions';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user