diff --git a/awx/ui/client/src/controllers/Credentials.js b/awx/ui/client/src/controllers/Credentials.js index 08dbe760bd..eecd4cf34a 100644 --- a/awx/ui/client/src/controllers/Credentials.js +++ b/awx/ui/client/src/controllers/Credentials.js @@ -119,8 +119,9 @@ export function CredentialsList($scope, $rootScope, $location, $log, Prompt({ hdr: 'Delete', - body: "
Delete credential " + name + "?
", - action: action + body: '
Are you sure you want to delete the credential below?
' + name + '
', + action: action, + actionText: 'DELETE' }); }; } @@ -565,8 +566,9 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, Prompt({ hdr: 'Delete', - body: 'Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?', - action: action + body: '
Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?
', + action: action, + actionText: 'DELETE' }); }; diff --git a/awx/ui/client/src/controllers/Inventories.js b/awx/ui/client/src/controllers/Inventories.js index f87561d955..b4b17f3fa9 100644 --- a/awx/ui/client/src/controllers/Inventories.js +++ b/awx/ui/client/src/controllers/Inventories.js @@ -341,8 +341,9 @@ export function InventoriesList($scope, $rootScope, $location, $log, Prompt({ hdr: 'Delete', - body: '
Delete inventory ' + $filter('sanitize')(name) + '?
', - action: action + body: '
Are you sure you want to delete the inventory below?
' + $filter('sanitize')(name) + '
', + action: action, + actionText: 'DELETE' }); }; @@ -761,8 +762,9 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, Prompt({ hdr: 'Delete', - body: '
Delete job template ' + this.scan_job_template.name + '?
', - action: action + body: '
Are you sure you want to delete the job template below?
' + this.scan_job_template.name + '
', + action: action, + actionText: 'DELETE' }); }; diff --git a/awx/ui/client/src/controllers/JobTemplates.js b/awx/ui/client/src/controllers/JobTemplates.js index c05c2464aa..07e059a6a4 100644 --- a/awx/ui/client/src/controllers/JobTemplates.js +++ b/awx/ui/client/src/controllers/JobTemplates.js @@ -91,8 +91,9 @@ export function JobTemplatesList($scope, $rootScope, $location, $log, Prompt({ hdr: 'Delete', - body: '
Delete job template ' + name + '?
', - action: action + body: '
Are you sure you want to delete the job template below?
' + name + '
', + action: action, + actionText: 'DELETE' }); }; @@ -635,7 +636,7 @@ export function JobTemplatesAdd(Refresh, $filter, $scope, $rootScope, $compile, }; Prompt({ hdr: 'Incomplete Survey', - body: 'Do you want to create a survey before proceeding?', + body: '
Do you want to create a survey before proceeding?
', action: action }); }); @@ -1128,7 +1129,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, }; Prompt({ hdr: 'Incomplete Survey', - body: 'Do you want to create a survey before proceeding?', + body: '
Do you want to create a survey before proceeding?
', action: action }); }); @@ -1190,7 +1191,7 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, }; Prompt({ hdr: 'Incomplete Survey', - body: 'Do you want to create a survey before proceeding?', + body: '
Do you want to create a survey before proceeding?
', action: action }); }); diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index 3319addd64..75a28136b4 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -87,8 +87,9 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location, Prompt({ hdr: 'Delete', - body: '
Delete organization ' + name + '?
', - action: action + body: '
Are you sure you want to delete the organization below?
' + name + '
', + action: action, + actionText: 'DELETE' }); }; } @@ -281,8 +282,9 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, Prompt({ hdr: 'Delete', - body: 'Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?', - action: action + body: '
Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?
', + action: action, + actionText: 'DELETE' }); }; diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index 3d8bf6a2db..6c1ab1d857 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -266,8 +266,9 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams, Prompt({ hdr: 'Delete', - body: '
Delete project ' + name + '?
', - action: action + body: '
Are you sure you want to delete the project below?
' + name + '
', + action: action, + actionText: 'DELETE' }); }; @@ -795,8 +796,9 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, Prompt({ hdr: 'Delete', - body: 'Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?', - action: action + body: '
Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?
', + action: action, + actionText: 'DELETE' }); }; diff --git a/awx/ui/client/src/controllers/Teams.js b/awx/ui/client/src/controllers/Teams.js index fbda9be487..2880e0289a 100644 --- a/awx/ui/client/src/controllers/Teams.js +++ b/awx/ui/client/src/controllers/Teams.js @@ -100,8 +100,9 @@ export function TeamsList($scope, $rootScope, $location, $log, $stateParams, Prompt({ hdr: 'Delete', - body: '
Delete team ' + name + '?
', - action: action + body: '
Are you sure you want to delete the team below?
' + name + '
', + action: action, + actionText: 'DELETE' }); }; } @@ -410,8 +411,9 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, Prompt({ hdr: 'Delete', - body: 'Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?', - action: action + body: '
Are you sure you want to remove ' + name + ' from ' + $scope.name + ' ' + title + '?
', + action: action, + actionText: 'DELETE' }); }; } diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 1e5f9c06bc..a01e330806 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -91,8 +91,9 @@ export function UsersList($scope, $rootScope, $location, $log, $stateParams, Prompt({ hdr: 'Delete', - body: '
Delete user ' + name + '?
', - action: action + body: '
Are you sure you want to delete the user below?
' + name + '
', + action: action, + actionText: 'DELETE' }); }; } @@ -460,8 +461,9 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, Prompt({ hdr: 'Delete', - body: 'Are you sure you want to remove ' + name + ' from ' + $scope.username + ' ' + title + '?', - action: action + body: '
Are you sure you want to remove ' + name + ' from ' + $scope.username + ' ' + title + '?
', + action: action, + actionText: 'DELETE' }); }; }); // $scope.$on diff --git a/awx/ui/client/src/helpers/Hosts.js b/awx/ui/client/src/helpers/Hosts.js index d360f11b84..65bc8de7c1 100644 --- a/awx/ui/client/src/helpers/Hosts.js +++ b/awx/ui/client/src/helpers/Hosts.js @@ -739,10 +739,15 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', listGenerator.name, } }; - body = (group) ? '

Are you sure you want to remove host ' + host_name + ' from group ' + group.name + '?' + + body = (group) ? '

Are you sure you want to remove host ' + host_name + ' from group ' + group.name + '?' + ' It will still be part of the inventory and available in All Hosts.

' : - '

Are you sure you want to permanently delete host ' + host_name + ' from the inventory?

'; - Prompt({ hdr: 'Delete Host', body: body, action: action_to_take, 'class': 'btn-danger' }); + '

Are you sure you want to permanently delete host ' + host_name + ' from the inventory?

'; + Prompt({ + hdr: 'Delete Host', + body: body, + action: action_to_take, + actionText: 'DELETE' + }); }; }]) diff --git a/awx/ui/client/src/helpers/JobSubmission.js b/awx/ui/client/src/helpers/JobSubmission.js index f50f1c2bd2..aee3570311 100644 --- a/awx/ui/client/src/helpers/JobSubmission.js +++ b/awx/ui/client/src/helpers/JobSubmission.js @@ -272,7 +272,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi Prompt({ hdr: 'Machine Credential Required', - body: "
There are no machine credentials defined in Tower. Launching this job requires a machine credential. " + + body: "
There are no machine credentials defined in Tower. Launching this job requires a machine credential. " + "Create one now?", action: action }); diff --git a/awx/ui/client/src/helpers/Jobs.js b/awx/ui/client/src/helpers/Jobs.js index adbe640f4b..115af21b62 100644 --- a/awx/ui/client/src/helpers/Jobs.js +++ b/awx/ui/client/src/helpers/Jobs.js @@ -540,8 +540,9 @@ export default body = (action_label === 'cancel' || job.status === 'new') ? "Submit the request to cancel" : "Delete"; Prompt({ hdr: hdr, - body: "
" + body + " job #" + id + " " + job.name + "?
", - action: action + body: "
" + body + " job #" + id + " " + job.name + "?
", + action: action, + actionText: (action_label === 'cancel' || job.status === 'new') ? "YES" : "DELETE" }); }); diff --git a/awx/ui/client/src/helpers/Schedules.js b/awx/ui/client/src/helpers/Schedules.js index 0537a07c4d..f744d6731c 100644 --- a/awx/ui/client/src/helpers/Schedules.js +++ b/awx/ui/client/src/helpers/Schedules.js @@ -541,8 +541,9 @@ export default Prompt({ hdr: hdr, - body: "
Are you sure you want to delete the " + schedule.name + " schedule?
", + body: '
Are you sure you want to delete the schedule below?
' + schedule.name + '
', action: action, + actionText: 'DELETE', backdrop: false }); diff --git a/awx/ui/client/src/inventory-scripts/list/list.controller.js b/awx/ui/client/src/inventory-scripts/list/list.controller.js index ef19014a56..1dad7b230d 100644 --- a/awx/ui/client/src/inventory-scripts/list/list.controller.js +++ b/awx/ui/client/src/inventory-scripts/list/list.controller.js @@ -70,11 +70,12 @@ export default }); }; - var bodyHtml = "
Are you sure you want to delete " + name + "?
"; + var bodyHtml = '
Are you sure you want to delete the inventory script below?
' + name + '
'; Prompt({ hdr: 'Delete', body: bodyHtml, - action: action + action: action, + actionText: 'DELETE' }); }; diff --git a/awx/ui/client/src/permissions/list/list.controller.js b/awx/ui/client/src/permissions/list/list.controller.js index 1112043a15..4b6412fff4 100644 --- a/awx/ui/client/src/permissions/list/list.controller.js +++ b/awx/ui/client/src/permissions/list/list.controller.js @@ -127,8 +127,9 @@ export default if ($scope.PermissionAddAllowed) { Prompt({ hdr: 'Delete', - body: 'Are you sure you want to delete ' + name + '?', - action: action + body: '
Are you sure you want to delete the permission below?
' + name + '
', + action: action, + actionText: 'DELETE' }); } }; diff --git a/awx/ui/client/src/shared/prompt-dialog.js b/awx/ui/client/src/shared/prompt-dialog.js index 602368efe7..1ee2ad1fa7 100644 --- a/awx/ui/client/src/shared/prompt-dialog.js +++ b/awx/ui/client/src/shared/prompt-dialog.js @@ -41,10 +41,11 @@ angular.module('PromptDialog', ['Utilities', 'sanitizeFilter']) scope.promptHeader = params.hdr; scope.promptBody = params.body; scope.promptAction = params.action; + scope.promptActionText = (params.actionText === null || params.actionText === undefined || params.actionText === '') ? 'YES' : params.actionText; local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop; - cls = (params['class'] === null || params['class'] === undefined) ? 'btn-danger' : params['class']; + cls = (params['class'] === null || params['class'] === undefined) ? 'Prompt-errorButton' : params['class']; $('#prompt_action_btn').removeClass(cls).addClass(cls); diff --git a/awx/ui/client/src/shared/prompt/prompt.less b/awx/ui/client/src/shared/prompt/prompt.less new file mode 100644 index 0000000000..7879374422 --- /dev/null +++ b/awx/ui/client/src/shared/prompt/prompt.less @@ -0,0 +1,98 @@ +@import "awx/ui/client/src/shared/branding/colors.default.less"; + +.Prompt-content { + display:flex; + flex-wrap:wrap; + flex-direction: row; + padding: 15px 20px; +} + +.Prompt-header { + display: flex; + width: 100%; +} + +.Prompt-title { + flex: 1 0 auto; + text-transform: uppercase; + color: @list-header-txt; + font-size: 14px; + font-weight: bold; + white-space: nowrap; +} + +.Prompt-exitHolder{ + justify-content: flex-end; + display:flex; +} + +.Prompt-exit{ + cursor:pointer; + padding:0px; + border: none; + height:20px; + font-size: 20px; + background-color:@default-bg; + color:@default-second-border; + transition: color 0.2s; + line-height:1; +} + +.Prompt-exit:hover{ + color:@default-icon; +} + +.Prompt-body { + width: 100%; +} + +.Prompt-bodyQuery { + padding: 15px 0px; + color: @default-interface-txt; +} + +.Prompt-bodyTarget { + color: @default-data-txt; +} + +.Prompt-footer { + display: flex; + justify-content: flex-end; + padding-top: 20px; + width: 100%; +} + +.Prompt-defaultButton { + background-color: @default-bg; + color: @btn-txt; + text-transform: uppercase; + border-radius: 5px; + border: 1px solid @btn-bord; + transition: background-color 0.2s; + padding-left:15px; + padding-right: 15px; +} + +.Prompt-defaultButton:hover { + background-color: @btn-bg-hov; + color: @btn-txt; +} + +.Prompt-errorButton { + background-color: @default-err; + color: @btn-txt-sel; + text-transform: uppercase; + border-radius: 5px; + transition: background-color 0.2s; + padding-left:15px; + padding-right: 15px; +} + +.Prompt-errorButton:hover { + background-color: @default-err-hov; + color: @btn-txt-sel; +} + +.Prompt-footerButton + .Prompt-footerButton { + margin-left: 20px; +} diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 8b529e3b3e..c5aefc097d 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -97,17 +97,18 @@