@pega/angular-sdk-overrides 0.25.13 → 0.25.15

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.
Files changed (45) hide show
  1. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +14 -2
  2. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +25 -1
  3. package/lib/field/auto-complete/auto-complete.component.ts +6 -6
  4. package/lib/field/group/group.component.ts +15 -4
  5. package/lib/field/multiselect/multiselect.component.html +1 -1
  6. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  7. package/lib/infra/Containers/flow-container/flow-container.component.ts +8 -5
  8. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -3
  9. package/lib/infra/Containers/view-container/view-container.component.html +1 -1
  10. package/lib/infra/Containers/view-container/view-container.component.ts +5 -9
  11. package/lib/infra/assignment/assignment.component.ts +2 -7
  12. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  13. package/lib/infra/assignment-card/assignment-card.component.ts +2 -8
  14. package/lib/infra/defer-load/defer-load.component.ts +1 -2
  15. package/lib/infra/reference/reference.component.html +7 -1
  16. package/lib/infra/reference/reference.component.ts +64 -109
  17. package/lib/infra/region/region.component.ts +1 -3
  18. package/lib/infra/root-container/root-container.component.html +1 -0
  19. package/lib/infra/root-container/root-container.component.ts +2 -5
  20. package/lib/infra/view/view.component.ts +5 -8
  21. package/lib/template/banner-page/banner-page.component.ts +1 -2
  22. package/lib/template/base/details-template-base.ts +45 -0
  23. package/lib/template/base/form-template-base.ts +0 -2
  24. package/lib/template/case-summary/case-summary.component.ts +0 -6
  25. package/lib/template/case-view/case-view.component.html +1 -1
  26. package/lib/template/data-reference/data-reference.component.ts +27 -18
  27. package/lib/template/default-form/default-form.component.html +1 -1
  28. package/lib/template/default-form/default-form.component.ts +1 -2
  29. package/lib/template/default-page/default-page.component.ts +1 -2
  30. package/lib/template/details/details.component.ts +1 -39
  31. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +2 -4
  32. package/lib/template/details-one-column/details-one-column.component.ts +1 -3
  33. package/lib/template/details-three-column/details-three-column.component.ts +3 -5
  34. package/lib/template/details-two-column/details-two-column.component.ts +2 -4
  35. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +2 -4
  36. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +1 -0
  37. package/lib/template/field-group-template/field-group-template.component.ts +18 -4
  38. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -10
  39. package/lib/template/one-column/one-column.component.html +3 -0
  40. package/lib/template/one-column-tab/one-column-tab.component.html +1 -0
  41. package/lib/template/page/page.component.html +1 -0
  42. package/lib/template/simple-table/simple-table.component.ts +5 -1
  43. package/lib/template/simple-table-manual/simple-table-manual.component.ts +13 -5
  44. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +0 -3
  45. package/package.json +1 -1
@@ -5,7 +5,6 @@ import { interval, Subscription } from 'rxjs';
5
5
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
6
6
  import { ServerConfigService } from '@pega/angular-sdk-components';
7
7
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
8
- import { ReferenceComponent } from '@pega/angular-sdk-components';
9
8
  import { PreviewViewContainerComponent } from '@pega/angular-sdk-components';
10
9
  import { ModalViewContainerComponent } from '@pega/angular-sdk-components';
11
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
@@ -39,7 +38,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
39
38
  // For interaction with AngularPConnect
40
39
  angularPConnectData: AngularPConnectData = {};
41
40
 
42
- componentName$ = '';
41
+ componentName$: any;
43
42
  bIsProgress$ = false;
44
43
 
45
44
  // preview and modalview pConn
@@ -140,9 +139,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
140
139
  setTimeout(() => {
141
140
  // makes sure Angular tracks these changes
142
141
  this.ngZone.run(() => {
143
- // the new rootObject may be a 'reference'. So,
144
- // normalize it to get the referencedView if that's the case
145
- const theNewPConn = ReferenceComponent.normalizePConn(rootObject.getPConnect());
142
+ const theNewPConn = rootObject.getPConnect();
146
143
  // update ComponentName$ before we update pConn$ to make sure they're in sync
147
144
  // when rendering...
148
145
  this.componentName$ = theNewPConn.getComponentName();
@@ -4,7 +4,6 @@ import { FormGroup } from '@angular/forms';
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
5
5
  import { Utils } from '@pega/angular-sdk-components';
6
6
  import { getAllFields } from '@pega/angular-sdk-components';
7
- import { ReferenceComponent } from '@pega/angular-sdk-components';
8
7
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
8
 
10
9
  const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs', 'ListView'];
@@ -145,12 +144,8 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
145
144
 
146
145
  // debugger;
147
146
 
148
- // normalize this.pConn$ in case it contains a 'reference'
149
- this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
150
-
151
147
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ViewProps;
152
148
  this.inheritedProps$ = this.pConn$.getInheritedProps();
153
-
154
149
  // NOTE: this.configProps$.visibility'] is used in view.component.ts such that
155
150
  // the View will only be rendered when this.configProps$.visibility'] is false.
156
151
  // It WILL render if true or undefined.
@@ -159,9 +154,11 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
159
154
  this.title$ = this.configProps$.title || '';
160
155
  // label & showLabel within inheritedProps takes precedence over configProps
161
156
  this.label$ = this.inheritedProps$.label || this.configProps$.label || '';
162
- this.showLabel$ = this.inheritedProps$.showLabel || this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
163
- // children may have a 'reference' so normalize the children array
164
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
157
+ this.showLabel$ =
158
+ this.inheritedProps$.showLabel !== undefined
159
+ ? this.inheritedProps$.showLabel
160
+ : this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
161
+ this.arChildren$ = this.pConn$.getChildren();
165
162
  this.visibility$ = this.configProps$.visibility ?? this.visibility$;
166
163
 
167
164
  /**
@@ -1,6 +1,5 @@
1
1
  import { Component, Input, OnChanges, OnInit, SimpleChanges, forwardRef } from '@angular/core';
2
2
 
3
- import { ReferenceComponent } from '@pega/angular-sdk-components';
4
3
  import { CommonModule } from '@angular/common';
5
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
5
 
@@ -59,6 +58,6 @@ export class BannerPageComponent implements OnInit, OnChanges {
59
58
  this.backgroundImage = this.configProps$.backgroundImage;
60
59
 
61
60
  // The children may contain 'reference' components, so normalize the children...
62
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
61
+ this.arChildren$ = this.pConn$.getChildren();
63
62
  }
64
63
  }
@@ -1,9 +1,11 @@
1
1
  import { Directive, OnInit, OnDestroy, Injector, Input } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
2
3
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
3
4
 
4
5
  @Directive()
5
6
  export class DetailsTemplateBase implements OnInit, OnDestroy {
6
7
  @Input() pConn$: typeof PConnect;
8
+ @Input() formGroup$: FormGroup;
7
9
 
8
10
  // For interaction with AngularPConnect
9
11
  protected angularPConnectData: AngularPConnectData = {};
@@ -64,4 +66,47 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
64
66
  return pConnect.resolveConfigProps(pConnect.getRawMetadata());
65
67
  });
66
68
  }
69
+
70
+ processDetailFields(kid: any): any[] {
71
+ const pKid = kid.getPConnect();
72
+ const fields = pKid.getChildren();
73
+ const processedFields: any[] = [];
74
+
75
+ fields?.forEach(field => {
76
+ const thePConn = field.getPConnect();
77
+ const theCompType = thePConn.getComponentName().toLowerCase();
78
+ if (theCompType === 'reference' || theCompType === 'group') {
79
+ const configProps = thePConn.getConfigProps();
80
+ configProps.readOnly = true;
81
+ configProps.displayMode = 'DISPLAY_ONLY';
82
+ const propToUse = { ...thePConn.getInheritedProps() };
83
+ configProps.label = propToUse?.label;
84
+ const options = {
85
+ context: thePConn.getContextName(),
86
+ pageReference: thePConn.getPageReference(),
87
+ referenceList: thePConn.getReferenceList()
88
+ };
89
+ const viewContConfig = {
90
+ meta: {
91
+ ...thePConn.getMetadata(),
92
+ type: theCompType,
93
+ config: configProps
94
+ },
95
+ options
96
+ };
97
+ const theViewCont = PCore.createPConnect(viewContConfig);
98
+ processedFields.push({
99
+ type: theCompType,
100
+ pConn: theViewCont?.getPConnect()
101
+ });
102
+ } else {
103
+ processedFields.push({
104
+ type: theCompType,
105
+ config: thePConn.getConfigProps()
106
+ });
107
+ }
108
+ });
109
+
110
+ return processedFields;
111
+ }
67
112
  }
@@ -7,8 +7,6 @@ export class FormTemplateBase implements OnDestroy {
7
7
  angularPConnectData: AngularPConnectData;
8
8
 
9
9
  ngOnDestroy(): void {
10
- PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
11
-
12
10
  if (this.angularPConnectData?.unsubscribeFn) {
13
11
  this.angularPConnectData.unsubscribeFn();
14
12
  }
@@ -1,7 +1,6 @@
1
1
  import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
- import { ReferenceComponent } from '@pega/angular-sdk-components';
5
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
5
  import { Utils } from '@pega/angular-sdk-components';
7
6
 
@@ -52,11 +51,6 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
52
51
  }
53
52
 
54
53
  initComponent() {
55
- // dereference the View in case the incoming pConn$ is a 'reference'
56
- this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
57
-
58
- // Then, continue on with other initialization
59
-
60
54
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
61
55
  this.arChildren$ = this.pConn$.getChildren();
62
56
 
@@ -35,7 +35,7 @@
35
35
  <div class="psdk-case-view-divider"></div>
36
36
 
37
37
  <div class="psdk-case-view-summary">
38
- <component-mapper name="CaseSummary" [props]="{ pConn$: caseSummaryPConn$ }"></component-mapper>
38
+ <component-mapper name="reference" [props]="{ pConn$: caseSummaryPConn$ }"></component-mapper>
39
39
  </div>
40
40
 
41
41
  <component-mapper
@@ -58,6 +58,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
58
58
  dataRelationshipContext: any;
59
59
  imagePosition: any;
60
60
  showImageDescription: any;
61
+ private isUpdatingFromDataCallback = false;
61
62
 
62
63
  constructor(
63
64
  private angularPConnect: AngularPConnectService,
@@ -69,7 +70,30 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
69
70
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
70
71
  this.children = this.pConn$.getChildren();
71
72
  this.updateSelf();
73
+ }
74
+
75
+ ngOnDestroy(): void {
76
+ if (this.angularPConnectData.unsubscribeFn) {
77
+ this.angularPConnectData.unsubscribeFn();
78
+ }
79
+ }
80
+
81
+ // Callback passed when subscribing to store change
82
+ onStateChange() {
83
+ // Should always check the bridge to see if the component should
84
+ // update itself (re-render)
85
+ const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
86
+
87
+ // ONLY call updateSelf when the component should update
88
+ if (bUpdateSelf) {
89
+ this.updateSelf();
90
+ }
91
+ }
72
92
 
93
+ getData() {
94
+ if (this.isUpdatingFromDataCallback) {
95
+ return;
96
+ }
73
97
  if (
74
98
  this.rawViewMetadata.config?.parameters &&
75
99
  !this.isDDSourceDeferred &&
@@ -94,7 +118,9 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
94
118
  }))
95
119
  .filter(item => item.key); // Filtering out undefined entries
96
120
  this.dropDownDataSource = ddDataSource;
121
+ this.isUpdatingFromDataCallback = true;
97
122
  this.updateSelf();
123
+ this.isUpdatingFromDataCallback = false;
98
124
  } else {
99
125
  const ddDataSource: any = [];
100
126
  this.dropDownDataSource = ddDataSource;
@@ -110,24 +136,6 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
110
136
  }
111
137
  }
112
138
 
113
- ngOnDestroy(): void {
114
- if (this.angularPConnectData.unsubscribeFn) {
115
- this.angularPConnectData.unsubscribeFn();
116
- }
117
- }
118
-
119
- // Callback passed when subscribing to store change
120
- onStateChange() {
121
- // Should always check the bridge to see if the component should
122
- // update itself (re-render)
123
- const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
124
-
125
- // ONLY call updateSelf when the component should update
126
- if (bUpdateSelf) {
127
- this.updateSelf();
128
- }
129
- }
130
-
131
139
  updateSelf() {
132
140
  // Update properties based on configProps
133
141
  const theConfigProps = this.pConn$.getConfigProps();
@@ -186,6 +194,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
186
194
 
187
195
  this.generateChildrenToRender();
188
196
  this.displayChild = !(this.displaySingleRef || this.displayMultiRef);
197
+ this.getData();
189
198
  }
190
199
 
191
200
  updatePropertiesFromProps(theConfigProps) {
@@ -2,7 +2,7 @@
2
2
  <div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
3
3
  </div>
4
4
  <div [className]="divClass$">
5
- <div *ngFor="let kid of arChildren$" [ngClass]="{ 'grid-column': kid.getPConnect().getComponentName() === 'View' }">
5
+ <div *ngFor="let kid of arChildren$" [ngClass]="{ 'grid-column': kid.getPConnect().getComponentName() === 'reference' }">
6
6
  <component-mapper
7
7
  [name]="kid.getPConnect().getComponentName()"
8
8
  [props]="{
@@ -2,7 +2,6 @@ import { Component, OnInit, Input, forwardRef, OnChanges } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
5
- import { ReferenceComponent } from '@pega/angular-sdk-components';
6
5
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
7
6
  import { TemplateUtils } from '@pega/angular-sdk-components';
8
7
  import { FormTemplateBase } from '@pega/angular-sdk-components';
@@ -91,7 +90,7 @@ export class DefaultFormComponent extends FormTemplateBase implements OnInit, On
91
90
  // repoint children before getting templateArray
92
91
  // Children may contain 'reference' component, so we need to
93
92
  // normalize them
94
- const children = ReferenceComponent.normalizePConnArray(kids[0].getPConnect().getChildren());
93
+ const children = kids[0].getPConnect().getChildren();
95
94
 
96
95
  if (areViewsChanged(this.arChildren$, children)) {
97
96
  this.arChildren$ = children;
@@ -1,6 +1,5 @@
1
1
  import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
- import { ReferenceComponent } from '@pega/angular-sdk-components';
4
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
4
 
6
5
  interface DefaultPageProps {
@@ -59,6 +58,6 @@ export class DefaultPageComponent implements OnInit, OnChanges {
59
58
  this.backgroundImage = this.configProps$.backgroundImage;
60
59
  this.enableBanner$ = this.configProps$.enableBanner;
61
60
 
62
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
61
+ this.arChildren$ = this.pConn$.getChildren();
63
62
  }
64
63
  }
@@ -35,45 +35,7 @@ export class DetailsComponent extends DetailsTemplateBase {
35
35
 
36
36
  const kids = this.pConn$.getChildren() as any[];
37
37
  for (const kid of kids) {
38
- this.arFields$ = [];
39
- const pKid = kid.getPConnect();
40
- const fields = pKid.getChildren();
41
- fields?.forEach(field => {
42
- const thePConn = field.getPConnect();
43
- const theCompType = thePConn.getComponentName().toLowerCase();
44
- if (theCompType === 'reference' || theCompType === 'group') {
45
- const configProps = thePConn.getConfigProps();
46
- configProps.readOnly = true;
47
- configProps.displayMode = 'DISPLAY_ONLY';
48
- const propToUse = { ...thePConn.getInheritedProps() };
49
- configProps.label = propToUse?.label;
50
- const options = {
51
- context: thePConn.getContextName(),
52
- pageReference: thePConn.getPageReference(),
53
- referenceList: thePConn.getReferenceList()
54
- };
55
- const viewContConfig = {
56
- meta: {
57
- ...thePConn.getMetadata(),
58
- type: theCompType,
59
- config: configProps
60
- },
61
- options
62
- };
63
- const theViewCont = PCore.createPConnect(viewContConfig);
64
- const data = {
65
- type: theCompType,
66
- pConn: theViewCont?.getPConnect()
67
- };
68
- this.arFields$.push(data);
69
- } else {
70
- const data = {
71
- type: theCompType,
72
- config: thePConn.getConfigProps()
73
- };
74
- this.arFields$.push(data);
75
- }
76
- });
38
+ this.arFields$ = this.processDetailFields(kid);
77
39
  }
78
40
  }
79
41
  }
@@ -36,12 +36,10 @@ export class DetailsNarrowWideComponent extends DetailsTemplateBase {
36
36
 
37
37
  const kids = this.pConn$.getChildren() as any[];
38
38
  for (const kid of kids) {
39
- const pKid = kid.getPConnect();
40
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
41
39
  if (kids.indexOf(kid) == 0) {
42
- this.arFields$ = pKidData.children;
40
+ this.arFields$ = this.processDetailFields(kid);
43
41
  } else {
44
- this.arFields2$ = pKidData.children;
42
+ this.arFields2$ = this.processDetailFields(kid);
45
43
  }
46
44
  }
47
45
  }
@@ -39,10 +39,8 @@ export class DetailsOneColumnComponent extends DetailsTemplateBase {
39
39
 
40
40
  const kids = this.pConn$.getChildren() as any[];
41
41
  for (const kid of kids) {
42
- const pKid = kid.getPConnect();
43
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
44
42
  if (kids.indexOf(kid) == 0) {
45
- this.arFields$ = pKidData.children;
43
+ this.arFields$ = this.processDetailFields(kid);
46
44
  }
47
45
  }
48
46
  }
@@ -43,14 +43,12 @@ export class DetailsThreeColumnComponent extends DetailsTemplateBase {
43
43
 
44
44
  const kids = this.pConn$.getChildren() as any[];
45
45
  for (const kid of kids) {
46
- const pKid = kid.getPConnect();
47
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
48
46
  if (kids.indexOf(kid) == 0) {
49
- this.arFields$ = pKidData.children;
47
+ this.arFields$ = this.processDetailFields(kid);
50
48
  } else if (kids.indexOf(kid) == 1) {
51
- this.arFields2$ = pKidData.children;
49
+ this.arFields2$ = this.processDetailFields(kid);
52
50
  } else {
53
- this.arFields3$ = pKidData.children;
51
+ this.arFields3$ = this.processDetailFields(kid);
54
52
  }
55
53
  }
56
54
  }
@@ -43,12 +43,10 @@ export class DetailsTwoColumnComponent extends DetailsTemplateBase {
43
43
 
44
44
  const kids = this.pConn$.getChildren() as any[];
45
45
  for (const kid of kids) {
46
- const pKid = kid.getPConnect();
47
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
48
46
  if (kids.indexOf(kid) == 0) {
49
- this.arFields$ = pKidData.children;
47
+ this.arFields$ = this.processDetailFields(kid);
50
48
  } else {
51
- this.arFields2$ = pKidData.children;
49
+ this.arFields2$ = this.processDetailFields(kid);
52
50
  }
53
51
  }
54
52
  }
@@ -40,12 +40,10 @@ export class DetailsWideNarrowComponent extends DetailsTemplateBase {
40
40
 
41
41
  const kids = this.pConn$.getChildren() as any[];
42
42
  for (const kid of kids) {
43
- const pKid = kid.getPConnect();
44
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
45
43
  if (kids.indexOf(kid) == 0) {
46
- this.arFields$ = pKidData.children;
44
+ this.arFields$ = this.processDetailFields(kid);
47
45
  } else {
48
- this.arFields2$ = pKidData.children;
46
+ this.arFields2$ = this.processDetailFields(kid);
49
47
  }
50
48
  }
51
49
  }
@@ -4,5 +4,6 @@
4
4
  <mat-tab-group id="dynamic-tabs" mat-stretch-tabs="false" animationDuration="0">
5
5
  <mat-tab *ngFor="let tab of tabsItems" [label]="tab.name">
6
6
  <component-mapper name="View" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>
7
+ <component-mapper name="reference" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>
7
8
  </mat-tab>
8
9
  </mat-tab-group>
@@ -43,6 +43,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
43
43
  readonlyMode: boolean;
44
44
  contextClass: any;
45
45
  heading: any;
46
+ headingPath: string[] = [];
46
47
  children: any;
47
48
  menuIconOverride$: any;
48
49
  referenceListLength = signal<number | null>(null);
@@ -150,11 +151,24 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
150
151
  return `${heading} ${index + 1}`;
151
152
  };
152
153
 
153
- getDynamicHeader = (item, index) => {
154
- if (this.heading && item[this.heading.substring(1)]) {
155
- return item[this.heading.substring(1)];
154
+ getDynamicHeader = (item: Record<string, unknown>, index: number): string => {
155
+ if (this.heading) {
156
+ let value: any = item;
157
+ this.headingPath = this.heading.substring(1).split('.');
158
+
159
+ for (const key of this.headingPath) {
160
+ if (value === null || typeof value !== 'object' || !(key in value)) {
161
+ value = undefined;
162
+ break;
163
+ }
164
+ value = Reflect.get(value, key);
165
+ }
166
+
167
+ if (value !== undefined && value !== null && value !== '') {
168
+ return value.toString();
169
+ }
156
170
  }
157
- return `Row ${index + 1}`;
171
+ return `${PCore.getLocaleUtils().getLocaleValue('Row', 'SimpleTable')} ${index + 1}`;
158
172
  };
159
173
 
160
174
  addFieldGroupItem() {
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, forwardRef, SimpleChanges, OnChanges } from '@angular/core';
1
+ import { Component, OnInit, Input, forwardRef } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup, FormBuilder } from '@angular/forms';
4
4
  import { buildFilterComponents } from '@pega/angular-sdk-components';
@@ -17,7 +17,7 @@ interface InlineDashboardPageProps {
17
17
  styleUrls: ['./inline-dashboard-page.component.scss'],
18
18
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
19
19
  })
20
- export class InlineDashboardPageComponent implements OnInit, OnChanges {
20
+ export class InlineDashboardPageComponent implements OnInit {
21
21
  @Input() pConn$: typeof PConnect;
22
22
 
23
23
  configProps$: InlineDashboardPageProps;
@@ -34,14 +34,6 @@ export class InlineDashboardPageComponent implements OnInit, OnChanges {
34
34
  this.updateSelf();
35
35
  }
36
36
 
37
- ngOnChanges(changes: SimpleChanges): void {
38
- const { pConn$ } = changes;
39
-
40
- if (pConn$.previousValue && pConn$.previousValue !== pConn$.currentValue) {
41
- this.updateSelf();
42
- }
43
- }
44
-
45
37
  updateSelf() {
46
38
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as InlineDashboardPageProps;
47
39
  const arChildren$ = this.pConn$.getChildren();
@@ -5,6 +5,9 @@
5
5
  <div *ngIf="kid.getPConnect().getRawMetadata()['type'] === 'View'">
6
6
  <component-mapper name="View" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
7
7
  </div>
8
+ <div *ngIf="kid.getPConnect().getRawMetadata()['type'] === 'reference'">
9
+ <component-mapper name="reference" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
10
+ </div>
8
11
  <div *ngIf="kid.getPConnect().getRawMetadata()['type'] === 'CaseCreateStage'">
9
12
  <component-mapper name="CaseCreateStage" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
10
13
  </div>
@@ -2,6 +2,7 @@
2
2
  <div *ngFor="let kid of arChildren$">
3
3
  <div [ngSwitch]="kid.getPConnect().getComponentName()">
4
4
  <component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
5
+ <component-mapper *ngSwitchCase="'reference'" name="reference" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
5
6
  <component-mapper *ngSwitchCase="'Region'" name="Region" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
6
7
  <div *ngSwitchDefault>Page Missing: {{ kid.getPConnect().getComponentName() }}</div>
7
8
  </div>
@@ -5,6 +5,7 @@
5
5
  <div *ngFor="let kid of arChildren$">
6
6
  <div [ngSwitch]="kid.getPConnect().getComponentName()">
7
7
  <component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
8
+ <component-mapper *ngSwitchCase="'reference'" name="reference" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
8
9
  <component-mapper *ngSwitchCase="'Region'" name="Region" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
9
10
  <div *ngSwitchDefault>Page Missing: {{ kid.getPConnect().getComponentName() }}</div>
10
11
  </div>
@@ -5,6 +5,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
5
5
  import { Utils } from '@pega/angular-sdk-components';
6
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
7
7
  import { buildMetaForListView, getContext } from '@pega/angular-sdk-components';
8
+ import { getReferenceList } from '@pega/angular-sdk-components';
8
9
 
9
10
  interface SimpleTableProps {
10
11
  // If any, enter additional props that only exist on this component
@@ -66,9 +67,12 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
66
67
  // Should always check the bridge to see if the component should
67
68
  // update itself (re-render)
68
69
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
69
-
70
+ const resolvedList = getReferenceList(this.pConn$);
71
+ this.pConn$.setReferenceList(resolvedList);
70
72
  // ONLY call updateSelf when the component should update
71
73
  if (bUpdateSelf) {
74
+ const resolvedList = getReferenceList(this.pConn$);
75
+ this.pConn$.setReferenceList(resolvedList);
72
76
  this.updateSelf();
73
77
  }
74
78
  }
@@ -159,12 +159,15 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
159
159
  referenceListStr: any;
160
160
  bUseSeparateViewForEdit: any;
161
161
  editView: any;
162
+ defaultActionId: any;
163
+ editActionId: any;
162
164
  settingsSvgIcon$: string;
163
165
 
164
166
  isInitialized = false;
165
167
  targetClassLabel: string;
166
168
  localizedVal = PCore.getLocaleUtils().getLocaleValue;
167
169
  localeCategory = 'SimpleTable';
170
+ editType: any;
168
171
  constructor(
169
172
  private angularPConnect: AngularPConnectService,
170
173
  public utils: Utils,
@@ -308,6 +311,10 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
308
311
  this.defaultView = editModeConfig ? editModeConfig.defaultView : viewForAddAndEditModal;
309
312
  this.bUseSeparateViewForEdit = editModeConfig ? editModeConfig.useSeparateViewForEdit : useSeparateViewForEdit;
310
313
  this.editView = editModeConfig ? editModeConfig.editView : viewForEditModal;
314
+ this.editType = editModeConfig?.editType;
315
+ this.defaultActionId = this.editType === 'action' ? editModeConfig?.defaultAction : undefined;
316
+ this.editActionId =
317
+ this.editType === 'action' && editModeConfig?.useSeparateActionForEdit ? editModeConfig?.editAction : editModeConfig?.defaultAction;
311
318
  const primaryFieldsViewIndex = resolvedFields.findIndex(field => field.config.value === 'pyPrimaryFields');
312
319
  // const showDeleteButton = !this.readOnlyMode && !hideDeleteRow;
313
320
 
@@ -923,7 +930,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
923
930
  const refKeys: string[] = inColKey.split('.');
924
931
  let valBuilder = inRowData;
925
932
  for (const key of refKeys) {
926
- valBuilder = valBuilder[key];
933
+ valBuilder = valBuilder[key] ? valBuilder[key] : valBuilder;
927
934
  }
928
935
  return valBuilder;
929
936
  }
@@ -958,17 +965,18 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
958
965
  }
959
966
 
960
967
  addRecord() {
961
- if (this.allowEditingInModal && this.defaultView) {
968
+ if (this.allowEditingInModal && (this.defaultView || this.defaultActionId)) {
962
969
  this.pConn$
963
970
  .getActionsApi()
964
- // @ts-expect-error
965
971
  .openEmbeddedDataModal(
966
972
  this.defaultView,
967
973
  this.pConn$ as any,
968
974
  this.referenceListStr,
969
975
  this.referenceList.length,
970
976
  PCore.getConstants().RESOURCE_STATUS.CREATE,
971
- this.targetClassLabel
977
+ this.targetClassLabel,
978
+ this.editType,
979
+ this.defaultActionId
972
980
  );
973
981
  } else {
974
982
  this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
@@ -1018,7 +1026,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
1018
1026
  const isDatapage = referenceListData.startsWith('D_');
1019
1027
  const pageReferenceValue = isDatapage
1020
1028
  ? `${referenceListData}[${index}]`
1021
- : `${this.pConn$.getPageReference()}${referenceListData}[${index}]`;
1029
+ : `${this.pConn$.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
1022
1030
  const config = {
1023
1031
  meta: item,
1024
1032
  options: {
@@ -22,9 +22,6 @@ export class WideNarrowPageComponent implements OnInit, OnDestroy {
22
22
  constructor(private angularPConnect: AngularPConnectService) {}
23
23
 
24
24
  ngOnInit(): void {
25
- // normalize the pConn$ in case the incoming pConn$ is a 'reference'
26
- // this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
27
-
28
25
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
29
26
 
30
27
  // this.updateSelf();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.25.13",
3
+ "version": "0.25.15",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"