RecordDeleteConfirmDialog
Delete confirmation dialog with cascade relation management for related data.
Installation
pnpm dlx @docyrus/cli add @docyrus/rn-record-delete-confirm-dialogUsage
import { RecordDeleteConfirmDialog } from '@/components/docyrus-native/record-delete-confirm-dialog';
<RecordDeleteConfirmDialog
open={isOpen}
onOpenChange={setIsOpen}
recordCount={selectedIds.length}
relations={relations}
isLoadingRelations={relationsQuery.isLoading}
isPending={deleteMutation.isPending}
onConfirm={async (childActions) => {
await deleteMany(selectedIds, childActions); // { [dataSourceId]: 'keep' | 'delete' }
setIsOpen(false);
}}
/>The dialog is a bottom ActionSheet. Each related data source gets a Keep / Delete choice (plus Keep all / Delete all shortcuts). Every time the sheet opens — and when the relations finish loading while it is open — all choices reset to keep, so a previous session's selection never leaks into the next delete. Relations are de-duplicated by dataSourceId (a data source linked through two fields is listed once), and onConfirm always receives an entry for every listed data source. While isPending, both buttons are disabled and the sheet cannot be dismissed; while isLoadingRelations, the confirm button is disabled.
API Reference
RecordDeleteConfirmDialogProps
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controls sheet visibility. |
onOpenChange | (open: boolean) => void | — | Called on Cancel / backdrop / close (not while isPending). |
recordCount | number | — | Number of records being deleted (title + description). |
relations | DataSourceRelation[] | — | Related data sources that reference the records. De-duplicated by dataSourceId. |
isLoadingRelations | boolean | false | Shows a loading row and disables the confirm button. |
onConfirm | (childActions: Record<string, ChildAction>) => void | Promise<void> | — | Called with one keep / delete entry per related data source. |
isPending | boolean | false | Disables the buttons, shows t('ui.common.deleting', 'Deleting...') and blocks dismissal. |
className | string | — | Additional classes for the action sheet (native extra). |
DataSourceRelation
| Field | Type | Description |
|---|---|---|
dataSourceId | string | Unique identifier of the related data source (key of childActions). |
dataSourceName | string | Display name of the related data source. |
dataSourceSlug | string | Slug of the related data source. |
appSlug | string | Application slug. |
dataSourceType | string | Type of the data source. |
fieldId | string | ID of the linking field. |
fieldSlug | string | Slug of the linking field. |
fieldName | string | Display name of the linking field (shown as "via …"). |
fieldType | string | Type of the linking field. |
ChildAction
type ChildAction = 'keep' | 'delete';keep removes the relation and keeps the related records; delete deletes them together with the parent.
Translation keys
| Key | English fallback |
|---|---|
ui.recordDeleteConfirmDialog.titleOne / titleMany | Delete this record? / Delete {count} records? |
ui.recordDeleteConfirmDialog.descriptionOne / descriptionMany | This will permanently delete this record. … / This will permanently delete {count} records. … |
ui.recordDeleteConfirmDialog.loadingRelations | Loading related data... |
ui.recordDeleteConfirmDialog.relatedData | Related data |
ui.recordDeleteConfirmDialog.keepAll / deleteAll | Keep all / Delete all |
ui.recordDeleteConfirmDialog.keep | Keep |
ui.recordDeleteConfirmDialog.via | via {field} |
ui.common.cancel / ui.common.delete / ui.common.deleting | Cancel / Delete / Deleting... |
Components
| Component | Description |
|---|---|
RecordDeleteConfirmDialog | Bottom-sheet delete confirmation with per-relation cascade choices. |
Type Exports
| Type | Description |
|---|---|
RecordDeleteConfirmDialogProps | Props for RecordDeleteConfirmDialog. |
DataSourceRelation | Related data source information. |
ChildAction | 'keep' | 'delete'. |
Breaking changes
- Choices now reset to
keepevery time the dialog opens (previously the last selection was kept). - The confirm button is disabled while
isLoadingRelations. onConfirmmay return a Promise (widening — existing handlers keep working).- The single-record title changed from "Delete 1 record?" to "Delete this record?"; all copy is translatable through the keys above.
RecordActivityPanel
Timeline of a record's Docyrus activity log with per-operation icons, tenant-aware timestamps and translatable copy.
Record PDF Export
Three-step wizard (Select a Template → Preview → PDF) that renders a Docyrus record to PDF with a saved HTML template, previews the server-compiled document in a WebView, and shares or prints the result. Includes the headless useDocyrusRecordPdfExport hook.