From ccb7758b377eddc21be687ec68ce5a70f6917f07 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 20 Jun 2018 15:27:40 -0700 Subject: [PATCH] Changes the ngShow for the Network Visualizer and Remediate Inventory buttons to only show them on the Details tab (or in the case of Remediate inventory, only show it on the Details or Hosts tab). --- .../smart-inventory/smart-inventory.form.js | 3 ++- .../standard-inventory/inventory.form.js | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js index 62a58e4023..edd6846619 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/smart-inventory/smart-inventory.form.js @@ -161,7 +161,8 @@ export default ['i18n', 'awxNetStrings', function(i18n, awxNetStrings) { network: { ngClick: 'goToGraph()', label: awxNetStrings.get('feature.ACTION_BUTTON'), - class: 'Form-primaryButton' + class: 'Form-primaryButton', + ngShow: "$state.is('inventories.editSmartInventory')" } } diff --git a/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js b/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js index ea3d67d025..9219c91fe4 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/inventory.form.js @@ -174,16 +174,17 @@ function(i18n, awxNetStrings) { } }, relatedButtons: { - remediate_inventory: { - ngClick: 'remediateInventory(id, insights_credential)', - ngShow: 'is_insights && mode !== "add" && canRemediate', - label: i18n._('Remediate Inventory'), - class: 'Form-primaryButton' - }, network: { ngClick: 'goToGraph()', + ngShow: "$state.is('inventories.edit')", label: awxNetStrings.get('feature.ACTION_BUTTON'), class: 'Form-primaryButton' + }, + remediate_inventory: { + ngClick: 'remediateInventory(id, insights_credential)', + ngShow: "is_insights && mode !== 'add' && canRemediate && ($state.is('inventories.edit') || $state.is('inventories.edit.hosts'))", + label: i18n._('Remediate Inventory'), + class: 'Form-primaryButton' } }