diff --git a/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js b/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js index 13d51cc68f..6b028a8702 100644 --- a/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js +++ b/awx/ui/client/src/organizations/linkout/organizations-linkout.route.js @@ -23,10 +23,7 @@ export default [ activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "organizations.edit"; - }, + parent: "organizations.edit", label: "USERS" }, resolve: { @@ -45,10 +42,7 @@ export default [ activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "organizations.edit"; - }, + parent: "organizations.edit", label: "TEAMS" }, resolve: { @@ -67,10 +61,7 @@ export default [ activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "organizations.edit"; - }, + parent: "organizations.edit", label: "INVENTORIES" }, resolve: { @@ -89,10 +80,7 @@ export default [ activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "organizations.edit"; - }, + parent: "organizations.edit", label: "PROJECTS" }, resolve: { @@ -111,10 +99,7 @@ export default [ activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "organizations.edit"; - }, + parent: "organizations.edit", label: "JOB TEMPLATES" }, resolve: { @@ -133,10 +118,7 @@ export default [ activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "organizations.edit"; - }, + parent: "organizations.edit", label: "ADMINS" }, resolve: { diff --git a/awx/ui/client/src/organizations/list/organizations-list.controller.js b/awx/ui/client/src/organizations/list/organizations-list.controller.js index 84510a60dc..878d23544f 100644 --- a/awx/ui/client/src/organizations/list/organizations-list.controller.js +++ b/awx/ui/client/src/organizations/list/organizations-list.controller.js @@ -8,12 +8,12 @@ export default ['$stateParams', '$scope', '$rootScope', '$location', '$log', '$compile', 'Rest', 'PaginateInit', 'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait', - '$state', 'generateList', 'Refresh', '$filter', + '$state', 'generateList', '$filter', function($stateParams, $scope, $rootScope, $location, $log, $compile, Rest, PaginateInit, SearchInit, OrganizationList, Alert, Prompt, ClearScope, ProcessErrors, GetBasePath, Wait, - $state, generateList, Refresh, $filter) { + $state, generateList, $filter) { ClearScope(); @@ -70,19 +70,14 @@ export default ['$stateParams', '$scope', '$rootScope', '$location', }; $scope.$on("ReloadOrgListView", function() { - var url = GetBasePath('organizations') + '?'; - if ($state.$current.self.name === "organizations" || - $state.$current.self.name === "organizations.add") { - $scope.activeCard = null; - } - if ($scope[list.iterator + 'SearchFilters']){ - url = url + _.reduce($scope[list.iterator+'SearchFilters'], (result, filter) => result + '&' + filter.url, ''); - } - Refresh({ - scope: $scope, - set: list.name, - iterator: list.iterator, - url: url + Rest.setUrl($scope.current_url); + Rest.get() + .success((data) => $scope.organizations = data.results) + .error(function(data, status) { + ProcessErrors($scope, data, status, null, { + hdr: 'Error!', + msg: 'Call to ' + defaultUrl + ' failed. DELETE returned status: ' + status + }); }); }); @@ -158,7 +153,7 @@ export default ['$stateParams', '$scope', '$rootScope', '$location', }); // grab the pagination elements, move, destroy list generator elements $('#organization-pagination').appendTo('#OrgCards'); - $('tag-search').appendTo('.OrgCards-search'); + $('#organizations tag-search').appendTo('.OrgCards-search'); $('#organizations-list').remove(); PaginateInit({ diff --git a/awx/ui/client/src/organizations/list/organizations-list.route.js b/awx/ui/client/src/organizations/list/organizations-list.route.js index c99604eecb..c965686317 100644 --- a/awx/ui/client/src/organizations/list/organizations-list.route.js +++ b/awx/ui/client/src/organizations/list/organizations-list.route.js @@ -17,10 +17,7 @@ export default { activityStreamTarget: 'organization' }, ncyBreadcrumb: { - parent: function($scope) { - $scope.$parent.$emit("ReloadOrgListView"); - return "setup"; - }, + parent: "setup", label: "ORGANIZATIONS" } };