Refactor confirmation dialogs to standardize button labels and styles across components (#2560)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
@@ -673,6 +673,14 @@ export class BookBrowserComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
icon: 'pi pi-image',
|
icon: 'pi pi-image',
|
||||||
acceptLabel: 'Yes',
|
acceptLabel: 'Yes',
|
||||||
rejectLabel: 'No',
|
rejectLabel: 'No',
|
||||||
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
|
severity: 'success'
|
||||||
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'No',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.regenerateCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
this.bookService.regenerateCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
@@ -705,6 +713,14 @@ export class BookBrowserComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
icon: 'pi pi-palette',
|
icon: 'pi pi-palette',
|
||||||
acceptLabel: 'Yes',
|
acceptLabel: 'Yes',
|
||||||
rejectLabel: 'No',
|
rejectLabel: 'No',
|
||||||
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
|
severity: 'success'
|
||||||
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'No',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.generateCustomCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
this.bookService.generateCustomCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
|
|||||||
@@ -442,6 +442,14 @@ export class SeriesPageComponent implements OnDestroy {
|
|||||||
icon: 'pi pi-image',
|
icon: 'pi pi-image',
|
||||||
acceptLabel: 'Yes',
|
acceptLabel: 'Yes',
|
||||||
rejectLabel: 'No',
|
rejectLabel: 'No',
|
||||||
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
|
severity: 'success'
|
||||||
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'No',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.regenerateCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
this.bookService.regenerateCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
@@ -474,6 +482,14 @@ export class SeriesPageComponent implements OnDestroy {
|
|||||||
icon: 'pi pi-palette',
|
icon: 'pi pi-palette',
|
||||||
acceptLabel: 'Yes',
|
acceptLabel: 'Yes',
|
||||||
rejectLabel: 'No',
|
rejectLabel: 'No',
|
||||||
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
|
severity: 'success'
|
||||||
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'No',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.bookService.generateCustomCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
this.bookService.generateCustomCoversForBooks(Array.from(this.selectedBooks)).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
|
|||||||
@@ -95,6 +95,14 @@ export class BookMenuService {
|
|||||||
icon: 'pi pi-exclamation-triangle',
|
icon: 'pi pi-exclamation-triangle',
|
||||||
acceptLabel: 'Yes',
|
acceptLabel: 'Yes',
|
||||||
rejectLabel: 'No',
|
rejectLabel: 'No',
|
||||||
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
|
severity: 'success'
|
||||||
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'No',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
const loader = this.loadingService.show(`Updating read status for ${count} book(s)...`);
|
const loader = this.loadingService.show(`Updating read status for ${count} book(s)...`);
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ export class LibraryShelfMenuService {
|
|||||||
this.confirmationService.confirm({
|
this.confirmationService.confirm({
|
||||||
message: `Are you sure you want to delete library: ${entity?.name}?`,
|
message: `Are you sure you want to delete library: ${entity?.name}?`,
|
||||||
header: 'Confirmation',
|
header: 'Confirmation',
|
||||||
|
acceptLabel: 'Yes',
|
||||||
|
rejectLabel: 'Cancel',
|
||||||
rejectButtonProps: {
|
rejectButtonProps: {
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
severity: 'secondary',
|
severity: 'secondary',
|
||||||
@@ -183,9 +185,16 @@ export class LibraryShelfMenuService {
|
|||||||
this.confirmationService.confirm({
|
this.confirmationService.confirm({
|
||||||
message: `Are you sure you want to delete shelf: ${entity?.name}?`,
|
message: `Are you sure you want to delete shelf: ${entity?.name}?`,
|
||||||
header: 'Confirmation',
|
header: 'Confirmation',
|
||||||
|
acceptLabel: 'Yes',
|
||||||
|
rejectLabel: 'Cancel',
|
||||||
acceptButtonProps: {
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
severity: 'danger'
|
severity: 'danger'
|
||||||
},
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'Cancel',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.shelfService.deleteShelf(entity?.id!).subscribe({
|
this.shelfService.deleteShelf(entity?.id!).subscribe({
|
||||||
complete: () => {
|
complete: () => {
|
||||||
@@ -237,9 +246,16 @@ export class LibraryShelfMenuService {
|
|||||||
this.confirmationService.confirm({
|
this.confirmationService.confirm({
|
||||||
message: `Are you sure you want to delete magic shelf: ${entity?.name}?`,
|
message: `Are you sure you want to delete magic shelf: ${entity?.name}?`,
|
||||||
header: 'Confirmation',
|
header: 'Confirmation',
|
||||||
|
acceptLabel: 'Yes',
|
||||||
|
rejectLabel: 'Cancel',
|
||||||
acceptButtonProps: {
|
acceptButtonProps: {
|
||||||
|
label: 'Yes',
|
||||||
severity: 'danger'
|
severity: 'danger'
|
||||||
},
|
},
|
||||||
|
rejectButtonProps: {
|
||||||
|
label: 'Cancel',
|
||||||
|
severity: 'secondary'
|
||||||
|
},
|
||||||
accept: () => {
|
accept: () => {
|
||||||
this.magicShelfService.deleteShelf(entity?.id!).subscribe({
|
this.magicShelfService.deleteShelf(entity?.id!).subscribe({
|
||||||
complete: () => {
|
complete: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user