@pega/angular-sdk-overrides 25.1.13 → 26.1.10

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 (153) hide show
  1. package/lib/designSystemExtension/alert/alert.component.html +4 -1
  2. package/lib/designSystemExtension/alert/alert.component.scss +9 -10
  3. package/lib/designSystemExtension/alert/alert.component.ts +6 -2
  4. package/lib/designSystemExtension/field-group/field-group.component.ts +11 -3
  5. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +51 -36
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +12 -0
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +11 -0
  8. package/lib/designSystemExtension/operator/operator.component.html +5 -3
  9. package/lib/designSystemExtension/operator/operator.component.scss +7 -0
  10. package/lib/designSystemExtension/operator/operator.component.ts +2 -1
  11. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.html +100 -10
  12. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +141 -1
  13. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.spec.ts +1 -1
  14. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +240 -72
  15. package/lib/field/auto-complete/auto-complete.component.html +46 -5
  16. package/lib/field/auto-complete/auto-complete.component.scss +92 -0
  17. package/lib/field/auto-complete/auto-complete.component.ts +350 -23
  18. package/lib/field/cancel-alert/cancel-alert.component.ts +38 -15
  19. package/lib/field/check-box/check-box.component.html +8 -6
  20. package/lib/field/check-box/check-box.component.ts +9 -2
  21. package/lib/field/currency/currency.component.html +2 -1
  22. package/lib/field/currency/currency.component.ts +10 -1
  23. package/lib/field/date/date.component.html +2 -1
  24. package/lib/field/date/date.component.ts +2 -0
  25. package/lib/field/date-time/date-time.component.html +2 -1
  26. package/lib/field/date-time/date-time.component.scss +46 -40
  27. package/lib/field/date-time/date-time.component.ts +29 -0
  28. package/lib/field/decimal/decimal.component.html +2 -1
  29. package/lib/field/decimal/decimal.component.ts +2 -0
  30. package/lib/field/dropdown/dropdown.component.html +4 -1
  31. package/lib/field/dropdown/dropdown.component.ts +18 -19
  32. package/lib/field/email/email.component.html +2 -1
  33. package/lib/field/email/email.component.ts +2 -2
  34. package/lib/field/embedded-data-multi/embedded-data-multi.component.html +3 -0
  35. package/lib/field/embedded-data-multi/embedded-data-multi.component.scss +0 -0
  36. package/lib/field/embedded-data-multi/embedded-data-multi.component.ts +173 -0
  37. package/lib/field/field.base.ts +27 -1
  38. package/lib/field/group/group.component.html +1 -1
  39. package/lib/field/group/group.component.ts +15 -5
  40. package/lib/field/integer/integer.component.html +2 -1
  41. package/lib/field/integer/integer.component.ts +4 -2
  42. package/lib/field/location/location.component.html +2 -1
  43. package/lib/field/location/location.component.ts +3 -1
  44. package/lib/field/multiselect/multiselect.component.html +1 -1
  45. package/lib/field/multiselect/multiselect.component.ts +23 -4
  46. package/lib/field/multiselect/utils.ts +5 -3
  47. package/lib/field/object-reference/object-reference.component.html +30 -15
  48. package/lib/field/object-reference/object-reference.component.ts +818 -94
  49. package/lib/field/percentage/percentage.component.html +2 -1
  50. package/lib/field/percentage/percentage.component.ts +10 -1
  51. package/lib/field/phone/phone.component.html +2 -1
  52. package/lib/field/phone/phone.component.ts +2 -1
  53. package/lib/field/radio-buttons/radio-buttons.component.html +2 -1
  54. package/lib/field/radio-buttons/radio-buttons.component.ts +10 -1
  55. package/lib/field/rich-text/rich-text.component.scss +1 -166
  56. package/lib/field/rich-text/rich-text.component.spec.ts +1 -1
  57. package/lib/field/rich-text/rich-text.component.ts +1 -1
  58. package/lib/field/selectable-card/selectable-card.component.html +1 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +31 -16
  60. package/lib/field/semantic-link/semantic-link.component.html +1 -1
  61. package/lib/field/semantic-link/semantic-link.component.scss +4 -0
  62. package/lib/field/semantic-link/semantic-link.component.ts +13 -7
  63. package/lib/field/text-area/text-area.component.html +2 -1
  64. package/lib/field/text-area/text-area.component.ts +2 -1
  65. package/lib/field/text-input/text-input.component.html +2 -1
  66. package/lib/field/text-input/text-input.component.ts +2 -1
  67. package/lib/field/time/time.component.html +2 -1
  68. package/lib/field/time/time.component.ts +2 -1
  69. package/lib/field/url/url.component.html +2 -1
  70. package/lib/field/url/url.component.ts +2 -1
  71. package/lib/field/user-reference/user-reference.component.html +4 -2
  72. package/lib/field/user-reference/user-reference.component.ts +11 -6
  73. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  74. package/lib/infra/Containers/flow-container/flow-container.component.ts +35 -46
  75. package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.html +12 -0
  76. package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.spec.ts +130 -0
  77. package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.ts +77 -0
  78. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +35 -8
  79. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +185 -194
  80. package/lib/infra/Containers/view-container/view-container.component.ts +32 -35
  81. package/lib/infra/assignment/assignment.component.html +2 -1
  82. package/lib/infra/assignment/assignment.component.ts +42 -15
  83. package/lib/infra/defer-load/defer-load.component.ts +6 -3
  84. package/lib/infra/multi-step/multi-step.component.html +25 -33
  85. package/lib/infra/multi-step/multi-step.component.scss +67 -125
  86. package/lib/infra/multi-step/multi-step.component.ts +11 -0
  87. package/lib/infra/navbar/navbar.component.ts +33 -36
  88. package/lib/infra/reference/reference.component.ts +1 -2
  89. package/lib/infra/root-container/root-container.component.ts +33 -38
  90. package/lib/infra/view/view.component.ts +21 -40
  91. package/lib/template/advanced-search/advanced-search.component.ts +0 -1
  92. package/lib/template/advanced-search/search-groups/search-groups.component.ts +2 -3
  93. package/lib/template/app-shell/app-shell.component.ts +13 -13
  94. package/lib/template/base/details-template-base.ts +41 -14
  95. package/lib/template/case-summary/case-summary.component.ts +15 -1
  96. package/lib/template/case-view/case-view.component.html +13 -1
  97. package/lib/template/case-view/case-view.component.spec.ts +119 -10
  98. package/lib/template/case-view/case-view.component.ts +52 -3
  99. package/lib/template/data-reference/data-reference.component.ts +2 -4
  100. package/lib/template/data-reference/search-form/search-form.component.html +1 -1
  101. package/lib/template/data-reference/search-form/search-form.component.ts +9 -1
  102. package/lib/template/data-reference/search-form/tabsData.ts +0 -1
  103. package/lib/template/default-form/default-form.component.html +19 -3
  104. package/lib/template/default-form/default-form.component.ts +13 -3
  105. package/lib/template/details/details.component.html +23 -3
  106. package/lib/template/details/details.component.scss +9 -2
  107. package/lib/template/details/details.component.ts +3 -70
  108. package/lib/template/details-narrow-wide/details-narrow-wide.component.html +21 -2
  109. package/lib/template/details-narrow-wide/details-narrow-wide.component.scss +8 -1
  110. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +3 -39
  111. package/lib/template/details-one-column/details-one-column.component.html +23 -1
  112. package/lib/template/details-one-column/details-one-column.component.scss +14 -0
  113. package/lib/template/details-one-column/details-one-column.component.ts +3 -40
  114. package/lib/template/details-three-column/details-three-column.component.html +21 -2
  115. package/lib/template/details-three-column/details-three-column.component.scss +8 -1
  116. package/lib/template/details-three-column/details-three-column.component.ts +3 -48
  117. package/lib/template/details-two-column/details-two-column.component.html +21 -2
  118. package/lib/template/details-two-column/details-two-column.component.scss +8 -1
  119. package/lib/template/details-two-column/details-two-column.component.ts +3 -46
  120. package/lib/template/details-wide-narrow/details-wide-narrow.component.html +21 -2
  121. package/lib/template/details-wide-narrow/details-wide-narrow.component.scss +8 -1
  122. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +3 -43
  123. package/lib/template/field-group-template/field-group-template.component.ts +19 -6
  124. package/lib/template/field-value-list/field-value-list.component.scss +17 -0
  125. package/lib/template/list-view/list-view.component.ts +47 -11
  126. package/lib/template/self-service-case-view/self-service-case-view.component.html +13 -1
  127. package/lib/template/self-service-case-view/self-service-case-view.component.spec.ts +96 -11
  128. package/lib/template/self-service-case-view/self-service-case-view.component.ts +52 -3
  129. package/lib/template/simple-table/simple-table.component.ts +6 -0
  130. package/lib/template/simple-table-manual/helpers.ts +84 -16
  131. package/lib/template/simple-table-manual/simple-table-manual.component.html +30 -14
  132. package/lib/template/simple-table-manual/simple-table-manual.component.scss +8 -2
  133. package/lib/template/simple-table-manual/simple-table-manual.component.ts +131 -43
  134. package/lib/template/single-reference-readonly/single-reference-readonly.component.html +0 -0
  135. package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +2 -3
  136. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +7 -8
  137. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +19 -21
  138. package/lib/widget/attachment/AttachmentUtils.ts +19 -11
  139. package/lib/widget/attachment/attachment.component.html +16 -6
  140. package/lib/widget/attachment/attachment.component.ts +14 -4
  141. package/lib/widget/case-history/case-history.component.ts +6 -2
  142. package/lib/widget/feed-container/feed-container.component.ts +1 -199
  143. package/lib/widget/file-utility/file-utility.component.ts +26 -30
  144. package/lib/widget/todo/todo.component.ts +7 -2
  145. package/package.json +2 -2
  146. package/lib/designSystemExtension/material-details/material-details.component.html +0 -40
  147. package/lib/designSystemExtension/material-details/material-details.component.scss +0 -116
  148. package/lib/designSystemExtension/material-details/material-details.component.spec.ts +0 -24
  149. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -31
  150. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +0 -29
  151. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +0 -34
  152. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.spec.ts +0 -22
  153. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +0 -37
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy, inject } from '@angular/core';
1
+ import { ChangeDetectorRef, Component, OnInit, Input, forwardRef, OnDestroy, inject } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
4
4
  import { interval, Subscription } from 'rxjs';
@@ -56,7 +56,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
56
56
  constructor(
57
57
  private angularPConnect: AngularPConnectService,
58
58
  private psService: ProgressSpinnerService,
59
- private ngZone: NgZone
59
+ private cdRef: ChangeDetectorRef
60
60
  ) {}
61
61
 
62
62
  ngOnInit(): void {
@@ -137,18 +137,16 @@ export class RootContainerComponent implements OnInit, OnDestroy {
137
137
  });
138
138
 
139
139
  setTimeout(() => {
140
- // makes sure Angular tracks these changes
141
- this.ngZone.run(() => {
142
- const theNewPConn = rootObject.getPConnect();
143
- // update ComponentName$ before we update pConn$ to make sure they're in sync
144
- // when rendering...
145
- this.componentName$ = theNewPConn.getComponentName();
146
-
147
- this.pConn$ = theNewPConn;
148
- // this.pConn$ = rootObject.getPConnect();
149
-
150
- console.log(`RootContainer updated pConn$ to be: ${this.componentName$}`);
151
- });
140
+ const theNewPConn = rootObject.getPConnect();
141
+ // update ComponentName$ before we update pConn$ to make sure they're in sync
142
+ // when rendering...
143
+ this.componentName$ = theNewPConn.getComponentName();
144
+
145
+ this.pConn$ = theNewPConn;
146
+ // this.pConn$ = rootObject.getPConnect();
147
+
148
+ console.log(`RootContainer updated pConn$ to be: ${this.componentName$}`);
149
+ this.cdRef.markForCheck();
152
150
  });
153
151
  }
154
152
  }
@@ -187,24 +185,23 @@ export class RootContainerComponent implements OnInit, OnDestroy {
187
185
  if (arChildren && arChildren.length == 1) {
188
186
  // have to have a quick timeout or get an "expressions changed" angular error
189
187
  setTimeout(() => {
190
- this.ngZone.run(() => {
191
- const localPConn = arChildren[0].getPConnect();
192
-
193
- this.componentName$ = localPConn.getComponentName();
194
- if (this.componentName$ === 'ViewContainer') {
195
- const configProps = this.pConn$.getConfigProps();
196
- const viewContConfig = {
197
- meta: {
198
- type: 'ViewContainer',
199
- config: configProps
200
- },
201
- options
202
- };
203
-
204
- this.viewContainerPConn$ = PCore.createPConnect(viewContConfig).getPConnect();
205
- }
206
- this.bShowRoot$ = true;
207
- });
188
+ const localPConn = arChildren[0].getPConnect();
189
+
190
+ this.componentName$ = localPConn.getComponentName();
191
+ if (this.componentName$ === 'ViewContainer') {
192
+ const configProps = this.pConn$.getConfigProps();
193
+ const viewContConfig = {
194
+ meta: {
195
+ type: 'ViewContainer',
196
+ config: configProps
197
+ },
198
+ options
199
+ };
200
+
201
+ this.viewContainerPConn$ = PCore.createPConnect(viewContConfig).getPConnect();
202
+ }
203
+ this.bShowRoot$ = true;
204
+ this.cdRef.markForCheck();
208
205
  });
209
206
  }
210
207
  }
@@ -222,9 +219,8 @@ export class RootContainerComponent implements OnInit, OnDestroy {
222
219
  console.log(ex);
223
220
  }
224
221
 
225
- this.ngZone.run(() => {
226
- this.bIsProgress$ = true;
227
- });
222
+ this.bIsProgress$ = true;
223
+ this.cdRef.markForCheck();
228
224
  });
229
225
  }
230
226
  }
@@ -236,9 +232,8 @@ export class RootContainerComponent implements OnInit, OnDestroy {
236
232
  // don't touch bIsProgress$ unless differnent
237
233
  if (bShow != this.bIsProgress$) {
238
234
  // makes sure Angular tracks these changes
239
- this.ngZone.run(() => {
240
- this.bIsProgress$ = bShow;
241
- });
235
+ this.bIsProgress$ = bShow;
236
+ this.cdRef.markForCheck();
242
237
  }
243
238
  }
244
239
  }
@@ -3,17 +3,29 @@ import { CommonModule } from '@angular/common';
3
3
  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
- import { getAllFields } from '@pega/angular-sdk-components';
7
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
7
 
9
- const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs', 'ListView'];
8
+ const NO_HEADER_TEMPLATES = [
9
+ 'SubTabs',
10
+ 'SimpleTable',
11
+ 'Details',
12
+ 'DetailsTwoColumn',
13
+ 'DetailsThreeColumn',
14
+ 'NarrowWideDetails',
15
+ 'WideNarrowDetails',
16
+ 'Confirmation',
17
+ 'DynamicTabs',
18
+ 'DetailsSubTabs',
19
+ 'ListView',
20
+ 'DataReference'
21
+ ];
22
+
10
23
  const DETAILS_TEMPLATES = [
11
24
  'Details',
12
- 'DetailsFields',
13
25
  'DetailsOneColumn',
14
- 'DetailsSubTabs',
15
- 'DetailsThreeColumn',
16
26
  'DetailsTwoColumn',
27
+ 'DetailsThreeColumn',
28
+ 'DetailsSubTabs',
17
29
  'NarrowWideDetails',
18
30
  'WideNarrowDetails'
19
31
  ];
@@ -146,7 +158,6 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
146
158
 
147
159
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ViewProps;
148
160
  this.inheritedProps$ = this.pConn$.getInheritedProps();
149
-
150
161
  // NOTE: this.configProps$.visibility'] is used in view.component.ts such that
151
162
  // the View will only be rendered when this.configProps$.visibility'] is false.
152
163
  // It WILL render if true or undefined.
@@ -155,7 +166,10 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
155
166
  this.title$ = this.configProps$.title || '';
156
167
  // label & showLabel within inheritedProps takes precedence over configProps
157
168
  this.label$ = this.inheritedProps$.label || this.configProps$.label || '';
158
- this.showLabel$ = this.inheritedProps$.showLabel || this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
169
+ this.showLabel$ =
170
+ this.inheritedProps$.showLabel !== undefined
171
+ ? this.inheritedProps$.showLabel
172
+ : (this.configProps$.showLabel ?? isDetailsTemplate(this.templateName$));
159
173
  this.arChildren$ = this.pConn$.getChildren();
160
174
  this.visibility$ = this.configProps$.visibility ?? this.visibility$;
161
175
 
@@ -181,39 +195,6 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
181
195
  // console.log("-->view update: " + this.angularPConnect.getComponentID(this) + ", template: " + this.templateName$ + ", kids: " + kidList);
182
196
  }
183
197
 
184
- // JA - adapting additionalProps from Nebula/Constellation version which uses static methods
185
- // on the component classes stored in PComponents (that Angular doesn't have)...
186
- additionalProps(state: any, getPConnect: any) {
187
- let propObj = {};
188
-
189
- // We already have the template name in this.templateName$
190
- if (this.templateName$ !== '') {
191
- let allFields = {};
192
-
193
- // These uses are adapted from Nebula/Constellation CaseSummary.additionalProps
194
- switch (this.templateName$) {
195
- case 'CaseSummary':
196
- allFields = getAllFields(getPConnect);
197
- // eslint-disable-next-line no-case-declarations
198
- const unresFields = {
199
- primaryFields: allFields[0],
200
- secondaryFields: allFields[1]
201
- };
202
- propObj = getPConnect.resolveConfigProps(unresFields);
203
- break;
204
-
205
- case 'Details':
206
- allFields = getAllFields(getPConnect);
207
- propObj = { fields: allFields[0] };
208
- break;
209
- default:
210
- break;
211
- }
212
- }
213
-
214
- return propObj;
215
- }
216
-
217
198
  ngOnDestroy(): void {
218
199
  if (this.angularPConnectData.unsubscribeFn) {
219
200
  this.angularPConnectData.unsubscribeFn();
@@ -71,7 +71,6 @@ export class AdvancedSearchComponent implements OnInit, OnChanges {
71
71
  const [firstChildMeta] = rawViewMetadata.children;
72
72
 
73
73
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
74
- // @ts-ignore
75
74
  const cache = PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey) ?? {};
76
75
 
77
76
  this.editableFieldComp = firstChildPConnect().createComponent({
@@ -37,7 +37,7 @@ export function flattenObj(obj: any): any {
37
37
  export const initializeSearchFields = (searchFields, getPConnect, referenceListClassID, searchFieldRestoreValues = {}) => {
38
38
  const filtersProperties = {};
39
39
  searchFields?.forEach(field => {
40
- let val = '';
40
+ let val;
41
41
  const { value, defaultValue = '' } = field.config;
42
42
  const propPath = PCore.getAnnotationUtils().getPropertyName(value);
43
43
 
@@ -210,8 +210,7 @@ export class SearchGroupsComponent implements OnInit, OnDestroy, OnChanges {
210
210
  isValidInput(formValues)
211
211
  ) {
212
212
  if (this.isValidatorField) {
213
- // @ts-ignore
214
- PCore.getMessageManager().clearContextMessages({ context: transientItemID });
213
+ PCore.getMessageManager().clearContextMessages({ context: this.transientItemID });
215
214
  }
216
215
 
217
216
  this.previousFormValues = formValues;
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { MatSnackBarModule, MatSnackBar } from '@angular/material/snack-bar';
4
4
  import { Subscription } from 'rxjs';
@@ -52,14 +52,14 @@ export class AppShellComponent implements OnInit, OnDestroy {
52
52
  bOkDisplayError = false;
53
53
  portalTemplate: string;
54
54
  links: any = [];
55
- imageURL: string | Blob;
55
+ imageURL: string | Blob | null;
56
56
  localizedVal = PCore.getLocaleUtils().getLocaleValue;
57
57
 
58
58
  constructor(
59
59
  private angularPConnect: AngularPConnectService,
60
60
  private erService: ErrorMessagesService,
61
61
  private snackBar: MatSnackBar,
62
- private ngZone: NgZone,
62
+ private cdRef: ChangeDetectorRef,
63
63
  private utils: Utils
64
64
  ) {}
65
65
 
@@ -89,7 +89,6 @@ export class AppShellComponent implements OnInit, OnDestroy {
89
89
  PCore.getEnvironmentInfo().setEnvironmentInfo({ ...PCore.getEnvironmentInfo().environmentInfoObject, pyPortalTemplate: 'wss' } as any);
90
90
  }
91
91
 
92
- // @ts-ignore - Property 'pyCaseTypesAvailableToCreateDP' does not exist on type pxApplication
93
92
  const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
94
93
  if (caseTypesAvailableToCreateDP) {
95
94
  const portalID = this.pConn$.getValue('.pyOwner');
@@ -152,17 +151,15 @@ export class AppShellComponent implements OnInit, OnDestroy {
152
151
  const portalClass = this.pConn$.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
153
152
  const envPortalName = envInfo.getPortalName();
154
153
 
155
- this.ngZone.run(() => {
156
- // making a copy, so can add info
157
- this.pages$ = this.configProps$.pages;
154
+ // making a copy, so can add info
155
+ this.pages$ = this.configProps$.pages;
158
156
 
159
- if (this.pages$) {
160
- this.bShowAppShell$ = true;
161
- }
157
+ if (this.pages$) {
158
+ this.bShowAppShell$ = true;
159
+ }
162
160
 
163
- this.caseTypes$ = this.configProps$.caseTypes;
164
- this.arChildren$ = this.pConn$.getChildren();
165
- });
161
+ this.caseTypes$ = this.configProps$.caseTypes;
162
+ this.arChildren$ = this.pConn$.getChildren();
166
163
 
167
164
  const portalLogo = this.configProps$.portalLogo;
168
165
  // using the default icon then fetch it from the static folder (not auth involved)
@@ -181,12 +178,14 @@ export class AppShellComponent implements OnInit, OnDestroy {
181
178
  .getSvcImageUrl(portalLogo)
182
179
  .then(data => {
183
180
  this.imageURL = data;
181
+ this.cdRef.markForCheck();
184
182
  })
185
183
  .catch(() => {
186
184
  console.error(`${this.localizedVal('Unable to load the image for the portal logo/icon with the insName', 'AppShell')}:${portalLogo}`);
187
185
  });
188
186
  }
189
187
  this.appName$ = this.localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase());
188
+ this.cdRef.markForCheck();
190
189
  }
191
190
 
192
191
  // fpr show/hiding error messages in the SnackBar component
@@ -244,5 +243,6 @@ export class AppShellComponent implements OnInit, OnDestroy {
244
243
  default:
245
244
  break;
246
245
  }
246
+ this.cdRef.markForCheck();
247
247
  }
248
248
  }
@@ -1,15 +1,20 @@
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 = {};
10
12
  protected angularPConnect;
11
13
 
12
- childrenMetadataOld;
14
+ children: any[] = [];
15
+ propsToUse: any = {};
16
+ showHighlightedData: boolean;
17
+ highlightedDataArr: any = [];
13
18
 
14
19
  constructor(injector: Injector) {
15
20
  this.angularPConnect = injector.get(AngularPConnectService);
@@ -37,23 +42,13 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
37
42
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
38
43
 
39
44
  // Only call updateSelf when the component should update
40
- if (bUpdateSelf || this.hasRawMetadataChanged()) {
45
+ if (bUpdateSelf) {
41
46
  this.updateSelf();
42
47
  }
43
48
  }
44
49
 
45
- // this method will get overriden by the child component
46
- updateSelf() {}
47
-
48
- hasRawMetadataChanged(): boolean {
49
- const newChildrenMetadata = this.fetchChildrenMetadata();
50
-
51
- if (!PCore.isDeepEqual(newChildrenMetadata, this.childrenMetadataOld)) {
52
- this.childrenMetadataOld = newChildrenMetadata;
53
- return true;
54
- }
55
-
56
- return false;
50
+ updateSelf() {
51
+ this.updateDetailsProps();
57
52
  }
58
53
 
59
54
  fetchChildrenMetadata() {
@@ -64,4 +59,36 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
64
59
  return pConnect.resolveConfigProps(pConnect.getRawMetadata());
65
60
  });
66
61
  }
62
+
63
+ updateDetailsProps() {
64
+ const { label, showLabel, showHighlightedData } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
65
+ this.propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
66
+ this.showHighlightedData = showHighlightedData;
67
+
68
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
69
+ this.pConn$.setInheritedProp('readOnly', true);
70
+
71
+ this.children = this.pConn$.getChildren() as any[];
72
+
73
+ // Process highlighted fields for display in the highlighted section
74
+ this.highlightedDataArr = this.processHighlightedFields();
75
+ }
76
+
77
+ processHighlightedFields(): any[] {
78
+ if (!this.showHighlightedData) return [];
79
+
80
+ const { highlightedData = [] } = (this.pConn$.getRawMetadata() as any).config;
81
+
82
+ return (highlightedData ?? []).map(field => {
83
+ field.config.displayMode = 'STACKED_LARGE_VAL';
84
+ field.config.readOnly = true;
85
+
86
+ if (field.config.value === '@P .pyStatusWork') {
87
+ field.type = 'TextInput';
88
+ field.config.displayAsStatus = true;
89
+ }
90
+
91
+ return this.pConn$.createComponent(field, '', 0, {}).getPConnect();
92
+ });
93
+ }
67
94
  }
@@ -3,6 +3,7 @@ import { FormGroup } from '@angular/forms';
3
3
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
5
  import { Utils } from '@pega/angular-sdk-components';
6
+ import { getAllFields } from '@pega/angular-sdk-components';
6
7
 
7
8
  interface CaseSummaryProps {
8
9
  // If any, enter additional props that only exist on this component
@@ -73,7 +74,20 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
73
74
  }
74
75
 
75
76
  updateSelf() {
77
+ this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
76
78
  this.generatePrimaryAndSecondaryFields();
79
+ this.status$ = this.configProps$.status;
80
+ this.bShowStatus$ = this.configProps$.showStatus;
81
+ }
82
+
83
+ additionalProps() {
84
+ const allFields = getAllFields(this.pConn$);
85
+ const fields = {
86
+ primaryFields: allFields[0],
87
+ secondaryFields: allFields[1]
88
+ };
89
+
90
+ return this.pConn$.resolveConfigProps(fields);
77
91
  }
78
92
 
79
93
  ngOnChanges() {
@@ -86,7 +100,7 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
86
100
 
87
101
  for (const oField of this.arChildren$[0].getPConnect().getChildren()) {
88
102
  const kid = oField.getPConnect();
89
- this.primaryFields$.push(kid.resolveConfigProps(kid.getRawMetadata()));
103
+ this.primaryFields$.push({ ...kid.resolveConfigProps(kid.getRawMetadata()), kid });
90
104
  }
91
105
 
92
106
  const secondarySummaryFields = this.prepareCaseSummaryData(this.arChildren$[1].getPConnect());
@@ -17,7 +17,9 @@
17
17
 
18
18
  <div class="psdk-case-view-buttons">
19
19
  <button *ngIf="editAction" mat-raised-button color="secondary" (click)="_editClick()">{{ localizedVal('Edit', localeCategory) }}</button>
20
- <button mat-raised-button color="secondary" [matMenuTriggerFor]="actionMenu">{{ localizedVal('Actions...', localeCategory) }}</button>
20
+ <button mat-raised-button color="secondary" [matMenuTriggerFor]="actionMenu" [disabled]="bActionsMenuDisabled$">
21
+ {{ localizedVal('Actions...', localeCategory) }}
22
+ </button>
21
23
  <mat-menu #actionMenu="matMenu" overlapTrigger="false">
22
24
  <ng-container *ngFor="let action of arAvailableActions$">
23
25
  <button mat-menu-item (click)="_menuActionClick(action)">
@@ -29,6 +31,16 @@
29
31
  {{ process.name }}
30
32
  </button>
31
33
  </ng-container>
34
+ <ng-container *ngFor="let action of arDataObjectActions$">
35
+ <button mat-menu-item (click)="_menuDataObjectActionClick(action)">
36
+ {{ localizedVal(action.name, '', localeKey) }}
37
+ </button>
38
+ </ng-container>
39
+ <ng-container *ngFor="let action of arCreateCaseActions$">
40
+ <button mat-menu-item (click)="_menuCreateCaseActionClick(action)">
41
+ {{ localizedVal(action.name, '', localeKey) }}
42
+ </button>
43
+ </ng-container>
32
44
  </mat-menu>
33
45
  </div>
34
46
 
@@ -1,24 +1,133 @@
1
- import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
1
+ import { ChangeDetectorRef } from '@angular/core';
2
2
 
3
3
  import { CaseViewComponent } from './case-view.component';
4
4
 
5
5
  describe('CaseViewComponent', () => {
6
6
  let component: CaseViewComponent;
7
- let fixture: ComponentFixture<CaseViewComponent>;
7
+ let actionsApi: { openDataObjectAction: jasmine.Spy; createWork: jasmine.Spy };
8
+ let dataInfoActions: any;
9
+ let dataRecord: any;
10
+ let caseInfo: any;
8
11
 
9
- beforeEach(waitForAsync(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [CaseViewComponent]
12
- }).compileComponents();
13
- }));
12
+ const tabsChild = {
13
+ getPConnect: () => ({
14
+ getRawMetadata: () => ({ type: 'region', name: 'Tabs' }),
15
+ getChildren: () => []
16
+ })
17
+ };
14
18
 
15
19
  beforeEach(() => {
16
- fixture = TestBed.createComponent(CaseViewComponent);
17
- component = fixture.componentInstance;
18
- fixture.detectChanges();
20
+ (globalThis as any).PCore = {
21
+ getLocaleUtils: () => ({ getLocaleValue: (value: string) => value })
22
+ };
23
+
24
+ actionsApi = {
25
+ openDataObjectAction: jasmine.createSpy('openDataObjectAction'),
26
+ createWork: jasmine.createSpy('createWork')
27
+ };
28
+ dataInfoActions = undefined;
29
+ dataRecord = { PlanID: 'P-1', CustomerID: 'C-9' };
30
+ caseInfo = { ID: 'C-1', availableActions: [], availableProcesses: [] };
31
+
32
+ const cdRef = { detectChanges: () => {}, markForCheck: () => {} } as unknown as ChangeDetectorRef;
33
+ const utils = { getImageSrc: () => '', getSDKStaticContentUrl: () => '' } as any;
34
+
35
+ component = new CaseViewComponent(cdRef, {} as any, utils);
36
+ component.pConn$ = {
37
+ resolveConfigProps: (props: any) => props,
38
+ getConfigProps: () => ({ icon: 'case', header: 'Header', subheader: 'ID-1' }),
39
+ getCaseInfo: () => ({ getClassName: () => 'My-Class', getName: () => 'My Case' }),
40
+ getChildren: () => [tabsChild],
41
+ getLocalizationService: () => ({ getLocalizedText: (value: string) => value }),
42
+ getDataObject: () => ({ caseInfo }),
43
+ getValue: (prop: string, context?: string) => {
44
+ if (prop === '.actions' && context === 'dataInfo') return dataInfoActions;
45
+ if (prop === '.content' && context === 'dataInfo') return dataRecord;
46
+ if (prop === '.classID' && context === 'dataInfo.content') return 'My-Data-Class';
47
+ if (context === '') return dataRecord[prop.slice(1)];
48
+ return undefined;
49
+ },
50
+ getActionsApi: () => actionsApi
51
+ } as any;
52
+ component.localizedVal = (value: string) => value;
19
53
  });
20
54
 
21
55
  it('should create', () => {
22
56
  expect(component).toBeTruthy();
23
57
  });
58
+
59
+ it('lists data object actions published under dataInfo', () => {
60
+ dataInfoActions = {
61
+ availableActions: [{ ID: 'Edit', name: 'Edit' }],
62
+ availableCreateCaseActions: [{ ID: 'My-Work-Class', name: 'Request Plan Change' }]
63
+ };
64
+
65
+ component.fullUpdate();
66
+
67
+ expect(component.arDataObjectActions$.length).toBe(1);
68
+ expect(component.arCreateCaseActions$.length).toBe(1);
69
+ });
70
+
71
+ it('falls back to empty arrays when the dataInfo context is absent', () => {
72
+ dataInfoActions = undefined;
73
+
74
+ component.fullUpdate();
75
+
76
+ expect(component.arDataObjectActions$).toEqual([]);
77
+ expect(component.arCreateCaseActions$).toEqual([]);
78
+ });
79
+
80
+ it('disables the actions menu when no action of any kind is available', () => {
81
+ component.fullUpdate();
82
+
83
+ expect(component.bActionsMenuDisabled$).toBeTrue();
84
+ });
85
+
86
+ it('enables the actions menu when only data object actions are available', () => {
87
+ dataInfoActions = { availableActions: [{ ID: 'Edit', name: 'Edit' }] };
88
+
89
+ component.fullUpdate();
90
+
91
+ expect(component.bActionsMenuDisabled$).toBeFalse();
92
+ });
93
+
94
+ it('picks up case actions that arrive after the first update, without a case ID change', () => {
95
+ component.fullUpdate();
96
+ expect(component.bActionsMenuDisabled$).toBeTrue();
97
+ expect(component.editAction).toBeUndefined();
98
+
99
+ caseInfo.availableActions = [{ ID: 'pyUpdateCaseDetails', name: 'Edit details' }];
100
+ component.updateCaseActions();
101
+
102
+ expect(component.arAvailableActions$.length).toBe(1);
103
+ expect(component.editAction).toBeTruthy();
104
+ expect(component.bActionsMenuDisabled$).toBeFalse();
105
+ });
106
+
107
+ it('opens a data object action with the record class and content', () => {
108
+ component._menuDataObjectActionClick({ ID: 'updateCVV', name: 'Update CVV' });
109
+
110
+ expect(actionsApi.openDataObjectAction).toHaveBeenCalledWith('My-Data-Class', dataRecord, 'updateCVV', 'Update CVV');
111
+ });
112
+
113
+ it('starts a new case with starting fields nested under the target reference field', () => {
114
+ component._menuCreateCaseActionClick({
115
+ ID: 'My-Work-Class',
116
+ name: 'Request Plan Change',
117
+ targetDataReferenceField: {
118
+ field: 'PlanRef',
119
+ inputs: [{ linkedField: 'PlanID' }, { linkedField: 'CustomerID' }]
120
+ }
121
+ });
122
+
123
+ expect(actionsApi.createWork).toHaveBeenCalledWith('My-Work-Class', {
124
+ startingFields: { PlanRef: { PlanID: 'P-1', CustomerID: 'C-9' } }
125
+ });
126
+ });
127
+
128
+ it('starts a new case with no starting fields when the action declares no inputs', () => {
129
+ component._menuCreateCaseActionClick({ ID: 'My-Work-Class', name: 'Request Plan Change' });
130
+
131
+ expect(actionsApi.createWork).toHaveBeenCalledWith('My-Work-Class', { startingFields: {} });
132
+ });
24
133
  });