mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 13:27:40 -02:30
@@ -76,7 +76,9 @@ function AtFormController (eventService, strings) {
|
||||
return values;
|
||||
}
|
||||
|
||||
if (component.state._key && typeof component.state._value === 'object') {
|
||||
if (component.state._format === 'selectFromOptions') {
|
||||
values[component.state.id] = component.state._value[0];
|
||||
} else if (component.state._key && typeof component.state._value === 'object') {
|
||||
values[component.state.id] = component.state._value[component.state._key];
|
||||
} else if (component.state._group) {
|
||||
values[component.state._key] = values[component.state._key] || {};
|
||||
|
||||
@@ -14,7 +14,7 @@ function BaseInputController (strings) {
|
||||
scope.state._required = scope.state.required || false;
|
||||
scope.state._isValid = scope.state._isValid || false;
|
||||
scope.state._disabled = scope.state._disabled || false;
|
||||
scope.state._activeModel = '_value';
|
||||
scope.state._activeModel = scope.state._activeModel || '_value';
|
||||
|
||||
if (scope.state.ask_at_runtime) {
|
||||
scope.state._displayPromptOnLaunch = true;
|
||||
@@ -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) {
|
||||
|
||||
@@ -59,7 +59,9 @@ function AtInputSelectController (baseInputController, eventService) {
|
||||
};
|
||||
|
||||
vm.updateDisplayModel = () => {
|
||||
if (scope.state._format === 'array') {
|
||||
if (scope.state._format === 'selectFromOptions') {
|
||||
scope.displayModel = scope.state._value[1];
|
||||
} else if (scope.state._format === 'array') {
|
||||
scope.displayModel = scope.state._value;
|
||||
} else if (scope.state._format === 'objects') {
|
||||
scope.displayModel = scope.state._value[scope.state._display];
|
||||
|
||||
Reference in New Issue
Block a user