From 5467b233ebe019eeddabca885bd51bb334414a08 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 12 Aug 2016 16:28:57 -0400 Subject: [PATCH] fix credential kind options for list --- awx/ui/client/src/controllers/Credentials.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/controllers/Credentials.js b/awx/ui/client/src/controllers/Credentials.js index 49150e22c9..bc84930255 100644 --- a/awx/ui/client/src/controllers/Credentials.js +++ b/awx/ui/client/src/controllers/Credentials.js @@ -46,13 +46,13 @@ export function CredentialsList($scope, $rootScope, $location, $log, Wait('stop'); $('#prompt-modal').modal('hide'); - list.fields.kind.searchOptions = $scope.credential_kind_options; + list.fields.kind.searchOptions = $scope.credential_kind_options_list; // Translate the kind value for (i = 0; i < $scope.credentials.length; i++) { - for (j = 0; j < $scope.credential_kind_options.length; j++) { - if ($scope.credential_kind_options[j].value === $scope.credentials[i].kind) { - $scope.credentials[i].kind = $scope.credential_kind_options[j].label; + for (j = 0; j < $scope.credential_kind_options_list.length; j++) { + if ($scope.credential_kind_options_list[j].value === $scope.credentials[i].kind) { + $scope.credentials[i].kind = $scope.credential_kind_options_list[j].label; break; } } @@ -77,6 +77,15 @@ export function CredentialsList($scope, $rootScope, $location, $log, $scope.search(list.iterator); }); + // Load the list of options for Kind + GetChoices({ + scope: $scope, + url: defaultUrl, + field: 'kind', + variable: 'credential_kind_options_list', + callback: 'choicesReadyCredential' + }); + $scope.addCredential = function () { $state.transitionTo('credentials.add'); };