Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ui/src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export default {
'delegate.write': 'Write',
'delegate.adminHelp': 'With the administration security level on this resource, the receivers of this delegation can create other delegations to share this access with other valid receivers',
'delegate.writeHelp': 'With the write security level, the receivers of this delegation can modify the members of the involved groups. Without this access, this delegation grants read-only rights',
// Fragments wrapping the receiver name in bold red on the delete
// confirmation (issue #37). The host keeps the monolithic
// `delegate.deleteConfirm` key intact.
'delegate.deleteConfirmBefore': 'Are you sure you want to delete the delegation for ',
'delegate.deleteConfirmAfter': '?',
'user.deleteConfirmBefore': 'Are you sure you want to delete ',
'user.deleteConfirmAfter': '?',
'group.deleteConfirmBefore': 'Are you sure you want to delete ',
Expand Down
5 changes: 5 additions & 0 deletions ui/src/i18n/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export default {
'delegate.write': 'Écriture',
'delegate.adminHelp': 'Avec le niveau de sécurité d\'administration sur cette ressource, les receveurs de cette délégation peuvent créer d\'autres délégations pour partager cet accès avec d\'autres receveurs valides',
'delegate.writeHelp': 'Avec le niveau de sécurité d\'écriture, les receveurs de cette délégation peuvent modifier les membres des groupes impliqués. Sans cet accès cette délégation ne donne qu\'un droit de lecture',
// Fragments encadrant le nom du destinataire en gras-rouge dans la
// confirmation de suppression (issue #37). Le host garde la clé
// monolithique `delegate.deleteConfirm` intacte.
'delegate.deleteConfirmBefore': 'Êtes-vous certain de supprimer la délégation pour ',
'delegate.deleteConfirmAfter': ' ?',
'user.deleteConfirmBefore': 'Êtes-vous certain de supprimer ',
'user.deleteConfirmAfter': ' ?',
'group.deleteConfirmBefore': 'Êtes-vous certain de supprimer ',
Expand Down
12 changes: 10 additions & 2 deletions ui/src/views/DelegateEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,16 @@
</v-card>
</v-dialog>

<LigojConfirmDialog v-model="confirmDelete" :title="t('delegate.deleteTitle')" :message="t('delegate.deleteConfirm', { name: form.receiver })" :confirm-label="t('common.delete')"
confirm-color="error" :loading="deleting" @confirm="remove" />
<!-- Receiver name rendered in bold red via the LigojConfirmDialog
default slot, mirroring the User/Group/Company/GroupMembers
confirmation pattern. The host's monolithic
`delegate.deleteConfirm` key stays intact for any other
consumer; we just use two plugin-local fragments around the
name. -->
<LigojConfirmDialog v-model="confirmDelete" :title="t('delegate.deleteTitle')" :confirm-label="t('common.delete')"
confirm-color="error" :loading="deleting" @confirm="remove">
{{ t('delegate.deleteConfirmBefore') }}<strong class="text-error">{{ form.receiver }}</strong>{{ t('delegate.deleteConfirmAfter') }}
</LigojConfirmDialog>

<!-- Unsaved-changes guard. Triggered either by a dialog close request
(Cancel / Esc / scrim) or by useFormGuard's onBeforeRouteLeave
Expand Down
29 changes: 15 additions & 14 deletions ui/src/views/DelegateListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,20 @@
{{ t('delegate.empty') }}
</v-alert>

<v-dialog v-model="deleteDialog" max-width="400">
<v-card>
<v-card-title>{{ t('delegate.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('delegate.deleteConfirm', { name: deleteTarget?.receiver?.name || deleteTarget?.name || deleteTarget?.id }) }}
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn variant="text" @click="deleteDialog = false">{{ t('common.cancel') }}</v-btn>
<v-btn color="error" variant="elevated" :loading="deleting" @click="confirmDelete">{{ t('common.delete') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- Receiver name rendered in bold red via the LigojConfirmDialog
default slot (issue #37), matching the pattern of PR #39
for User / Company / Group / GroupMembers and the in-popup
delete confirmation of DelegateEditDialog. -->
<LigojConfirmDialog
v-model="deleteDialog"
:title="t('delegate.deleteTitle')"
:confirm-label="t('common.delete')"
confirm-color="error"
:loading="deleting"
@confirm="confirmDelete"
>
{{ t('delegate.deleteConfirmBefore') }}<strong class="text-error">{{ deleteTarget?.receiver?.name || deleteTarget?.name || deleteTarget?.id }}</strong>{{ t('delegate.deleteConfirmAfter') }}
</LigojConfirmDialog>

<v-dialog v-model="bulkDeleteDialog" max-width="400">
<v-card>
Expand All @@ -100,7 +101,7 @@

<script setup>
import { ref, computed, onMounted } from 'vue'
import { useDataTable, useApi, useAppStore, useI18nStore, LigojDataTableServer } from '@ligoj/host'
import { useDataTable, useApi, useAppStore, useI18nStore, LigojDataTableServer, LigojConfirmDialog } from '@ligoj/host'
import DelegateEditDialog from './DelegateEditDialog.vue'
import { TYPE_ICONS } from '../composables/delegateTypes.js'

Expand Down
Loading