taging some delete modals for translations

This commit is contained in:
Jared Tabor
2017-09-19 11:20:49 -07:00
parent 3fb6b5594d
commit ef4388f414
3 changed files with 18 additions and 18 deletions

View File

@@ -5,8 +5,8 @@
*************************************************/ *************************************************/
export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErrors', 'InitiatePlaybookRun', 'GetBasePath', 'Alert', '$rootScope', export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErrors', 'InitiatePlaybookRun', 'GetBasePath', 'Alert', '$rootScope', 'i18n',
function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybookRun, GetBasePath, Alert, $rootScope) { function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybookRun, GetBasePath, Alert, $rootScope, i18n) {
var val = { var val = {
// the playbook_on_stats event returns the count data in a weird format. // the playbook_on_stats event returns the count data in a weird format.
// format to what we need! // format to what we need!
@@ -90,9 +90,9 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
}, },
deleteJob: function(job) { deleteJob: function(job) {
Prompt({ Prompt({
hdr: 'Delete Job', hdr: i18n._("Delete Job"),
body: `<div class='Prompt-bodyQuery'> body: `<div class='Prompt-bodyQuery'>
Are you sure you want to delete the job below? ${i18n._("Are you sure you want to delete the job below?")}
</div> </div>
<div class='Prompt-bodyTarget'> <div class='Prompt-bodyTarget'>
#${job.id} ${$filter('sanitize')(job.name)} #${job.id} ${$filter('sanitize')(job.name)}
@@ -116,7 +116,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
}); });
}); });
}, },
actionText: 'DELETE' actionText: i18n._('DELETE')
}); });
}, },
cancelJob: function(job) { cancelJob: function(job) {
@@ -139,9 +139,9 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
}; };
Prompt({ Prompt({
hdr: 'Cancel Job', hdr: i18n._('Cancel Job'),
body: `<div class='Prompt-bodyQuery'> body: `<div class='Prompt-bodyQuery' translate>
Are you sure you want to cancel the job below? ${i18n._("Are you sure you want to cancel the job below?")}
</div> </div>
<div class='Prompt-bodyTarget'> <div class='Prompt-bodyTarget'>
#${job.id} ${$filter('sanitize')(job.name)} #${job.id} ${$filter('sanitize')(job.name)}
@@ -163,7 +163,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
} }
}); });
}, },
actionText: 'PROCEED' actionText: i18n._('PROCEED')
}); });
}, },
relaunchJob: function(scope) { relaunchJob: function(scope) {

View File

@@ -1,4 +1,4 @@
export default export default
function DeleteJob($state, Find, Rest, Wait, ProcessErrors, Prompt, Alert, function DeleteJob($state, Find, Rest, Wait, ProcessErrors, Prompt, Alert,
$filter, i18n) { $filter, i18n) {
return function(params) { return function(params) {
@@ -76,7 +76,7 @@ export default
reloadListStateParams = _.cloneDeep($state.params); reloadListStateParams = _.cloneDeep($state.params);
reloadListStateParams.job_search.page = (parseInt(reloadListStateParams.job_search.page)-1).toString(); reloadListStateParams.job_search.page = (parseInt(reloadListStateParams.job_search.page)-1).toString();
} }
$state.go('.', reloadListStateParams, {reload: true}); $state.go('.', reloadListStateParams, {reload: true});
Wait('stop'); Wait('stop');
} }
@@ -107,12 +107,12 @@ export default
} }
scope.removeCancelJob = scope.$on('CancelJob', function() { scope.removeCancelJob = scope.$on('CancelJob', function() {
var cancelBody = "<div class=\"Prompt-bodyQuery\">" + i18n._("Submit the request to cancel?") + "</div>"; var cancelBody = "<div class=\"Prompt-bodyQuery\">" + i18n._("Submit the request to cancel?") + "</div>";
var deleteBody = "<div class=\"Prompt-bodyQuery\">" + i18n._("Are you sure you want to delete the job below?") + "</div><div class=\"Prompt-bodyTarget\">#" + id + " " + $filter('sanitize')(job.name) + "</div>"; var deleteBody = "<div class=\"Prompt-bodyQuery\">" + i18n._("Are you sure you want to delete the job below?") + "</div><div class=\"Prompt-bodyTarget\" translate>#" + id + " " + $filter('sanitize')(job.name) + "</div>";
Prompt({ Prompt({
hdr: hdr, hdr: hdr,
body: (action_label === 'cancel' || job.status === 'new') ? cancelBody : deleteBody, body: (action_label === 'cancel' || job.status === 'new') ? cancelBody : deleteBody,
action: action, action: action,
actionText: (action_label === 'cancel' || job.status === 'new') ? "OK" : "DELETE" actionText: (action_label === 'cancel' || job.status === 'new') ? i18n._("OK") : i18n._("DELETE")
}); });
}); });

View File

@@ -8,12 +8,12 @@ export default ['$scope', '$rootScope',
'Alert','TemplateList', 'Prompt', 'ProcessErrors', 'Alert','TemplateList', 'Prompt', 'ProcessErrors',
'GetBasePath', 'InitiatePlaybookRun', 'Wait', '$state', '$filter', 'GetBasePath', 'InitiatePlaybookRun', 'Wait', '$state', '$filter',
'Dataset', 'rbacUiControlService', 'TemplatesService','QuerySet', 'Dataset', 'rbacUiControlService', 'TemplatesService','QuerySet',
'TemplateCopyService', 'TemplateCopyService', 'i18n',
function( function(
$scope, $rootScope, Alert, $scope, $rootScope, Alert,
TemplateList, Prompt, ProcessErrors, GetBasePath, TemplateList, Prompt, ProcessErrors, GetBasePath,
InitiatePlaybookRun, Wait, $state, $filter, Dataset, rbacUiControlService, TemplatesService, InitiatePlaybookRun, Wait, $state, $filter, Dataset, rbacUiControlService, TemplatesService,
qs, TemplateCopyService qs, TemplateCopyService, i18n
) { ) {
var list = TemplateList; var list = TemplateList;
@@ -99,8 +99,8 @@ export default ['$scope', '$rootScope',
$scope.deleteJobTemplate = function(template) { $scope.deleteJobTemplate = function(template) {
if(template) { if(template) {
Prompt({ Prompt({
hdr: 'Delete', hdr: i18n._('Delete'),
body: '<div class="Prompt-bodyQuery">Are you sure you want to delete the template below?</div><div class="Prompt-bodyTarget">' + $filter('sanitize')(template.name) + '</div>', body: `<div class="Prompt-bodyQuery">${i18n._("Are you sure you want to delete the template below?")}</div><div class="Prompt-bodyTarget">${$filter('sanitize')(template.name)}</div>`,
action: function() { action: function() {
function handleSuccessfulDelete(isWorkflow) { function handleSuccessfulDelete(isWorkflow) {
@@ -151,7 +151,7 @@ export default ['$scope', '$rootScope',
Alert('Error: Unable to determine template type', 'We were unable to determine this template\'s type while deleting.'); Alert('Error: Unable to determine template type', 'We were unable to determine this template\'s type while deleting.');
} }
}, },
actionText: 'DELETE' actionText: i18n._('DELETE')
}); });
} }
else { else {