@pega/angular-sdk-components 0.25.8 → 0.25.9

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.
@@ -1915,7 +1915,8 @@ class DeferLoadComponent {
1915
1915
  // update itself (re-render)
1916
1916
  const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
1917
1917
  const lastUpdateCaseTime = this.pConn$.getValue('caseInfo.lastUpdateTime');
1918
- if (theRequestedAssignment !== this.currentLoadedAssignment || (lastUpdateCaseTime && lastUpdateCaseTime !== this.lastUpdateCaseTime)) {
1918
+ if ((theRequestedAssignment && theRequestedAssignment !== this.currentLoadedAssignment) ||
1919
+ (lastUpdateCaseTime && lastUpdateCaseTime !== this.lastUpdateCaseTime)) {
1919
1920
  this.currentLoadedAssignment = theRequestedAssignment;
1920
1921
  this.lastUpdateCaseTime = lastUpdateCaseTime;
1921
1922
  this.updateSelf();
@@ -1989,6 +1990,8 @@ class DeferLoadComponent {
1989
1990
  }
1990
1991
  }
1991
1992
  else if (this.resourceType === this.PAGE) {
1993
+ if (!this.loadViewCaseID)
1994
+ return;
1992
1995
  // Rendering defer loaded tabs in case/ page context
1993
1996
  this.pConn$
1994
1997
  .getActionsApi()
@@ -10894,6 +10897,7 @@ class FieldGroupTemplateComponent {
10894
10897
  this.utils = utils;
10895
10898
  this.angularPConnectData = {};
10896
10899
  this.showLabel$ = true;
10900
+ this.referenceListLength = signal(null);
10897
10901
  this.allowAdd = true;
10898
10902
  this.allowEdit = true;
10899
10903
  this.allowDelete = true;
@@ -10901,16 +10905,13 @@ class FieldGroupTemplateComponent {
10901
10905
  return `${heading} ${index + 1}`;
10902
10906
  };
10903
10907
  this.getDynamicHeader = (item, index) => {
10904
- if (this.fieldHeader === 'propertyRef' && this.heading && item[this.heading.substring(1)]) {
10908
+ if (this.heading && item[this.heading.substring(1)]) {
10905
10909
  return item[this.heading.substring(1)];
10906
10910
  }
10907
10911
  return `Row ${index + 1}`;
10908
10912
  };
10909
10913
  }
10910
10914
  ngOnInit() {
10911
- // First thing in initialization is registering and subscribing to the AngularPConnect service
10912
- this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
10913
- this.updateSelf();
10914
10915
  this.menuIconOverride$ = this.utils.getImageSrc('trash', this.utils.getSDKStaticContentUrl());
10915
10916
  const { allowActions, allowTableEdit, referenceList } = this.configProps$;
10916
10917
  if (allowActions && Object.keys(allowActions).length > 0) {
@@ -10931,15 +10932,6 @@ class FieldGroupTemplateComponent {
10931
10932
  this.angularPConnectData.unsubscribeFn();
10932
10933
  }
10933
10934
  }
10934
- onStateChange() {
10935
- // Should always check the bridge to see if the component should
10936
- // update itself (re-render)
10937
- const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
10938
- // ONLY call updateSelf when the component should update
10939
- if (bUpdateSelf) {
10940
- this.updateSelf();
10941
- }
10942
- }
10943
10935
  ngOnChanges(changes) {
10944
10936
  if (changes && changes.configProps$) {
10945
10937
  const props = changes.configProps$;
@@ -10949,14 +10941,12 @@ class FieldGroupTemplateComponent {
10949
10941
  this.pConn$ = changes?.pConn$?.currentValue;
10950
10942
  }
10951
10943
  this.updateSelf();
10944
+ setTimeout(() => {
10945
+ this.angularPConnect.shouldComponentUpdate(this);
10946
+ }, 100);
10952
10947
  }
10953
10948
  }
10954
10949
  }
10955
- ngAfterViewInit() {
10956
- const resolvedList = getReferenceList(this.pConn$);
10957
- // @ts-ignore - Expected 3 arguments, but got 1
10958
- this.pConn$.getListActions().initDefaultPageInstructions(resolvedList);
10959
- }
10960
10950
  updateSelf() {
10961
10951
  const inheritedProps = this.pConn$.getInheritedProps();
10962
10952
  const { label, hideLabel, allowRowDelete, referenceList, fieldHeader, renderMode, displayMode, heading, contextClass, lookForChildInConfig } = this.configProps$;
@@ -10972,7 +10962,9 @@ class FieldGroupTemplateComponent {
10972
10962
  if (this.readonlyMode) {
10973
10963
  this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
10974
10964
  }
10975
- if (this.referenceListLength != referenceList?.length) {
10965
+ if (this.referenceListLength() != referenceList?.length) {
10966
+ // @ts-ignore - Expected 3 arguments, but got 1
10967
+ this.pConn$.getListActions().initDefaultPageInstructions(resolvedList);
10976
10968
  this.children = referenceList?.map((item, index) => {
10977
10969
  return {
10978
10970
  id: index,
@@ -10982,10 +10974,10 @@ class FieldGroupTemplateComponent {
10982
10974
  };
10983
10975
  });
10984
10976
  }
10985
- this.referenceListLength = referenceList?.length || 0;
10977
+ this.referenceListLength.set(referenceList?.length || 0);
10986
10978
  }
10987
10979
  addFieldGroupItem() {
10988
- this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceListLength);
10980
+ this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceListLength());
10989
10981
  }
10990
10982
  deleteFieldGroupItem(index) {
10991
10983
  this.pConn$.getListActions().deleteEntry(index);
@@ -16532,10 +16524,11 @@ class AttachmentComponent {
16532
16524
  const rawValue = this.pConn$.getComponentConfig().value;
16533
16525
  const isAttachmentAnnotationPresent = typeof rawValue === 'object' ? false : rawValue?.includes('@ATTACHMENT');
16534
16526
  const { attachments, isOldAttachment } = isAttachmentAnnotationPresent ? value : PCore.getAttachmentUtils().prepareAttachmentData(value);
16527
+ const isAttachmentsChanged = !PCore.isDeepEqual(this.attachments, attachments);
16535
16528
  this.isOldAttachment = isOldAttachment;
16536
16529
  this.attachments = attachments;
16537
16530
  // update the attachments shown in the UI
16538
- if (this.attachments.length) {
16531
+ if (isAttachmentsChanged) {
16539
16532
  this.updateAttachments();
16540
16533
  }
16541
16534
  }
@@ -16766,6 +16759,7 @@ class AttachmentComponent {
16766
16759
  fileResponses[index].value.thumbnail = localFile.props.thumbnail;
16767
16760
  localFile.inProgress = false;
16768
16761
  localFile.ID = fileResponses[index].value.ID;
16762
+ localFile.props.id = fileResponses[index].value.ID;
16769
16763
  localFile.props.meta = this.localizationService.getLocalizedText('Uploaded successfully');
16770
16764
  localFile.props.progress = 100;
16771
16765
  localFile.handle = fileResponses[index].value.ID;