cat-qw-lib 0.28.2 → 0.28.4

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.
@@ -563,6 +563,7 @@ class BaseControlComponent {
563
563
  destroy$ = new Subject();
564
564
  attributeDestroy$ = new Subject();
565
565
  ngOnInit() {
566
+ console.log(this.attributeModel);
566
567
  this.addToAttributeList();
567
568
  this.baseQuery.getIsFormSubmitted()
568
569
  .pipe(takeUntil(this.destroy$))
@@ -594,11 +595,21 @@ class BaseControlComponent {
594
595
  }
595
596
  }
596
597
  addToAttributeList() {
598
+ console.log(this.attributeModel);
597
599
  if (this.attributeModel) {
600
+ console.log(this.attributeModel);
601
+ // Ensure allAttributes is a mutable array
602
+ if (!Array.isArray(BaseControlComponent.allAttributes)) {
603
+ BaseControlComponent.allAttributes = [];
604
+ }
598
605
  if (!BaseControlComponent.allAttributes.some(attr => attr.name === this.attributeModel.name && attr.displayText === this.attributeModel.displayText)) {
599
- BaseControlComponent.allAttributes = [...BaseControlComponent.allAttributes, this.attributeModel];
606
+ // Create a new array to avoid modifying a frozen array
607
+ BaseControlComponent.allAttributes = [...BaseControlComponent.allAttributes, { ...this.attributeModel }];
600
608
  }
601
- this.baseStore.setAttributeModelList(BaseControlComponent.allAttributes);
609
+ console.log(Object.isExtensible(BaseControlComponent.allAttributes)); // Should return true
610
+ console.log(Object.isFrozen(BaseControlComponent.allAttributes)); // Should return false
611
+ console.log(BaseControlComponent.allAttributes);
612
+ this.baseStore.setAttributeModelList([...BaseControlComponent.allAttributes]);
602
613
  }
603
614
  }
604
615
  // handleEnterKey(event:any, valid: boolean|null) {