Skip to content

Commit

Permalink
fix: prevent validation error when closing dialogs (#1617)
Browse files Browse the repository at this point in the history
* do not show validation error after submitting the wish list/order template form
* do not show validation error after saving data when rejecting a requisition in dialogs
  • Loading branch information
SGrueber authored Mar 27, 2024
1 parent 4e06b47 commit f14f8aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ export class RequisitionRejectDialogComponent implements OnInit {

/** Opens the modal. */
show() {
this.rejectForm.reset();
this.modal = this.ngbModal.open(this.modalTemplate);
}

/** Close the modal. */
hide() {
this.rejectForm.reset();
this.submitted = false;
if (this.modal) {
this.modal.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,13 @@ export class OrderTemplatePreferencesDialogComponent implements OnInit {

/** Opens the modal. */
show() {
if (this.orderTemplate) {
this.model = pick(this.orderTemplate, 'title');
}
this.orderTemplateForm.reset();
this.model = pick(this.orderTemplate, 'title');
this.modal = this.ngbModal.open(this.modalTemplate);
}

/** Close the modal. */
hide() {
this.orderTemplateForm.reset({});
this.submitted = false;
if (this.modal) {
this.modal.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class WishlistPreferencesDialogComponent implements OnInit {

/** Opens the modal. */
show() {
this.wishListForm.reset();
if (!this.wishlist) {
this.model = { preferred: false };
} else {
Expand All @@ -136,7 +137,6 @@ export class WishlistPreferencesDialogComponent implements OnInit {

/** Close the modal. */
hide() {
this.wishListForm.reset();
this.submitted = false;
if (this.modal) {
this.modal.close();
Expand Down

0 comments on commit f14f8aa

Please sign in to comment.