Browse Source

feat(lib): destructure parameters in alert and confirmation dialogs

pull/6305/head
Kenrick Tandrian 2 months ago
parent
commit
2c7de6656a
  1. 8
      libs/ui/src/lib/notifications/alert-dialog/alert-dialog.component.ts
  2. 18
      libs/ui/src/lib/notifications/confirmation-dialog/confirmation-dialog.component.ts

8
libs/ui/src/lib/notifications/alert-dialog/alert-dialog.component.ts

@ -18,9 +18,9 @@ export class GfAlertDialogComponent {
protected readonly dialogRef =
inject<MatDialogRef<GfAlertDialogComponent>>(MatDialogRef);
public initialize(aParams: AlertDialogParams) {
this.discardLabel = aParams.discardLabel;
this.message = aParams.message;
this.title = aParams.title;
public initialize({ discardLabel, message, title }: AlertDialogParams) {
this.discardLabel = discardLabel;
this.message = message;
this.title = title;
}
}

18
libs/ui/src/lib/notifications/confirmation-dialog/confirmation-dialog.component.ts

@ -29,11 +29,17 @@ export class GfConfirmationDialogComponent {
}
}
public initialize(aParams: ConfirmDialogParams) {
this.confirmLabel = aParams.confirmLabel;
this.confirmType = aParams.confirmType;
this.discardLabel = aParams.discardLabel;
this.message = aParams.message;
this.title = aParams.title;
public initialize({
confirmLabel,
confirmType,
discardLabel,
message,
title
}: ConfirmDialogParams) {
this.confirmLabel = confirmLabel;
this.confirmType = confirmType;
this.discardLabel = discardLabel;
this.message = message;
this.title = title;
}
}

Loading…
Cancel
Save