Removed use of N_ in favor of i18n._

This commit is contained in:
Michael Abashian
2017-07-06 11:01:58 -04:00
parent 3d3ee33290
commit 819308dd6c
2 changed files with 142 additions and 143 deletions

View File

@@ -4,149 +4,148 @@
* All Rights Reserved * 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 { fields: {
name: 'nested_hosts', toggleHost: {
iterator: 'nested_host', ngDisabled: 'host.has_inventory_sources',
editTitle: '{{ nested_host.name }}', // i don't think this is correct label: '',
// showTitle: false, columnClass: 'List-staticColumn--toggle',
well: true, type: "toggle",
wellOverride: true, ngClick: "toggleHost($event, nested_host)",
index: false, awToolTip: "<p>" +
hover: true, i18n._("Indicates if a host is available and should be included in running jobs.") +
// hasChildren: true, "</p><p>" +
multiSelect: true, i18n._("For hosts that are part of an external" +
trackBy: 'nested_host.id', " inventory, this flag cannot be changed. It will be" +
basePath: 'api/v2/groups/{{$stateParams.group_id}}/all_hosts/', " set by the inventory sync process.") +
"</p>",
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: { fieldActions: {
toggleHost: {
ngDisabled: 'host.has_inventory_sources', columnClass: 'col-lg-6 col-md-4 col-sm-4 col-xs-5 text-right',
label: '', edit: {
columnClass: 'List-staticColumn--toggle', ngClick: "editHost(nested_host.id)",
type: "toggle", icon: 'icon-edit',
ngClick: "toggleHost($event, nested_host)", awToolTip: i18n._('Edit host'),
awToolTip: "<p>" + dataPlacement: 'top',
N_("Indicates if a host is available and should be included in running jobs.") + ngShow: 'nested_host.summary_fields.user_capabilities.edit'
"</p><p>" + },
N_("For hosts that are part of an external" + view: {
" inventory, this flag cannot be changed. It will be" + ngClick: "editHost(nested_host.id)",
" set by the inventory sync process.") + awToolTip: i18n._('View host'),
"</p>", dataPlacement: 'top',
dataPlacement: "right", ngShow: '!nested_host.summary_fields.user_capabilities.edit'
nosort: true, },
"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: '', actions: {
iconOnly: true, launch: {
nosort: true, mode: 'all',
// do not remove this ng-click directive ngDisabled: '!hostsSelected',
// the list generator case to handle fields without ng-click ngClick: 'setAdhocPattern()',
// cannot handle the aw-* directives 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."),
ngClick: 'noop()', dataPlacement: 'top',
awPopOver: "{{ nested_host.job_status_html }}", actionClass: 'btn List-buttonDefault',
dataTitle: "{{ nested_host.job_status_title }}", buttonContent: i18n._('RUN COMMANDS'),
awToolTip: "{{ nested_host.badgeToolTip }}", showTipWhenDisabled: true,
dataPlacement: 'top', tooltipInnerClass: "Tooltip-wide",
icon: "{{ 'fa icon-job-' + nested_host.active_failures }}", // TODO: we don't always want to show this
id: 'active-failures-action', ngShow: true
columnClass: 'status-column List-staticColumn--smallStatus' },
}, system_tracking: {
name: { buttonContent: i18n._('System Tracking'),
key: true, ngClick: 'systemTracking()',
label: N_('Hosts'), 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."),
ngClick: "editHost(nested_host.id)", dataTipWatch: "systemTrackingTooltip",
ngClass: "{ 'host-disabled-label': !nested_host.enabled }", dataPlacement: 'top',
columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7', awFeature: 'system_tracking',
dataHostId: "{{ nested_host.id }}", actionClass: 'btn List-buttonDefault system-tracking',
dataType: "nested_host", ngDisabled: 'systemTrackingDisabled || !hostsSelected',
class: 'InventoryManage-breakWord' 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: '&#43; ' + 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: '&#43; ' + N_('ADD'),
ngShow: 'canAdd',
dataPlacement: "top",
options: [
{
optionContent: N_('Existing Host'),
optionSref: '.associate',
ngShow: 'canAdd'
},
{
optionContent: N_('New Host'),
optionSref: '.add',
ngShow: 'canAdd'
}
],
}
}
};

View File

@@ -11,7 +11,7 @@ import addController from './group-nested-hosts-add.controller';
export default export default
angular.module('nestedHosts', []) angular.module('nestedHosts', [])
.value('NestedHostsListDefinition', nestedHostsListDefinition) .factory('NestedHostsListDefinition', nestedHostsListDefinition)
.factory('NestedHostsFormDefinition', nestedHostsFormDefinition) .factory('NestedHostsFormDefinition', nestedHostsFormDefinition)
.controller('NestedHostsAddController', addController) .controller('NestedHostsAddController', addController)
.controller('NestedHostsListController', controller); .controller('NestedHostsListController', controller);