From 5a47da60e1d4a27fa11b687c316457fb04fcb317 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 20 Jan 2016 23:17:51 -0500 Subject: [PATCH] fixed breadcrumb reload problem --- awx/ui/client/src/app.js | 10 ++++------ awx/ui/client/src/controllers/Organizations.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index dc33fe1d15..f407aa8543 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -559,7 +559,10 @@ var tower = angular.module('Tower', [ templateUrl: urlPrefix + 'partials/organizations.html', controller: OrganizationsList, ncyBreadcrumb: { - parent: "setup", + parent: function($scope) { + $scope.$parent.$emit("ReloadOrgListView"); + return "setup"; + }, label: "ORGANIZATIONS" }, resolve: { @@ -569,11 +572,6 @@ var tower = angular.module('Tower', [ } }). - state('organizations.cards', { - url: '/foo', - templateUrl: urlPrefix + 'organizations/cards.partial.html', - }). - state('organizations.add', { url: '/add', templateUrl: urlPrefix + 'partials/organizations.crud.html', diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index f92c1479e3..c71469568e 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -47,6 +47,19 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, }); }; + $scope.$on("ReloadOrgListView", function() { + if ($state.$current.self.name === "organizations") { + delete $scope.activeCard; + if ($scope.orgCards) { + $scope.orgCards = $scope.orgCards.map(function (card) { + delete card.isActiveCard; + return card; + }); + } + $scope.hideListHeader = false; + } + }); + $scope.$on("ReloadOrganzationCards", function(e, id) { $scope.activeCard = id; getOrganization(id);