From 3b791609cd1c8edb36ce0d94a577a4221565df79 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Wed, 13 Dec 2017 13:23:15 -0500 Subject: [PATCH] fix merge issue with inventory source service --- .../related/sources/sources.service.js | 45 +++++++------------ 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.service.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.service.js index 4064e52c65..cc8a9237aa 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.service.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.service.js @@ -120,35 +120,8 @@ export default source = source && source.value ? source.value : ''; if(source === 'ec2'){ return _.map(group_by, 'value').join(','); - } - if(source === 'vmware'){ - 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); - }); - group_by = (Array.isArray(group_by)) ? _.uniq(group_by).join() : ""; - return group_by; - } - else { - return; - } - }, - deleteHosts(id) { - this.url = GetBasePath('inventory_sources') + id + '/hosts/'; - Rest.setUrl(this.url); - return Rest.destroy() - .success(this.success.bind(this)) - .error(this.error.bind(this)) - .finally(); - }, - deleteGroups(id) { - this.url = GetBasePath('inventory_sources') + id + '/groups/'; - Rest.setUrl(this.url); - return Rest.destroy() - .success(this.success.bind(this)) - .error(this.error.bind(this)) - .finally(); } + if(source === 'vmware'){ group_by = _.map(group_by, (i) => {return i.value;}); $("#inventory_source_group_by").siblings(".select2").first().find(".select2-selection__choice").each(function(optionIndex, option){ @@ -160,6 +133,22 @@ export default else { return; } + }, + deleteHosts(id) { + this.url = GetBasePath('inventory_sources') + id + '/hosts/'; + Rest.setUrl(this.url); + return Rest.destroy() + .success(this.success.bind(this)) + .error(this.error.bind(this)) + .finally(); + }, + deleteGroups(id) { + this.url = GetBasePath('inventory_sources') + id + '/groups/'; + Rest.setUrl(this.url); + return Rest.destroy() + .success(this.success.bind(this)) + .error(this.error.bind(this)) + .finally(); } }; }];