From bfcbd8a82346701e887ccec51b5cf2bbd005eb2f Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Tue, 28 Feb 2017 12:03:33 -0500 Subject: [PATCH] Leftover cleanup from 3.1 back to devel --- .../src/credentials/list/credentials-list.controller.js | 4 +--- awx/ui/client/src/home/home.controller.js | 4 ++-- .../client/src/projects/list/projects-list.controller.js | 8 ++------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/awx/ui/client/src/credentials/list/credentials-list.controller.js b/awx/ui/client/src/credentials/list/credentials-list.controller.js index 859e0ea998..6f420f2cd9 100644 --- a/awx/ui/client/src/credentials/list/credentials-list.controller.js +++ b/awx/ui/client/src/credentials/list/credentials-list.controller.js @@ -52,12 +52,10 @@ export default ['$scope', '$rootScope', '$location', '$log', // Set the item type label if (list.fields.kind && $scope.options && $scope.options.hasOwnProperty('kind')) { - $scope.options.kind.choices.every(function(choice) { + $scope.options.kind.choices.forEach(function(choice) { if (choice[0] === item.kind) { itm.kind_label = choice[1]; - return false; } - return true; }); } }); diff --git a/awx/ui/client/src/home/home.controller.js b/awx/ui/client/src/home/home.controller.js index b5bf73e5de..80d4da45f1 100644 --- a/awx/ui/client/src/home/home.controller.js +++ b/awx/ui/client/src/home/home.controller.js @@ -23,7 +23,7 @@ export default ['$scope', '$compile', '$stateParams', '$rootScope', '$location', ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard host graph data: ' + status }); }); - Rest.setUrl(GetBasePath("jobs") + "?order_by=-finished&page_size=5&finished__isnull=false"); + Rest.setUrl("api/v1/unified_jobs?order_by=-finished&page_size=5&finished__isnull=false&type=workflow_job,job"); Rest.get() .success(function (data) { $scope.dashboardJobsListData = data.results; @@ -99,7 +99,7 @@ export default ['$scope', '$compile', '$stateParams', '$rootScope', '$location', .error(function (data, status) { ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard: ' + status }); }); - Rest.setUrl(GetBasePath("jobs") + "?order_by=-finished&page_size=5&finished__isnull=false"); + Rest.setUrl("api/v1/unified_jobs?order_by=-finished&page_size=5&finished__isnull=false&type=workflow_job,job"); Rest.get() .success(function (data) { data = data.results; diff --git a/awx/ui/client/src/projects/list/projects-list.controller.js b/awx/ui/client/src/projects/list/projects-list.controller.js index 6ecb5eb7fa..09f53ad019 100644 --- a/awx/ui/client/src/projects/list/projects-list.controller.js +++ b/awx/ui/client/src/projects/list/projects-list.controller.js @@ -55,12 +55,10 @@ export default ['$scope', '$rootScope', '$location', '$log', '$stateParams', // Set the item type label if (list.fields.scm_type && $scope.options && $scope.options.hasOwnProperty('scm_type')) { - $scope.options.scm_type.choices.every(function(choice) { + $scope.options.scm_type.choices.forEach(function(choice) { if (choice[0] === item.scm_type) { itm.type_label = choice[1]; - return false; } - return true; }); } @@ -272,7 +270,7 @@ export default ['$scope', '$rootScope', '$location', '$log', '$stateParams', } catch (e) { // ignore } - $scope.projects.every(function(project) { + $scope.projects.forEach(function(project) { if (project.id === project_id) { if (project.scm_type === "Manual" || Empty(project.scm_type)) { // Do not respond. Button appears greyed out as if it is disabled. Not disabled though, because we need mouse over event @@ -283,9 +281,7 @@ export default ['$scope', '$rootScope', '$location', '$log', '$stateParams', } else { ProjectUpdate({ scope: $scope, project_id: project.id }); } - return false; } - return true; }); };