@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
@@ -29,7 +29,6 @@ export class CaseHistoryComponent implements OnInit {
29
29
  ngOnInit(): void {
30
30
  this.configProps$ = this.pConn$.getConfigProps();
31
31
 
32
- // @ts-ignore - second parameter pageReference for getValue method should be optional
33
32
  const caseID = this.pConn$.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
34
33
  const dataViewName = 'D_pyWorkHistory';
35
34
  const context = this.pConn$.getContextName();
@@ -46,7 +45,7 @@ export class CaseHistoryComponent implements OnInit {
46
45
  this.fields$ = [
47
46
  { label: this.pConn$.getLocalizedValue('Date', '', ''), type: 'DateTime', fieldName: 'pxTimeCreated' },
48
47
  { label: this.pConn$.getLocalizedValue('Description', '', ''), type: 'TextInput', fieldName: 'pyMessageKey' },
49
- { label: this.pConn$.getLocalizedValue('User', '', ''), type: 'TextInput', fieldName: 'pyPerformer' }
48
+ { label: this.pConn$.getLocalizedValue('Performed by', '', ''), type: 'TextInput', fieldName: 'pyPerformer' }
50
49
  ];
51
50
 
52
51
  const tableDataResults = this.updateData(historyJSON.data.data, this.fields$);
@@ -25,8 +25,8 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
25
25
  // Used with AngularPConnect
26
26
  angularPConnectData: AngularPConnectData = {};
27
27
 
28
- userName$: string;
29
- imageKey$: string;
28
+ userName$: string | undefined;
29
+ imageKey$: string | undefined;
30
30
 
31
31
  currentUserInitials$: string;
32
32
  currentUserName$: string;
@@ -65,7 +65,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
65
65
  ngOnInit(): void {
66
66
  this.userName$ = PCore.getEnvironmentInfo().getOperatorName();
67
67
  this.imageKey$ = PCore.getEnvironmentInfo().getOperatorImageInsKey();
68
- this.updateCurrentUserName(this.userName$);
68
+ this.updateCurrentUserName(this.userName$ ?? '');
69
69
 
70
70
  // First thing in initialization is registering and subscribing to the AngularPConnect service
71
71
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
@@ -387,7 +387,6 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
387
387
  if (bUpdateSelf) {
388
388
  this.updateSelf();
389
389
  } else {
390
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
391
390
  const newPulseData = this.pConn$.getDataObject().pulse;
392
391
 
393
392
  if (!isEqual(newPulseData, this.pulseData)) {
@@ -395,7 +394,6 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
395
394
  }
396
395
  }
397
396
 
398
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
399
397
  this.pulseData = this.pConn$.getDataObject().pulse;
400
398
  }
401
399
 
@@ -404,13 +402,11 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
404
402
  }
405
403
 
406
404
  getMessageData() {
407
- const messageIDs = (this.pConn$.getConfigProps() as any).messageIDs;
408
- const userName = (this.pConn$.getConfigProps() as any).currentUser;
409
- // @ts-ignore - second parameter pageReference for getValue method should be optional
405
+ const messageIDs = this.pConn$.getConfigProps().messageIDs;
406
+ const userName = this.pConn$.getConfigProps().currentUser;
410
407
  const imageKey = this.pConn$.getValue('OperatorID.pyImageInsKey');
411
408
 
412
- // @ts-ignore - parameter “contextName” for getDataObject method should be optional
413
- const oData: any = this.pConn$.getDataObject();
409
+ const oData = this.pConn$.getDataObject();
414
410
 
415
411
  if (messageIDs && messageIDs.length > 0) {
416
412
  this.pulseMessages$ = JSON.parse(JSON.stringify(oData.pulse.messages));
@@ -536,7 +532,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
536
532
 
537
533
  // If feedAPI is defined then only post message
538
534
  if (this.feedAPI) {
539
- this./* feedAPI. */ postMessage((this.pConn$.getConfigProps() as any).value, this.pulseConversation);
535
+ this./* feedAPI. */ postMessage(this.pConn$.getConfigProps().value, this.pulseConversation);
540
536
  } else {
541
537
  console.log("We don't support Pulse yet");
542
538
  }
@@ -41,7 +41,7 @@
41
41
 
42
42
  <div *ngIf="bShowLinkModal$" class="psdk-dialog-background">
43
43
  <div class="psdk-modal-link-top">
44
- <h3>{{ pConn$.getLocalizedValue('Add local link', '', '') }}</h3>
44
+ <h3>{{ pConn$.getLocalizedValue('Add links', '', '') }}</h3>
45
45
  <div class="psdk-modal-link-entry">
46
46
  <div class="psdk-modal-body">
47
47
  <div class="psdk-modal-links-row">
@@ -61,7 +61,7 @@
61
61
  </div>
62
62
 
63
63
  <div class="psdk-modal-link-add">
64
- <button mat-raised-button color="primary" (click)="_addLink()">{{ pConn$.getLocalizedValue('Add Link', '', '') }}</button>
64
+ <button mat-raised-button color="primary" (click)="_addLink()">{{ pConn$.getLocalizedValue('Add link', '', '') }}</button>
65
65
  </div>
66
66
  </div>
67
67
 
@@ -64,18 +64,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
64
64
 
65
65
  currentCaseID = '';
66
66
 
67
- addAttachmentsActions: any[] = [
68
- {
69
- text: 'Add files',
70
- id: 'addNewFiles',
71
- onClick: () => this.createModal('addLocalFile')
72
- },
73
- {
74
- text: 'Add links',
75
- id: 'addNewLinks',
76
- onClick: () => this.createModal('addLocalLink')
77
- }
78
- ];
67
+ addAttachmentsActions: any;
79
68
 
80
69
  constructor(
81
70
  private angularPConnect: AngularPConnectService,
@@ -93,7 +82,18 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
93
82
  this.lu_icon$ = 'paper-clip';
94
83
 
95
84
  this.closeSvgIcon$ = this.utils.getImageSrc('times', this.utils.getSDKStaticContentUrl());
96
-
85
+ this.addAttachmentsActions = [
86
+ {
87
+ text: this.pConn$.getLocalizedValue('Add files', '', ''),
88
+ id: 'addNewFiles',
89
+ onClick: () => this.createModal('addLocalFile')
90
+ },
91
+ {
92
+ text: this.pConn$.getLocalizedValue('Add links', '', ''),
93
+ id: 'addNewLinks',
94
+ onClick: () => this.createModal('addLocalLink')
95
+ }
96
+ ];
97
97
  // const onViewAllCallback = () => this.onViewAll(this.arFullListAttachments);
98
98
 
99
99
  this.lu_onViewAllFunction = { onClick: this.onViewAll.bind(this) };
@@ -106,7 +106,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
106
106
  this.createModalButtons();
107
107
 
108
108
  PCore.getPubSubUtils().subscribe(
109
- (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
109
+ PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
110
110
  this.updateSelf.bind(this),
111
111
  'caseAttachmentsUpdateFromCaseview'
112
112
  );
@@ -117,10 +117,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
117
117
  this.angularPConnectData.unsubscribeFn();
118
118
  }
119
119
 
120
- PCore.getPubSubUtils().unsubscribe(
121
- (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
122
- 'caseAttachmentsUpdateFromCaseview'
123
- );
120
+ PCore.getPubSubUtils().unsubscribe(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, 'caseAttachmentsUpdateFromCaseview');
124
121
  }
125
122
 
126
123
  // Callback passed when subscribing to store change
@@ -142,7 +139,6 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
142
139
 
143
140
  onAttachFiles(files) {
144
141
  const attachmentUtils = PCore.getAttachmentUtils();
145
- // @ts-ignore - second parameter pageReference for getValue method should be optional
146
142
  const caseID = this.pConn$.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
147
143
 
148
144
  if (files.length > 0) {
@@ -185,7 +181,6 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
185
181
 
186
182
  onAttachLinks(links) {
187
183
  const attachmentUtils = PCore.getAttachmentUtils();
188
- // @ts-ignore - second parameter pageReference for getValue method should be optional
189
184
  const caseID = this.pConn$.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
190
185
 
191
186
  if (links.length > 0) {
@@ -711,7 +706,6 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
711
706
  }
712
707
 
713
708
  getCaseID() {
714
- // @ts-ignore - second parameter pageReference for getValue method should be optional
715
709
  return this.pConn$.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID) || '';
716
710
  }
717
711
 
@@ -760,7 +754,6 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
760
754
  }
761
755
 
762
756
  caseHasChanged(): boolean {
763
- // @ts-ignore - second parameter pageReference for getValue method should be optional
764
757
  const caseID = this.pConn$.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
765
758
  if (this.currentCaseID !== caseID) {
766
759
  this.currentCaseID = caseID;
@@ -8,7 +8,7 @@
8
8
  <div class="psdk-utility-count" id="attachments-count">{{ count$ }}</div>
9
9
  <div style="flex-grow: 1"></div>
10
10
  <div class="header-icon">
11
- <button mat-icon-button [matMenuTriggerFor]="utilityMenu">
11
+ <button id="file-menu" mat-icon-button [matMenuTriggerFor]="utilityMenu">
12
12
  <img class="psdk-utility-card-actions-svg-icon" src="{{ settingsSvgIcon$ }}" />
13
13
  </button>
14
14
  <mat-menu #utilityMenu="matMenu" overlapTrigger="false">
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "QuickCreate",
3
+ "label": "Quick create",
4
+ "description": "Quick create widget",
5
+ "type": "Widget",
6
+ "subtype": "PAGE",
7
+ "properties": [],
8
+ "defaultConfig": {}
9
+ }
@@ -56,7 +56,7 @@ export class QuickCreateComponent implements OnInit, OnChanges {
56
56
  this.classFilter$.forEach(item => {
57
57
  let icon = this.utils.getImageSrc('polaris-solid', this.utils.getSDKStaticContentUrl());
58
58
  let label = '';
59
- envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => {
59
+ (envInfo.environmentInfoObject as any).pyCaseTypeList.forEach(casetype => {
60
60
  if (casetype.pyWorkTypeImplementationClassName === item) {
61
61
  icon = casetype.pxIcon && this.utils.getImageSrc(casetype?.pxIcon, this.utils.getSDKStaticContentUrl());
62
62
  label = casetype.pyWorkTypeName ?? '';
@@ -2,7 +2,7 @@
2
2
  <div class="psdk-todo-header">
3
3
  <div *ngIf="showTodoList$" class="psdk-avatar">{{ this.currentUserInitials$ }}</div>
4
4
  <div id="worklist" class="psdk-todo-text">{{ headerText$ }}</div>
5
- <div *ngIf="showTodoList$" class="psdk-assignment-count">{{ assignmentCount$ }}</div>
5
+ <div *ngIf="showTodoList$" class="psdk-assignment-count">{{ count }}</div>
6
6
  </div>
7
7
  <br /><br />
8
8
  <div *ngIf="showTodoList$" class="psdk-display-divider"></div>
@@ -15,10 +15,11 @@
15
15
  <div class="psdk-todo-assignment-title">{{ getAssignmentName(assignment) }}</div>
16
16
  <div class="psdk-todo-assignment-data">
17
17
  <div class="psdk-todo-assignment-task">
18
- Task in
19
- <button class="psdk-todo-id" style="cursor: pointer" (click)="clickGo(assignment)">
18
+ {{ localizedVal('Task in', localeCategory) }}
19
+ <button class="psdk-todo-id" style="cursor: pointer" (click)="clickGo(assignment)" *ngIf="!isConfirm || canPerform; else readOnlyText">
20
20
  {{ assignment.name }} {{ getID(assignment) }}
21
21
  </button>
22
+ <ng-template #readOnlyText> {{ assignment.name }} {{ getID(assignment) }} </ng-template>
22
23
  <span *ngIf="assignment.status != undefined">
23
24
  &bull; <span class="psdk-todo-assignment-status">{{ assignment?.status }}</span>
24
25
  </span>
@@ -26,7 +27,7 @@
26
27
  </div>
27
28
  </div>
28
29
  </div>
29
- <div class="psdk-todo-assignment-action">
30
+ <div class="psdk-todo-assignment-action" *ngIf="!isConfirm || canPerform">
30
31
  <button mat-flat-button color="primary" (click)="clickGo(assignment)">{{ localizedVal('Go', localeCategory) }}</button>
31
32
  </div>
32
33
  </div>
@@ -35,13 +36,13 @@
35
36
  </div>
36
37
  </div>
37
38
 
38
- <div *ngIf="assignmentCount$ > 3">
39
+ <div *ngIf="count > 3">
39
40
  <div *ngIf="bShowMore$; else showLess" class="psdk-todo-show-more">
40
- <button mat-stroked-button (click)="_showMore()">Show more</button>
41
+ <button mat-stroked-button (click)="_showMore()">{{ showMoreLocalizedValue === 'show_more' ? 'Show more' : showMoreLocalizedValue }}</button>
41
42
  </div>
42
43
  <ng-template #showLess>
43
44
  <div class="psdk-todo-show-more">
44
- <button mat-stroked-button (click)="_showLess()">Show less</button>
45
+ <button mat-stroked-button (click)="_showLess()">{{ showlessLocalizedValue === 'show_less' ? 'Show less' : showlessLocalizedValue }}</button>
45
46
  </div>
46
47
  </ng-template>
47
48
  </div>
@@ -1,10 +1,54 @@
1
- import { Component, OnInit, Input, NgZone, OnDestroy, OnChanges } from '@angular/core';
1
+ import { Component, OnInit, Input, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { MatButtonModule } from '@angular/material/button';
4
4
  import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
5
5
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
6
6
  import { ErrorMessagesService } from '@pega/angular-sdk-components';
7
7
  import { Utils } from '@pega/angular-sdk-components';
8
+ import { updateWorkList } from '@pega/angular-sdk-components';
9
+
10
+ const fetchMyWorkList = (datapage, fields, numberOfRecords, includeTotalCount, context) => {
11
+ return PCore.getDataPageUtils()
12
+ .getDataAsync(
13
+ datapage,
14
+ context,
15
+ {},
16
+ {
17
+ pageNumber: 1,
18
+ pageSize: numberOfRecords
19
+ },
20
+ {
21
+ select: Object.keys(fields).map(key => ({ field: PCore.getAnnotationUtils().getPropertyName(fields[key]) })),
22
+ sortBy: [
23
+ { field: 'pxUrgencyAssign', type: 'DESC' },
24
+ { field: 'pxDeadlineTime', type: 'ASC' },
25
+ { field: 'pxCreateDateTime', type: 'DESC' }
26
+ ]
27
+ },
28
+ {
29
+ invalidateCache: true,
30
+ additionalApiParams: {
31
+ includeTotalCount
32
+ }
33
+ }
34
+ )
35
+ .then(response => {
36
+ return {
37
+ ...response,
38
+ data: (Array.isArray(response?.data) ? response.data : []).map(row =>
39
+ Object.keys(fields).reduce((obj, key) => {
40
+ obj[key] = row[PCore.getAnnotationUtils().getPropertyName(fields[key])];
41
+ return obj;
42
+ }, {})
43
+ )
44
+ };
45
+ });
46
+ };
47
+
48
+ const getMappedValue = value => {
49
+ const mappedValue = PCore.getEnvironmentInfo().getKeyMapping(value);
50
+ return mappedValue === null ? value : mappedValue;
51
+ };
8
52
 
9
53
  interface ToDoProps {
10
54
  // If any, enter additional props that only exist on this component
@@ -23,7 +67,7 @@ interface ToDoProps {
23
67
  standalone: true,
24
68
  imports: [CommonModule, MatButtonModule]
25
69
  })
26
- export class TodoComponent implements OnInit, OnDestroy, OnChanges {
70
+ export class TodoComponent implements OnInit, OnDestroy {
27
71
  @Input() pConn$: typeof PConnect;
28
72
  @Input() caseInfoID$: string;
29
73
  @Input() datasource$: any;
@@ -36,9 +80,8 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
36
80
  @Input() isConfirm;
37
81
 
38
82
  configProps$: ToDoProps;
39
- currentUser$: string;
83
+ currentUser$: string | undefined;
40
84
  currentUserInitials$ = '--';
41
- assignmentCount$: number;
42
85
  bShowMore$ = true;
43
86
  arAssignments$: any[];
44
87
  assignmentsSource$: any;
@@ -48,101 +91,63 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
48
91
  localeCategory = 'Todo';
49
92
  showlessLocalizedValue = this.localizedVal('show_less', 'CosmosFields');
50
93
  showMoreLocalizedValue = this.localizedVal('show_more', 'CosmosFields');
94
+ canPerform: boolean;
95
+ count: number;
51
96
 
52
97
  constructor(
53
98
  private psService: ProgressSpinnerService,
54
99
  private erService: ErrorMessagesService,
55
- private ngZone: NgZone,
56
100
  private utils: Utils
57
101
  ) {}
58
102
 
59
103
  ngOnInit() {
60
104
  this.CONSTS = PCore.getConstants();
61
- const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }: any = PCore.getEvents().getCaseEvent();
62
-
63
- PCore.getPubSubUtils().subscribe(
64
- PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
65
- () => {
66
- this.updateToDo();
67
- },
68
- 'updateToDo'
69
- );
70
-
71
- PCore.getPubSubUtils().subscribe(
72
- CREATE_STAGE_SAVED,
73
- () => {
74
- this.updateList();
75
- },
76
- CREATE_STAGE_SAVED
77
- );
105
+ const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent();
78
106
 
79
- PCore.getPubSubUtils().subscribe(
80
- CREATE_STAGE_DELETED,
81
- () => {
82
- this.updateList();
83
- },
84
- CREATE_STAGE_DELETED
85
- );
107
+ PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, () => this.updateToDo(), 'updateToDo');
108
+ PCore.getPubSubUtils().subscribe(CREATE_STAGE_SAVED, () => this.updateList(), CREATE_STAGE_SAVED);
109
+ PCore.getPubSubUtils().subscribe(CREATE_STAGE_DELETED, () => this.updateList(), CREATE_STAGE_DELETED);
86
110
 
87
111
  this.updateToDo();
88
112
  }
89
113
 
90
114
  ngOnDestroy() {
91
- const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }: any = PCore.getEvents().getCaseEvent();
115
+ const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent();
92
116
 
93
117
  PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'updateToDo');
94
-
95
118
  PCore.getPubSubUtils().unsubscribe(CREATE_STAGE_SAVED, CREATE_STAGE_SAVED);
96
-
97
119
  PCore.getPubSubUtils().unsubscribe(CREATE_STAGE_DELETED, CREATE_STAGE_DELETED);
98
120
  }
99
121
 
100
- ngOnChanges() {
101
- // don't update until we'va had an init
102
- if (PCore) {
103
- this.updateToDo();
104
- }
105
- }
106
-
107
- updateWorkList(key) {
108
- (
109
- PCore.getDataApiUtils()
110
- // @ts-ignore - 2nd parameter "payload" and 3rd parameter "context" should be optional in getData method
111
- .getData(key) as Promise<any>
112
- )
113
- .then(responseData => {
114
- const dataObject = {};
115
- dataObject[key] = {
116
- pxResults: responseData.data.data
117
- };
118
-
119
- this.pConn$.updateState(dataObject);
120
- this.updateToDo();
121
- })
122
- .catch(err => {
123
- console.error(err?.stack);
124
- });
125
- }
126
-
127
122
  updateList() {
128
- this.updateWorkList('D_pyMyWorkList');
123
+ const {
124
+ WORK_BASKET: {
125
+ DATA_PAGES: { D__PY_MY_WORK_LIST }
126
+ }
127
+ } = PCore.getConstants();
128
+ updateWorkList(getPConnect, getMappedValue(D__PY_MY_WORK_LIST));
129
129
  }
130
130
 
131
131
  updateToDo() {
132
132
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ToDoProps;
133
133
 
134
- if (this.headerText$ == undefined) {
135
- this.headerText$ = this.configProps$.headerText;
136
- }
137
-
138
- this.datasource$ = this.configProps$.datasource ? this.configProps$.datasource : this.datasource$;
139
- this.myWorkList$ = this.configProps$.myWorkList ? this.configProps$.myWorkList : this.myWorkList$;
134
+ this.headerText$ = this.headerText$ || this.configProps$.headerText;
135
+ this.datasource$ = this.datasource$ || this.configProps$.datasource;
136
+ this.myWorkList$ = this.myWorkList$ || this.configProps$.myWorkList;
140
137
 
141
138
  this.assignmentsSource$ = this.datasource$?.source || this.myWorkList$?.source;
142
139
 
143
140
  if (this.showTodoList$) {
144
- this.assignmentCount$ = this.assignmentsSource$ != null ? this.assignmentsSource$.length : 0;
145
- this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
141
+ if (this.assignmentsSource$) {
142
+ this.count = this.assignmentsSource$ ? this.assignmentsSource$.length : 0;
143
+ this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
144
+ } else if (this.myWorkList$.datapage) {
145
+ fetchMyWorkList(this.myWorkList$.datapage, this.pConn$.getComponentConfig()?.myWorkList.fields, 3, true, this.context$).then(responseData => {
146
+ this.deferLoadWorklistItems(responseData);
147
+ });
148
+ } else {
149
+ this.arAssignments$ = [];
150
+ }
146
151
  } else {
147
152
  // get caseInfoId assignment.
148
153
  // eslint-disable-next-line no-lonely-if
@@ -151,8 +156,15 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
151
156
  }
152
157
  }
153
158
 
159
+ this.canPerform = this.arAssignments$?.[0]?.canPerform === 'true' || this.arAssignments$?.[0]?.canPerform === true;
160
+
154
161
  this.currentUser$ = PCore.getEnvironmentInfo().getOperatorName();
155
- this.currentUserInitials$ = this.utils.getInitials(this.currentUser$);
162
+ this.currentUserInitials$ = this.utils.getInitials(this.currentUser$ ?? '');
163
+ }
164
+
165
+ deferLoadWorklistItems(responseData) {
166
+ this.count = responseData.totalCount;
167
+ this.arAssignments$ = responseData.data;
156
168
  }
157
169
 
158
170
  getID(assignment: any) {
@@ -181,15 +193,6 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
181
193
  return this.type$ === this.CONSTS.TODO ? assignment.name : assignment.stepName;
182
194
  }
183
195
 
184
- initAssignments(): any[] {
185
- if (this.assignmentsSource$) {
186
- this.assignmentCount$ = this.assignmentsSource$.length;
187
- return this.topThreeAssignments(this.assignmentsSource$);
188
- }
189
- // turn off todolist
190
- return [];
191
- }
192
-
193
196
  getCaseInfoAssignment(assignmentsSource: any[], caseInfoID: string) {
194
197
  const result: any[] = [];
195
198
  for (const source of assignmentsSource) {
@@ -206,18 +209,26 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
206
209
  }
207
210
 
208
211
  _showMore() {
209
- this.ngZone.run(() => {
210
- this.bShowMore$ = false;
212
+ this.bShowMore$ = false;
213
+
214
+ const { WORKLIST } = PCore.getConstants();
215
+
216
+ if (this.type$ === WORKLIST && this.count && this.count > this.arAssignments$.length && !this.assignmentsSource$) {
217
+ fetchMyWorkList(this.myWorkList$.datapage, this.pConn$.getComponentConfig()?.myWorkList.fields, this.count, false, this.context$).then(
218
+ response => {
219
+ this.arAssignments$ = response.data;
220
+ }
221
+ );
222
+ } else {
211
223
  this.arAssignments$ = this.assignmentsSource$;
212
- });
224
+ }
213
225
  }
214
226
 
215
227
  _showLess() {
216
- this.ngZone.run(() => {
217
- this.bShowMore$ = true;
228
+ this.bShowMore$ = true;
229
+ const { WORKLIST } = PCore.getConstants();
218
230
 
219
- this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
220
- });
231
+ this.arAssignments$ = this.type$ === WORKLIST ? this.arAssignments$.slice(0, 3) : this.topThreeAssignments(this.assignmentsSource$);
221
232
  }
222
233
 
223
234
  isChildCase(assignment) {
@@ -230,7 +241,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
230
241
  const sTarget = this.pConn$.getContainerName();
231
242
  const sTargetContainerName = sTarget;
232
243
 
233
- const options: any = { containerName: sTargetContainerName };
244
+ const options: any = { containerName: sTargetContainerName, channelName: '' };
234
245
 
235
246
  if (classname === null || classname === '') {
236
247
  classname = this.pConn$.getCaseInfo().getClassName();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "23.1.10",
3
+ "version": "24.2.10",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"