diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts index b20d8837f..4db4f640d 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts @@ -454,9 +454,15 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { confirmDeleteBooks(): void { this.confirmationService.confirm({ - message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?`, + message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?\n\nThis will permanently remove the book files from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', + acceptIcon: 'pi pi-trash', + rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', + acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { const count = this.selectedBooks.size; const loader = this.loadingService.show(`Deleting ${count} book(s)...`); diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts index 1cff90d0a..b459effe9 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts @@ -303,12 +303,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { icon: 'pi pi-trash', command: () => { this.confirmationService.confirm({ - message: `Are you sure you want to delete "${this.book.metadata?.title}"?`, + message: `Are you sure you want to delete "${this.book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', acceptIcon: 'pi pi-trash', rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { this.bookService.deleteBooks(new Set([this.book.id])).subscribe(); } @@ -622,12 +625,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { icon: 'pi pi-book', command: () => { this.confirmationService.confirm({ - message: `Are you sure you want to delete "${this.book.metadata?.title}"?`, + message: `Are you sure you want to delete "${this.book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', acceptIcon: 'pi pi-trash', rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { this.bookService.deleteBooks(new Set([this.book.id])).subscribe(); } diff --git a/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts b/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts index 2138460d9..a5625f8da 100644 --- a/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts +++ b/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts @@ -370,9 +370,15 @@ export class SeriesPageComponent implements OnDestroy { confirmDeleteBooks(): void { this.confirmationService.confirm({ - message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?`, + message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?\n\nThis will permanently remove the book files from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', + acceptIcon: 'pi pi-trash', + rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', + acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { const count = this.selectedBooks.size; const loader = this.loadingService.show(`Deleting ${count} book(s)...`); diff --git a/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts b/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts index b48c451ef..7a78da7d8 100644 --- a/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts +++ b/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts @@ -235,12 +235,15 @@ export class MetadataViewerComponent implements OnInit, OnChanges { icon: 'pi pi-trash', command: () => { this.confirmationService.confirm({ - message: `Are you sure you want to delete "${book.metadata?.title}"?`, + message: `Are you sure you want to delete "${book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', acceptIcon: 'pi pi-trash', rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { this.bookService.deleteBooks(new Set([book.id])).subscribe({ next: () => { diff --git a/booklore-ui/src/assets/layout/styles/global.scss b/booklore-ui/src/assets/layout/styles/global.scss index eddc5ae5e..82a424086 100644 --- a/booklore-ui/src/assets/layout/styles/global.scss +++ b/booklore-ui/src/assets/layout/styles/global.scss @@ -115,3 +115,18 @@ margin: 0.25rem 0; flex-shrink: 0; } + +// ============================================================================= +// Confirmation Dialog Styles +// ============================================================================= + +.p-confirmdialog { + max-width: 500px; + width: 90vw; + + .p-confirmdialog-message { + white-space: pre-line; + word-wrap: break-word; + overflow-wrap: break-word; + } +}