Skip to content

Commit

Permalink
feat: reset form after document is sent (#1993)
Browse files Browse the repository at this point in the history
The form gets fully reloaded after the sidebar is closed. The same fix
applied for the Document Create form.

Solves: PZ-3740
  • Loading branch information
infonl-marcel authored Nov 5, 2024
1 parent a308ef2 commit c3ec50d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export class InformatieObjectCreateAttendedComponent
window.open(documentCreatieResponse.redirectURL);
this.sideNav.close();
this.document.emit(documentCreateData);
this.form.reset();
this.sideNav.close();
} else {
this.dialog.open(NotificationDialogComponent, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { DocumentVerzendGegevens } from "../model/document-verzend-gegevens";
export class InformatieObjectVerzendenComponent implements OnInit, OnChanges {
@Input() zaak: Zaak;
@Input() sideNav: MatDrawer;
@Output() documentVerzonden = new EventEmitter<void>();
@Output() documentSent = new EventEmitter<void>();

@ViewChild(FormComponent) form: FormComponent;

Expand Down Expand Up @@ -110,7 +110,7 @@ export class InformatieObjectVerzendenComponent implements OnInit, OnChanges {
? "msg.documenten.verzenden.uitgevoerd"
: "msg.document.verzenden.uitgevoerd",
);
this.documentVerzonden.emit();
this.documentSent.emit();
this.sideNav.close();
});
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/main/app/src/app/zaken/zaak-view/zaak-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*ngSwitchCase="sideNavAction.DOCUMENT_MAKEN"
[sideNav]="actionsSidenav"
[zaak]="zaak"
(document)="documentToegevoegd()"
(document)="documentCreated()"
></zac-informatie-object-create-attended>
<zac-informatie-object-add
*ngSwitchCase="sideNavAction.DOCUMENT_TOEVOEGEN"
Expand All @@ -70,7 +70,7 @@
*ngSwitchCase="sideNavAction.DOCUMENT_VERZENDEN"
[sideNav]="actionsSidenav"
[zaak]="zaak"
(documentVerzonden)="updateZaak()"
(documentSent)="documentSent()"
></zac-informatie-verzenden>
<zac-human-task-do
*ngSwitchCase="sideNavAction.TAAK_STARTEN"
Expand Down
20 changes: 15 additions & 5 deletions src/main/app/src/app/zaken/zaak-view/zaak-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,11 @@ export class ZaakViewComponent
SessionStorageUtil.setItem("toonAfgerondeTaken", this.toonAfgerondeTaken);
}

sluitSidenav(): void {
this.action = null;
this.actionsSidenav.close();
}

taakGestart(): void {
this.actiefPlanItem = null;
this.sluitSidenav();
Expand All @@ -1311,11 +1316,6 @@ export class ZaakViewComponent
this.updateZaak();
}

sluitSidenav(): void {
this.action = null;
this.actionsSidenav.close();
}

mailVerstuurd(mailVerstuurd: boolean): void {
this.sluitSidenav();
if (mailVerstuurd) {
Expand All @@ -1334,6 +1334,16 @@ export class ZaakViewComponent
this.updateZaak();
}

documentCreated(): void {
this.sluitSidenav();
this.updateZaak();
}

documentSent(): void {
this.sluitSidenav();
this.updateZaak();
}

startZaakOntkoppelenDialog(gerelateerdeZaak: GerelateerdeZaak): void {
const zaakOntkoppelGegevens: ZaakOntkoppelGegevens =
new ZaakOntkoppelGegevens();
Expand Down

0 comments on commit c3ec50d

Please sign in to comment.