mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
fixing issue with select2 data collection
there was an error with not collecting select2 data if there were no source_regions chosen for the source selected.
This commit is contained in:
@@ -1253,12 +1253,14 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Create a string out of selected list of regions
|
// Create a string out of selected list of regions
|
||||||
regions = $('#source_source_regions').select2("data");
|
if(sources_scope.source_regions){
|
||||||
r = [];
|
regions = $('#source_source_regions').select2("data");
|
||||||
for (i = 0; i < regions.length; i++) {
|
r = [];
|
||||||
r.push(regions[i].id);
|
for (i = 0; i < regions.length; i++) {
|
||||||
|
r.push(regions[i].id);
|
||||||
|
}
|
||||||
|
data.source_regions = r.join();
|
||||||
}
|
}
|
||||||
data.source_regions = r.join();
|
|
||||||
|
|
||||||
if (sources_scope.source && (sources_scope.source.value === 'ec2')) {
|
if (sources_scope.source && (sources_scope.source.value === 'ec2')) {
|
||||||
data.instance_filters = sources_scope.instance_filters;
|
data.instance_filters = sources_scope.instance_filters;
|
||||||
@@ -1380,7 +1382,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
group_created = true;
|
group_created = true;
|
||||||
group_id = data.id;
|
group_id = data.id;
|
||||||
sources_scope.source_url = data.related.inventory_source;
|
sources_scope.source_url = data.related.inventory_source;
|
||||||
if (properties_scope.variables) {
|
if (properties_scope.variables && properties_scope.variables !== "---") {
|
||||||
modal_scope.$emit('updateVariables', json_data, data.related.variable_data);
|
modal_scope.$emit('updateVariables', json_data, data.related.variable_data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user