@pega/angular-sdk-overrides 0.24.8 → 0.25.1

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 (172) hide show
  1. package/lib/designSystemExtension/alert/alert.component.ts +0 -1
  2. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -2
  3. package/lib/designSystemExtension/banner/banner.component.ts +0 -1
  4. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -2
  5. package/lib/designSystemExtension/field-group/field-group.component.ts +0 -1
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -2
  8. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -1
  9. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  10. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -2
  11. package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +0 -1
  12. package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +0 -1
  13. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +0 -1
  14. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  15. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  16. package/lib/designSystemExtension/operator/operator.component.ts +5 -5
  17. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -8
  18. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +0 -1
  19. package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +0 -1
  20. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  21. package/lib/field/auto-complete/auto-complete.component.ts +31 -16
  22. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -1
  23. package/lib/field/check-box/check-box.component.html +18 -6
  24. package/lib/field/check-box/check-box.component.ts +17 -12
  25. package/lib/field/currency/currency.component.html +4 -4
  26. package/lib/field/currency/currency.component.ts +42 -20
  27. package/lib/field/date/date.component.html +3 -7
  28. package/lib/field/date/date.component.ts +22 -40
  29. package/lib/field/date-time/date-time.component.html +3 -4
  30. package/lib/field/date-time/date-time.component.ts +35 -17
  31. package/lib/field/decimal/decimal.component.html +4 -3
  32. package/lib/field/decimal/decimal.component.ts +47 -22
  33. package/lib/field/dropdown/dropdown.component.html +1 -0
  34. package/lib/field/dropdown/dropdown.component.ts +146 -19
  35. package/lib/field/email/email.component.ts +24 -5
  36. package/lib/field/group/group.component.ts +2 -3
  37. package/lib/field/integer/integer.component.ts +22 -5
  38. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  39. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -3
  40. package/lib/field/location/config-ext.json +8 -0
  41. package/lib/field/location/location.component.html +45 -0
  42. package/lib/field/location/location.component.scss +18 -0
  43. package/lib/field/location/location.component.spec.ts +22 -0
  44. package/lib/field/location/location.component.ts +385 -0
  45. package/lib/field/multiselect/multiselect.component.ts +17 -10
  46. package/lib/field/percentage/percentage.component.html +3 -3
  47. package/lib/field/percentage/percentage.component.ts +45 -21
  48. package/lib/field/phone/config-ext.json +1 -1
  49. package/lib/field/phone/phone.component.html +9 -6
  50. package/lib/field/phone/phone.component.scss +9 -0
  51. package/lib/field/phone/phone.component.ts +30 -27
  52. package/lib/field/radio-buttons/radio-buttons.component.html +17 -12
  53. package/lib/field/radio-buttons/radio-buttons.component.ts +13 -10
  54. package/lib/field/rich-text/rich-text.component.ts +19 -9
  55. package/lib/field/scalar-list/scalar-list.component.ts +3 -5
  56. package/lib/field/selectable-card/selectable-card.component.html +40 -0
  57. package/lib/field/selectable-card/selectable-card.component.scss +0 -0
  58. package/lib/field/selectable-card/selectable-card.component.spec.ts +22 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +255 -0
  60. package/lib/field/semantic-link/semantic-link.component.ts +0 -1
  61. package/lib/field/text/text.component.ts +8 -5
  62. package/lib/field/text-area/text-area.component.html +4 -1
  63. package/lib/field/text-area/text-area.component.ts +22 -6
  64. package/lib/field/text-content/text-content.component.ts +0 -1
  65. package/lib/field/text-input/text-input.component.ts +22 -5
  66. package/lib/field/time/time.component.html +2 -2
  67. package/lib/field/time/time.component.ts +35 -7
  68. package/lib/field/url/url.component.ts +22 -5
  69. package/lib/field/user-reference/user-reference.component.html +40 -46
  70. package/lib/field/user-reference/user-reference.component.ts +111 -21
  71. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  72. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -48
  73. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  74. package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +0 -1
  75. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  76. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -9
  77. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  78. package/lib/infra/Containers/view-container/helper.ts +22 -0
  79. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  80. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  81. package/lib/infra/action-buttons/action-buttons.component.ts +0 -1
  82. package/lib/infra/assignment/assignment.component.html +1 -1
  83. package/lib/infra/assignment/assignment.component.ts +82 -41
  84. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  85. package/lib/infra/assignment-card/assignment-card.component.ts +0 -1
  86. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  87. package/lib/infra/defer-load/defer-load.component.ts +8 -6
  88. package/lib/infra/error-boundary/error-boundary.component.ts +0 -1
  89. package/lib/infra/multi-step/multi-step.component.ts +0 -1
  90. package/lib/infra/navbar/navbar.component.ts +3 -6
  91. package/lib/infra/reference/reference.component.ts +77 -90
  92. package/lib/infra/region/region.component.ts +0 -1
  93. package/lib/infra/root-container/root-container.component.html +2 -15
  94. package/lib/infra/root-container/root-container.component.ts +27 -33
  95. package/lib/infra/stages/stages.component.scss +2 -2
  96. package/lib/infra/stages/stages.component.ts +0 -1
  97. package/lib/infra/view/view.component.html +7 -20
  98. package/lib/infra/view/view.component.ts +20 -3
  99. package/lib/template/app-shell/app-shell.component.ts +20 -3
  100. package/lib/template/banner-page/banner-page.component.ts +0 -1
  101. package/lib/template/base/details-template-base.ts +67 -0
  102. package/lib/template/base/form-template-base.ts +16 -0
  103. package/lib/template/case-summary/case-summary.component.ts +7 -23
  104. package/lib/template/case-view/case-view.component.html +4 -4
  105. package/lib/template/case-view/case-view.component.ts +8 -14
  106. package/lib/template/confirmation/confirmation.component.html +1 -1
  107. package/lib/template/confirmation/confirmation.component.ts +1 -2
  108. package/lib/template/data-reference/data-reference.component.ts +36 -41
  109. package/lib/template/default-form/default-form.component.html +0 -4
  110. package/lib/template/default-form/default-form.component.ts +41 -25
  111. package/lib/template/details/details.component.ts +7 -42
  112. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -40
  113. package/lib/template/details-one-column/details-one-column.component.ts +7 -43
  114. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  115. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -38
  116. package/lib/template/details-three-column/details-three-column.component.ts +7 -44
  117. package/lib/template/details-two-column/details-two-column.component.ts +8 -45
  118. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -43
  119. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  120. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  121. package/lib/template/field-group-list/field-group-list.component.ts +0 -1
  122. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  123. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  124. package/lib/template/field-group-template/field-group-template.component.ts +68 -48
  125. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  126. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  127. package/lib/template/field-value-list/field-value-list.component.ts +0 -1
  128. package/lib/template/inline-dashboard/inline-dashboard.component.ts +0 -1
  129. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -3
  130. package/lib/template/list-page/list-page.component.ts +0 -1
  131. package/lib/template/list-view/list-view.component.html +6 -1
  132. package/lib/template/list-view/list-view.component.scss +11 -0
  133. package/lib/template/list-view/list-view.component.ts +25 -11
  134. package/lib/template/list-view/listViewHelpers.ts +4 -10
  135. package/lib/template/list-view/utils.ts +2 -5
  136. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +0 -1
  137. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -2
  138. package/lib/template/one-column/one-column.component.ts +4 -4
  139. package/lib/template/one-column-page/one-column-page.component.ts +0 -1
  140. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -2
  141. package/lib/template/page/page.component.ts +1 -2
  142. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -2
  143. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  144. package/lib/template/simple-table/simple-table.component.ts +0 -1
  145. package/lib/template/simple-table-manual/helpers.ts +126 -10
  146. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  147. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  148. package/lib/template/simple-table-manual/simple-table-manual.component.ts +110 -54
  149. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -4
  150. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +0 -1
  151. package/lib/template/sub-tabs/sub-tabs.component.ts +0 -1
  152. package/lib/template/three-column/three-column.component.ts +4 -4
  153. package/lib/template/three-column-page/three-column-page.component.ts +0 -1
  154. package/lib/template/two-column/two-column.component.ts +4 -4
  155. package/lib/template/two-column-page/two-column-page.component.ts +0 -1
  156. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -2
  157. package/lib/template/utils.ts +16 -0
  158. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -4
  159. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -2
  160. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -4
  161. package/lib/widget/app-announcement/app-announcement.component.ts +0 -1
  162. package/lib/widget/attachment/attachment.component.ts +9 -13
  163. package/lib/widget/case-history/case-history.component.ts +0 -1
  164. package/lib/widget/feed-container/feed-container.component.ts +7 -10
  165. package/lib/widget/file-utility/file-utility.component.ts +2 -6
  166. package/lib/widget/list-utility/list-utility.component.ts +0 -1
  167. package/lib/widget/quick-create/quick-create.component.ts +0 -1
  168. package/lib/widget/todo/todo.component.html +5 -6
  169. package/lib/widget/todo/todo.component.scss +9 -0
  170. package/lib/widget/todo/todo.component.ts +95 -85
  171. package/lib/widget/utility/utility.component.ts +0 -1
  172. package/package.json +1 -1
@@ -6,9 +6,18 @@ import { FormGroup } from '@angular/forms';
6
6
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
7
7
  import { ErrorMessagesService } from '@pega/angular-sdk-components';
8
8
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
9
+ import { BannerService } from '@pega/angular-sdk-components';
9
10
  import { ReferenceComponent } from '@pega/angular-sdk-components';
10
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
12
 
13
+ function getRefreshProps(refreshConditions) {
14
+ // refreshConditions cuurently supports only "Changes" event
15
+ if (!refreshConditions) {
16
+ return [];
17
+ }
18
+ return refreshConditions.filter(item => item.event && item.event === 'Changes').map(item => [item.field, item.field?.substring(1)]) || [];
19
+ }
20
+
12
21
  interface AssignmentProps {
13
22
  // If any, enter additional props that only exist on this component
14
23
  template: string;
@@ -18,7 +27,6 @@ interface AssignmentProps {
18
27
  selector: 'app-assignment',
19
28
  templateUrl: './assignment.component.html',
20
29
  styleUrls: ['./assignment.component.scss'],
21
- standalone: true,
22
30
  imports: [CommonModule, MatSnackBarModule, forwardRef(() => ComponentMapperComponent)]
23
31
  })
24
32
  export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
@@ -29,7 +37,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
29
37
  @Input() isCreateStage$: boolean;
30
38
  @Input() updateToken$: number;
31
39
  @Input() isInModal$ = false;
32
- @Input() banners;
33
40
 
34
41
  // For interaction with AngularPConnect
35
42
  angularPConnectData: AngularPConnectData = {};
@@ -69,12 +76,15 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
69
76
  localeCategory = 'Assignment';
70
77
  localeReference;
71
78
 
79
+ snackBarRef;
80
+
72
81
  constructor(
73
82
  private angularPConnect: AngularPConnectService,
74
83
  private psService: ProgressSpinnerService,
75
84
  private erService: ErrorMessagesService,
76
85
  private ngZone: NgZone,
77
- private snackBar: MatSnackBar
86
+ private snackBar: MatSnackBar,
87
+ public bannerService: BannerService
78
88
  ) {}
79
89
 
80
90
  ngOnInit(): void {
@@ -105,6 +115,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
105
115
  // Should always check the bridge to see if the component should update itself (re-render)
106
116
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
107
117
 
118
+ this.bannerService.updateBanners(this.itemKey$);
119
+
108
120
  // ONLY call updateSelf when the component should update
109
121
  // AND removing the "gate" that was put there since shouldComponentUpdate
110
122
  // should be the real "gate"
@@ -128,6 +140,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
128
140
  }
129
141
 
130
142
  updateChanges() {
143
+ this.registerForRefresh();
144
+
131
145
  // pConn$ may be a 'reference' component, so normalize it
132
146
  this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
133
147
 
@@ -285,6 +299,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
285
299
  }
286
300
 
287
301
  buttonClick(sAction, sButtonType) {
302
+ this.snackBarRef?.dismiss();
303
+ this.bannerService.clearBanners();
304
+ PCore.getPubSubUtils().publish('clearBannerMessages');
288
305
  // right now, done on an individual basis, setting bReInit to true
289
306
  // upon the next flow container state change, will cause the flow container
290
307
  // to re-initialize
@@ -308,21 +325,21 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
308
325
  switch (sAction) {
309
326
  case 'navigateToStep':
310
327
  this.erService.sendMessage('publish', '');
311
- if (this.formValid()) {
312
- this.bReInit = true;
313
- this.psService.sendMessage(true);
314
328
 
315
- const navigatePromise = this.navigateToStep('previous', this.itemKey$);
316
- navigatePromise
317
- .then(() => {
318
- this.updateChanges();
319
- this.psService.sendMessage(false);
320
- })
321
- .catch(() => {
322
- this.psService.sendMessage(false);
323
- this.snackBar.open(`${this.localizedVal('Navigation failed!', this.localeCategory)}`, 'Ok');
324
- });
325
- }
329
+ this.bReInit = true;
330
+ this.psService.sendMessage(true);
331
+
332
+ const navigatePromise = this.navigateToStep('previous', this.itemKey$);
333
+ navigatePromise
334
+ .then(() => {
335
+ this.updateChanges();
336
+ this.psService.sendMessage(false);
337
+ })
338
+ .catch(() => {
339
+ this.psService.sendMessage(false);
340
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Navigation failed!', this.localeCategory)}`, 'Ok');
341
+ });
342
+
326
343
  break;
327
344
 
328
345
  case 'saveAssignment': {
@@ -332,14 +349,13 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
332
349
 
333
350
  savePromise
334
351
  .then(() => {
335
- // @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'.
336
352
  const caseType = this.pConn$.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
337
353
  PCore.getPubSubUtils().publish('cancelPressed');
338
354
  this.onSaveActionSuccess({ caseType, caseID, assignmentID });
339
355
  })
340
356
  .catch(() => {
341
357
  this.psService.sendMessage(false);
342
- this.snackBar.open(`${this.localizedVal('Save failed', this.localeCategory)}`, 'Ok');
358
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Save failed', this.localeCategory)}`, 'Ok');
343
359
  });
344
360
 
345
361
  break;
@@ -363,7 +379,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
363
379
  })
364
380
  .catch(() => {
365
381
  this.psService.sendMessage(false);
366
- this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
382
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
367
383
  });
368
384
  } else {
369
385
  this.psService.sendMessage(true);
@@ -380,7 +396,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
380
396
  })
381
397
  .catch(() => {
382
398
  this.psService.sendMessage(false);
383
- this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
399
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
384
400
  });
385
401
  }
386
402
  break;
@@ -392,7 +408,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
392
408
  .then(() => {})
393
409
  .catch(() => {
394
410
  this.psService.sendMessage(false);
395
- this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
411
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
396
412
  });
397
413
 
398
414
  break;
@@ -405,23 +421,18 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
405
421
  switch (sAction) {
406
422
  case 'finishAssignment':
407
423
  this.erService.sendMessage('publish', '');
408
- if (this.formValid()) {
409
- this.bReInit = true;
410
- this.psService.sendMessage(true);
411
- const finishPromise = this.finishAssignment(this.itemKey$); // JA - was itemID but Nebula/Constellation uses itemKey
412
- finishPromise
413
- .then(() => {
414
- this.psService.sendMessage(false);
415
- this.updateChanges();
416
- })
417
- .catch(() => {
418
- this.psService.sendMessage(false);
419
- this.snackBar.open(`${this.localizedVal('Submit failed!', this.localeCategory)}`, 'Ok');
420
- });
421
- } else {
422
- // let snackBarRef = this.snackBar.open("Please fix errors on form.", "Ok");
423
- this.erService.sendMessage('show', this.localizedVal('Please fix errors on form.', this.localeCategory));
424
- }
424
+ this.bReInit = true;
425
+ this.psService.sendMessage(true);
426
+ const finishPromise = this.finishAssignment(this.itemKey$); // JA - was itemID but Nebula/Constellation uses itemKey
427
+ finishPromise
428
+ .then(() => {
429
+ this.psService.sendMessage(false);
430
+ this.updateChanges();
431
+ })
432
+ .catch(() => {
433
+ this.psService.sendMessage(false);
434
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Submit failed!', this.localeCategory)}`, 'Ok');
435
+ });
425
436
  break;
426
437
 
427
438
  case 'approveCase': {
@@ -431,7 +442,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
431
442
  .then(() => {})
432
443
  .catch(() => {
433
444
  this.psService.sendMessage(false);
434
- this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
445
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
435
446
  });
436
447
 
437
448
  break;
@@ -453,10 +464,40 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
453
464
  });
454
465
  }
455
466
 
456
- // eslint-disable-next-line sonarjs/no-identical-functions
457
467
  topViewRefresh(): void {
458
468
  Object.values(this.formGroup$.controls).forEach((control: any) => {
459
469
  control.markAsTouched();
460
470
  });
461
471
  }
472
+
473
+ registerForRefresh() {
474
+ const refreshConditions = this.pConn$.getCaseInfo()?.getActionRefreshConditions();
475
+ const pageReference = this.pConn$.getPageReference();
476
+ const context = this.pConn$.getContextName();
477
+
478
+ // refresh api de-registration
479
+ PCore.getRefreshManager().deRegisterForRefresh(context);
480
+
481
+ // refresh api registration
482
+ const refreshProps = getRefreshProps(refreshConditions);
483
+ const caseKey = this.pConn$.getCaseInfo().getKey();
484
+ const refreshOptions = {
485
+ autoDetectRefresh: true,
486
+ preserveClientChanges: false
487
+ };
488
+ if (refreshProps.length > 0) {
489
+ refreshProps.forEach(prop => {
490
+ PCore.getRefreshManager().registerForRefresh(
491
+ 'PROP_CHANGE',
492
+ this.pConn$.getActionsApi().refreshCaseView.bind(this.pConn$.getActionsApi(), caseKey, '', pageReference, {
493
+ ...refreshOptions,
494
+ refreshFor: prop[0]
495
+ }),
496
+ `${pageReference}.${prop[1]}`,
497
+ `${context}/${pageReference}`,
498
+ context
499
+ );
500
+ });
501
+ }
502
+ }
462
503
  }
@@ -18,6 +18,7 @@
18
18
  <div class="psdk-case-view-divider"></div>
19
19
 
20
20
  <component-mapper
21
+ *ngIf="arMainButtons$ && arSecondaryButtons$"
21
22
  name="ActionButtons"
22
23
  [props]="{ arMainButtons$, arSecondaryButtons$ }"
23
24
  [parent]="this"
@@ -8,7 +8,6 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
8
  selector: 'app-assignment-card',
9
9
  templateUrl: './assignment-card.component.html',
10
10
  styleUrls: ['./assignment-card.component.scss'],
11
- standalone: true,
12
11
  imports: [CommonModule, ReactiveFormsModule, forwardRef(() => ComponentMapperComponent)]
13
12
  })
14
13
  export class AssignmentCardComponent implements OnInit, OnChanges {
@@ -14,7 +14,6 @@ import { getFilterExpression, getFormattedDate, createFilter, combineFilters } f
14
14
  selector: 'app-dashboard-filter',
15
15
  templateUrl: './dashboard-filter.component.html',
16
16
  styleUrls: ['./dashboard-filter.component.scss'],
17
- standalone: true,
18
17
  imports: [
19
18
  CommonModule,
20
19
  MatFormFieldModule,
@@ -15,7 +15,6 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
15
15
  selector: 'app-defer-load',
16
16
  templateUrl: './defer-load.component.html',
17
17
  styleUrls: ['./defer-load.component.scss'],
18
- standalone: true,
19
18
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
20
19
  })
21
20
  export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
@@ -38,6 +37,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
38
37
  CASE: any;
39
38
  PAGE: any;
40
39
  DATA: any;
40
+ lastUpdateCaseTime;
41
41
  constructor(private angularPConnect: AngularPConnectService) {
42
42
  this.constants = PCore.getConstants();
43
43
  }
@@ -58,8 +58,10 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
58
58
  // Should always check the bridge to see if the component should
59
59
  // update itself (re-render)
60
60
  const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
61
- if (theRequestedAssignment !== this.currentLoadedAssignment) {
61
+ const lastUpdateCaseTime = this.pConn$.getValue('caseInfo.lastUpdateTime');
62
+ if (theRequestedAssignment !== this.currentLoadedAssignment || (lastUpdateCaseTime && lastUpdateCaseTime !== this.lastUpdateCaseTime)) {
62
63
  this.currentLoadedAssignment = theRequestedAssignment;
64
+ this.lastUpdateCaseTime = lastUpdateCaseTime;
63
65
  this.loadActiveTab();
64
66
  }
65
67
  }
@@ -81,7 +83,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
81
83
  this.resourceType = resourceType;
82
84
  this.isContainerPreview = /preview_[0-9]*/g.test(this.pConn$.getContextName());
83
85
 
84
- const theConfigProps: any = this.pConn$.getConfigProps();
86
+ const theConfigProps = this.pConn$.getConfigProps();
85
87
  this.deferLoadId = theConfigProps.deferLoadId;
86
88
  this.name = this.name || theConfigProps.name;
87
89
 
@@ -91,8 +93,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
91
93
  getViewOptions = () => ({
92
94
  viewContext: this.resourceType,
93
95
  pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID,
94
- container: this.isContainerPreview ? 'preview' : null,
95
- containerName: this.isContainerPreview ? 'preview' : null,
96
+ container: this.isContainerPreview ? 'preview' : undefined,
97
+ containerName: this.isContainerPreview ? 'preview' : undefined,
96
98
  updateData: this.isContainerPreview
97
99
  });
98
100
 
@@ -116,7 +118,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
116
118
  }
117
119
  };
118
120
  const configObject = PCore.createPConnect(config);
119
- configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
121
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
120
122
  this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
121
123
  this.componentName$ = this.loadedPConn$.getComponentName();
122
124
  if (this.deferLoadId) {
@@ -5,7 +5,6 @@ import { CommonModule } from '@angular/common';
5
5
  selector: 'app-error-boundary',
6
6
  templateUrl: './error-boundary.component.html',
7
7
  styleUrls: ['./error-boundary.component.scss'],
8
- standalone: true,
9
8
  imports: [CommonModule]
10
9
  })
11
10
  export class ErrorBoundaryComponent {
@@ -9,7 +9,6 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
9
  templateUrl: './multi-step.component.html',
10
10
  styleUrls: ['./multi-step.component.scss'],
11
11
  providers: [Utils],
12
- standalone: true,
13
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
14
13
  })
15
14
  export class MultiStepComponent implements OnInit {
@@ -7,8 +7,6 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
7
7
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
 
10
- declare const window: any;
11
-
12
10
  interface NavBarProps {
13
11
  // If any, enter additional props that only exist on this component
14
12
  showAppName?: boolean;
@@ -19,7 +17,6 @@ interface NavBarProps {
19
17
  templateUrl: './navbar.component.html',
20
18
  styleUrls: ['./navbar.component.scss'],
21
19
  providers: [Utils],
22
- standalone: true,
23
20
  imports: [CommonModule, MatListModule, MatMenuModule]
24
21
  })
25
22
  export class NavbarComponent implements OnInit, OnDestroy {
@@ -36,11 +33,11 @@ export class NavbarComponent implements OnInit, OnDestroy {
36
33
  navExpandCollapse$: string;
37
34
  bShowCaseTypes$ = false;
38
35
 
39
- portalApp$ = '';
36
+ portalApp$: string | undefined = '';
40
37
  portalLogoImage$: string;
41
38
  showAppName$?: boolean = false;
42
39
 
43
- portalOperator$: string;
40
+ portalOperator$: string | undefined;
44
41
  portalOperatorInitials$: string;
45
42
 
46
43
  actionsAPI: any;
@@ -131,7 +128,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
131
128
 
132
129
  this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');
133
130
  this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName();
134
- this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$);
131
+ this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? '');
135
132
  this.showAppName$ = this.configProps$.showAppName;
136
133
 
137
134
  this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel();
@@ -13,53 +13,42 @@ import { Component } from '@angular/core';
13
13
  standalone: true
14
14
  })
15
15
  export class ReferenceComponent {
16
- referencedComponent: any = null;
17
-
18
16
  /* Used to toggle some class-wide logging */
19
17
  private static bLogging = false;
20
18
 
21
- constructor() {
22
- // With new static method approach, this shouldn't be called any more
23
- window.alert(`in ReferenceComponent constructor!`);
24
-
25
- console.error(`in ReferenceComponent constructor!`);
26
- }
27
-
28
- // onStateChange and updateSelf methods removed from original implementation
29
- // when we moved to the static method implementation.
30
-
31
- // STATIC method to create a normalized PConn (a fully realized View that the 'reference'
32
- // component refers to) from the given pConn. Has to add in some stuff as in the constructor
33
- static createFullReferencedViewFromRef(inPConn: any) {
34
- // BAIL and ERROR if inPConn is NOT a reference!
19
+ /**
20
+ * Creates a normalized PConn from a reference component.
21
+ * Resolves the reference to its fully realized View with proper configuration.
22
+ *
23
+ * @param inPConn - The PConn object that represents a reference component
24
+ * @returns The dereferenced PConnect object, or null if reference can't be resolved
25
+ */
26
+ static createFullReferencedViewFromRef(inPConn: any): any {
27
+ // Validate that inPConn is a reference component
35
28
  if (inPConn.getComponentName() !== 'reference') {
36
- // debugger;
37
-
38
29
  console.error(`Reference component: createFullReferencedViewFromRef inPConn is NOT a reference! ${inPConn.getComponentName()}`);
30
+ return null;
39
31
  }
40
32
 
41
- const theResolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
42
-
43
- const referenceConfig = { ...inPConn.getComponentConfig() } || {};
33
+ // Get reference configuration and make a copy
34
+ const referenceConfig = { ...inPConn.getComponentConfig() };
44
35
 
45
- // Since SDK-A implements Reference as static methods and we don't rely on
46
- // the Reference component's handling of the visibility prop, we leave it in
47
- // (and also leaving the others in for now) so the referenced View can act on
48
- // the visibility prop. (The following 3 lines were carried over from React SDK)
36
+ // Remove properties that should not be inherited by the referenced view
37
+ // (Maintained from React SDK implementation)
49
38
  delete referenceConfig?.name;
50
- // delete referenceConfig?.type;
51
- // delete referenceConfig?.visibility;
39
+ delete referenceConfig?.type;
40
+ delete referenceConfig?.visibility;
52
41
 
42
+ // Get the metadata for the referenced view
53
43
  const viewMetadata = inPConn.getReferencedView();
54
44
 
45
+ // Return null if view metadata is not found
55
46
  if (!viewMetadata) {
56
47
  console.log('View not found ', inPConn.getComponentConfig());
57
48
  return null;
58
49
  }
59
50
 
60
- // If we get here, we have metadata for a View component...
61
- // const referencedComponentName = viewMetadata.type;
62
-
51
+ // Create the view object by merging metadata with reference config
63
52
  const viewObject = {
64
53
  ...viewMetadata,
65
54
  config: {
@@ -68,23 +57,31 @@ export class ReferenceComponent {
68
57
  }
69
58
  };
70
59
 
60
+ // Resolve configuration properties
61
+ const resolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
62
+ const { visibility = true, context, readOnly = false, displayMode = '' } = resolvedConfigProps;
63
+
64
+ // Log debug information if logging is enabled
71
65
  if (ReferenceComponent.bLogging) {
72
- console.log(`Reference: about to call createComponent with pageReference: context: ${theResolvedConfigProps.context}`);
66
+ console.log(`Reference: about to call createComponent with pageReference: context: ${inPConn.getContextName()}`);
73
67
  }
74
68
 
69
+ // Create the component with the right context
75
70
  const viewComponent = inPConn.createComponent(viewObject, null, null, {
76
- pageReference: theResolvedConfigProps.context
71
+ pageReference: context && context.startsWith('@CLASS') ? '' : context
77
72
  });
78
73
 
79
- // updating the referencedComponent should trigger a render
74
+ // Get the PConnect object from the created component
80
75
  const newCompPConnect = viewComponent.getPConnect();
81
76
 
77
+ // Set inherited configuration on the new component
82
78
  newCompPConnect.setInheritedConfig({
83
79
  ...referenceConfig,
84
- readOnly: theResolvedConfigProps.readOnly ? theResolvedConfigProps.readOnly : false,
85
- displayMode: theResolvedConfigProps.displayMode ? theResolvedConfigProps.displayMode : null
80
+ readOnly,
81
+ displayMode
86
82
  });
87
83
 
84
+ // Log debug information if logging is enabled
88
85
  if (ReferenceComponent.bLogging) {
89
86
  console.log(
90
87
  `Angular Reference component: createFullReferencedViewFromRef -> newCompPConnect configProps: ${JSON.stringify(
@@ -93,73 +90,63 @@ export class ReferenceComponent {
93
90
  );
94
91
  }
95
92
 
96
- return newCompPConnect;
93
+ // Return the component if it should be visible, otherwise null
94
+ return visibility !== false ? newCompPConnect : null;
97
95
  }
98
96
 
99
- // STATIC method that other components can call to normalize
100
- // a pConn object that might be a 'reference'. If the incoming
101
- // pConn is a reference, return its dereferenced View PConnect's
102
- // getPConnect. Otherwise, return the passed in pConn unchanged
103
- // inPConn = a PConn object (ex: { getPConnect()} )
104
- static normalizePConn(inPConn: any) {
105
- // debugger;
106
-
107
- let returnObj = false;
108
- let thePConnType = '';
109
-
110
- if (inPConn.getPConnect) {
111
- // inPConn is an object (ex: { getPConnect()} ), so we want to return
112
- // any referenced view as the object containing the
113
- // the getPConnect function
114
- returnObj = true;
115
- thePConnType = inPConn.getPConnect().getComponentName();
116
- } else {
117
- // inPConn is an object with the PConnect function, so we want
118
- // to return any referenced view as the object containing the
119
- // the c11n function
120
- returnObj = false;
121
- thePConnType = inPConn.getComponentName();
97
+ /**
98
+ * Normalizes a PConn object that might be a 'reference'.
99
+ * If the incoming PConn is a reference, returns its dereferenced View.
100
+ * Otherwise, returns the passed in PConn unchanged.
101
+ *
102
+ * @param inPConn - A PConn object (ex: { getPConnect() } or direct PConnect)
103
+ * @returns The normalized PConn object with references resolved
104
+ */
105
+ static normalizePConn(inPConn: any): any {
106
+ // Early return for null or undefined input
107
+ if (!inPConn) {
108
+ return inPConn;
122
109
  }
123
110
 
124
- if (thePConnType === 'reference') {
125
- if (returnObj) {
126
- // WAS...
127
- // const theRefViewPConn = inPConn.getPConnect().getReferencedViewPConnect(true);
128
- // Now: ALWAYS calling createFullReferencedViewFromRef to have options, PageReference, etc.
129
- // set correctly in the C11nEnv (PConnect) object
130
- // debugger;
131
- let theRefViewPConn = this.createFullReferencedViewFromRef(inPConn.getPConnect());
132
- // now return its PConnect
133
- theRefViewPConn = theRefViewPConn.getComponent();
134
-
135
- // const theFullReference = theRefViewPConn.getPConnect().getFullReference();
136
- // console.log(`theFullReference: ${theFullReference}`);
137
-
138
- return theRefViewPConn;
111
+ // Determine if we have an object with getPConnect method or direct PConnect
112
+ const hasGetPConnectMethod = !!inPConn.getPConnect;
113
+
114
+ // Get the component name in the appropriate way based on the object type
115
+ const componentName = hasGetPConnectMethod ? inPConn.getPConnect().getComponentName() : inPConn.getComponentName();
116
+
117
+ // Only process if this is a reference component
118
+ if (componentName === 'reference') {
119
+ if (hasGetPConnectMethod) {
120
+ // For objects with getPConnect method, get the referenced view and its component
121
+ const refViewPConn = this.createFullReferencedViewFromRef(inPConn.getPConnect());
122
+ return refViewPConn?.getComponent();
139
123
  }
140
- // console.log(`created theFullRefView full reference: ${theFullRefView.getFullReference()}`);
141
- // debugger;
142
124
 
125
+ // For direct PConnect objects, just create the referenced view
143
126
  return this.createFullReferencedViewFromRef(inPConn);
144
127
  }
128
+
129
+ // Not a reference component, return unchanged
145
130
  return inPConn;
146
131
  }
147
132
 
148
- // STATIC method that other components can call to normalize
149
- // an array of pConn objects where any of the children might
150
- // be a 'reference'. The array returns an array of children
151
- // where any 'reference' is replaced with its ReferencedView
152
- // inPConnArray is an array of PConn objects or functions.
153
- // Its value is passed to normalizePConn
154
-
155
- static normalizePConnArray(inPConnArray: any) {
156
- if (!(inPConnArray?.length > 0)) {
157
- // null or empty array, return what was passed in
158
- return inPConnArray;
133
+ /**
134
+ * Normalizes an array of PConn objects by replacing any 'reference' components
135
+ * with their referenced views.
136
+ *
137
+ * @param inPConnArray - Array of PConn objects to normalize
138
+ * @returns Normalized array with references resolved, or empty array if input is invalid
139
+ */
140
+ static normalizePConnArray(inPConnArray: any[]): any[] {
141
+ // Handle null, undefined, or empty array case
142
+ if (!inPConnArray?.length) {
143
+ return inPConnArray || [];
159
144
  }
160
145
 
161
- return inPConnArray.map(child => {
162
- return ReferenceComponent.normalizePConn(child);
163
- });
146
+ // Process array: normalize each item and filter out any null/undefined results
147
+ const normalizedArray = inPConnArray.map(child => ReferenceComponent.normalizePConn(child)).filter(Boolean);
148
+
149
+ // Ensure we always return an array (even if filter removes all items)
150
+ return normalizedArray || [];
164
151
  }
165
152
  }
@@ -8,7 +8,6 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
8
  selector: 'app-region',
9
9
  templateUrl: './region.component.html',
10
10
  styleUrls: ['./region.component.scss'],
11
- standalone: true,
12
11
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
13
12
  })
14
13
  export class RegionComponent implements OnInit, OnChanges {
@@ -5,20 +5,11 @@
5
5
  <div *ngIf="bShowRoot$">
6
6
  <div [ngSwitch]="componentName$">
7
7
  <component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$, displayOnlyFA$ }"></component-mapper>
8
- <!-- <app-reference *ngSwitchCase="'reference'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-reference> -->
9
8
  <component-mapper
10
9
  *ngSwitchCase="'ViewContainer'"
11
10
  name="ViewContainer"
12
- [props]="{ pConn$: displayOnlyFA$ ? viewContainerPConn$ : pConn$, displayOnlyFA$ }"
11
+ [props]="{ pConn$: viewContainerPConn$, displayOnlyFA$ }"
13
12
  ></component-mapper>
14
- <app-hybrid-view-container *ngSwitchCase="'HybridViewContainer'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-hybrid-view-container>
15
- <app-modal-view-container
16
- *ngSwitchCase="'ModalViewContainer'"
17
- [pConn$]="pConn$"
18
- [displayOnlyFA$]="displayOnlyFA$"
19
- (modalVisibleChange)="modalVisibleChanged($event)"
20
- ></app-modal-view-container>
21
- <div *ngSwitchCase="''"></div>
22
13
  <div *ngSwitchDefault>{{ localizedVal('RootContainer Missing: ' + componentName$, localeCategory) }}.</div>
23
14
  </div>
24
15
  </div>
@@ -28,9 +19,5 @@
28
19
  </div>
29
20
 
30
21
  <div *ngIf="mConn$ != null">
31
- <app-modal-view-container
32
- [pConn$]="mConn$"
33
- [displayOnlyFA$]="displayOnlyFA$"
34
- (modalVisibleChange)="modalVisibleChanged($event)"
35
- ></app-modal-view-container>
22
+ <app-modal-view-container [pConn$]="mConn$"></app-modal-view-container>
36
23
  </div>