Skip to content

Commit 465f7cb

Browse files
committed
Add confirmation warning
1 parent 675ef85 commit 465f7cb

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

packages/sprinkle-core/app/locale/en_US/messages.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
'DELETE_CONFIRM_YES' => 'Yes, delete',
9898
'DELETE_CONFIRM_NAMED' => 'Are you sure you want to delete {{user_name}}?',
9999
'DELETE_CONFIRM_YES_NAMED' => 'Yes, delete {{name}}',
100-
'DELETE_CANNOT_UNDONE' => 'This action cannot be undone.',
101100
'DELETE_NAMED' => 'Delete {{name}}',
102101
'DENY' => 'Deny',
103102
'DESCRIPTION' => 'Description',
@@ -118,8 +117,9 @@
118117
'PRINT' => 'Print',
119118
'REMOVE' => 'Remove',
120119
'UNACTIVATED' => 'Unactivated',
121-
'UNKNOWN' => 'Unknown',
120+
'UNKNOWN' => 'Unknown',
122121
'UPDATE' => 'Update',
123122
'VIEW' => 'View',
123+
'WARNING_CANNOT_UNDONE' => 'This action cannot be undone.',//OK
124124
'YES' => 'Yes',
125125
];

packages/sprinkle-core/app/locale/fr_FR/messages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
'DELETE_CONFIRM_YES' => 'Oui, supprimer',
9898
'DELETE_CONFIRM_NAMED' => 'Êtes-vous sûr de vouloir supprimer {{name}}?',
9999
'DELETE_CONFIRM_YES_NAMED' => 'Oui, supprimer {{name}}',
100-
'DELETE_CANNOT_UNDONE' => 'Cette action ne peut être annulée.',
101100
'DELETE_NAMED' => 'Supprimer {{name}}',
102101
'DENY' => 'Refuser',
103102
'DESCRIPTION' => 'Description',
@@ -121,5 +120,6 @@
121120
'UNKNOWN' => 'Inconnu',
122121
'UPDATE' => 'Mettre à jour',
123122
'VIEW' => 'Voir',
123+
'WARNING_CANNOT_UNDONE' => 'Cette action ne peut être annulée.',
124124
'YES' => 'Oui',
125125
];

packages/theme-pink-cupcake/src/components/Modals/UFModalConfirmation.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Modal Confirmation Component
44
*/
55
import { Severity } from '@userfrosting/sprinkle-core/interfaces'
6-
import { useTranslator } from '@userfrosting/sprinkle-core/stores'
7-
const { translate } = useTranslator()
86
97
/**
108
* Emits - Events emitted by the component buttons. Note closing the modal with
@@ -49,6 +47,7 @@ interface Props {
4947
cancelBtn?: boolean
5048
title?: string | null
5149
prompt?: string
50+
warning?: string
5251
}
5352
const {
5453
closable = false,
@@ -63,7 +62,8 @@ const {
6362
rejectSeverity = Severity.Default,
6463
cancelBtn = true,
6564
title = 'CONFIRMATION',
66-
prompt = 'CONFIRM_ACTION'
65+
prompt = 'CONFIRM_ACTION',
66+
warning = 'WARNING_CANNOT_UNDONE'
6767
} = defineProps<Props>()
6868
6969
/**
@@ -106,8 +106,13 @@ const btnClass = (severity: Severity) => {
106106
</template>
107107
<slot>
108108
<div class="uk-text-center">
109-
<p v-if="icon"><font-awesome-icon :icon="icon" class="uk-text-warning fa-4x" /></p>
109+
<p v-if="icon">
110+
<font-awesome-icon :icon="icon" class="uk-text-warning fa-4x" />
111+
</p>
110112
<slot name="prompt">{{ $t(prompt) }}</slot>
113+
<div class="uk-text-meta" v-if="warning">
114+
<slot name="warning">{{ $t(warning) }}</slot>
115+
</div>
111116
</div>
112117
</slot>
113118
<template #footer>

packages/theme-pink-cupcake/src/components/Pages/Admin/User/UserActivateModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const updateUser = (fieldName: string, value: string) => {
7777
:rejectIcon="null"
7878
:acceptSeverity="Severity.Success">
7979
<template #prompt>
80-
<p v-html="$t('USER.ACTIVATE_CONFIRM', props.user)"></p>
80+
<div v-html="$t('USER.ACTIVATE_CONFIRM', props.user)"></div>
8181
</template>
8282
</UFModalConfirmation>
8383

@@ -90,7 +90,7 @@ const updateUser = (fieldName: string, value: string) => {
9090
:rejectIcon="null"
9191
:acceptSeverity="Severity.Success">
9292
<template #prompt>
93-
<p v-html="$t('USER.DISABLE_CONFIRM', props.user)"></p>
93+
<div v-html="$t('USER.DISABLE_CONFIRM', props.user)"></div>
9494
</template>
9595
</UFModalConfirmation>
9696

@@ -103,7 +103,7 @@ const updateUser = (fieldName: string, value: string) => {
103103
:rejectIcon="null"
104104
:acceptSeverity="Severity.Success">
105105
<template #prompt>
106-
<p v-html="$t('USER.ENABLE_CONFIRM', props.user)"></p>
106+
<div v-html="$t('USER.ENABLE_CONFIRM', props.user)"></div>
107107
</template>
108108
</UFModalConfirmation>
109109
</template>

packages/theme-pink-cupcake/src/components/Pages/Admin/User/UserDeleteModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const deleteConfirmed = () => {
5353
:rejectIcon="null"
5454
:acceptSeverity="Severity.Danger">
5555
<template #prompt>
56-
<p v-html="$t('USER.DELETE_CONFIRM', props.user)"></p>
56+
<div v-html="$t('USER.DELETE_CONFIRM', props.user)"></div>
5757
</template>
5858
</UFModalConfirmation>
5959
</template>

0 commit comments

Comments
 (0)