diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-12 21:08:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-12 21:08:38 +0300 |
commit | aed0a60015f542db07f971fe321bd52207f632a4 (patch) | |
tree | f2a8ba4cf78799af1aff3ee49013afe791925bbb /app/assets/javascripts/lib | |
parent | 0024c2f44455cf5ace9235a7efa195c12a1d72d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue | 20 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal.js | 4 |
2 files changed, 22 insertions, 2 deletions
diff --git a/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue b/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue index 1d8eb73d3d7..3788d8ab20c 100644 --- a/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue +++ b/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue @@ -3,7 +3,6 @@ import { GlModal, GlSafeHtmlDirective } from '@gitlab/ui'; import { __ } from '~/locale'; export default { - cancelAction: { text: __('Cancel') }, directives: { SafeHtml: GlSafeHtmlDirective, }, @@ -36,6 +35,16 @@ export default { required: false, default: 'confirm', }, + cancelText: { + type: String, + required: false, + default: __('Cancel'), + }, + cancelVariant: { + type: String, + required: false, + default: 'default', + }, modalHtmlMessage: { type: String, required: false, @@ -71,7 +80,14 @@ export default { }; }, cancelAction() { - return this.hideCancel ? null : this.$options.cancelAction; + return this.hideCancel + ? null + : { + text: this.cancelText, + attributes: { + variant: this.cancelVariant, + }, + }; }, shouldShowHeader() { return Boolean(this.title?.length); diff --git a/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal.js b/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal.js index 1adb6f9c26f..173116062c9 100644 --- a/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal.js +++ b/app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal.js @@ -7,6 +7,8 @@ export function confirmAction( primaryBtnText, secondaryBtnVariant, secondaryBtnText, + cancelBtnVariant, + cancelBtnText, modalHtmlMessage, title, hideCancel, @@ -28,6 +30,8 @@ export function confirmAction( secondaryVariant: secondaryBtnVariant, primaryVariant: primaryBtnVariant, primaryText: primaryBtnText, + cancelVariant: cancelBtnVariant, + cancelText: cancelBtnText, title, modalHtmlMessage, hideCancel, |