mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 01:08:48 -03:30
Merge pull request #1646 from jaredevantabor/1476-cancel-job
Changes "Cancel" to "OK" on cancel-job-prompt modal
This commit is contained in:
@@ -132,7 +132,7 @@ function ListJobsController (
|
|||||||
resourceName: $filter('sanitize')(job.name),
|
resourceName: $filter('sanitize')(job.name),
|
||||||
body: deleteModalBody,
|
body: deleteModalBody,
|
||||||
action,
|
action,
|
||||||
actionText: 'DELETE'
|
actionText: strings.get('DELETE'),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -174,7 +174,8 @@ function ListJobsController (
|
|||||||
resourceName: $filter('sanitize')(job.name),
|
resourceName: $filter('sanitize')(job.name),
|
||||||
body: deleteModalBody,
|
body: deleteModalBody,
|
||||||
action,
|
action,
|
||||||
actionText: strings.get('CANCEL')
|
actionText: strings.get('cancelJob.CANCEL_JOB'),
|
||||||
|
cancelText: strings.get('cancelJob.RETURN')
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -442,9 +442,10 @@ function toggleLabels () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cancelJob () {
|
function cancelJob () {
|
||||||
const actionText = strings.get('warnings.CANCEL_ACTION');
|
const actionText = strings.get('cancelJob.CANCEL_JOB');
|
||||||
const hdr = strings.get('warnings.CANCEL_HEADER');
|
const hdr = strings.get('cancelJob.HEADER');
|
||||||
const warning = strings.get('warnings.CANCEL_BODY');
|
const warning = strings.get('cancelJob.SUBMIT_REQUEST');
|
||||||
|
const cancelText = strings.get('cancelJob.RETURN');
|
||||||
|
|
||||||
const id = resource.model.get('id');
|
const id = resource.model.get('id');
|
||||||
const name = $filter('sanitize')(resource.model.get('name'));
|
const name = $filter('sanitize')(resource.model.get('name'));
|
||||||
@@ -467,13 +468,13 @@ function cancelJob () {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
prompt({ hdr, resourceName, body, actionText, action });
|
prompt({ hdr, resourceName, body, actionText, action, cancelText });
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteJob () {
|
function deleteJob () {
|
||||||
const actionText = strings.get('DELETE');
|
const actionText = strings.get('DELETE');
|
||||||
const hdr = strings.get('warnings.DELETE_HEADER');
|
const hdr = strings.get('deleteResource.HEADER');
|
||||||
const warning = strings.get('warnings.DELETE_BODY');
|
const warning = strings.get('deleteResource.CONFIRM', 'job');
|
||||||
|
|
||||||
const id = resource.model.get('id');
|
const id = resource.model.get('id');
|
||||||
const name = $filter('sanitize')(resource.model.get('name'));
|
const name = $filter('sanitize')(resource.model.get('name'));
|
||||||
|
|||||||
@@ -8,14 +8,6 @@ function JobsStrings (BaseString) {
|
|||||||
TITLE: t.s('JOBZ')
|
TITLE: t.s('JOBZ')
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.warnings = {
|
|
||||||
CANCEL_ACTION: t.s('PROCEED'),
|
|
||||||
CANCEL_BODY: t.s('Are you sure you want to cancel this job?'),
|
|
||||||
CANCEL_HEADER: t.s('Cancel Job'),
|
|
||||||
DELETE_BODY: t.s('Are you sure you want to delete this job?'),
|
|
||||||
DELETE_HEADER: t.s('Delete Job'),
|
|
||||||
};
|
|
||||||
|
|
||||||
ns.status = {
|
ns.status = {
|
||||||
RUNNING: t.s('The host status bar will update when the job is complete.'),
|
RUNNING: t.s('The host status bar will update when the job is complete.'),
|
||||||
UNAVAILABLE: t.s('Host status information for this job is unavailable.'),
|
UNAVAILABLE: t.s('Host status information for this job is unavailable.'),
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<div class="Modal-body" ng-bind-html="promptBody" id="prompt-body">
|
<div class="Modal-body" ng-bind-html="promptBody" id="prompt-body">
|
||||||
</div>
|
</div>
|
||||||
<div class="Modal-footer">
|
<div class="Modal-footer">
|
||||||
<a href="#" data-target="#prompt-modal" data-dismiss="modal" id="prompt_cancel_btn" class="btn Modal-defaultButton Modal-footerButton" translate>CANCEL</a>
|
<a href="#" data-target="#prompt-modal" data-dismiss="modal" id="prompt_cancel_btn" class="btn Modal-defaultButton Modal-footerButton" ng-bind="cancelActionText"></a>
|
||||||
<a href="" ng-hide="hideActionButton" ng-class="promptActionBtnClass" ng-click="promptAction()" id="prompt_action_btn" class="btn Modal-footerButton" ng-bind="promptActionText"></a>
|
<a href="" ng-hide="hideActionButton" ng-class="promptActionBtnClass" ng-click="promptAction()" id="prompt_action_btn" class="btn Modal-footerButton" ng-bind="promptActionText"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ function BaseStringService (namespace) {
|
|||||||
this.JSON = t.s('JSON');
|
this.JSON = t.s('JSON');
|
||||||
this.DELETE = t.s('DELETE');
|
this.DELETE = t.s('DELETE');
|
||||||
this.COPY = t.s('COPY');
|
this.COPY = t.s('COPY');
|
||||||
|
this.YES = t.s('YES');
|
||||||
|
|
||||||
this.deleteResource = {
|
this.deleteResource = {
|
||||||
HEADER: t.s('Delete'),
|
HEADER: t.s('Delete'),
|
||||||
@@ -79,7 +80,9 @@ function BaseStringService (namespace) {
|
|||||||
|
|
||||||
this.cancelJob = {
|
this.cancelJob = {
|
||||||
HEADER: t.s('Cancel'),
|
HEADER: t.s('Cancel'),
|
||||||
SUBMIT_REQUEST: t.s('Are you sure you want to submit the request to cancel this job?')
|
SUBMIT_REQUEST: t.s('Are you sure you want to submit the request to cancel this job?'),
|
||||||
|
CANCEL_JOB: t.s('Cancel Job'),
|
||||||
|
RETURN: t.s('Return')
|
||||||
};
|
};
|
||||||
|
|
||||||
this.error = {
|
this.error = {
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('PromptDialog', ['Utilities'])
|
angular.module('PromptDialog', ['Utilities'])
|
||||||
.factory('Prompt', [
|
.factory('Prompt', [ 'AppStrings',
|
||||||
function () {
|
function (strings) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var dialog = angular.element(document.getElementById('prompt-modal')),
|
var dialog = angular.element(document.getElementById('prompt-modal')),
|
||||||
@@ -42,7 +42,8 @@ angular.module('PromptDialog', ['Utilities'])
|
|||||||
scope.promptResourceName = params.resourceName;
|
scope.promptResourceName = params.resourceName;
|
||||||
scope.promptBody = params.body;
|
scope.promptBody = params.body;
|
||||||
scope.promptAction = params.action;
|
scope.promptAction = params.action;
|
||||||
scope.promptActionText = (params.actionText === null || params.actionText === undefined || params.actionText === '') ? 'YES' : params.actionText;
|
scope.promptActionText = (params.actionText === null || params.actionText === undefined || params.actionText === '') ? strings.get('YES') : params.actionText;
|
||||||
|
scope.cancelActionText = (params.cancelText === null || params.cancelText === undefined || params.cancelText === '') ? strings.get('CANCEL') : params.cancelText;
|
||||||
scope.hideActionButton = params.hideActionButton ? true : false;
|
scope.hideActionButton = params.hideActionButton ? true : false;
|
||||||
|
|
||||||
local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;
|
local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;
|
||||||
|
|||||||
Reference in New Issue
Block a user