From 4d1b10f0d13c675da461acb5c2a08d57ac8dabf5 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Thu, 1 Dec 2016 20:32:06 -0500 Subject: [PATCH] Fixes missing Wait("stop") calls, resolves audit items in #3816 (#4218) --- awx/ui/client/src/controllers/Credentials.js | 7 ++++--- awx/ui/client/src/controllers/Projects.js | 1 + awx/ui/client/src/controllers/Teams.js | 1 + awx/ui/client/src/helpers/Jobs.js | 12 ++++++------ .../inventories/list/inventory-list.controller.js | 4 ++-- .../notification-templates-list/list.controller.js | 6 +++--- .../edit/organizations-edit.controller.js | 1 + 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/awx/ui/client/src/controllers/Credentials.js b/awx/ui/client/src/controllers/Credentials.js index f8ebbf2197..1681205992 100644 --- a/awx/ui/client/src/controllers/Credentials.js +++ b/awx/ui/client/src/controllers/Credentials.js @@ -52,13 +52,12 @@ export function CredentialsList($scope, $rootScope, $location, $log, Rest.setUrl(url); Rest.destroy() .success(function() { - if (parseInt($state.params.credential_id) === id) { $state.go("^", null, { reload: true }); } else { - // @issue: OLD SEARCH - // $scope.search(list.iterator); + $state.go('.', null, {reload: true}); } + Wait('stop'); }) .error(function(data, status) { ProcessErrors($scope, data, status, null, { @@ -302,6 +301,7 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, Rest.get() .success(function(data) { $scope.canShareCredential = (data.count) ? true : false; + Wait('stop'); }).error(function(data, status) { ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to find if users is admin of org' + status }); }); @@ -462,6 +462,7 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $scope.credential_obj = data; $scope.$emit('credentialLoaded'); + Wait('stop'); }) .error(function(data, status) { ProcessErrors($scope, data, status, form, { diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index 045fc3ff12..429338cd5f 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -551,6 +551,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $scope.project_obj = data; $scope.name = data.name; $scope.$emit('projectLoaded'); + Wait('stop'); }) .error(function (data, status) { ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), diff --git a/awx/ui/client/src/controllers/Teams.js b/awx/ui/client/src/controllers/Teams.js index 5eb75c4ee3..0e3a47d855 100644 --- a/awx/ui/client/src/controllers/Teams.js +++ b/awx/ui/client/src/controllers/Teams.js @@ -173,6 +173,7 @@ export function TeamsEdit($scope, $rootScope, $stateParams, $scope.organization_name = data.summary_fields.organization.name; $scope.team_obj = data; + Wait('stop'); }); $scope.$watch('team_obj.summary_fields.user_capabilities.edit', function(val) { diff --git a/awx/ui/client/src/helpers/Jobs.js b/awx/ui/client/src/helpers/Jobs.js index b3df9fa03c..19a206a22c 100644 --- a/awx/ui/client/src/helpers/Jobs.js +++ b/awx/ui/client/src/helpers/Jobs.js @@ -125,9 +125,9 @@ export default }; }]) - .factory('DeleteJob', ['Find', 'GetBasePath', 'Rest', 'Wait', + .factory('DeleteJob', ['$state', 'Find', 'GetBasePath', 'Rest', 'Wait', 'ProcessErrors', 'Prompt', 'Alert', '$filter', - function(Find, GetBasePath, Rest, Wait, ProcessErrors, Prompt, Alert, + function($state, Find, GetBasePath, Rest, Wait, ProcessErrors, Prompt, Alert, $filter){ return function(params) { var scope = params.scope, @@ -176,8 +176,8 @@ export default scope.$emit(callback, action_label); } else { - // @issue: OLD SEARCH - // scope.search(scope.iterator); + $state.reload(); + Wait('stop'); } }) .error(function(obj, status) { @@ -198,8 +198,8 @@ export default scope.$emit(callback, action_label); } else { - // @issue: OLD SEARCH - // scope.search(scope.iterator); + $state.reload(); + Wait('stop'); } }) .error(function (obj, status) { diff --git a/awx/ui/client/src/inventories/list/inventory-list.controller.js b/awx/ui/client/src/inventories/list/inventory-list.controller.js index 8df936f240..6b8a75f0cc 100644 --- a/awx/ui/client/src/inventories/list/inventory-list.controller.js +++ b/awx/ui/client/src/inventories/list/inventory-list.controller.js @@ -274,8 +274,8 @@ function InventoriesList($scope, $rootScope, $location, $log, if (parseInt($state.params.inventory_id) === id) { $state.go("^", null, {reload: true}); } else { - // @issue: OLD SEARCH - // $scope.search(list.iterator); + $state.go('.', null, {reload: true}); + Wait('stop'); } }) .error(function (data, status) { diff --git a/awx/ui/client/src/notifications/notification-templates-list/list.controller.js b/awx/ui/client/src/notifications/notification-templates-list/list.controller.js index cf69fa6918..e82cc8219e 100644 --- a/awx/ui/client/src/notifications/notification-templates-list/list.controller.js +++ b/awx/ui/client/src/notifications/notification-templates-list/list.controller.js @@ -162,11 +162,11 @@ Rest.destroy() .success(function() { if (parseInt($state.params.notification_template_id) === id) { - $state.go("^", null, { reload: true }); + $state.go("^", null, { reload: true }); } else { - // @issue: OLD SEARCH - // $scope.search(list.iterator); + $state.go('.', null, {reload: true}); } + Wait('stop'); }) .error(function(data, status) { ProcessErrors($scope, data, status, null, { diff --git a/awx/ui/client/src/organizations/edit/organizations-edit.controller.js b/awx/ui/client/src/organizations/edit/organizations-edit.controller.js index 07eabd6489..6d06679ffa 100644 --- a/awx/ui/client/src/organizations/edit/organizations-edit.controller.js +++ b/awx/ui/client/src/organizations/edit/organizations-edit.controller.js @@ -47,6 +47,7 @@ export default ['$scope', '$rootScope', '$location', '$log', '$stateParams', } $scope.organization_obj = data; $scope.$emit('organizationLoaded'); + Wait('stop'); }) .error(function(data, status) { ProcessErrors($scope, data, status, form, {