Add clear warning when deleting books that files will be permanently removed (#2438)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
@@ -454,9 +454,15 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
|
|||||||
|
|
||||||
confirmDeleteBooks(): void {
|
confirmDeleteBooks(): void {
|
||||||
this.confirmationService.confirm({
|
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',
|
header: 'Confirm Deletion',
|
||||||
icon: 'pi pi-exclamation-triangle',
|
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: () => {
|
accept: () => {
|
||||||
const count = this.selectedBooks.size;
|
const count = this.selectedBooks.size;
|
||||||
const loader = this.loadingService.show(`Deleting ${count} book(s)...`);
|
const loader = this.loadingService.show(`Deleting ${count} book(s)...`);
|
||||||
|
|||||||
+8
-2
@@ -303,12 +303,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
icon: 'pi pi-trash',
|
icon: 'pi pi-trash',
|
||||||
command: () => {
|
command: () => {
|
||||||
this.confirmationService.confirm({
|
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',
|
header: 'Confirm Deletion',
|
||||||
icon: 'pi pi-exclamation-triangle',
|
icon: 'pi pi-exclamation-triangle',
|
||||||
acceptIcon: 'pi pi-trash',
|
acceptIcon: 'pi pi-trash',
|
||||||
rejectIcon: 'pi pi-times',
|
rejectIcon: 'pi pi-times',
|
||||||
|
acceptLabel: 'Delete',
|
||||||
|
rejectLabel: 'Cancel',
|
||||||
acceptButtonStyleClass: 'p-button-danger',
|
acceptButtonStyleClass: 'p-button-danger',
|
||||||
|
rejectButtonStyleClass: 'p-button-outlined',
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.deleteBooks(new Set([this.book.id])).subscribe();
|
this.bookService.deleteBooks(new Set([this.book.id])).subscribe();
|
||||||
}
|
}
|
||||||
@@ -622,12 +625,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
icon: 'pi pi-book',
|
icon: 'pi pi-book',
|
||||||
command: () => {
|
command: () => {
|
||||||
this.confirmationService.confirm({
|
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',
|
header: 'Confirm Deletion',
|
||||||
icon: 'pi pi-exclamation-triangle',
|
icon: 'pi pi-exclamation-triangle',
|
||||||
acceptIcon: 'pi pi-trash',
|
acceptIcon: 'pi pi-trash',
|
||||||
rejectIcon: 'pi pi-times',
|
rejectIcon: 'pi pi-times',
|
||||||
|
acceptLabel: 'Delete',
|
||||||
|
rejectLabel: 'Cancel',
|
||||||
acceptButtonStyleClass: 'p-button-danger',
|
acceptButtonStyleClass: 'p-button-danger',
|
||||||
|
rejectButtonStyleClass: 'p-button-outlined',
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.deleteBooks(new Set([this.book.id])).subscribe();
|
this.bookService.deleteBooks(new Set([this.book.id])).subscribe();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,9 +370,15 @@ export class SeriesPageComponent implements OnDestroy {
|
|||||||
|
|
||||||
confirmDeleteBooks(): void {
|
confirmDeleteBooks(): void {
|
||||||
this.confirmationService.confirm({
|
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',
|
header: 'Confirm Deletion',
|
||||||
icon: 'pi pi-exclamation-triangle',
|
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: () => {
|
accept: () => {
|
||||||
const count = this.selectedBooks.size;
|
const count = this.selectedBooks.size;
|
||||||
const loader = this.loadingService.show(`Deleting ${count} book(s)...`);
|
const loader = this.loadingService.show(`Deleting ${count} book(s)...`);
|
||||||
|
|||||||
+4
-1
@@ -235,12 +235,15 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
|
|||||||
icon: 'pi pi-trash',
|
icon: 'pi pi-trash',
|
||||||
command: () => {
|
command: () => {
|
||||||
this.confirmationService.confirm({
|
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',
|
header: 'Confirm Deletion',
|
||||||
icon: 'pi pi-exclamation-triangle',
|
icon: 'pi pi-exclamation-triangle',
|
||||||
acceptIcon: 'pi pi-trash',
|
acceptIcon: 'pi pi-trash',
|
||||||
rejectIcon: 'pi pi-times',
|
rejectIcon: 'pi pi-times',
|
||||||
|
acceptLabel: 'Delete',
|
||||||
|
rejectLabel: 'Cancel',
|
||||||
acceptButtonStyleClass: 'p-button-danger',
|
acceptButtonStyleClass: 'p-button-danger',
|
||||||
|
rejectButtonStyleClass: 'p-button-outlined',
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.deleteBooks(new Set([book.id])).subscribe({
|
this.bookService.deleteBooks(new Set([book.id])).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
|
|||||||
@@ -115,3 +115,18 @@
|
|||||||
margin: 0.25rem 0;
|
margin: 0.25rem 0;
|
||||||
flex-shrink: 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user