From 776fae3c35b3837f5111b9b73e0d6a9f25838a74 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 30 Jun 2017 18:13:50 -0400 Subject: [PATCH] Fixed credential kind lookup on inventory source --- .../related/sources/add/sources-add.controller.js | 4 ++-- .../related/sources/edit/sources-edit.controller.js | 11 ----------- .../sources/lookup/sources-lookup-credential.route.js | 1 + .../inventories/related/sources/sources.form.js | 2 -- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js index d51c64a105..b153d4bdad 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js @@ -99,10 +99,10 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition', } $scope.lookupCredential = function(){ + let kind = ($scope.source.value === "ec2") ? "aws" : $scope.source.value; $state.go('.credential', { credential_search: { - // TODO: get kind sorting for credential properly implemented - // kind: kind, + kind: kind, page_size: '5', page: '1' } diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js index 254f33d946..8fe3e05e08 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js @@ -274,17 +274,6 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', }); } - $scope.lookupCredential = function(){ - $state.go('.credential', { - credential_search: { - // TODO: get kind sorting for credential properly implemented - // kind: kind, - page_size: '5', - page: '1' - } - }); - }; - $scope.lookupProject = function(){ $state.go('.project', { project_search: { diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-credential.route.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-credential.route.js index d033432ac1..fa12eb8cc1 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-credential.route.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-credential.route.js @@ -5,6 +5,7 @@ export default { page_size:"5", order_by:"name", role_level:"use_role", + kind: null }, dynamic:true, squash:"" diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js index 1dda910277..8296bda460 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js @@ -123,8 +123,6 @@ return { ngOptions: 'source.label for source in source_region_choices track by source.value', multiSelect: true, ngShow: "source && (source.value == 'rax' || source.value == 'ec2' || source.value == 'gce' || source.value == 'azure' || source.value == 'azure_rm')", - - dataTitle: 'Source Regions', dataPlacement: 'right', awPopOver: "

Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, " +