Skip to content

Commit

Permalink
enh: add cancel button to confirmation dialog
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M. <[email protected]>
  • Loading branch information
enjeck committed Dec 13, 2024
1 parent 78bbc66 commit 807390d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/modules/sidebar/partials/ShareList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
:title="t('tables', 'Confirm table manager promotion')"
:cancel-title="t('tables', 'Cancel')"
:confirm-title="t('tables', 'Promote to table manager')"
confirm-class="error"
confirm-class="warning"
:show-modal="showModal"
@confirm="promoteToManager"
@cancel="showModal=false" />
Expand Down
25 changes: 20 additions & 5 deletions src/shared/modals/DialogConfirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<NcModal v-if="showModal" @close="$emit('cancel')">
<NcModal v-if="showModal" :name="t('tables', 'Confirm action')" @close="$emit('cancel')">
<div class="modal__content">
<div class="row">
<div v-if="title" class="col-4">
Expand All @@ -14,10 +14,17 @@
</div>
</div>
<div class="row space-T">
<div class="fix-col-4 end">
<NcButton :type="confirmClass" :aria-label="confirmTitle" @click="$emit('confirm')">
{{ confirmTitle }}
</NcButton>
<div class="fix-col-4 space-T justify-between">
<div>
<NcButton :aria-label="cancelTitle" @click="$emit('cancel')">
{{ cancelTitle }}
</NcButton>
</div>
<div>
<NcButton :type="confirmClass" :aria-label="confirmTitle" @click="$emit('confirm')">
{{ confirmTitle }}
</NcButton>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -46,6 +53,14 @@ export default {
type: String,
default: null,
},
cancelTitle: {
type: String,
default: t('tables', 'Cancel'),
},
cancelClass: {
type: String,
default: 'tertiary',
},
confirmTitle: {
type: String,
default: t('tables', 'Confirm'),
Expand Down

0 comments on commit 807390d

Please sign in to comment.