@eric-emg/symphiq-components 1.2.156 → 1.2.158

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.
@@ -52988,6 +52988,11 @@ class SymphiqCreateAccountDashboardComponent {
52988
52988
  this.initializeFocusAreasMap();
52989
52989
  effect(() => {
52990
52990
  const data = this.accountData();
52991
+ if (data && (this.editMode() || this.focusAreasEditMode()) && this.isLoading()) {
52992
+ this.editMode.set(false);
52993
+ this.focusAreasEditMode.set(false);
52994
+ this.isLoading.set(false);
52995
+ }
52991
52996
  if (data && !this.editMode() && !this.focusAreasEditMode()) {
52992
52997
  this.accountForm.patchValue(data);
52993
52998
  if (data.shopName === data.companyName) {
@@ -53076,7 +53081,7 @@ class SymphiqCreateAccountDashboardComponent {
53076
53081
  if (this.isLoading())
53077
53082
  return false;
53078
53083
  if (this.focusAreasEditMode()) {
53079
- return this.allFocusAreasAnswered();
53084
+ return this.allFocusAreasAnswered() && this.focusAreasChanged();
53080
53085
  }
53081
53086
  if (!this.isFormValid())
53082
53087
  return false;
@@ -53096,7 +53101,6 @@ class SymphiqCreateAccountDashboardComponent {
53096
53101
  focusAreaDetails: this.getFocusAreaDetailsFromMap()
53097
53102
  };
53098
53103
  this.onCreateAccount.emit(formData);
53099
- this.editMode.set(false);
53100
53104
  }
53101
53105
  }
53102
53106
  handleSaveFocusAreas() {
@@ -53107,7 +53111,6 @@ class SymphiqCreateAccountDashboardComponent {
53107
53111
  focusAreaDetails: this.getFocusAreaDetailsFromMap()
53108
53112
  };
53109
53113
  this.onCreateAccount.emit(formData);
53110
- this.focusAreasEditMode.set(false);
53111
53114
  }
53112
53115
  }
53113
53116
  initializeFocusAreasMap() {
@@ -53192,6 +53195,23 @@ class SymphiqCreateAccountDashboardComponent {
53192
53195
  }
53193
53196
  this.focusAreasEditMode.set(false);
53194
53197
  }
53198
+ focusAreasChanged() {
53199
+ if (!this.originalFocusAreasMap)
53200
+ return false;
53201
+ const current = this.focusAreasMap();
53202
+ for (const [domain, originalValue] of this.originalFocusAreasMap) {
53203
+ const currentValue = current.get(domain);
53204
+ if (!currentValue)
53205
+ return true;
53206
+ if (originalValue.status !== currentValue.status)
53207
+ return true;
53208
+ if (originalValue.tools.length !== currentValue.tools.length)
53209
+ return true;
53210
+ if (!originalValue.tools.every((tool, i) => currentValue.tools[i] === tool))
53211
+ return true;
53212
+ }
53213
+ return false;
53214
+ }
53195
53215
  isLightMode() {
53196
53216
  return this.viewMode() === ViewModeEnum.LIGHT;
53197
53217
  }