diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js index 120bb64d1f..9231c9c8d8 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js @@ -4,149 +4,148 @@ * All Rights Reserved *************************************************/ -import { N_ } from '../../../../../../i18n'; +export default ['i18n', function(i18n) { + return { + name: 'nested_hosts', + iterator: 'nested_host', + editTitle: '{{ nested_host.name }}', // i don't think this is correct + // showTitle: false, + well: true, + wellOverride: true, + index: false, + hover: true, + // hasChildren: true, + multiSelect: true, + trackBy: 'nested_host.id', + basePath: 'api/v2/groups/{{$stateParams.group_id}}/all_hosts/', -export default { - name: 'nested_hosts', - iterator: 'nested_host', - editTitle: '{{ nested_host.name }}', // i don't think this is correct - // showTitle: false, - well: true, - wellOverride: true, - index: false, - hover: true, - // hasChildren: true, - multiSelect: true, - trackBy: 'nested_host.id', - basePath: 'api/v2/groups/{{$stateParams.group_id}}/all_hosts/', + fields: { + toggleHost: { + ngDisabled: 'host.has_inventory_sources', + label: '', + columnClass: 'List-staticColumn--toggle', + type: "toggle", + ngClick: "toggleHost($event, nested_host)", + awToolTip: "
" + + i18n._("Indicates if a host is available and should be included in running jobs.") + + "
" + + i18n._("For hosts that are part of an external" + + " inventory, this flag cannot be changed. It will be" + + " set by the inventory sync process.") + + "
", + dataPlacement: "right", + nosort: true, + }, + active_failures: { + label: '', + iconOnly: true, + nosort: true, + // do not remove this ng-click directive + // the list generator case to handle fields without ng-click + // cannot handle the aw-* directives + ngClick: 'noop()', + awPopOver: "{{ nested_host.job_status_html }}", + dataTitle: "{{ nested_host.job_status_title }}", + awToolTip: "{{ nested_host.badgeToolTip }}", + dataPlacement: 'top', + icon: "{{ 'fa icon-job-' + nested_host.active_failures }}", + id: 'active-failures-action', + columnClass: 'status-column List-staticColumn--smallStatus' + }, + name: { + key: true, + label: i18n._('Hosts'), + ngClick: "editHost(nested_host.id)", + ngClass: "{ 'host-disabled-label': !nested_host.enabled }", + columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7', + dataHostId: "{{ nested_host.id }}", + dataType: "nested_host", + class: 'InventoryManage-breakWord' + } + }, - fields: { - toggleHost: { - ngDisabled: 'host.has_inventory_sources', - label: '', - columnClass: 'List-staticColumn--toggle', - type: "toggle", - ngClick: "toggleHost($event, nested_host)", - awToolTip: "" + - N_("Indicates if a host is available and should be included in running jobs.") + - "
" + - N_("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + - "
", - dataPlacement: "right", - nosort: true, + fieldActions: { + + columnClass: 'col-lg-6 col-md-4 col-sm-4 col-xs-5 text-right', + edit: { + ngClick: "editHost(nested_host.id)", + icon: 'icon-edit', + awToolTip: i18n._('Edit host'), + dataPlacement: 'top', + ngShow: 'nested_host.summary_fields.user_capabilities.edit' + }, + view: { + ngClick: "editHost(nested_host.id)", + awToolTip: i18n._('View host'), + dataPlacement: 'top', + ngShow: '!nested_host.summary_fields.user_capabilities.edit' + }, + "delete": { + //label: 'Delete', + ngClick: "disassociateHost(nested_host)", + icon: 'icon-trash', + awToolTip: i18n._('Disassociate host'), + dataPlacement: 'top', + ngShow: 'nested_host.summary_fields.user_capabilities.delete' + } }, - active_failures: { - label: '', - iconOnly: true, - nosort: true, - // do not remove this ng-click directive - // the list generator case to handle fields without ng-click - // cannot handle the aw-* directives - ngClick: 'noop()', - awPopOver: "{{ nested_host.job_status_html }}", - dataTitle: "{{ nested_host.job_status_title }}", - awToolTip: "{{ nested_host.badgeToolTip }}", - dataPlacement: 'top', - icon: "{{ 'fa icon-job-' + nested_host.active_failures }}", - id: 'active-failures-action', - columnClass: 'status-column List-staticColumn--smallStatus' - }, - name: { - key: true, - label: N_('Hosts'), - ngClick: "editHost(nested_host.id)", - ngClass: "{ 'host-disabled-label': !nested_host.enabled }", - columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7', - dataHostId: "{{ nested_host.id }}", - dataType: "nested_host", - class: 'InventoryManage-breakWord' + + actions: { + launch: { + mode: 'all', + ngDisabled: '!hostsSelected', + ngClick: 'setAdhocPattern()', + awToolTip: i18n._("Select an inventory source by clicking the check box beside it. The inventory source can be a single group or host, a selection of multiple hosts, or a selection of multiple groups."), + dataPlacement: 'top', + actionClass: 'btn List-buttonDefault', + buttonContent: i18n._('RUN COMMANDS'), + showTipWhenDisabled: true, + tooltipInnerClass: "Tooltip-wide", + // TODO: we don't always want to show this + ngShow: true + }, + system_tracking: { + buttonContent: i18n._('System Tracking'), + ngClick: 'systemTracking()', + awToolTip: i18n._("Select one or two hosts by clicking the checkbox beside the host. System tracking offers the ability to compare the results of two scan runs from different dates on one host or the same date on two hosts."), + dataTipWatch: "systemTrackingTooltip", + dataPlacement: 'top', + awFeature: 'system_tracking', + actionClass: 'btn List-buttonDefault system-tracking', + ngDisabled: 'systemTrackingDisabled || !hostsSelected', + showTipWhenDisabled: true, + tooltipInnerClass: "Tooltip-wide", + ngShow: true + }, + refresh: { + mode: 'all', + awToolTip: i18n._("Refresh the page"), + ngClick: "refreshGroups()", + ngShow: "socketStatus == 'error'", + actionClass: 'btn List-buttonDefault', + buttonContent: i18n._('REFRESH') + }, + add: { + mode: 'all', + type: 'buttonDropdown', + awToolTip: i18n._("Add a host"), + actionClass: 'btn List-buttonSubmit', + buttonContent: '+ ' + i18n._('ADD'), + ngShow: 'canAdd', + dataPlacement: "top", + options: [ + { + optionContent: i18n._('Existing Host'), + optionSref: '.associate', + ngShow: 'canAdd' + }, + { + optionContent: i18n._('New Host'), + optionSref: '.add', + ngShow: 'canAdd' + } + ], + } } - }, - - fieldActions: { - - columnClass: 'col-lg-6 col-md-4 col-sm-4 col-xs-5 text-right', - edit: { - ngClick: "editHost(nested_host.id)", - icon: 'icon-edit', - awToolTip: N_('Edit host'), - dataPlacement: 'top', - ngShow: 'nested_host.summary_fields.user_capabilities.edit' - }, - view: { - ngClick: "editHost(nested_host.id)", - awToolTip: N_('View host'), - dataPlacement: 'top', - ngShow: '!nested_host.summary_fields.user_capabilities.edit' - }, - "delete": { - //label: 'Delete', - ngClick: "disassociateHost(nested_host)", - icon: 'icon-trash', - awToolTip: N_('Disassociate host'), - dataPlacement: 'top', - ngShow: 'nested_host.summary_fields.user_capabilities.delete' - } - }, - - actions: { - launch: { - mode: 'all', - ngDisabled: '!hostsSelected', - ngClick: 'setAdhocPattern()', - awToolTip: N_("Select an inventory source by clicking the check box beside it. The inventory source can be a single group or host, a selection of multiple hosts, or a selection of multiple groups."), - dataPlacement: 'top', - actionClass: 'btn List-buttonDefault', - buttonContent: N_('RUN COMMANDS'), - showTipWhenDisabled: true, - tooltipInnerClass: "Tooltip-wide", - // TODO: we don't always want to show this - ngShow: true - }, - system_tracking: { - buttonContent: N_('System Tracking'), - ngClick: 'systemTracking()', - awToolTip: N_("Select one or two hosts by clicking the checkbox beside the host. System tracking offers the ability to compare the results of two scan runs from different dates on one host or the same date on two hosts."), - dataTipWatch: "systemTrackingTooltip", - dataPlacement: 'top', - awFeature: 'system_tracking', - actionClass: 'btn List-buttonDefault system-tracking', - ngDisabled: 'systemTrackingDisabled || !hostsSelected', - showTipWhenDisabled: true, - tooltipInnerClass: "Tooltip-wide", - ngShow: true - }, - refresh: { - mode: 'all', - awToolTip: N_("Refresh the page"), - ngClick: "refreshGroups()", - ngShow: "socketStatus == 'error'", - actionClass: 'btn List-buttonDefault', - buttonContent: N_('REFRESH') - }, - add: { - mode: 'all', - type: 'buttonDropdown', - awToolTip: N_("Add a host"), - actionClass: 'btn List-buttonSubmit', - buttonContent: '+ ' + N_('ADD'), - ngShow: 'canAdd', - dataPlacement: "top", - options: [ - { - optionContent: N_('Existing Host'), - optionSref: '.associate', - ngShow: 'canAdd' - }, - { - optionContent: N_('New Host'), - optionSref: '.add', - ngShow: 'canAdd' - } - ], - } - } - -}; + }; +}]; diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/main.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/main.js index 70bb5ae1b1..6905795f3d 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/main.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/main.js @@ -11,7 +11,7 @@ import addController from './group-nested-hosts-add.controller'; export default angular.module('nestedHosts', []) - .value('NestedHostsListDefinition', nestedHostsListDefinition) + .factory('NestedHostsListDefinition', nestedHostsListDefinition) .factory('NestedHostsFormDefinition', nestedHostsFormDefinition) .controller('NestedHostsAddController', addController) .controller('NestedHostsListController', controller);