diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-05 18:08:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-05 18:08:37 +0300 |
commit | 4001deba7325ebf380f0d60038107e56a3c7e2c3 (patch) | |
tree | 89af01b4676aa4be29a63e5b481f41fb91ec2320 /app/assets/javascripts/lib | |
parent | 7e964f54ed3dd08ed528481843ba1972684335dc (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 | 23 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal.js | 12 |
2 files changed, 34 insertions, 1 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 fd52c498ee0..a7fb322174b 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 @@ -26,6 +26,16 @@ export default { required: false, default: 'confirm', }, + secondaryText: { + type: String, + required: false, + default: '', + }, + secondaryVariant: { + type: String, + required: false, + default: 'confirm', + }, modalHtmlMessage: { type: String, required: false, @@ -47,6 +57,18 @@ export default { }, }; }, + secondaryAction() { + if (!this.secondaryText) { + return null; + } + + return { + text: this.secondaryText, + attributes: { + variant: this.secondaryVariant, + }, + }; + }, cancelAction() { return this.hideCancel ? null : this.$options.cancelAction; }, @@ -69,6 +91,7 @@ export default { :title="title" :action-primary="primaryAction" :action-cancel="cancelAction" + :action-secondary="secondaryAction" :hide-header="!shouldShowHeader" @primary="$emit('confirmed')" @hidden="$emit('closed')" 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 a8a89d0644a..1adb6f9c26f 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 @@ -2,7 +2,15 @@ import Vue from 'vue'; export function confirmAction( message, - { primaryBtnVariant, primaryBtnText, modalHtmlMessage, title, hideCancel } = {}, + { + primaryBtnVariant, + primaryBtnText, + secondaryBtnVariant, + secondaryBtnText, + modalHtmlMessage, + title, + hideCancel, + } = {}, ) { return new Promise((resolve) => { let confirmed = false; @@ -16,6 +24,8 @@ export function confirmAction( 'confirm-modal', { props: { + secondaryText: secondaryBtnText, + secondaryVariant: secondaryBtnVariant, primaryVariant: primaryBtnVariant, primaryText: primaryBtnText, title, |