diff --git a/awx/ui/client/legacy-styles/main-layout.less b/awx/ui/client/legacy-styles/main-layout.less index ac74aa8e22..cb6884b798 100644 --- a/awx/ui/client/legacy-styles/main-layout.less +++ b/awx/ui/client/legacy-styles/main-layout.less @@ -93,6 +93,10 @@ body { margin-top: 20px; } +.Panel-hidden { + display: none; +} + .btn{ text-transform: uppercase; } diff --git a/awx/ui/client/src/inventories/groups/groups.list.js b/awx/ui/client/src/inventories/groups/groups.list.js index bbf1280824..816a48d92b 100644 --- a/awx/ui/client/src/inventories/groups/groups.list.js +++ b/awx/ui/client/src/inventories/groups/groups.list.js @@ -24,7 +24,6 @@ export default { iconOnly: true, awToolTip: "{{ group.hosts_status_tip }}", dataPlacement: "top", - ngClick: "showFailedHosts(group)", icon: "{{ 'fa icon-job-' + group.hosts_status_class }}", columnClass: 'status-column List-staticColumn--smallStatus' }, diff --git a/awx/ui/client/src/inventories/groups/list/groups-list.controller.js b/awx/ui/client/src/inventories/groups/list/groups-list.controller.js index 9e66fa5c9d..68b7da4f35 100644 --- a/awx/ui/client/src/inventories/groups/list/groups-list.controller.js +++ b/awx/ui/client/src/inventories/groups/list/groups-list.controller.js @@ -183,15 +183,13 @@ $scope.cancelUpdate = function (id) { GroupsCancelUpdate({ scope: $scope, id: id }); }; + $scope.viewUpdateStatus = function (id) { ViewUpdateStatus({ scope: $scope, group_id: id }); }; - $scope.showFailedHosts = function() { - // TODO: implement - }; $scope.copyMoveGroup = function(id){ $state.go('inventories.edit.groups.copyMoveGroup', {group_id: id, groups: $stateParams.groups}); diff --git a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js index 94b0d05a4f..471c38cb59 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js @@ -167,15 +167,14 @@ $scope.cancelUpdate = function (id) { GroupsCancelUpdate({ scope: $scope, id: id }); }; + $scope.viewUpdateStatus = function (id) { ViewUpdateStatus({ scope: $scope, group_id: id }); }; - $scope.showFailedHosts = function() { - // TODO: implement - }; + // $scope.$parent governed by InventoryManageController, for unified multiSelect options $scope.$on('multiSelectList.selectionChanged', (event, selection) => { $scope.$parent.groupsSelected = selection.length > 0 ? true : false; diff --git a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js index 8987130a59..f474e7d595 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js @@ -24,7 +24,6 @@ export default { iconOnly: true, awToolTip: "{{ nested_group.hosts_status_tip }}", dataPlacement: "top", - ngClick: "showFailedHosts(nested_group)", icon: "{{ 'fa icon-job-' + nested_group.hosts_status_class }}", columnClass: 'status-column List-staticColumn--smallStatus' }, diff --git a/awx/ui/client/src/inventories/inventories.partial.html b/awx/ui/client/src/inventories/inventories.partial.html index ae2f1df601..3cfe4b2711 100644 --- a/awx/ui/client/src/inventories/inventories.partial.html +++ b/awx/ui/client/src/inventories/inventories.partial.html @@ -1,4 +1,5 @@
+
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 new file mode 100644 index 0000000000..56ed21bf6f --- /dev/null +++ b/awx/ui/client/src/shared/limit-panels/limit-panels.directive.js @@ -0,0 +1,30 @@ +export default ['$rootScope', function($rootScope) { + return { + restrict: 'E', + scope: { + maxPanels: '@', + panelContainer: '@' + }, + link: function(scope) { + + scope.maxPanels = parseInt(scope.maxPanels); + + $rootScope.$on('$stateChangeSuccess', function() { + let panels = angular.element('#' + scope.panelContainer).find('.Panel'); + + if(panels.length > scope.maxPanels) { + // hide the excess panels + $(panels).each(function( index ) { + if(index+1 > scope.maxPanels) { + $(this).addClass('Panel-hidden'); + } + }); + } + else { + // show all the panels + $(panels).removeClass('Panel-hidden'); + } + }); + } + }; +}]; diff --git a/awx/ui/client/src/shared/limit-panels/main.js b/awx/ui/client/src/shared/limit-panels/main.js new file mode 100644 index 0000000000..407cb09a95 --- /dev/null +++ b/awx/ui/client/src/shared/limit-panels/main.js @@ -0,0 +1,5 @@ +import directive from './limit-panels.directive'; + +export default + angular.module('LimitPanelsModule', []) + .directive('awLimitPanels', directive); diff --git a/awx/ui/client/src/shared/main.js b/awx/ui/client/src/shared/main.js index 27b6bb1488..eccf67be4e 100644 --- a/awx/ui/client/src/shared/main.js +++ b/awx/ui/client/src/shared/main.js @@ -30,6 +30,7 @@ import PromptDialog from './prompt-dialog'; import directives from './directives'; import features from './features/main'; import orgAdminLookup from './org-admin-lookup/main'; +import limitPanels from './limit-panels/main'; import 'angular-duration-format'; export default @@ -57,6 +58,7 @@ angular.module('shared', [listGenerator.name, filters.name, features.name, orgAdminLookup.name, + limitPanels.name, require('angular-cookies'), 'angular-duration-format' ])