From 698f2e7b8ff5aaba08160b418f5ad98f09045641 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 12 Mar 2015 12:16:47 -0400 Subject: [PATCH] Added icon on inventories view for manage inventory With the Manage Inventory page being essentially nested below the Edit Inventory page, I have added a new icon and a new button for getting to these pages. --- awx/ui/static/js/controllers/Inventories.js | 8 ++++++++ awx/ui/static/js/forms/Inventories.js | 9 +++++++++ awx/ui/static/js/lists/Inventories.js | 20 +++++++++++++------- awx/ui/static/js/lists/InventoryGroups.js | 10 +++++----- awx/ui/static/js/shared/generator-helpers.js | 3 +++ 5 files changed, 38 insertions(+), 12 deletions(-) diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index acdf7c5de1..1911fbdb0d 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -318,6 +318,10 @@ export function InventoriesList($scope, $rootScope, $location, $log, $routeParam $location.path($location.path() + '/' + id); }; + $scope.manageInventory = function(id){ + $location.path($location.path() + '/' + id + '/manage'); + } + $scope.deleteInventory = function (id, name) { var action = function () { @@ -613,6 +617,10 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $ }); }; + $scope.manageInventory = function(){ + $location.path($location.path() + '/manage'); + } + $scope.showActivity = function () { Stream({ scope: $scope }); }; diff --git a/awx/ui/static/js/forms/Inventories.js b/awx/ui/static/js/forms/Inventories.js index b5a9fca1f3..b6c598b819 100644 --- a/awx/ui/static/js/forms/Inventories.js +++ b/awx/ui/static/js/forms/Inventories.js @@ -22,6 +22,15 @@ export default well: true, actions: { + manage: { + 'class': "btn-primary btn-xs activity-btn", + ngClick: "manageInventory()", + awToolTip: "Manage Inventory", + dataPlacement: "top", + icon: "icon-sitemap", + mode: 'edit', + iconSize: 'large' + }, stream: { 'class': "btn-primary btn-xs activity-btn", ngClick: "showActivity()", diff --git a/awx/ui/static/js/lists/Inventories.js b/awx/ui/static/js/lists/Inventories.js index 99b3d1d123..012d0bc701 100644 --- a/awx/ui/static/js/lists/Inventories.js +++ b/awx/ui/static/js/lists/Inventories.js @@ -49,7 +49,7 @@ export default label: 'Name', columnClass: 'col-md-4 col-sm-6 col-xs-6', modalColumnClass: 'col-md-8', - linkTo: '/#/inventories/{{inventory.id}}/manage' + linkTo: '/#/inventories/{{inventory.id}}' }, organization: { label: 'Organization', @@ -97,12 +97,18 @@ export default }, fieldActions: { - failed_hosts: { - //label: 'Failures', - ngHref: "{{ inventory.failed_hosts_link }}", - iconClass: "{{ 'fa icon-failures-' + inventory.failed_hosts_class }}", - awToolTip: "{{ inventory.failed_hosts_tip }}", - dataPlacement: "top" + // failed_hosts: { + // //label: 'Failures', + // ngHref: "{{ inventory.failed_hosts_link }}", + // iconClass: "{{ 'fa icon-failures-' + inventory.failed_hosts_class }}", + // awToolTip: "{{ inventory.failed_hosts_tip }}", + // dataPlacement: "top" + // }, + manage: { + label: 'Manage', + ngClick: 'manageInventory(inventory.id)', + awToolTip: 'Manage Inventory', + dataPlacement: 'top' }, edit: { label: 'Edit', diff --git a/awx/ui/static/js/lists/InventoryGroups.js b/awx/ui/static/js/lists/InventoryGroups.js index ef88713e4d..99cea4e5c7 100644 --- a/awx/ui/static/js/lists/InventoryGroups.js +++ b/awx/ui/static/js/lists/InventoryGroups.js @@ -83,11 +83,11 @@ export default ngClick: "createGroup()", awToolTip: "Create a new group" }, - properties: { - mode: 'all', - awToolTip: "Edit inventory properties", - ngClick: 'editInventoryProperties()' - }, + // properties: { + // mode: 'all', + // awToolTip: "Edit inventory properties", + // ngClick: 'editInventoryProperties()' + // }, refresh: { mode: 'all', awToolTip: "Refresh the page", diff --git a/awx/ui/static/js/shared/generator-helpers.js b/awx/ui/static/js/shared/generator-helpers.js index 085e9df298..d33c5dc6e2 100644 --- a/awx/ui/static/js/shared/generator-helpers.js +++ b/awx/ui/static/js/shared/generator-helpers.js @@ -162,6 +162,9 @@ angular.module('GeneratorHelpers', [systemStatus.name]) case 'copy': icon = "fa-copy"; break; + case 'manage': + icon = "fa-sitemap"; + break; } icon += (size) ? " " + size : ""; return Icon(icon);