updating vmware popover content

for instance_filters and group_by
This commit is contained in:
Jared Tabor 2017-07-10 11:18:28 -07:00
parent f8e5e800f8
commit 9bbd1be560
3 changed files with 15 additions and 7 deletions

View File

@ -178,7 +178,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
}
function initGroupBySelect(){
var add_new = false;
let add_new = false;
if($scope && $scope.source && $scope.source === 'ec2' || $scope && $scope.source && $scope.source.value && $scope.source.value === 'ec2'){
$scope.group_by_choices = $scope.ec2_group_by;
$scope.groupByPopOver = "<p>Select which groups to create automatically. " +
@ -209,8 +209,12 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
add_new = true;
$scope.group_by_choices = [];
$scope.group_by = $scope.group_by_choices;
$scope.groupByPopOver = "<p> ToDo: VMWare group by documentation here</p>";
$scope.instanceFilterPopOver = "<p> ToDo: VMWare instance groups popover content</p>";
$scope.groupByPopOver = `Specify which groups to create automatically.
Group names will be created similar to the options selected.
If blank, all groups above are created. Refer to Ansible Tower documentation for more detail.`;
$scope.instanceFilterPopOver = `Provide a comma-separated list of filter expressions.
Hosts are imported when <em>ANY</em> of the filters match.
Refer to Ansible Tower documentation for more detail.`;
}
CreateSelect2({
element: '#inventory_source_group_by',

View File

@ -268,7 +268,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
}
function initGroupBySelect(){
var add_new = false;
let add_new = false;
if($scope && $scope.source && $scope.source === 'ec2' || $scope && $scope.source && $scope.source.value && $scope.source.value === 'ec2'){
$scope.group_by_choices = $scope.ec2_group_by;
let group_by = inventorySourceData.group_by.split(',');
@ -303,8 +303,12 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
$scope.group_by_choices = (inventorySourceData.group_by) ? inventorySourceData.group_by.split(',')
.map((i) => ({name: i, label: i, value: i})) : [];
$scope.group_by = $scope.group_by_choices;
$scope.groupByPopOver = "<p> ToDo: VMWare group by documentation here</p>";
$scope.instanceFilterPopOver = "<p> ToDo: VMWare instance groups popover content</p>";
$scope.groupByPopOver = `Specify which groups to create automatically.
Group names will be created similar to the options selected.
If blank, all groups above are created. Refer to Ansible Tower documentation for more detail.`;
$scope.instanceFilterPopOver = `Provide a comma-separated list of filter expressions.
Hosts are imported when <em>ANY</em> of the filters match.
Refer to Ansible Tower documentation for more detail.`;
}
CreateSelect2({
element: '#inventory_source_group_by',

View File

@ -122,7 +122,7 @@ export default
return _.map(group_by, 'value').join(',');
}
if(source === 'vmware'){
group_by = _.map(group_by, function(i){return i.value;});
group_by = _.map(group_by, (i) => {return i.value;});
$("#inventory_source_group_by").siblings(".select2").first().find(".select2-selection__choice").each(function(optionIndex, option){
group_by.push(option.title);
});