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 = protected readonly dialogRef =
inject<MatDialogRef<GfAlertDialogComponent>>(MatDialogRef); inject<MatDialogRef<GfAlertDialogComponent>>(MatDialogRef);
public initialize(aParams: AlertDialogParams) { public initialize({ discardLabel, message, title }: AlertDialogParams) {
this.discardLabel = aParams.discardLabel; this.discardLabel = discardLabel;
this.message = aParams.message; this.message = message;
this.title = aParams.title; 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) { public initialize({
this.confirmLabel = aParams.confirmLabel; confirmLabel,
this.confirmType = aParams.confirmType; confirmType,
this.discardLabel = aParams.discardLabel; discardLabel,
this.message = aParams.message; message,
this.title = aParams.title; title
}: ConfirmDialogParams) {
this.confirmLabel = confirmLabel;
this.confirmType = confirmType;
this.discardLabel = discardLabel;
this.message = message;
this.title = title;
} }
} }

Loading…
Cancel
Save