From 86d3d9466afc072eb13560b1b00e09c8c3753553 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 15 May 2017 10:08:05 -0400 Subject: [PATCH] Fixed limit panels bug, breadcrumb and redirect bugs --- .../groups/nested-hosts/nested-hosts-edit.route.js | 4 ++-- .../src/inventories/related-hosts/add/host-add.controller.js | 2 +- .../inventories/related-hosts/edit/host-edit.controller.js | 5 +++-- .../src/inventories/related-hosts/edit/host-edit.route.js | 2 +- .../client/src/shared/limit-panels/limit-panels.directive.js | 3 +++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/src/inventories/groups/nested-hosts/nested-hosts-edit.route.js b/awx/ui/client/src/inventories/groups/nested-hosts/nested-hosts-edit.route.js index 63b65d648c..8bcd6ec985 100644 --- a/awx/ui/client/src/inventories/groups/nested-hosts/nested-hosts-edit.route.js +++ b/awx/ui/client/src/inventories/groups/nested-hosts/nested-hosts-edit.route.js @@ -2,8 +2,8 @@ export default { name: "inventories.edit.groups.edit.nested_hosts.edit", url: "/edit/:host_id", ncyBreadcrumb: { - parent: "inventories.edit.groups.edit", - label: "ASSOCIATED HOSTS" + parent: "inventories.edit.groups.edit.nested_hosts", + label: "{{breadcrumb.host_name}}" }, views: { 'hostForm@inventories': { diff --git a/awx/ui/client/src/inventories/related-hosts/add/host-add.controller.js b/awx/ui/client/src/inventories/related-hosts/add/host-add.controller.js index baeb5f80fb..15bb942f5f 100644 --- a/awx/ui/client/src/inventories/related-hosts/add/host-add.controller.js +++ b/awx/ui/client/src/inventories/related-hosts/add/host-add.controller.js @@ -52,7 +52,7 @@ export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition' // assign the host to current group if not at the root level if ($stateParams.group_id) { HostManageService.associateGroup(res.data, $stateParams.group_id).then(function() { - $state.go('inventories.edit.groups.edit.nested_hosts', { group_id: $stateParams.group_id }, { reload: true }); + $state.go('^.edit', { group_id: $stateParams.group_id, host_id: res.data.id }, { reload: true }); }); } else { $state.go('^.edit', { host_id: res.data.id }, { reload: true }); diff --git a/awx/ui/client/src/inventories/related-hosts/edit/host-edit.controller.js b/awx/ui/client/src/inventories/related-hosts/edit/host-edit.controller.js index 048388f791..4eb6575c16 100644 --- a/awx/ui/client/src/inventories/related-hosts/edit/host-edit.controller.js +++ b/awx/ui/client/src/inventories/related-hosts/edit/host-edit.controller.js @@ -5,8 +5,8 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'DashboardHostsForm', 'GenerateForm', 'ParseTypeChange', 'DashboardHostService', 'host', - function($scope, $state, $stateParams, DashboardHostsForm, GenerateForm, ParseTypeChange, DashboardHostService, host){ + ['$scope', '$state', '$stateParams', 'DashboardHostsForm', 'GenerateForm', 'ParseTypeChange', 'DashboardHostService', 'host', '$rootScope', + function($scope, $state, $stateParams, DashboardHostsForm, GenerateForm, ParseTypeChange, DashboardHostService, host, $rootScope){ $scope.parseType = 'yaml'; $scope.formCancel = function(){ $state.go('^', null, {reload: true}); @@ -36,6 +36,7 @@ var init = function(){ $scope.host = host; $scope.name = host.name; + $rootScope.breadcrumb.host_name = host.name; $scope.description = host.description; $scope.variables = getVars(host.variables); ParseTypeChange({ diff --git a/awx/ui/client/src/inventories/related-hosts/edit/host-edit.route.js b/awx/ui/client/src/inventories/related-hosts/edit/host-edit.route.js index f44066c625..5bc5d264b5 100644 --- a/awx/ui/client/src/inventories/related-hosts/edit/host-edit.route.js +++ b/awx/ui/client/src/inventories/related-hosts/edit/host-edit.route.js @@ -3,7 +3,7 @@ export default { url: "/edit/:host_id", ncyBreadcrumb: { parent: "inventories.edit.hosts", - label: "HOSTS" + label: "{{breadcrumb.host_name}}" }, views: { 'hostForm@inventories': { diff --git a/awx/ui/client/src/shared/limit-panels/limit-panels.directive.js b/awx/ui/client/src/shared/limit-panels/limit-panels.directive.js index 56ed21bf6f..16832a772f 100644 --- a/awx/ui/client/src/shared/limit-panels/limit-panels.directive.js +++ b/awx/ui/client/src/shared/limit-panels/limit-panels.directive.js @@ -18,6 +18,9 @@ export default ['$rootScope', function($rootScope) { if(index+1 > scope.maxPanels) { $(this).addClass('Panel-hidden'); } + else { + $(this).removeClass('Panel-hidden'); + } }); } else {