Skip to content

Commit

Permalink
PMW-29: Add Opslaan & sluiten knop
Browse files Browse the repository at this point in the history
  • Loading branch information
geertplaisier committed Jun 19, 2024
1 parent 3c1ae6f commit 650ce60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@
mat-flat-button>Verwijder plan</button>
<div class="divider"></div>
<button (click)="cancel()" mat-flat-button>Annuleren</button>
<button (click)="save()"
[disabled]="(disableSave$ | async) || saving()"
color="primary"
mat-flat-button>
<button (click)="save()" [disabled]="(disableSave$ | async) || saving()" color="primary" mat-flat-button>
@if (saving()) {
<mat-spinner diameter="20"></mat-spinner>
} @else {
Opslaan
}
</button>
<button (click)="save(true)" [disabled]="(disableSave$ | async) || saving()" color="primary" mat-flat-button>
@if (saving()) {
<mat-spinner diameter="20"></mat-spinner>
} @else {
Opslaan & sluiten
}
</button>
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class PlanregistratieDialogComponent {
this.planregistratieService.updatePlan(updatedPlan);
}

public save() {
public save(closeAfterSaving?: boolean) {
this.saving.set(true);
this.planregistratieService.save$().subscribe(success => {
this.saving.set(false);
Expand All @@ -83,6 +83,9 @@ export class PlanregistratieDialogComponent {
showCloseButton: true,
};
SnackBarMessageComponent.open$(this.matSnackBar, config).subscribe();
if (success && closeAfterSaving) {
this.cancel();
}
});
}

Expand Down

0 comments on commit 650ce60

Please sign in to comment.