@pega/angular-sdk-overrides 23.1.10 → 24.2.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 (137) 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.html +7 -4
  4. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  5. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
  6. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
  7. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
  8. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
  9. package/lib/designSystemExtension/operator/operator.component.ts +11 -6
  10. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
  11. package/lib/field/auto-complete/auto-complete.component.ts +17 -14
  12. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
  13. package/lib/field/check-box/check-box.component.html +16 -15
  14. package/lib/field/check-box/check-box.component.scss +14 -1
  15. package/lib/field/check-box/check-box.component.ts +128 -45
  16. package/lib/field/currency/currency.component.html +16 -7
  17. package/lib/field/currency/currency.component.ts +55 -20
  18. package/lib/field/date/date.component.html +1 -6
  19. package/lib/field/date/date.component.ts +22 -39
  20. package/lib/field/date-time/date-time.component.html +6 -7
  21. package/lib/field/date-time/date-time.component.ts +28 -45
  22. package/lib/field/decimal/decimal.component.html +14 -4
  23. package/lib/field/decimal/decimal.component.ts +47 -7
  24. package/lib/field/dropdown/dropdown.component.ts +132 -21
  25. package/lib/field/email/email.component.ts +14 -4
  26. package/lib/field/group/group.component.html +1 -1
  27. package/lib/field/group/group.component.ts +6 -2
  28. package/lib/field/integer/integer.component.html +1 -1
  29. package/lib/field/integer/integer.component.ts +13 -5
  30. package/lib/field/multiselect/multiselect.component.html +33 -0
  31. package/lib/field/multiselect/multiselect.component.scss +7 -0
  32. package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
  33. package/lib/field/multiselect/multiselect.component.ts +369 -0
  34. package/lib/field/multiselect/utils.ts +209 -0
  35. package/lib/field/percentage/percentage.component.html +17 -6
  36. package/lib/field/percentage/percentage.component.ts +51 -12
  37. package/lib/field/phone/phone.component.html +1 -1
  38. package/lib/field/phone/phone.component.ts +11 -14
  39. package/lib/field/radio-buttons/radio-buttons.component.ts +9 -12
  40. package/lib/field/rich-text/config-ext.json +10 -0
  41. package/lib/field/rich-text/rich-text.component.html +1 -1
  42. package/lib/field/rich-text/rich-text.component.ts +8 -6
  43. package/lib/field/scalar-list/scalar-list.component.ts +4 -4
  44. package/lib/field/text/text.component.ts +2 -0
  45. package/lib/field/text-area/text-area.component.html +2 -1
  46. package/lib/field/text-area/text-area.component.ts +13 -8
  47. package/lib/field/text-input/text-input.component.html +1 -1
  48. package/lib/field/text-input/text-input.component.ts +13 -5
  49. package/lib/field/time/time.component.html +3 -2
  50. package/lib/field/time/time.component.ts +23 -7
  51. package/lib/field/url/url.component.html +2 -1
  52. package/lib/field/url/url.component.ts +15 -5
  53. package/lib/field/user-reference/user-reference.component.html +42 -45
  54. package/lib/field/user-reference/user-reference.component.ts +73 -27
  55. package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
  56. package/lib/infra/Containers/base-components/helper.ts +89 -0
  57. package/lib/infra/Containers/flow-container/flow-container.component.html +9 -4
  58. package/lib/infra/Containers/flow-container/flow-container.component.ts +38 -33
  59. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +41 -9
  60. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  61. package/lib/infra/Containers/view-container/helper.ts +22 -0
  62. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  63. package/lib/infra/assignment/assignment.component.ts +37 -39
  64. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  65. package/lib/infra/defer-load/defer-load.component.ts +9 -12
  66. package/lib/infra/multi-step/multi-step.component.html +1 -1
  67. package/lib/infra/multi-step/multi-step.component.scss +1 -0
  68. package/lib/infra/navbar/navbar.component.html +4 -4
  69. package/lib/infra/navbar/navbar.component.ts +9 -6
  70. package/lib/infra/root-container/root-container.component.ts +3 -3
  71. package/lib/infra/stages/stages.component.scss +2 -2
  72. package/lib/infra/view/view.component.html +7 -20
  73. package/lib/infra/view/view.component.ts +21 -3
  74. package/lib/template/app-shell/app-shell.component.ts +20 -2
  75. package/lib/template/banner-page/config-ext.json +9 -0
  76. package/lib/template/base/details-template-base.ts +67 -0
  77. package/lib/template/base/form-template-base.ts +10 -0
  78. package/lib/template/case-summary/case-summary.component.ts +38 -4
  79. package/lib/template/case-view/case-view.component.html +7 -7
  80. package/lib/template/case-view/case-view.component.scss +2 -0
  81. package/lib/template/case-view/case-view.component.ts +8 -19
  82. package/lib/template/confirmation/confirmation.component.ts +1 -1
  83. package/lib/template/data-reference/data-reference.component.ts +37 -43
  84. package/lib/template/default-form/default-form.component.html +0 -4
  85. package/lib/template/default-form/default-form.component.ts +7 -23
  86. package/lib/template/details/details.component.ts +7 -41
  87. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
  88. package/lib/template/details-one-column/details-one-column.component.ts +7 -42
  89. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  90. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  91. package/lib/template/details-three-column/details-three-column.component.ts +7 -43
  92. package/lib/template/details-two-column/details-two-column.component.ts +8 -44
  93. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
  94. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  95. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  96. package/lib/template/field-group-template/field-group-template.component.ts +4 -14
  97. package/lib/template/field-value-list/field-value-list.component.html +8 -3
  98. package/lib/template/field-value-list/field-value-list.component.scss +2 -1
  99. package/lib/template/field-value-list/field-value-list.component.ts +1 -0
  100. package/lib/template/inline-dashboard-page/config-ext.json +9 -0
  101. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
  102. package/lib/template/list-view/list-view.component.html +9 -6
  103. package/lib/template/list-view/list-view.component.scss +11 -0
  104. package/lib/template/list-view/list-view.component.ts +60 -32
  105. package/lib/template/list-view/listViewHelpers.ts +1 -2
  106. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
  107. package/lib/template/one-column/one-column.component.ts +4 -3
  108. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
  109. package/lib/template/page/page.component.ts +1 -1
  110. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
  111. package/lib/template/repeating-structures/repeating-structures.component.ts +2 -3
  112. package/lib/template/simple-table/simple-table.component.ts +0 -2
  113. package/lib/template/simple-table-manual/helpers.ts +2 -2
  114. package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
  115. package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
  116. package/lib/template/simple-table-manual/simple-table-manual.component.ts +60 -28
  117. package/lib/template/simple-table-select/simple-table-select.component.ts +5 -7
  118. package/lib/template/three-column/three-column.component.ts +4 -3
  119. package/lib/template/two-column/two-column.component.ts +4 -3
  120. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
  121. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
  122. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
  123. package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
  124. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +5 -4
  125. package/lib/widget/attachment/attachment.component.html +50 -26
  126. package/lib/widget/attachment/attachment.component.scss +118 -0
  127. package/lib/widget/attachment/attachment.component.ts +256 -503
  128. package/lib/widget/case-history/case-history.component.ts +1 -2
  129. package/lib/widget/feed-container/feed-container.component.ts +7 -11
  130. package/lib/widget/file-utility/file-utility.component.html +2 -2
  131. package/lib/widget/file-utility/file-utility.component.ts +15 -22
  132. package/lib/widget/list-utility/list-utility.component.html +1 -1
  133. package/lib/widget/quick-create/config-ext.json +9 -0
  134. package/lib/widget/quick-create/quick-create.component.ts +1 -1
  135. package/lib/widget/todo/todo.component.html +8 -7
  136. package/lib/widget/todo/todo.component.ts +97 -86
  137. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy, Injector } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormBuilder, FormGroup } from '@angular/forms';
4
4
  import { MatCardModule } from '@angular/material/card';
5
5
  import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
6
- import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
7
6
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
8
7
  import { ReferenceComponent } from '@pega/angular-sdk-components';
9
8
  import { Utils } from '@pega/angular-sdk-components';
10
9
  import { getToDoAssignments, showBanner } from './helpers';
11
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
+ import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
14
14
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
@@ -32,11 +32,9 @@ interface FlowContainerProps {
32
32
  standalone: true,
33
33
  imports: [CommonModule, MatCardModule, forwardRef(() => ComponentMapperComponent)]
34
34
  })
35
- export class FlowContainerComponent implements OnInit, OnDestroy {
35
+ export class FlowContainerComponent extends FlowContainerBaseComponent implements OnInit, OnDestroy {
36
36
  @Input() pConn$: typeof PConnect;
37
37
 
38
- // For interaction with AngularPConnect
39
- angularPConnectData: AngularPConnectData = {};
40
38
  pCoreConstants: typeof publicConstants;
41
39
  configProps$: FlowContainerProps;
42
40
 
@@ -72,14 +70,17 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
72
70
  banners: any[];
73
71
  // itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
74
72
 
73
+ pConnectOfActiveContainerItem;
74
+
75
75
  constructor(
76
- private angularPConnect: AngularPConnectService,
76
+ injector: Injector,
77
77
  private cdRef: ChangeDetectorRef,
78
78
  private psService: ProgressSpinnerService,
79
79
  private fb: FormBuilder,
80
80
  private ngZone: NgZone,
81
81
  private utils: Utils
82
82
  ) {
83
+ super(injector);
83
84
  // create the formGroup
84
85
  this.formGroup$ = this.fb.group({ hideRequired: false });
85
86
  }
@@ -103,6 +104,8 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
103
104
 
104
105
  this.initContainer();
105
106
 
107
+ this.checkAndUpdate();
108
+
106
109
  PCore.getPubSubUtils().subscribe(
107
110
  PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
108
111
  () => {
@@ -148,10 +151,14 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
148
151
  // Should always check the bridge to see if the component should update itself (re-render)
149
152
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
150
153
 
154
+ const pConn = this.pConnectOfActiveContainerItem || this.pConn$;
155
+ const caseViewModeFromProps = this.angularPConnect.getComponentProp(this, 'caseViewMode');
156
+ const caseViewModeFromRedux = pConn.getValue('context_data.caseViewMode', '');
157
+
151
158
  // ONLY call updateSelf when the component should update
152
159
  // AND removing the "gate" that was put there since shouldComponentUpdate
153
160
  // should be the real "gate"
154
- if (bUpdateSelf) {
161
+ if (bUpdateSelf || caseViewModeFromProps !== caseViewModeFromRedux) {
155
162
  // don't want to redraw the flow container when there are page messages, because
156
163
  // the redraw causes us to loose the errors on the elements
157
164
  const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
@@ -179,7 +186,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
179
186
  }
180
187
 
181
188
  getTodoVisibilty() {
182
- // @ts-ignore - second parameter pageReference for getValue method should be optional
183
189
  const caseViewMode = this.pConn$.getValue('context_data.caseViewMode');
184
190
  if (caseViewMode && caseViewMode === 'review') {
185
191
  const kid = this.pConn$.getChildren()[0];
@@ -194,7 +200,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
194
200
  }
195
201
 
196
202
  initContainer() {
197
- const containerMgr: any = this.pConn$.getContainerManager();
203
+ const containerMgr = this.pConn$.getContainerManager();
198
204
  const baseContext = this.pConn$.getContextName();
199
205
  const containerName = this.pConn$.getContainerName();
200
206
  const containerType = 'single';
@@ -233,7 +239,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
233
239
 
234
240
  // when true, update arChildren from pConn, otherwise, arChilren will be updated in updateSelf()
235
241
  if (bLoadChildren) {
236
- this.arChildren$ = this.pConn$.getChildren() as any[];
242
+ this.arChildren$ = this.pConn$.getChildren();
237
243
  }
238
244
 
239
245
  // const oData = this.pConn$.getDataObject();
@@ -273,25 +279,30 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
273
279
 
274
280
  hasAssignments() {
275
281
  let hasAssignments = false;
276
- // @ts-ignore - second parameter pageReference for getValue method should be optional
277
282
  const assignmentsList = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
278
- const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
283
+ // const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
279
284
  // 8.7 includes assignments in Assignments List that may be assigned to
280
285
  // a different operator. So, see if there are any assignments for
281
286
  // the current operator
287
+ const isEmbedded = window.location.href.includes('embedded');
282
288
  let bAssignmentsForThisOperator = false;
283
289
 
290
+ if (isEmbedded) {
291
+ const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
292
+ for (const assignment of assignmentsList) {
293
+ if (assignment.assigneeInfo.ID === thisOperator) {
294
+ bAssignmentsForThisOperator = true;
295
+ }
296
+ }
297
+ } else {
298
+ bAssignmentsForThisOperator = true;
299
+ }
300
+
284
301
  // Bail if there is no assignmentsList
285
302
  if (!assignmentsList) {
286
303
  return hasAssignments;
287
304
  }
288
305
 
289
- for (const assignment of assignmentsList) {
290
- if ((assignment as any).assigneeInfo.ID === thisOperator) {
291
- bAssignmentsForThisOperator = true;
292
- }
293
- }
294
-
295
306
  const hasChildCaseAssignments = this.hasChildCaseAssignments();
296
307
 
297
308
  if (bAssignmentsForThisOperator || hasChildCaseAssignments || this.isCaseWideLocalAction()) {
@@ -302,10 +313,8 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
302
313
  }
303
314
 
304
315
  isCaseWideLocalAction() {
305
- // @ts-ignore - second parameter pageReference for getValue method should be optional
306
316
  const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);
307
- // @ts-ignore - second parameter pageReference for getValue method should be optional
308
- const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS) as any[];
317
+ const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS);
309
318
  let bCaseWideAction = false;
310
319
  if (caseActions && actionID) {
311
320
  const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
@@ -317,7 +326,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
317
326
  }
318
327
 
319
328
  hasChildCaseAssignments() {
320
- // @ts-ignore - second parameter pageReference for getValue method should be optional
321
329
  const childCases = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS);
322
330
 
323
331
  return childCases && childCases.length > 0;
@@ -328,9 +336,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
328
336
 
329
337
  const { CASE_INFO: CASE_CONSTS } = PCore.getConstants();
330
338
 
331
- // @ts-ignore - second parameter pageReference for getValue method should be optional
332
339
  const caseActions = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ACTIONS) as any[];
333
- // @ts-ignore - second parameter pageReference for getValue method should be optional
334
340
  const activeActionID = this.pConn$.getValue(CASE_CONSTS.ACTIVE_ACTION_ID);
335
341
  const activeAction = caseActions?.find(action => action.ID === activeActionID);
336
342
  if (activeAction) {
@@ -370,8 +376,9 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
370
376
  // const { getPConnect } = this.arChildren$[0].getPConnect();
371
377
  const localPConn = this.arChildren$[0].getPConnect();
372
378
 
373
- // @ts-ignore - second parameter pageReference for getValue method should be optional
374
- const caseViewMode = this.pConn$.getValue('context_data.caseViewMode');
379
+ this.pConnectOfActiveContainerItem = this.getPConnectOfActiveContainerItem(this.pConn$) || this.pConn$;
380
+
381
+ const caseViewMode = this.pConnectOfActiveContainerItem.getValue('context_data.caseViewMode');
375
382
  this.bShowBanner = showBanner(this.pConn$);
376
383
 
377
384
  if (caseViewMode && caseViewMode == 'review') {
@@ -424,7 +431,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
424
431
  const todoAssignments = getToDoAssignments(this.pConn$);
425
432
 
426
433
  if (todoAssignments && todoAssignments.length > 0) {
427
- // @ts-ignore - second parameter pageReference for getValue method should be optional
428
434
  this.todo_caseInfoID$ = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ID);
429
435
  this.todo_datasource$ = { source: todoAssignments };
430
436
  }
@@ -452,9 +458,10 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
452
458
  }
453
459
 
454
460
  showCaseMessages() {
455
- // @ts-ignore - second parameter pageReference for getValue method should be optional
456
461
  this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
457
- if (this.caseMessages$ || !this.hasAssignments()) {
462
+ // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
463
+ // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
464
+ if (!this.hasAssignments()) {
458
465
  this.bHasCaseMessages$ = true;
459
466
  this.bShowConfirm = true;
460
467
  this.checkSvg$ = this.utils.getImageSrc('check', this.utils.getSDKStaticContentUrl());
@@ -465,11 +472,10 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
465
472
  }
466
473
 
467
474
  // publish this "assignmentFinished" for mashup, need to get approved as a standard
468
- // @ts-ignore - second parameter “payload” for publish method should be optional
469
475
  PCore.getPubSubUtils().publish('assignmentFinished');
470
476
 
471
477
  this.psService.sendMessage(false);
472
- } else if (this.bHasCaseMessages$) {
478
+ } else {
473
479
  this.bHasCaseMessages$ = false;
474
480
  this.bShowConfirm = false;
475
481
  }
@@ -478,6 +484,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
478
484
  updateFlowContainerChildren() {
479
485
  // routingInfo was added as component prop in populateAdditionalProps
480
486
  const routingInfo = this.angularPConnect.getComponentProp(this, 'routingInfo');
487
+ this.confirm_pconn = null;
481
488
 
482
489
  let loadingInfo: any;
483
490
  try {
@@ -565,7 +572,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
565
572
  this.psService.sendMessage(false);
566
573
 
567
574
  const oWorkItem = configObject.getPConnect();
568
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
569
575
  const oWorkData: any = oWorkItem.getDataObject();
570
576
 
571
577
  this.containerName$ = this.localizedVal(this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name, undefined, this.localeReference);
@@ -592,7 +598,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
592
598
  });
593
599
  }
594
600
 
595
- // eslint-disable-next-line sonarjs/no-identical-functions
596
601
  topViewRefresh(): void {
597
602
  Object.values(this.formGroup$.controls).forEach(control => {
598
603
  control.markAsTouched();
@@ -6,6 +6,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
6
6
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
7
7
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
8
  import { getBanners } from '@pega/angular-sdk-components';
9
+ import { ReferenceComponent } from '@pega/angular-sdk-components';
9
10
 
10
11
  /**
11
12
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
@@ -88,7 +89,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
88
89
  this.itemKey$ = baseContext.concat('/').concat(acName);
89
90
  }
90
91
 
91
- const containerMgr: any = this.pConn$.getContainerManager();
92
+ const containerMgr = this.pConn$.getContainerManager();
92
93
 
93
94
  containerMgr.initializeContainers({
94
95
  type: 'multiple'
@@ -200,10 +201,9 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
200
201
  }
201
202
 
202
203
  createView(routingInfo, currentItem, latestItem, key) {
203
- const configObject = this.getConfigObject(currentItem, this.pConn$);
204
+ const configObject = this.getConfigObject(currentItem, null, false);
204
205
  const newComp = configObject?.getPConnect();
205
206
  // const newCompName = newComp.getComponentName();
206
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
207
207
  const caseInfo = newComp && newComp.getDataObject() && newComp.getDataObject().caseInfo ? newComp.getDataObject().caseInfo : null;
208
208
  // The metadata for pyDetails changed such that the "template": "CaseView"
209
209
  // is no longer a child of the created View but is in the created View's
@@ -248,8 +248,17 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
248
248
  ID,
249
249
  `${theNewCaseInfo?.getClassName()}!CASE!${theNewCaseInfo.getName()}`.toUpperCase()
250
250
  );
251
- // // update children with new view's children
252
- this.arChildren$ = newComp.getChildren() as any[];
251
+
252
+ const bIsRefComponent = this.checkIfRefComponent(newComp);
253
+
254
+ if (bIsRefComponent) {
255
+ const newPConn = ReferenceComponent.normalizePConn(newComp);
256
+ this.arChildren$ = ReferenceComponent.normalizePConnArray(newPConn.getChildren());
257
+ } else {
258
+ // update children with new view's children
259
+ this.arChildren$ = newComp.getChildren();
260
+ }
261
+
253
262
  this.bShowModal$ = true;
254
263
 
255
264
  // for when non modal
@@ -280,16 +289,30 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
280
289
  });
281
290
  }
282
291
 
283
- getConfigObject(item, pConnect) {
292
+ getConfigObject(item, pConnect, isReverseCoexistence = false) {
293
+ let config;
294
+ if (isReverseCoexistence) {
295
+ config = {
296
+ options: {
297
+ pageReference: pConnect?.getPageReference(),
298
+ hasForm: true,
299
+ containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL
300
+ }
301
+ };
302
+ return PCore.createPConnect(config);
303
+ }
284
304
  if (item) {
285
- const { context, view } = item;
286
- const config = {
305
+ const { context, view, isBulkAction } = item;
306
+ const target = PCore.getContainerUtils().getTargetFromContainerItemID(context);
307
+ config = {
287
308
  meta: view,
288
309
  options: {
289
310
  context,
290
311
  pageReference: view.config.context || pConnect.getPageReference(),
291
312
  hasForm: true,
292
- containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL
313
+ ...(isBulkAction && { isBulkAction }),
314
+ containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL,
315
+ target
293
316
  }
294
317
  };
295
318
  return PCore.createPConnect(config);
@@ -297,6 +320,15 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
297
320
  return null;
298
321
  }
299
322
 
323
+ checkIfRefComponent(thePConn: any): boolean {
324
+ let bReturn = false;
325
+ if (thePConn && thePConn.getComponentName() == 'reference') {
326
+ bReturn = true;
327
+ }
328
+
329
+ return bReturn;
330
+ }
331
+
300
332
  onAlertState(bData: boolean) {
301
333
  this.bAlertState = bData;
302
334
  this.bShowCancelAlert$ = false;
@@ -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,13 +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
- // @ts-ignore - Property 'getMetadata' is private and only accessible within class
125
- if (this.pConn$.getMetadata().children) {
126
- containerMgr.addContainerItem(this.dispatchObject);
127
- }
113
+ if (!PCore.checkIfSemanticURL()) containerMgr.addContainerItem(this.pConn$ as any);
114
+ if (!this.displayOnlyFA$) configureBrowserBookmark(this.pConn$);
128
115
 
129
116
  sessionStorage.setItem('hasViewContainer', 'true');
130
117
  }
@@ -255,7 +242,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
255
242
  console.error(`ViewContainer has a newComp that is NOT a reference!`);
256
243
 
257
244
  this.createdViewPConn$ = newComp;
258
- const newConfigProps: any = newComp.getConfigProps();
245
+ const newConfigProps = newComp.getConfigProps();
259
246
  this.templateName$ = newConfigProps.template || '';
260
247
  this.title$ = newConfigProps.title || '';
261
248
  // update children with new view's children
@@ -38,7 +38,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
38
38
  newPConn$: any;
39
39
  containerName$: string;
40
40
 
41
- bIsRefComponent = false;
42
41
  bInitialized = false;
43
42
 
44
43
  templateName$: string;
@@ -60,6 +59,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
60
59
  cancelAssignment: any;
61
60
  cancelCreateStageAssignment: any;
62
61
  showPage: any;
62
+ approveCase: any;
63
+ rejectCase: any;
63
64
 
64
65
  // itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
65
66
 
@@ -127,45 +128,19 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
127
128
  }
128
129
 
129
130
  updateChanges() {
130
- this.bIsRefComponent = this.checkIfRefComponent(this.pConn$);
131
-
132
- this.ngZone.run(() => {
133
- // pConn$ may be a 'reference' component, so normalize it
134
- // this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
135
- this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
136
-
137
- // If 'reference' so we need to get the children of the normalized pConn
138
- if (this.bIsRefComponent) {
139
- // this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
140
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
141
- }
142
- });
143
-
144
- this.createButtons();
145
- }
131
+ // pConn$ may be a 'reference' component, so normalize it
132
+ this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
146
133
 
147
- checkIfRefComponent(thePConn: any): boolean {
148
- let bReturn = false;
149
- if (thePConn && thePConn.getComponentName() == 'reference') {
150
- bReturn = true;
134
+ if (this.arChildren$) {
135
+ this.createButtons();
151
136
  }
152
-
153
- return bReturn;
154
137
  }
155
138
 
156
139
  initComponent() {
157
- this.bIsRefComponent = this.checkIfRefComponent(this.pConn$);
158
-
159
140
  // pConn$ may be a 'reference' component, so normalize it
160
141
  // this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
161
142
  this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
162
143
 
163
- // If 'reference' so we need to get the children of the normalized pConn
164
- if (this.bIsRefComponent) {
165
- // this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
166
- this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
167
- }
168
-
169
144
  // prevent re-intializing with flowContainer update unless an action is taken
170
145
  this.bReInit = false;
171
146
  this.bHasNavigation$ = false;
@@ -205,8 +180,12 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
205
180
  this.showPage = actionsAPI.showPage.bind(actionsAPI);
206
181
 
207
182
  this.cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);
183
+ this.approveCase = actionsAPI.approveCase?.bind(actionsAPI);
184
+ this.rejectCase = actionsAPI.rejectCase?.bind(actionsAPI);
208
185
 
209
- this.createButtons();
186
+ if (this.arChildren$) {
187
+ this.createButtons();
188
+ }
210
189
  }
211
190
 
212
191
  createButtons() {
@@ -354,7 +333,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
354
333
  savePromise
355
334
  .then(() => {
356
335
  const caseType = this.pConn$.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
357
- // @ts-ignore - second parameter “payload” for publish method should be optional
358
336
  PCore.getPubSubUtils().publish('cancelPressed');
359
337
  this.onSaveActionSuccess({ caseType, caseID, assignmentID });
360
338
  })
@@ -369,12 +347,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
369
347
  case 'cancelAssignment':
370
348
  this.bReInit = true;
371
349
  this.erService.sendMessage('dismiss', '');
372
- // @ts-ignore - Property 'isAssignmentInCreateStage' is private and only accessible within class 'CaseInfo'
373
350
  const isAssignmentInCreateStage = this.pConn$.getCaseInfo().isAssignmentInCreateStage();
374
351
  const isLocalAction =
375
- // @ts-ignore - Property 'isLocalAction' is private and only accessible within class 'CaseInfo'.
376
352
  this.pConn$.getCaseInfo().isLocalAction() ||
377
- // @ts-ignore - second parameter pageReference for getValue method should be optional
378
353
  (PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION && this.pConn$.getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION));
379
354
  // check if create stage (modal)
380
355
  if (isAssignmentInCreateStage && this.isInModal$ && !isLocalAction) {
@@ -394,14 +369,12 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
394
369
 
395
370
  // publish before cancel pressed, because
396
371
  // cancel assignment happens "after" cancel assignment happens
397
- // @ts-ignore - second parameter “payload” for publish method should be optional
398
372
  PCore.getPubSubUtils().publish('cancelPressed');
399
373
 
400
374
  const cancelPromise = this.cancelAssignment(this.itemKey$);
401
375
  cancelPromise
402
376
  .then(() => {
403
377
  this.psService.sendMessage(false);
404
- // @ts-ignore - second parameter “payload” for publish method should be optional
405
378
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
406
379
  })
407
380
  .catch(() => {
@@ -411,11 +384,23 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
411
384
  }
412
385
  break;
413
386
 
387
+ case 'rejectCase': {
388
+ const rejectPromise = this.rejectCase(this.itemKey$);
389
+
390
+ rejectPromise
391
+ .then(() => {})
392
+ .catch(() => {
393
+ this.psService.sendMessage(false);
394
+ this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
395
+ });
396
+
397
+ break;
398
+ }
399
+
414
400
  default:
415
401
  break;
416
402
  }
417
403
  } else if (sButtonType == 'primary') {
418
- // eslint-disable-next-line sonarjs/no-small-switch
419
404
  switch (sAction) {
420
405
  case 'finishAssignment':
421
406
  this.erService.sendMessage('publish', '');
@@ -437,6 +422,19 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
437
422
  this.erService.sendMessage('show', this.localizedVal('Please fix errors on form.', this.localeCategory));
438
423
  }
439
424
  break;
425
+
426
+ case 'approveCase': {
427
+ const approvePromise = this.approveCase(this.itemKey$);
428
+
429
+ approvePromise
430
+ .then(() => {})
431
+ .catch(() => {
432
+ this.psService.sendMessage(false);
433
+ this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
434
+ });
435
+
436
+ break;
437
+ }
440
438
  default:
441
439
  break;
442
440
  }
@@ -47,7 +47,6 @@ export class DashboardFilterComponent implements OnInit {
47
47
 
48
48
  clearFilters() {
49
49
  this.filtersFormGroup$.reset();
50
- // @ts-ignore - second parameter “payload” for publish method should be optional
51
50
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL);
52
51
  }
53
52