mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Translate job status in smart status tooltip. Mark strings for translation in project form
This commit is contained in:
parent
456ef49ee3
commit
30ce85b80a
@ -56,7 +56,7 @@ export default ['i18n', 'NotificationsList', 'TemplateList',
|
||||
label: i18n._('SCM Type'),
|
||||
type: 'select',
|
||||
class: 'Form-dropDown--scmType',
|
||||
defaultText: 'Choose an SCM Type',
|
||||
defaultText: i18n._('Choose an SCM Type'),
|
||||
ngOptions: 'type.label for type in scm_type_options track by type.value',
|
||||
ngChange: 'scmChange()',
|
||||
required: true,
|
||||
@ -115,7 +115,7 @@ export default ['i18n', 'NotificationsList', 'TemplateList',
|
||||
hideSubForm: "scm_type.value === 'manual'",
|
||||
awPopOverWatch: "urlPopover",
|
||||
awPopOver: "set in controllers/projects",
|
||||
dataTitle: 'SCM URL',
|
||||
dataTitle: i18n._('SCM URL'),
|
||||
dataContainer: 'body',
|
||||
dataPlacement: 'right',
|
||||
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||
|
||||
@ -4,13 +4,38 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default ['$scope', '$filter', 'i18n',
|
||||
function ($scope, $filter, i18n) {
|
||||
export default ['$scope', '$filter', 'i18n', 'JobsStrings',
|
||||
function ($scope, $filter, i18n, JobsStrings) {
|
||||
|
||||
const strings = JobsStrings;
|
||||
|
||||
function isFailureState(status) {
|
||||
return status === 'failed' || status === 'error' || status === 'canceled';
|
||||
}
|
||||
|
||||
function getTranslatedStatusString(status) {
|
||||
switch (status) {
|
||||
case 'new':
|
||||
return strings.get('list.NEW');
|
||||
case 'pending':
|
||||
return strings.get('list.PENDING');
|
||||
case 'waiting':
|
||||
return strings.get('list.WAITING');
|
||||
case 'running':
|
||||
return strings.get('list.RUNNING');
|
||||
case 'successful':
|
||||
return strings.get('list.SUCCESSFUL');
|
||||
case 'failed':
|
||||
return strings.get('list.FAILED');
|
||||
case 'error':
|
||||
return strings.get('list.ERROR');
|
||||
case 'canceled':
|
||||
return strings.get('list.CANCELED');
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
};
|
||||
|
||||
function init(){
|
||||
var singleJobStatus = true;
|
||||
var firstJobStatus;
|
||||
@ -37,7 +62,7 @@ export default ['$scope', '$filter', 'i18n',
|
||||
jobId: job.id,
|
||||
sortDate: job.finished || "running" + job.id,
|
||||
finished: finished,
|
||||
status_tip: `${i18n._('JOB ID')}: ${job.id} <br>${i18n._('STATUS')}: ${job.status.toUpperCase()} <br>${i18n._('FINISHED')}: ${finished}`,
|
||||
status_tip: `${i18n._('JOB ID')}: ${job.id} <br>${i18n._('STATUS')}: ${getTranslatedStatusString(job.status).toUpperCase()} <br>${i18n._('FINISHED')}: ${finished}`,
|
||||
detailsUrl: detailsBaseUrl + job.id
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user