mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 05:00:07 -03:30
Merge pull request #331 from mabashian/7509-host-filter-permissions
Smart Inv permissions bug fixes
This commit is contained in:
@@ -98,8 +98,7 @@ export default ['i18n', function(i18n) {
|
|||||||
ngClick: 'editInventory(inventory)',
|
ngClick: 'editInventory(inventory)',
|
||||||
awToolTip: i18n._('Edit inventory'),
|
awToolTip: i18n._('Edit inventory'),
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: 'inventory.summary_fields.user_capabilities.edit',
|
ngShow: '!inventory.pending_deletion && inventory.summary_fields.user_capabilities.edit'
|
||||||
ngHide: 'inventory.pending_deletion'
|
|
||||||
},
|
},
|
||||||
view: {
|
view: {
|
||||||
label: i18n._('View'),
|
label: i18n._('View'),
|
||||||
@@ -113,8 +112,7 @@ export default ['i18n', function(i18n) {
|
|||||||
ngClick: "deleteInventory(inventory.id, inventory.name)",
|
ngClick: "deleteInventory(inventory.id, inventory.name)",
|
||||||
awToolTip: i18n._('Delete inventory'),
|
awToolTip: i18n._('Delete inventory'),
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: 'inventory.summary_fields.user_capabilities.delete',
|
ngShow: '!inventory.pending_deletion && inventory.summary_fields.user_capabilities.delete'
|
||||||
ngHide: 'inventory.pending_deletion'
|
|
||||||
|
|
||||||
},
|
},
|
||||||
pending_deletion: {
|
pending_deletion: {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default ['$scope', 'QuerySet', 'InventoryHostsStrings',
|
|||||||
function($scope, qs, InventoryHostsStrings) {
|
function($scope, qs, InventoryHostsStrings) {
|
||||||
$scope.hostFilterTags = [];
|
$scope.hostFilterTags = [];
|
||||||
|
|
||||||
$scope.filterTooltip = InventoryHostsStrings.get('smartinventories.TOOLTIP');
|
$scope.filterTooltip = $scope.fieldIsDisabled ? '' : InventoryHostsStrings.get('smartinventories.TOOLTIP');
|
||||||
|
|
||||||
$scope.$watch('hostFilter', function(){
|
$scope.$watch('hostFilter', function(){
|
||||||
$scope.hostFilterTags = [];
|
$scope.hostFilterTags = [];
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default ['templateUrl', '$compile',
|
|||||||
function(templateUrl, $compile) {
|
function(templateUrl, $compile) {
|
||||||
return {
|
return {
|
||||||
scope: {
|
scope: {
|
||||||
hostFilter: '='
|
hostFilter: '=',
|
||||||
|
fieldIsDisabled: '='
|
||||||
},
|
},
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
templateUrl: templateUrl('inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/smart-inventory-host-filter'),
|
templateUrl: templateUrl('inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/smart-inventory-host-filter'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="input-group Form-mixedInputGroup">
|
<div class="input-group Form-mixedInputGroup">
|
||||||
<span class="input-group-btn Form-variableHeightButtonGroup">
|
<span class="input-group-btn Form-variableHeightButtonGroup">
|
||||||
<button type="button" class="Form-lookupButton Form-lookupButton--variableHeight btn btn-default" ng-click="openHostFilterModal()">
|
<button type="button" class="Form-lookupButton Form-lookupButton--variableHeight btn btn-default" ng-click="openHostFilterModal()" ng-disabled="fieldIsDisabled">
|
||||||
<i class="fa fa-search"></i>
|
<i class="fa fa-search"></i>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default ['i18n', 'InventoryCompletedJobsList', function(i18n, InventoryCo
|
|||||||
smart_hosts: {
|
smart_hosts: {
|
||||||
label: i18n._('Smart Host Filter'),
|
label: i18n._('Smart Host Filter'),
|
||||||
type: 'custom',
|
type: 'custom',
|
||||||
control: '<smart-inventory-host-filter host-filter="smart_hosts"></smart-inventory-host-filter>',
|
control: '<smart-inventory-host-filter host-filter="smart_hosts" field-is-disabled="!(inventory_obj.summary_fields.user_capabilities.edit || canAdd)"></smart-inventory-host-filter>',
|
||||||
awPopOver: "<p>" + i18n._("Populate the hosts for this inventory by using a search filter.") + "</p><p>" + i18n._("Example: ansible_facts.ansible_distribution:\"RedHat\"") + "</p><p>" + i18n._("Refer to the Ansible Tower documentation for further syntax and examples.") + "</p>",
|
awPopOver: "<p>" + i18n._("Populate the hosts for this inventory by using a search filter.") + "</p><p>" + i18n._("Example: ansible_facts.ansible_distribution:\"RedHat\"") + "</p><p>" + i18n._("Refer to the Ansible Tower documentation for further syntax and examples.") + "</p>",
|
||||||
dataTitle: i18n._('Smart Host Filter'),
|
dataTitle: i18n._('Smart Host Filter'),
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
|
|||||||
Reference in New Issue
Block a user