From ad5d0454c2ac7185de1803f6e2a44f3f02df0de7 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 3 Jun 2014 19:02:56 -0400 Subject: [PATCH] AC-1325 plus inventory refactor cleanup Fixed obvious issues found after pulling in inventory refactor changes from 1.4.11 branch. Included fixing modal dialog issues. --- awx/ui/static/js/controllers/Inventories.js | 25 ++++++++++++--------- awx/ui/static/js/forms/Inventories.js | 2 +- awx/ui/static/js/lists/InventoryGroups.js | 6 ++--- awx/ui/static/less/ansible-ui.less | 23 ------------------- awx/ui/static/less/inventory-edit.less | 7 +++--- awx/ui/static/lib/ansible/form-generator.js | 4 ++-- awx/ui/static/partials/inventory-edit.html | 2 ++ 7 files changed, 27 insertions(+), 42 deletions(-) diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index 8f61f01313..dcc0867127 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -486,7 +486,7 @@ InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log function InventoriesEdit ($scope, $location, $routeParams, $compile, GenerateList, ClearScope, Empty, Wait, Rest, Alert, LoadBreadCrumbs, GetBasePath, ProcessErrors, Breadcrumbs, InventoryGroups, InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg, GetHostsStatusMsg, GroupsEdit, InventoryUpdate, GroupsCancelUpdate, ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary, - InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize, SetContainerHeights, GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight, + InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize, GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight, GroupsCopy, HostsCopy) { @@ -519,7 +519,19 @@ function InventoriesEdit ($scope, $location, $routeParams, $compile, GenerateLis } $scope.removeHostReloadComplete = $scope.$on('HostReloadComplete', function() { if ($scope.initial_height) { - $('#hosts-container .well').height($scope.initial_height + 49); + var host_height = $('#hosts-container .well').height(), + group_height = $('#group-list-container .well').height(), + new_height; + + if (host_height > group_height) { + new_height = host_height - (host_height - group_height); + } + else if (host_height < group_height) { + new_height = host_height + (group_height - host_height); + } + if (new_height) { + $('#hosts-container .well').height(new_height); + } $scope.initial_height = null; } }); @@ -549,17 +561,10 @@ function InventoriesEdit ($scope, $location, $routeParams, $compile, GenerateLis scope: $scope }); - /*SetContainerHeights({ - group_scope: $scope, - host_scope: hostScope, - reloadHosts: false - });*/ - if ($(window).width() > 1210) { - $scope.initial_height = GetGroupContainerHeight() - 20; + $scope.initial_height = GetGroupContainerHeight(); $('#groups-container .list-table-container').height($scope.initial_height); rows = GetGroupContainerRows(); - //$('#hosts-container .well').height( height ); } else { rows = 20; diff --git a/awx/ui/static/js/forms/Inventories.js b/awx/ui/static/js/forms/Inventories.js index c8e53f29ee..809f5d1c5a 100644 --- a/awx/ui/static/js/forms/Inventories.js +++ b/awx/ui/static/js/forms/Inventories.js @@ -10,7 +10,7 @@ angular.module('InventoryFormDefinition', []) .value('InventoryForm', { addTitle: 'Create Inventory', - editTitle: '{{ inventory_name | capitalize }}', + editTitle: '{{ inventory_name }}', name: 'inventory', well: true, diff --git a/awx/ui/static/js/lists/InventoryGroups.js b/awx/ui/static/js/lists/InventoryGroups.js index e0f9f3533d..cc351a04ca 100644 --- a/awx/ui/static/js/lists/InventoryGroups.js +++ b/awx/ui/static/js/lists/InventoryGroups.js @@ -9,7 +9,7 @@ angular.module('InventoryGroupsDefinition', []) name: 'groups', iterator: 'group', - editTitle: '{{ inventory_name }}', + editTitle: '{{ inventory.name }}', showTitle: false, well: true, index: false, @@ -134,7 +134,7 @@ angular.module('InventoryGroupsDefinition', []) edit: { //label: 'Edit', mode: 'all', - ngClick: "editGroup(group.group_id, group.id)", + ngClick: "editGroup(group.id)", awToolTip: 'Edit group', dataPlacement: "top" }, @@ -148,7 +148,7 @@ angular.module('InventoryGroupsDefinition', []) "delete": { //label: 'Delete', mode: 'all', - ngClick: "deleteGroup(group.id, group.group_id)", + ngClick: "deleteGroup(group.id)", awToolTip: 'Delete group', dataPlacement: "top" } diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index dcd601e5dc..73f3aa730c 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -1330,29 +1330,6 @@ input[type="checkbox"].checkbox-no-label { margin-bottom: 0; } - #groups-table-header { - margin-bottom: 0; - } - - #groups-container { - .list-table-container { - overflow: auto; - } - .list-actions { - margin-bottom: 15px; - } - } - - #hosts-container { - .list-table-container { - position: relative; - top: -15px; - } - .well { - margin-bottom: 8px; - } - } - #inventories_table i[class*="icon-job-"], #home_groups_table i[class*="icon-job-"] { margin-left: 10px; diff --git a/awx/ui/static/less/inventory-edit.less b/awx/ui/static/less/inventory-edit.less index b69d642c4a..9942eb0d1f 100644 --- a/awx/ui/static/less/inventory-edit.less +++ b/awx/ui/static/less/inventory-edit.less @@ -116,8 +116,9 @@ margin-bottom: 15px; } -#group-list-container { - .list-actions { - margin-bottom: 0; +#group-list-container, +#hosts-container { + .page-row { + margin-top: 5px; } } diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index b5abf3af25..5b68ce5581 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -1136,7 +1136,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator } } - if (!this.modal && this.form.actions) { + if ((options.showActions === undefined || options.showActions === true) && !this.modal && this.form.actions) { html += this.getActions(options); } @@ -1251,7 +1251,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator } //buttons - if (!this.modal) { + if ((options.showButtons === undefined || options.showButtons === true) && !this.modal) { if (this.has('buttons')) { if (this.form.twoColumns) { diff --git a/awx/ui/static/partials/inventory-edit.html b/awx/ui/static/partials/inventory-edit.html index c9e69d2655..7686250658 100644 --- a/awx/ui/static/partials/inventory-edit.html +++ b/awx/ui/static/partials/inventory-edit.html @@ -152,6 +152,8 @@ +
+