diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index cda1ae0618..c635386b66 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -453,13 +453,17 @@ function InventoriesEdit ($scope, $location, $routeParams, $compile, GenerateLis } } - $scope.cancelUpdate = function(id) { - GroupsCancelUpdate({ scope: $scope, tree_id: id }); + $scope.cancelUpdate = function(tree_id) { + GroupsCancelUpdate({ scope: $scope, tree_id: tree_id }); } - $scope.toggle = function(id) { + $scope.toggle = function(tree_id) { // Expand/collapse nodes - ToggleChildren({ scope: $scope, list: list, id: id }); + if (tree_id !== $scope.selected_tree_id) { + $scope.showHosts(tree_id, Find({ list: $scope.groups, key: 'id', val: tree_id }).group_id, false); + console.log('set group_id to: ' + $scope.selected_group_id); + } + ToggleChildren({ scope: $scope, list: list, id: tree_id }); } $scope.refreshGroups = function(tree_id, group_id) { diff --git a/awx/ui/static/js/controllers/JobEvents.js b/awx/ui/static/js/controllers/JobEvents.js index 64bf87bff5..281ae44a38 100644 --- a/awx/ui/static/js/controllers/JobEvents.js +++ b/awx/ui/static/js/controllers/JobEvents.js @@ -136,6 +136,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest, set[i]['class'] = 'parentNode'; } else { + set[i]['ngicon'] = 'fa fa-square-o node-no-toggle'; set[i]['class'] = 'childNode'; set[i]['event_detail'] = formatJSON(set[i].event_data); } diff --git a/awx/ui/static/js/helpers/Children.js b/awx/ui/static/js/helpers/Children.js index de102d835a..fc3fcbeac9 100644 --- a/awx/ui/static/js/helpers/Children.js +++ b/awx/ui/static/js/helpers/Children.js @@ -57,7 +57,7 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities']) // Expand: lookup and display children expand(clicked); } - else { + else if (/minus-square-o/.test(set[clicked]['ngicon'])) { collapse(clicked); } } diff --git a/awx/ui/static/js/lists/JobEvents.js b/awx/ui/static/js/lists/JobEvents.js index da280dec66..29059e68ec 100644 --- a/awx/ui/static/js/lists/JobEvents.js +++ b/awx/ui/static/js/lists/JobEvents.js @@ -94,12 +94,11 @@ angular.module('JobEventsListDefinition', []) }, fieldActions: { - edit: { + view: { label: 'View', ngClick: "viewJobEvent(\{\{ jobevent.id \}\})", - icon: 'icon-zoom-in', - "class": 'btn-default btn-xs', - awToolTip: 'View event details' + awToolTip: 'View event details', + dataPlacement: 'top' } } }); diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 116765d940..cd4765efe0 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -995,7 +995,7 @@ input[type="checkbox"].checkbox-no-label { .level-10 { padding-left: 200px; } .level-3-detail { - padding-left: 72px; + padding-left: 80px; } #job_events .control-group { @@ -1045,7 +1045,7 @@ input[type="checkbox"].checkbox-no-label { border-right: 1px solid #ddd; } -.node-toggle { +.node-toggle, .node-no-toggle { /* also used on job evetns */ float: none; padding-top: 3px; @@ -1054,6 +1054,10 @@ input[type="checkbox"].checkbox-no-label { margin-left: 0; } +.node-no-toggle { + opacity: .30; +} + .disabled { color: @grey; } diff --git a/awx/ui/static/lib/ansible/InventoryTree.js b/awx/ui/static/lib/ansible/InventoryTree.js index fca72fb889..7f1734348f 100644 --- a/awx/ui/static/lib/ansible/InventoryTree.js +++ b/awx/ui/static/lib/ansible/InventoryTree.js @@ -218,7 +218,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper']) source: sorted[i].summary_fields.inventory_source.source, group_id: sorted[i].id, event_level: level, - ngicon: (sorted[i].children.length > 0) ? 'fa fa-minus-square-o node-toggle' : null, + ngicon: (sorted[i].children.length > 0) ? 'fa fa-minus-square-o node-toggle' : 'fa fa-square-o node-no-toggle', ngclick: 'toggle(' + id + ')', related: { children: (sorted[i].children.length > 0) ? sorted[i].related.children : '', diff --git a/awx/ui/static/lib/ansible/generator-helpers.js b/awx/ui/static/lib/ansible/generator-helpers.js index da6d458782..085976f177 100644 --- a/awx/ui/static/lib/ansible/generator-helpers.js +++ b/awx/ui/static/lib/ansible/generator-helpers.js @@ -505,8 +505,8 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers']) // Add collapse/expand icon --used on job_events page if (list['hasChildren'] && field.hasChildren) { html += " " + - " "; + " "; + //ng-show=\"'\{\{ " + list.iterator + ".related.children \}\}' !== ''\" } // Start the Link