@pega/angular-sdk-overrides 24.1.10 → 24.2.12

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 (125) hide show
  1. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -1
  2. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
  3. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  4. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -1
  5. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  6. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -1
  7. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  8. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  9. package/lib/designSystemExtension/operator/operator.component.ts +5 -4
  10. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
  11. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  12. package/lib/field/auto-complete/auto-complete.component.ts +31 -15
  13. package/lib/field/check-box/check-box.component.html +4 -0
  14. package/lib/field/check-box/check-box.component.ts +11 -10
  15. package/lib/field/currency/currency.component.html +4 -4
  16. package/lib/field/currency/currency.component.ts +42 -19
  17. package/lib/field/date/date.component.html +3 -7
  18. package/lib/field/date/date.component.ts +22 -39
  19. package/lib/field/date-time/date-time.component.html +3 -4
  20. package/lib/field/date-time/date-time.component.ts +35 -16
  21. package/lib/field/decimal/decimal.component.html +4 -3
  22. package/lib/field/decimal/decimal.component.ts +47 -21
  23. package/lib/field/dropdown/dropdown.component.html +1 -0
  24. package/lib/field/dropdown/dropdown.component.ts +146 -18
  25. package/lib/field/email/email.component.ts +24 -4
  26. package/lib/field/group/group.component.ts +2 -2
  27. package/lib/field/integer/integer.component.ts +22 -4
  28. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  29. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -2
  30. package/lib/field/multiselect/multiselect.component.ts +15 -5
  31. package/lib/field/percentage/percentage.component.html +3 -3
  32. package/lib/field/percentage/percentage.component.ts +45 -20
  33. package/lib/field/phone/config-ext.json +1 -1
  34. package/lib/field/phone/phone.component.html +4 -2
  35. package/lib/field/phone/phone.component.ts +16 -26
  36. package/lib/field/radio-buttons/radio-buttons.component.html +3 -6
  37. package/lib/field/radio-buttons/radio-buttons.component.ts +9 -9
  38. package/lib/field/rich-text/rich-text.component.ts +19 -8
  39. package/lib/field/scalar-list/scalar-list.component.ts +3 -4
  40. package/lib/field/text/text.component.ts +8 -4
  41. package/lib/field/text-area/text-area.component.html +4 -1
  42. package/lib/field/text-area/text-area.component.ts +22 -5
  43. package/lib/field/text-input/text-input.component.ts +22 -4
  44. package/lib/field/time/time.component.html +2 -2
  45. package/lib/field/time/time.component.ts +35 -6
  46. package/lib/field/url/url.component.ts +22 -4
  47. package/lib/field/user-reference/user-reference.component.html +40 -46
  48. package/lib/field/user-reference/user-reference.component.ts +111 -20
  49. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  50. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -47
  51. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  52. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  53. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -8
  54. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  55. package/lib/infra/Containers/view-container/helper.ts +22 -0
  56. package/lib/infra/Containers/view-container/view-container.component.ts +5 -17
  57. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  58. package/lib/infra/assignment/assignment.component.html +1 -1
  59. package/lib/infra/assignment/assignment.component.ts +82 -40
  60. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  61. package/lib/infra/defer-load/defer-load.component.ts +8 -5
  62. package/lib/infra/navbar/navbar.component.ts +3 -5
  63. package/lib/infra/reference/reference.component.ts +77 -90
  64. package/lib/infra/root-container/root-container.component.html +2 -15
  65. package/lib/infra/root-container/root-container.component.ts +27 -30
  66. package/lib/infra/stages/stages.component.scss +2 -2
  67. package/lib/infra/view/view.component.html +7 -20
  68. package/lib/infra/view/view.component.ts +20 -2
  69. package/lib/template/app-shell/app-shell.component.ts +20 -2
  70. package/lib/template/base/details-template-base.ts +67 -0
  71. package/lib/template/base/form-template-base.ts +16 -0
  72. package/lib/template/case-summary/case-summary.component.ts +1 -1
  73. package/lib/template/case-view/case-view.component.html +4 -4
  74. package/lib/template/case-view/case-view.component.ts +8 -13
  75. package/lib/template/confirmation/confirmation.component.html +1 -1
  76. package/lib/template/confirmation/confirmation.component.ts +1 -1
  77. package/lib/template/data-reference/data-reference.component.ts +36 -40
  78. package/lib/template/default-form/default-form.component.html +0 -4
  79. package/lib/template/default-form/default-form.component.ts +41 -24
  80. package/lib/template/details/details.component.ts +7 -41
  81. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
  82. package/lib/template/details-one-column/details-one-column.component.ts +7 -42
  83. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  84. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  85. package/lib/template/details-three-column/details-three-column.component.ts +7 -43
  86. package/lib/template/details-two-column/details-two-column.component.ts +8 -44
  87. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
  88. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  89. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -3
  90. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  91. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  92. package/lib/template/field-group-template/field-group-template.component.ts +68 -47
  93. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  94. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  95. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
  96. package/lib/template/list-view/list-view.component.html +6 -1
  97. package/lib/template/list-view/list-view.component.scss +11 -0
  98. package/lib/template/list-view/list-view.component.ts +25 -7
  99. package/lib/template/list-view/listViewHelpers.ts +3 -6
  100. package/lib/template/list-view/utils.ts +2 -5
  101. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
  102. package/lib/template/one-column/one-column.component.ts +4 -3
  103. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
  104. package/lib/template/page/page.component.ts +1 -1
  105. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
  106. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -1
  107. package/lib/template/simple-table-manual/helpers.ts +10 -8
  108. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  109. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  110. package/lib/template/simple-table-manual/simple-table-manual.component.ts +77 -37
  111. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -3
  112. package/lib/template/three-column/three-column.component.ts +4 -3
  113. package/lib/template/two-column/two-column.component.ts +4 -3
  114. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
  115. package/lib/template/utils.ts +16 -0
  116. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
  117. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
  118. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -3
  119. package/lib/widget/attachment/attachment.component.ts +7 -9
  120. package/lib/widget/feed-container/feed-container.component.ts +7 -9
  121. package/lib/widget/file-utility/file-utility.component.ts +2 -5
  122. package/lib/widget/todo/todo.component.html +5 -6
  123. package/lib/widget/todo/todo.component.scss +9 -0
  124. package/lib/widget/todo/todo.component.ts +95 -84
  125. package/package.json +1 -1
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  </mat-card>
40
40
  </div>
41
- <div *ngIf="bShowBanner && bShowConfirm">
41
+ <div *ngIf="bShowBanner && bShowConfirm && confirm_pconn">
42
42
  <component-mapper name="View" [props]="{ formGroup$, pConn$: confirm_pconn }"></component-mapper>
43
43
  </div>
44
44
  </div>
@@ -6,7 +6,7 @@ import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
6
6
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
7
7
  import { ReferenceComponent } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
- import { getToDoAssignments, showBanner } from './helpers';
9
+ import { getToDoAssignments, hasAssignments, showBanner } from './helpers';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
12
12
 
@@ -104,6 +104,8 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
104
104
 
105
105
  this.initContainer();
106
106
 
107
+ this.checkAndUpdate();
108
+
107
109
  PCore.getPubSubUtils().subscribe(
108
110
  PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
109
111
  () => {
@@ -119,6 +121,14 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
119
121
  },
120
122
  'cancelPressed'
121
123
  );
124
+
125
+ PCore.getPubSubUtils().subscribe(
126
+ 'clearBannerMessages',
127
+ () => {
128
+ this.banners = [];
129
+ },
130
+ 'clearBannerMessages'
131
+ );
122
132
  }
123
133
 
124
134
  ngOnDestroy() {
@@ -129,6 +139,8 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
129
139
  PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'cancelAssignment');
130
140
 
131
141
  PCore.getPubSubUtils().unsubscribe('cancelPressed', 'cancelPressed');
142
+
143
+ PCore.getPubSubUtils().unsubscribe('clearBannerMessages', 'clearBannerMessages');
132
144
  }
133
145
 
134
146
  handleCancel() {
@@ -153,13 +165,15 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
153
165
  const caseViewModeFromProps = this.angularPConnect.getComponentProp(this, 'caseViewMode');
154
166
  const caseViewModeFromRedux = pConn.getValue('context_data.caseViewMode', '');
155
167
 
168
+ const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
169
+
156
170
  // ONLY call updateSelf when the component should update
157
171
  // AND removing the "gate" that was put there since shouldComponentUpdate
158
172
  // should be the real "gate"
173
+ // eslint-disable-next-line sonarjs/no-collapsible-if
159
174
  if (bUpdateSelf || caseViewModeFromProps !== caseViewModeFromRedux) {
160
175
  // don't want to redraw the flow container when there are page messages, because
161
176
  // the redraw causes us to loose the errors on the elements
162
- const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
163
177
  if (!completeProps.pageMessages || completeProps.pageMessages.length == 0) {
164
178
  // with a cancel, need to timeout so todo will update correctly
165
179
  if (this.bHasCancel) {
@@ -170,10 +184,10 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
170
184
  } else {
171
185
  this.updateSelf();
172
186
  }
173
- } else {
174
- this.showPageMessages(completeProps);
175
187
  }
176
188
  }
189
+
190
+ this.showPageMessages(completeProps);
177
191
  }
178
192
 
179
193
  showPageMessages(completeProps: FlowContainerProps) {
@@ -198,7 +212,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
198
212
  }
199
213
 
200
214
  initContainer() {
201
- const containerMgr: any = this.pConn$.getContainerManager();
215
+ const containerMgr = this.pConn$.getContainerManager();
202
216
  const baseContext = this.pConn$.getContextName();
203
217
  const containerName = this.pConn$.getContainerName();
204
218
  const containerType = 'single';
@@ -237,7 +251,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
237
251
 
238
252
  // when true, update arChildren from pConn, otherwise, arChilren will be updated in updateSelf()
239
253
  if (bLoadChildren) {
240
- this.arChildren$ = this.pConn$.getChildren() as any[];
254
+ this.arChildren$ = this.pConn$.getChildren();
241
255
  }
242
256
 
243
257
  // const oData = this.pConn$.getDataObject();
@@ -275,44 +289,9 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
275
289
  this.psService.sendMessage(false);
276
290
  }
277
291
 
278
- hasAssignments() {
279
- let hasAssignments = false;
280
- const assignmentsList: any[] = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
281
- // const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
282
- // 8.7 includes assignments in Assignments List that may be assigned to
283
- // a different operator. So, see if there are any assignments for
284
- // the current operator
285
- const isEmbedded = window.location.href.includes('embedded');
286
- let bAssignmentsForThisOperator = false;
287
-
288
- if (isEmbedded) {
289
- const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
290
- for (const assignment of assignmentsList) {
291
- if (assignment.assigneeInfo.ID === thisOperator) {
292
- bAssignmentsForThisOperator = true;
293
- }
294
- }
295
- } else {
296
- bAssignmentsForThisOperator = true;
297
- }
298
-
299
- // Bail if there is no assignmentsList
300
- if (!assignmentsList) {
301
- return hasAssignments;
302
- }
303
-
304
- const hasChildCaseAssignments = this.hasChildCaseAssignments();
305
-
306
- if (bAssignmentsForThisOperator || hasChildCaseAssignments || this.isCaseWideLocalAction()) {
307
- hasAssignments = true;
308
- }
309
-
310
- return hasAssignments;
311
- }
312
-
313
292
  isCaseWideLocalAction() {
314
293
  const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);
315
- const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS) as any[];
294
+ const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS);
316
295
  let bCaseWideAction = false;
317
296
  if (caseActions && actionID) {
318
297
  const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
@@ -457,7 +436,9 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
457
436
 
458
437
  showCaseMessages() {
459
438
  this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
460
- if (this.caseMessages$ || !this.hasAssignments()) {
439
+ // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
440
+ // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
441
+ if (!hasAssignments(this.pConn$)) {
461
442
  this.bHasCaseMessages$ = true;
462
443
  this.bShowConfirm = true;
463
444
  this.checkSvg$ = this.utils.getImageSrc('check', this.utils.getSDKStaticContentUrl());
@@ -467,9 +448,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
467
448
  this.caseMessages$ = this.localizedVal('Thank you! The next step in this case has been routed appropriately.', this.localeCategory);
468
449
  }
469
450
 
470
- // publish this "assignmentFinished" for mashup, need to get approved as a standard
471
- PCore.getPubSubUtils().publish('assignmentFinished');
472
-
473
451
  this.psService.sendMessage(false);
474
452
  } else {
475
453
  this.bHasCaseMessages$ = false;
@@ -480,6 +458,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
480
458
  updateFlowContainerChildren() {
481
459
  // routingInfo was added as component prop in populateAdditionalProps
482
460
  const routingInfo = this.angularPConnect.getComponentProp(this, 'routingInfo');
461
+ this.confirm_pconn = null;
483
462
 
484
463
  let loadingInfo: any;
485
464
  try {
@@ -593,7 +572,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
593
572
  });
594
573
  }
595
574
 
596
- // eslint-disable-next-line sonarjs/no-identical-functions
597
575
  topViewRefresh(): void {
598
576
  Object.values(this.formGroup$.controls).forEach(control => {
599
577
  control.markAsTouched();
@@ -28,12 +28,12 @@ function getChildCaseAssignments(pConnect) {
28
28
  return allAssignments;
29
29
  }
30
30
 
31
- function hasAssignments(pConnect) {
31
+ export function hasAssignments(pConnect) {
32
32
  const { CASE_INFO } = PCore.getConstants();
33
33
  const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
34
34
  const childCasesAssignments = getChildCaseAssignments(pConnect);
35
35
 
36
- return assignments || childCasesAssignments || isCaseWideLocalAction(pConnect);
36
+ return assignments || childCasesAssignments?.length || isCaseWideLocalAction(pConnect);
37
37
  }
38
38
 
39
39
  export const showBanner = getPConnect => {
@@ -1,4 +1,4 @@
1
- <div id="dialog" *ngIf="bShowModal$ && bShowAsModal$" class="psdk-dialog-background">
1
+ <div id="dialog" *ngIf="bShowModal$" class="psdk-dialog-background">
2
2
  <div class="psdk-modal-view-container-top" id="{{ buildName$ }}">
3
3
  <h3 *ngIf="title$ != ''">{{ title$ }}</h3>
4
4
  <component-mapper
@@ -15,16 +15,6 @@
15
15
  </div>
16
16
  </div>
17
17
 
18
- <div *ngIf="bShowModal$ && !bShowAsModal$">
19
- <div id="{{ buildName$ }}">
20
- <h3 *ngIf="title$ != ''">{{ title$ }}</h3>
21
- <component-mapper
22
- name="Assignment"
23
- [props]="{ pConn$: createdViewPConn$, formGroup$, arChildren$, itemKey$, isCreateStage$: true, updateToken$ }"
24
- ></component-mapper>
25
- </div>
26
- </div>
27
-
28
18
  <div *ngIf="bShowCancelAlert$">
29
19
  <component-mapper
30
20
  name="CancelAlert"
@@ -23,7 +23,6 @@ import { ReferenceComponent } from '@pega/angular-sdk-components';
23
23
  })
24
24
  export class ModalViewContainerComponent implements OnInit, OnDestroy {
25
25
  @Input() pConn$: typeof PConnect;
26
- @Input() displayOnlyFA$: boolean;
27
26
 
28
27
  // for when non modal
29
28
  @Output() modalVisibleChange = new EventEmitter<boolean>();
@@ -39,7 +38,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
39
38
  context$: string;
40
39
  title$ = '';
41
40
  bShowModal$ = false;
42
- bShowAsModal$ = true;
43
41
  itemKey$: string;
44
42
  formGroup$: FormGroup;
45
43
  oCaseInfo: Object = {};
@@ -73,11 +71,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
73
71
  }
74
72
 
75
73
  ngOnInit(): void {
76
- if (this.displayOnlyFA$) {
77
- // for when non modal
78
- this.bShowAsModal$ = false;
79
- }
80
-
81
74
  // First thing in initialization is registering and subscribing to the AngularPConnect service
82
75
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
83
76
 
@@ -89,7 +82,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
89
82
  this.itemKey$ = baseContext.concat('/').concat(acName);
90
83
  }
91
84
 
92
- const containerMgr: any = this.pConn$.getContainerManager();
85
+ const containerMgr = this.pConn$.getContainerManager();
93
86
 
94
87
  containerMgr.initializeContainers({
95
88
  type: 'multiple'
@@ -18,7 +18,7 @@ export class PreviewViewContainerComponent implements OnInit {
18
18
  @Input() pConn$: typeof PConnect;
19
19
 
20
20
  ngOnInit(): void {
21
- const containerMgr: any = this.pConn$.getContainerManager();
21
+ const containerMgr = this.pConn$.getContainerManager();
22
22
 
23
23
  containerMgr.initializeContainers({
24
24
  type: 'multiple'
@@ -0,0 +1,22 @@
1
+ export const addContainerItem = pConnect => {
2
+ const containerManager = pConnect.getContainerManager();
3
+ const context = pConnect.getContextName();
4
+ containerManager.addContainerItem({
5
+ context,
6
+ semanticURL: ''
7
+ });
8
+ };
9
+
10
+ export const configureBrowserBookmark = pConnect => {
11
+ const context = pConnect.getContextName();
12
+ const containerName = pConnect.getContainerName();
13
+ const navPages = pConnect.getValue('pyPortal.pyPrimaryNavPages');
14
+ const defaultViewLabel = Array.isArray(navPages) && navPages[0] ? navPages[0].pyLabel : '';
15
+ PCore.configureForBrowserBookmark({
16
+ context,
17
+ containerName,
18
+ acName: containerName,
19
+ semanticURL: '',
20
+ defaultViewLabel
21
+ });
22
+ };
@@ -5,6 +5,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
5
5
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
6
6
  import { ReferenceComponent } from '@pega/angular-sdk-components';
7
7
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
+ import { configureBrowserBookmark } from './helper';
8
9
 
9
10
  /**
10
11
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
@@ -86,7 +87,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
86
87
 
87
88
  this.pConn$.isBoundToState();
88
89
 
89
- const containerMgr: any = this.pConn$.getContainerManager();
90
+ const containerMgr = this.pConn$.getContainerManager();
90
91
 
91
92
  this.prepareDispatchObject = this.prepareDispatchObject.bind(this);
92
93
 
@@ -96,20 +97,10 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
96
97
  // And expose less via ui-bootstrap.js
97
98
  this.state = {
98
99
  dispatchObject: this.dispatchObject,
99
- // PCore is defined in pxBootstrapShell - eventually will be exported in place of constellationCore
100
-
101
100
  visible: !PCore.checkIfSemanticURL()
102
101
  };
103
102
 
104
- // here, to match Nebula/Constellation, the constructor of ViewContainer is only called once, and thus init/add container is only
105
- // called once. Because of Angular creating and destroy components if the parent changes a lot, this component will be
106
- // created and destroyed more than once. So the sessionStore "hasViewContainer" is set to false in rootContainer and then
107
- // after first round is true here. Subsequent ViewContainer creation will not init/add more containers.
108
-
109
103
  if (sessionStorage.getItem('hasViewContainer') == 'false') {
110
- // unlike Nebula/Constellation, have to initializeContainer after we create a dispatcObject and state, otherwise, when calling
111
- // initializeContainer before, code will get executed that needs state that wasn't defined.
112
-
113
104
  containerMgr.initializeContainers({
114
105
  type: mode === CONTAINER_TYPE.MULTIPLE ? CONTAINER_TYPE.MULTIPLE : CONTAINER_TYPE.SINGLE
115
106
  });
@@ -118,12 +109,9 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
118
109
  /* NOTE: setContainerLimit use is temporary. It is a non-public, unsupported API. */
119
110
  PCore.getContainerUtils().setContainerLimit(`${APP.APP}/${name}`, limit);
120
111
  }
121
- }
122
112
 
123
- if (sessionStorage.getItem('hasViewContainer') == 'false') {
124
- if (this.pConn$.getMetadata().children) {
125
- containerMgr.addContainerItem(this.dispatchObject);
126
- }
113
+ if (!PCore.checkIfSemanticURL()) containerMgr.addContainerItem(this.pConn$ as any);
114
+ if (!this.displayOnlyFA$) configureBrowserBookmark(this.pConn$);
127
115
 
128
116
  sessionStorage.setItem('hasViewContainer', 'true');
129
117
  }
@@ -254,7 +242,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
254
242
  console.error(`ViewContainer has a newComp that is NOT a reference!`);
255
243
 
256
244
  this.createdViewPConn$ = newComp;
257
- const newConfigProps: any = newComp.getConfigProps();
245
+ const newConfigProps = newComp.getConfigProps();
258
246
  this.templateName$ = newConfigProps.template || '';
259
247
  this.title$ = newConfigProps.title || '';
260
248
  // update children with new view's children
@@ -1,4 +1,4 @@
1
- <mat-grid-list cols="2" rowHeight="6.25rem">
1
+ <mat-grid-list *ngIf="arMainButtons$ && arSecondaryButtons$" cols="2" rowHeight="6.25rem">
2
2
  <mat-grid-tile>
3
3
  <button *ngFor="let aButton of arSecondaryButtons$" mat-raised-button color="secondary" (click)="buttonClick(aButton.jsAction, 'secondary')">
4
4
  {{ localizedVal(aButton.name, localeCategory) }}
@@ -1,5 +1,5 @@
1
1
  <div>
2
- <div><component-mapper name="AlertBanner" [props]="{ banners }" [parent]="this"></component-mapper></div>
2
+ <div><component-mapper name="AlertBanner" [props]="{ banners: bannerService.banners }" [parent]="this"></component-mapper></div>
3
3
  <div *ngIf="bHasNavigation$" class="psdk-stepper">
4
4
  <component-mapper
5
5
  name="MultiStep"
@@ -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;
@@ -29,7 +38,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
29
38
  @Input() isCreateStage$: boolean;
30
39
  @Input() updateToken$: number;
31
40
  @Input() isInModal$ = false;
32
- @Input() banners;
33
41
 
34
42
  // For interaction with AngularPConnect
35
43
  angularPConnectData: AngularPConnectData = {};
@@ -69,12 +77,15 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
69
77
  localeCategory = 'Assignment';
70
78
  localeReference;
71
79
 
80
+ snackBarRef;
81
+
72
82
  constructor(
73
83
  private angularPConnect: AngularPConnectService,
74
84
  private psService: ProgressSpinnerService,
75
85
  private erService: ErrorMessagesService,
76
86
  private ngZone: NgZone,
77
- private snackBar: MatSnackBar
87
+ private snackBar: MatSnackBar,
88
+ public bannerService: BannerService
78
89
  ) {}
79
90
 
80
91
  ngOnInit(): void {
@@ -105,6 +116,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
105
116
  // Should always check the bridge to see if the component should update itself (re-render)
106
117
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
107
118
 
119
+ this.bannerService.updateBanners(this.itemKey$);
120
+
108
121
  // ONLY call updateSelf when the component should update
109
122
  // AND removing the "gate" that was put there since shouldComponentUpdate
110
123
  // should be the real "gate"
@@ -128,6 +141,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
128
141
  }
129
142
 
130
143
  updateChanges() {
144
+ this.registerForRefresh();
145
+
131
146
  // pConn$ may be a 'reference' component, so normalize it
132
147
  this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
133
148
 
@@ -285,6 +300,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
285
300
  }
286
301
 
287
302
  buttonClick(sAction, sButtonType) {
303
+ this.snackBarRef?.dismiss();
304
+ this.bannerService.clearBanners();
305
+ PCore.getPubSubUtils().publish('clearBannerMessages');
288
306
  // right now, done on an individual basis, setting bReInit to true
289
307
  // upon the next flow container state change, will cause the flow container
290
308
  // to re-initialize
@@ -308,21 +326,21 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
308
326
  switch (sAction) {
309
327
  case 'navigateToStep':
310
328
  this.erService.sendMessage('publish', '');
311
- if (this.formValid()) {
312
- this.bReInit = true;
313
- this.psService.sendMessage(true);
314
329
 
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
- }
330
+ this.bReInit = true;
331
+ this.psService.sendMessage(true);
332
+
333
+ const navigatePromise = this.navigateToStep('previous', this.itemKey$);
334
+ navigatePromise
335
+ .then(() => {
336
+ this.updateChanges();
337
+ this.psService.sendMessage(false);
338
+ })
339
+ .catch(() => {
340
+ this.psService.sendMessage(false);
341
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Navigation failed!', this.localeCategory)}`, 'Ok');
342
+ });
343
+
326
344
  break;
327
345
 
328
346
  case 'saveAssignment': {
@@ -332,14 +350,13 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
332
350
 
333
351
  savePromise
334
352
  .then(() => {
335
- // @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'.
336
353
  const caseType = this.pConn$.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
337
354
  PCore.getPubSubUtils().publish('cancelPressed');
338
355
  this.onSaveActionSuccess({ caseType, caseID, assignmentID });
339
356
  })
340
357
  .catch(() => {
341
358
  this.psService.sendMessage(false);
342
- this.snackBar.open(`${this.localizedVal('Save failed', this.localeCategory)}`, 'Ok');
359
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Save failed', this.localeCategory)}`, 'Ok');
343
360
  });
344
361
 
345
362
  break;
@@ -363,7 +380,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
363
380
  })
364
381
  .catch(() => {
365
382
  this.psService.sendMessage(false);
366
- this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
383
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
367
384
  });
368
385
  } else {
369
386
  this.psService.sendMessage(true);
@@ -380,7 +397,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
380
397
  })
381
398
  .catch(() => {
382
399
  this.psService.sendMessage(false);
383
- this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
400
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
384
401
  });
385
402
  }
386
403
  break;
@@ -392,7 +409,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
392
409
  .then(() => {})
393
410
  .catch(() => {
394
411
  this.psService.sendMessage(false);
395
- this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
412
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
396
413
  });
397
414
 
398
415
  break;
@@ -405,23 +422,18 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
405
422
  switch (sAction) {
406
423
  case 'finishAssignment':
407
424
  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
- }
425
+ this.bReInit = true;
426
+ this.psService.sendMessage(true);
427
+ const finishPromise = this.finishAssignment(this.itemKey$); // JA - was itemID but Nebula/Constellation uses itemKey
428
+ finishPromise
429
+ .then(() => {
430
+ this.psService.sendMessage(false);
431
+ this.updateChanges();
432
+ })
433
+ .catch(() => {
434
+ this.psService.sendMessage(false);
435
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Submit failed!', this.localeCategory)}`, 'Ok');
436
+ });
425
437
  break;
426
438
 
427
439
  case 'approveCase': {
@@ -431,7 +443,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
431
443
  .then(() => {})
432
444
  .catch(() => {
433
445
  this.psService.sendMessage(false);
434
- this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
446
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
435
447
  });
436
448
 
437
449
  break;
@@ -453,10 +465,40 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
453
465
  });
454
466
  }
455
467
 
456
- // eslint-disable-next-line sonarjs/no-identical-functions
457
468
  topViewRefresh(): void {
458
469
  Object.values(this.formGroup$.controls).forEach((control: any) => {
459
470
  control.markAsTouched();
460
471
  });
461
472
  }
473
+
474
+ registerForRefresh() {
475
+ const refreshConditions = this.pConn$.getCaseInfo()?.getActionRefreshConditions();
476
+ const pageReference = this.pConn$.getPageReference();
477
+ const context = this.pConn$.getContextName();
478
+
479
+ // refresh api de-registration
480
+ PCore.getRefreshManager().deRegisterForRefresh(context);
481
+
482
+ // refresh api registration
483
+ const refreshProps = getRefreshProps(refreshConditions);
484
+ const caseKey = this.pConn$.getCaseInfo().getKey();
485
+ const refreshOptions = {
486
+ autoDetectRefresh: true,
487
+ preserveClientChanges: false
488
+ };
489
+ if (refreshProps.length > 0) {
490
+ refreshProps.forEach(prop => {
491
+ PCore.getRefreshManager().registerForRefresh(
492
+ 'PROP_CHANGE',
493
+ this.pConn$.getActionsApi().refreshCaseView.bind(this.pConn$.getActionsApi(), caseKey, '', pageReference, {
494
+ ...refreshOptions,
495
+ refreshFor: prop[0]
496
+ }),
497
+ `${pageReference}.${prop[1]}`,
498
+ `${context}/${pageReference}`,
499
+ context
500
+ );
501
+ });
502
+ }
503
+ }
462
504
  }
@@ -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"
@@ -38,6 +38,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
38
38
  CASE: any;
39
39
  PAGE: any;
40
40
  DATA: any;
41
+ lastUpdateCaseTime;
41
42
  constructor(private angularPConnect: AngularPConnectService) {
42
43
  this.constants = PCore.getConstants();
43
44
  }
@@ -58,8 +59,10 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
58
59
  // Should always check the bridge to see if the component should
59
60
  // update itself (re-render)
60
61
  const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
61
- if (theRequestedAssignment !== this.currentLoadedAssignment) {
62
+ const lastUpdateCaseTime = this.pConn$.getValue('caseInfo.lastUpdateTime');
63
+ if (theRequestedAssignment !== this.currentLoadedAssignment || (lastUpdateCaseTime && lastUpdateCaseTime !== this.lastUpdateCaseTime)) {
62
64
  this.currentLoadedAssignment = theRequestedAssignment;
65
+ this.lastUpdateCaseTime = lastUpdateCaseTime;
63
66
  this.loadActiveTab();
64
67
  }
65
68
  }
@@ -81,7 +84,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
81
84
  this.resourceType = resourceType;
82
85
  this.isContainerPreview = /preview_[0-9]*/g.test(this.pConn$.getContextName());
83
86
 
84
- const theConfigProps: any = this.pConn$.getConfigProps();
87
+ const theConfigProps = this.pConn$.getConfigProps();
85
88
  this.deferLoadId = theConfigProps.deferLoadId;
86
89
  this.name = this.name || theConfigProps.name;
87
90
 
@@ -91,8 +94,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
91
94
  getViewOptions = () => ({
92
95
  viewContext: this.resourceType,
93
96
  pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID,
94
- container: this.isContainerPreview ? 'preview' : null,
95
- containerName: this.isContainerPreview ? 'preview' : null,
97
+ container: this.isContainerPreview ? 'preview' : undefined,
98
+ containerName: this.isContainerPreview ? 'preview' : undefined,
96
99
  updateData: this.isContainerPreview
97
100
  });
98
101
 
@@ -116,7 +119,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
116
119
  }
117
120
  };
118
121
  const configObject = PCore.createPConnect(config);
119
- configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
122
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
120
123
  this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
121
124
  this.componentName$ = this.loadedPConn$.getComponentName();
122
125
  if (this.deferLoadId) {