@masterteam/properties 0.0.65 → 0.0.66

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, computed, viewChild, input, linkedSignal, signal, Component, DestroyRef, effect, forwardRef, ChangeDetectionStrategy, EnvironmentInjector, ViewContainerRef, ViewChild } from '@angular/core';
2
+ import { inject, Injectable, computed, viewChild, input, linkedSignal, signal, Component, DestroyRef, effect, forwardRef, ChangeDetectionStrategy, EnvironmentInjector, untracked, ViewContainerRef, ViewChild } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import { Table } from '@masterteam/components/table';
5
5
  import { Router, ActivatedRoute } from '@angular/router';
@@ -2657,7 +2657,10 @@ class PropertyForm {
2657
2657
  effect(() => {
2658
2658
  const defaultViewType = this.facade.defaultViewType();
2659
2659
  if (!this.propertyId() && defaultViewType) {
2660
- this.mainControl.patchValue({ ...this.mainControl.value, viewType: defaultViewType }, { emitEvent: true });
2660
+ // untracked: see syncFormWithSelectedProperty effect patchValue runs
2661
+ // DynamicForm.writeValue → evaluateRelations (reads+writes its signals),
2662
+ // which would otherwise make this effect self-dependent and loop.
2663
+ untracked(() => this.mainControl.patchValue({ ...this.mainControl.value, viewType: defaultViewType }, { emitEvent: true }));
2661
2664
  }
2662
2665
  });
2663
2666
  // Track previous property type
@@ -2668,7 +2671,10 @@ class PropertyForm {
2668
2671
  prev = this.propertyType();
2669
2672
  return;
2670
2673
  }
2671
- this.configurationControl.reset(null);
2674
+ // untracked: reset can reach a bound config DynamicForm.writeValue →
2675
+ // evaluateRelations (reads+writes its signals); keep this effect bound
2676
+ // only to propertyType so it doesn't self-trigger.
2677
+ untracked(() => this.configurationControl.reset(null));
2672
2678
  });
2673
2679
  effect(() => {
2674
2680
  const currentPropertyType = this.propertyType();
@@ -2684,7 +2690,12 @@ class PropertyForm {
2684
2690
  });
2685
2691
  effect(() => {
2686
2692
  const property = this.facade.selected();
2687
- this.syncFormWithSelectedProperty(property);
2693
+ // Patch the form imperatively, untracked: mainControl.patchValue triggers
2694
+ // DynamicForm.writeValue → evaluateRelations, which both reads and writes
2695
+ // the DynamicForm's signals (fieldStates, etc.). Without untracked those
2696
+ // reads register as dependencies of THIS effect, which the same call then
2697
+ // mutates — so the effect re-runs forever (the freeze-on-save loop).
2698
+ untracked(() => this.syncFormWithSelectedProperty(property));
2688
2699
  });
2689
2700
  effect(() => {
2690
2701
  this.resolveConfigurationComponent(this.selectedPropertyTypeConfiguration());