show/hide Insights action buttons

to prevent the user from navigating to the insights dashboard if
they don't have their insights inventory configured with an insights
credential.
This commit is contained in:
Jared Tabor 2017-07-03 15:14:32 -07:00
parent 5ab1a76785
commit 74c486a4cd
4 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ function(i18n) {
dataPlacement: 'top',
title: i18n._('Insights'),
skipGenerator: true,
ngIf: 'host.insights_system_id!==null'
ngIf: "host.insights_system_id!==null && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')"
}
}
};

View File

@ -74,7 +74,7 @@
</td>
<td class="List-actionsContainer">
<div class="List-actionButtonCell List-tableCell">
<button id="insights-action" class="List-actionButton " data-placement="top" ng-click="goToInsights(host.id)" aw-tool-tip="View Insights Data" ng-show="host.insights_system_id">
<button id="insights-action" class="List-actionButton " data-placement="top" ng-click="goToInsights(host.id)" aw-tool-tip="View Insights Data" ng-show="host.insights_system_id && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')">
<i class="fa fa-info"></i>
</button>
<button id="edit-action" class="List-actionButton " ng-class="{'List-editButton--selected' : $stateParams['host_id'] == host.id}" data-placement="top" ng-click="editHost(host.id)" aw-tool-tip="Edit host" ng-show="host.summary_fields.user_capabilities.edit">

View File

@ -126,7 +126,7 @@ function(i18n) {
dataPlacement: 'top',
title: i18n._('Insights'),
skipGenerator: true,
ngIf: 'host.insights_system_id!==null'
ngIf: "host.insights_system_id!==null && host.summary_fields.inventory.hasOwnProperty('insights_credential_id')"
}
}
};

View File

@ -86,7 +86,7 @@ export default ['i18n', function(i18n) {
icon: 'fa-info',
awToolTip: 'View Insights Data',
dataPlacement: 'top',
ngShow: 'host.insights_system_id'
ngShow: 'host.insights_system_id && host.summary_fields.inventory.hasOwnProperty("insights_credential_id")'
},
edit: {
//label: 'Edit',