@masterteam/work-center 0.0.54 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,8 +48,14 @@ class WorkCenterClientFormModal {
48
48
  : 'create', ...(ngDevMode ? [{ debugName: "formMode" }] : /* istanbul ignore next */ []));
49
49
  validationMessage = signal(null, ...(ngDevMode ? [{ debugName: "validationMessage" }] : /* istanbul ignore next */ []));
50
50
  submitError = signal(null, ...(ngDevMode ? [{ debugName: "submitError" }] : /* istanbul ignore next */ []));
51
- isSubmitting = signal(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : /* istanbul ignore next */ []));
52
51
  submitStatus = signal(null, ...(ngDevMode ? [{ debugName: "submitStatus" }] : /* istanbul ignore next */ []));
52
+ /**
53
+ * Mirrors the client form's own submit state instead of tracking it locally.
54
+ * A blocking `process-submit/validate` failure ends the submit without
55
+ * emitting `submitted` or `errored`, so a local flag would stay stuck at
56
+ * `true` and permanently disable Submit / keep the "Submitting…" hint up.
57
+ */
58
+ isSubmitting = computed(() => this.processForm().submitting(), ...(ngDevMode ? [{ debugName: "isSubmitting" }] : /* istanbul ignore next */ []));
53
59
  onSubmit() {
54
60
  this.validationMessage.set(null);
55
61
  this.submitError.set(null);
@@ -58,11 +64,9 @@ class WorkCenterClientFormModal {
58
64
  this.validationMessage.set(this.transloco.translate('workCenter.validation.fillRequiredFields'));
59
65
  return;
60
66
  }
61
- this.isSubmitting.set(true);
62
67
  this.processForm().submit();
63
68
  }
64
69
  onSubmitted(response) {
65
- this.isSubmitting.set(false);
66
70
  this.submitError.set(null);
67
71
  const status = response.status === 'PendingApproval' ? 'pending' : 'executed';
68
72
  this.submitStatus.set(status);
@@ -71,7 +75,6 @@ class WorkCenterClientFormModal {
71
75
  }
72
76
  }
73
77
  onErrored(error) {
74
- this.isSubmitting.set(false);
75
78
  this.submitError.set(error ??
76
79
  this.transloco.translate('workCenter.error.failedSubmit'));
77
80
  }