@pega/angular-sdk-overrides 0.24.9 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/lib/designSystemExtension/alert/alert.component.ts +0 -1
  2. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -2
  3. package/lib/designSystemExtension/banner/banner.component.ts +0 -1
  4. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -2
  5. package/lib/designSystemExtension/field-group/field-group.component.ts +0 -1
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -2
  8. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -1
  9. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  10. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -2
  11. package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +0 -1
  12. package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +0 -1
  13. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +0 -1
  14. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  15. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  16. package/lib/designSystemExtension/operator/operator.component.ts +5 -5
  17. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -8
  18. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +0 -1
  19. package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +0 -1
  20. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  21. package/lib/field/auto-complete/auto-complete.component.ts +31 -16
  22. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -1
  23. package/lib/field/check-box/check-box.component.html +18 -6
  24. package/lib/field/check-box/check-box.component.ts +17 -12
  25. package/lib/field/currency/currency.component.html +4 -4
  26. package/lib/field/currency/currency.component.ts +42 -20
  27. package/lib/field/date/date.component.html +3 -7
  28. package/lib/field/date/date.component.ts +22 -40
  29. package/lib/field/date-time/date-time.component.html +3 -4
  30. package/lib/field/date-time/date-time.component.ts +35 -17
  31. package/lib/field/decimal/decimal.component.html +4 -3
  32. package/lib/field/decimal/decimal.component.ts +47 -22
  33. package/lib/field/dropdown/dropdown.component.html +1 -0
  34. package/lib/field/dropdown/dropdown.component.ts +146 -19
  35. package/lib/field/email/email.component.ts +24 -5
  36. package/lib/field/group/group.component.ts +2 -3
  37. package/lib/field/integer/integer.component.ts +22 -5
  38. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  39. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -3
  40. package/lib/field/location/config-ext.json +8 -0
  41. package/lib/field/location/location.component.html +45 -0
  42. package/lib/field/location/location.component.scss +18 -0
  43. package/lib/field/location/location.component.spec.ts +22 -0
  44. package/lib/field/location/location.component.ts +385 -0
  45. package/lib/field/multiselect/multiselect.component.ts +17 -10
  46. package/lib/field/percentage/percentage.component.html +3 -3
  47. package/lib/field/percentage/percentage.component.ts +45 -21
  48. package/lib/field/phone/config-ext.json +1 -1
  49. package/lib/field/phone/phone.component.html +9 -6
  50. package/lib/field/phone/phone.component.scss +9 -0
  51. package/lib/field/phone/phone.component.ts +30 -27
  52. package/lib/field/radio-buttons/radio-buttons.component.html +17 -12
  53. package/lib/field/radio-buttons/radio-buttons.component.ts +13 -10
  54. package/lib/field/rich-text/rich-text.component.ts +19 -9
  55. package/lib/field/scalar-list/scalar-list.component.ts +3 -5
  56. package/lib/field/selectable-card/selectable-card.component.html +40 -0
  57. package/lib/field/selectable-card/selectable-card.component.scss +0 -0
  58. package/lib/field/selectable-card/selectable-card.component.spec.ts +22 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +255 -0
  60. package/lib/field/semantic-link/semantic-link.component.ts +0 -1
  61. package/lib/field/text/text.component.ts +8 -5
  62. package/lib/field/text-area/text-area.component.html +4 -1
  63. package/lib/field/text-area/text-area.component.ts +22 -6
  64. package/lib/field/text-content/text-content.component.ts +0 -1
  65. package/lib/field/text-input/text-input.component.ts +22 -5
  66. package/lib/field/time/time.component.html +2 -2
  67. package/lib/field/time/time.component.ts +35 -7
  68. package/lib/field/url/url.component.ts +22 -5
  69. package/lib/field/user-reference/user-reference.component.html +40 -46
  70. package/lib/field/user-reference/user-reference.component.ts +111 -21
  71. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  72. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -48
  73. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  74. package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +0 -1
  75. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  76. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -9
  77. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  78. package/lib/infra/Containers/view-container/helper.ts +22 -0
  79. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  80. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  81. package/lib/infra/action-buttons/action-buttons.component.ts +0 -1
  82. package/lib/infra/assignment/assignment.component.html +1 -1
  83. package/lib/infra/assignment/assignment.component.ts +82 -41
  84. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  85. package/lib/infra/assignment-card/assignment-card.component.ts +0 -1
  86. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  87. package/lib/infra/defer-load/defer-load.component.ts +8 -6
  88. package/lib/infra/error-boundary/error-boundary.component.ts +0 -1
  89. package/lib/infra/multi-step/multi-step.component.ts +0 -1
  90. package/lib/infra/navbar/navbar.component.ts +3 -6
  91. package/lib/infra/reference/reference.component.ts +77 -90
  92. package/lib/infra/region/region.component.ts +0 -1
  93. package/lib/infra/root-container/root-container.component.html +2 -15
  94. package/lib/infra/root-container/root-container.component.ts +27 -33
  95. package/lib/infra/stages/stages.component.scss +2 -2
  96. package/lib/infra/stages/stages.component.ts +0 -1
  97. package/lib/infra/view/view.component.html +7 -20
  98. package/lib/infra/view/view.component.ts +20 -3
  99. package/lib/template/app-shell/app-shell.component.ts +20 -3
  100. package/lib/template/banner-page/banner-page.component.ts +0 -1
  101. package/lib/template/base/details-template-base.ts +67 -0
  102. package/lib/template/base/form-template-base.ts +16 -0
  103. package/lib/template/case-summary/case-summary.component.ts +7 -23
  104. package/lib/template/case-view/case-view.component.html +4 -4
  105. package/lib/template/case-view/case-view.component.ts +8 -14
  106. package/lib/template/confirmation/confirmation.component.html +1 -1
  107. package/lib/template/confirmation/confirmation.component.ts +1 -2
  108. package/lib/template/data-reference/data-reference.component.ts +36 -41
  109. package/lib/template/default-form/default-form.component.html +0 -4
  110. package/lib/template/default-form/default-form.component.ts +41 -25
  111. package/lib/template/details/details.component.ts +7 -42
  112. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -40
  113. package/lib/template/details-one-column/details-one-column.component.ts +7 -43
  114. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  115. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -38
  116. package/lib/template/details-three-column/details-three-column.component.ts +7 -44
  117. package/lib/template/details-two-column/details-two-column.component.ts +8 -45
  118. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -43
  119. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  120. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  121. package/lib/template/field-group-list/field-group-list.component.ts +0 -1
  122. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  123. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  124. package/lib/template/field-group-template/field-group-template.component.ts +68 -48
  125. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  126. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  127. package/lib/template/field-value-list/field-value-list.component.ts +0 -1
  128. package/lib/template/inline-dashboard/inline-dashboard.component.ts +0 -1
  129. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -3
  130. package/lib/template/list-page/list-page.component.ts +0 -1
  131. package/lib/template/list-view/list-view.component.html +6 -1
  132. package/lib/template/list-view/list-view.component.scss +11 -0
  133. package/lib/template/list-view/list-view.component.ts +25 -11
  134. package/lib/template/list-view/listViewHelpers.ts +4 -10
  135. package/lib/template/list-view/utils.ts +2 -5
  136. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +0 -1
  137. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -2
  138. package/lib/template/one-column/one-column.component.ts +4 -4
  139. package/lib/template/one-column-page/one-column-page.component.ts +0 -1
  140. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -2
  141. package/lib/template/page/page.component.ts +1 -2
  142. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -2
  143. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  144. package/lib/template/simple-table/simple-table.component.ts +0 -1
  145. package/lib/template/simple-table-manual/helpers.ts +126 -10
  146. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  147. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  148. package/lib/template/simple-table-manual/simple-table-manual.component.ts +110 -54
  149. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -4
  150. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +0 -1
  151. package/lib/template/sub-tabs/sub-tabs.component.ts +0 -1
  152. package/lib/template/three-column/three-column.component.ts +4 -4
  153. package/lib/template/three-column-page/three-column-page.component.ts +0 -1
  154. package/lib/template/two-column/two-column.component.ts +4 -4
  155. package/lib/template/two-column-page/two-column-page.component.ts +0 -1
  156. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -2
  157. package/lib/template/utils.ts +16 -0
  158. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -4
  159. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -2
  160. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -4
  161. package/lib/widget/app-announcement/app-announcement.component.ts +0 -1
  162. package/lib/widget/attachment/attachment.component.ts +9 -13
  163. package/lib/widget/case-history/case-history.component.ts +0 -1
  164. package/lib/widget/feed-container/feed-container.component.ts +7 -10
  165. package/lib/widget/file-utility/file-utility.component.ts +2 -6
  166. package/lib/widget/list-utility/list-utility.component.ts +0 -1
  167. package/lib/widget/quick-create/quick-create.component.ts +0 -1
  168. package/lib/widget/todo/todo.component.html +5 -6
  169. package/lib/widget/todo/todo.component.scss +9 -0
  170. package/lib/widget/todo/todo.component.ts +95 -85
  171. package/lib/widget/utility/utility.component.ts +0 -1
  172. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy, ViewChild, ElementRef } from '@angular/core';
1
+ import { Component, OnInit, Input, NgZone, OnDestroy, ViewChild, ElementRef } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import { MatButtonModule } from '@angular/material/button';
@@ -8,7 +8,6 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
8
8
  import download from 'downloadjs';
9
9
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
10
10
  import { Utils } from '@pega/angular-sdk-components';
11
- import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
13
12
 
14
13
  interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
@@ -22,8 +21,7 @@ interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
22
21
  selector: 'app-attachment',
23
22
  templateUrl: './attachment.component.html',
24
23
  styleUrls: ['./attachment.component.scss'],
25
- standalone: true,
26
- imports: [CommonModule, MatProgressSpinnerModule, MatMenuModule, MatIconModule, MatButtonModule, forwardRef(() => ComponentMapperComponent)]
24
+ imports: [CommonModule, MatProgressSpinnerModule, MatMenuModule, MatIconModule, MatButtonModule]
27
25
  })
28
26
  export class AttachmentComponent implements OnInit, OnDestroy {
29
27
  @Input() pConn$: typeof PConnect;
@@ -120,7 +118,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
120
118
 
121
119
  updateSelf() {
122
120
  const configProps: AttachmentProps = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as AttachmentProps;
123
- const stateProps: any = this.pConn$.getStateProps();
121
+ const stateProps = this.pConn$.getStateProps();
124
122
  const { value, label, extensions, displayMode } = configProps;
125
123
 
126
124
  if (configProps.required != null) {
@@ -149,7 +147,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
149
147
 
150
148
  this.validateMessage = this.angularPConnectData.validateMessage;
151
149
  this.extensions$ = extensions;
152
- this.valueRef = (this.pConn$.getStateProps() as any).value;
150
+ this.valueRef = this.pConn$.getStateProps().value;
153
151
  this.valueRef = this.valueRef.startsWith('.') ? this.valueRef.substring(1) : this.valueRef;
154
152
  this.displayMode = displayMode;
155
153
  /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */
@@ -277,7 +275,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
277
275
  this.updateAttachmentState(this.pConn$, this.getAttachmentKey(this.valueRef), [...currentAttachmentList, ...attachmentsList]);
278
276
  if (file.inProgress) {
279
277
  // @ts-ignore - 3rd parameter "responseEncoding" should be optional
280
- PCore.getAttachmentUtils().cancelRequest(file.ID, pConn.getContextName());
278
+ PCore.getAttachmentUtils().cancelRequest(file.ID, this.pConn$.getContextName());
281
279
  }
282
280
  }
283
281
 
@@ -317,14 +315,13 @@ export class AttachmentComponent implements OnInit, OnDestroy {
317
315
  )} ${this.extensions$.replaceAll('.', '')}`;
318
316
  }
319
317
  if (f.props.error) {
320
- const fieldName = (this.pConn$.getStateProps() as any).value;
318
+ const fieldName = this.pConn$.getStateProps().value;
321
319
  const context = this.pConn$.getContextName();
322
320
  PCore.getMessageManager().addMessages({
323
321
  messages: [
324
322
  {
325
323
  type: 'error',
326
- // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
327
- message: pConn.getLocalizedValue('Error with one or more files', '', '')
324
+ message: this.pConn$.getLocalizedValue('Error with one or more files', '', '')
328
325
  }
329
326
  ],
330
327
  property: fieldName,
@@ -348,7 +345,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
348
345
  }
349
346
 
350
347
  clearFieldErrorMessages() {
351
- const fieldName = (this.pConn$.getStateProps() as any).value;
348
+ const fieldName = this.pConn$.getStateProps().value;
352
349
  const context = this.pConn$.getContextName();
353
350
  PCore.getMessageManager().clearMessages({
354
351
  type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,
@@ -376,14 +373,13 @@ export class AttachmentComponent implements OnInit, OnDestroy {
376
373
  f.props.icon = this.utils.getIconFromFileType(f.type);
377
374
  f.props.name = this.pConn$.getLocalizedValue('Unable to upload file', '', '');
378
375
  f.inProgress = false;
379
- const fieldName = (this.pConn$.getStateProps() as any).value;
376
+ const fieldName = this.pConn$.getStateProps().value;
380
377
  const context = this.pConn$.getContextName();
381
378
  // set errors to property to block submit even on errors in file upload
382
379
  PCore.getMessageManager().addMessages({
383
380
  messages: [
384
381
  {
385
382
  type: 'error',
386
- // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
387
383
  message: this.pConn$.getLocalizedValue('Error with one or more files', '', '')
388
384
  }
389
385
  ],
@@ -11,7 +11,6 @@ interface CaseHistoryProps {
11
11
  selector: 'app-case-history',
12
12
  templateUrl: './case-history.component.html',
13
13
  styleUrls: ['./case-history.component.scss'],
14
- standalone: true,
15
14
  imports: [CommonModule, MatTableModule]
16
15
  })
17
16
  export class CaseHistoryComponent implements OnInit {
@@ -9,14 +9,11 @@ import isEqual from 'fast-deep-equal';
9
9
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
10
10
  import { Utils } from '@pega/angular-sdk-components';
11
11
 
12
- declare const window: any;
13
-
14
12
  @Component({
15
13
  selector: 'app-feed-container',
16
14
  templateUrl: './feed-container.component.html',
17
15
  styleUrls: ['./feed-container.component.scss'],
18
16
  providers: [Utils],
19
- standalone: true,
20
17
  imports: [CommonModule, MatFormFieldModule, MatInputModule, MatGridListModule, MatButtonModule]
21
18
  })
22
19
  export class FeedContainerComponent implements OnInit, OnDestroy {
@@ -25,8 +22,8 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
25
22
  // Used with AngularPConnect
26
23
  angularPConnectData: AngularPConnectData = {};
27
24
 
28
- userName$: string;
29
- imageKey$: string;
25
+ userName$: string | undefined;
26
+ imageKey$: string | undefined;
30
27
 
31
28
  currentUserInitials$: string;
32
29
  currentUserName$: string;
@@ -65,7 +62,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
65
62
  ngOnInit(): void {
66
63
  this.userName$ = PCore.getEnvironmentInfo().getOperatorName();
67
64
  this.imageKey$ = PCore.getEnvironmentInfo().getOperatorImageInsKey();
68
- this.updateCurrentUserName(this.userName$);
65
+ this.updateCurrentUserName(this.userName$ ?? '');
69
66
 
70
67
  // First thing in initialization is registering and subscribing to the AngularPConnect service
71
68
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
@@ -402,11 +399,11 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
402
399
  }
403
400
 
404
401
  getMessageData() {
405
- const messageIDs = (this.pConn$.getConfigProps() as any).messageIDs;
406
- const userName = (this.pConn$.getConfigProps() as any).currentUser;
402
+ const messageIDs = this.pConn$.getConfigProps().messageIDs;
403
+ const userName = this.pConn$.getConfigProps().currentUser;
407
404
  const imageKey = this.pConn$.getValue('OperatorID.pyImageInsKey');
408
405
 
409
- const oData: any = this.pConn$.getDataObject();
406
+ const oData = this.pConn$.getDataObject();
410
407
 
411
408
  if (messageIDs && messageIDs.length > 0) {
412
409
  this.pulseMessages$ = JSON.parse(JSON.stringify(oData.pulse.messages));
@@ -532,7 +529,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
532
529
 
533
530
  // If feedAPI is defined then only post message
534
531
  if (this.feedAPI) {
535
- this./* feedAPI. */ postMessage((this.pConn$.getConfigProps() as any).value, this.pulseConversation);
532
+ this./* feedAPI. */ postMessage(this.pConn$.getConfigProps().value, this.pulseConversation);
536
533
  } else {
537
534
  console.log("We don't support Pulse yet");
538
535
  }
@@ -17,7 +17,6 @@ interface FileUtilityProps {
17
17
  selector: 'app-file-utility',
18
18
  templateUrl: './file-utility.component.html',
19
19
  styleUrls: ['./file-utility.component.scss'],
20
- standalone: true,
21
20
  imports: [CommonModule, MatButtonModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
22
21
  })
23
22
  export class FileUtilityComponent implements OnInit, OnDestroy {
@@ -106,7 +105,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
106
105
  this.createModalButtons();
107
106
 
108
107
  PCore.getPubSubUtils().subscribe(
109
- (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
108
+ PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
110
109
  this.updateSelf.bind(this),
111
110
  'caseAttachmentsUpdateFromCaseview'
112
111
  );
@@ -117,10 +116,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
117
116
  this.angularPConnectData.unsubscribeFn();
118
117
  }
119
118
 
120
- PCore.getPubSubUtils().unsubscribe(
121
- (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
122
- 'caseAttachmentsUpdateFromCaseview'
123
- );
119
+ PCore.getPubSubUtils().unsubscribe(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, 'caseAttachmentsUpdateFromCaseview');
124
120
  }
125
121
 
126
122
  // Callback passed when subscribing to store change
@@ -10,7 +10,6 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  selector: 'app-list-utility',
11
11
  templateUrl: './list-utility.component.html',
12
12
  styleUrls: ['./list-utility.component.scss'],
13
- standalone: true,
14
13
  imports: [CommonModule, MatButtonModule, MatMenuModule, MatProgressSpinnerModule, forwardRef(() => ComponentMapperComponent)]
15
14
  })
16
15
  export class ListUtilityComponent implements OnInit {
@@ -14,7 +14,6 @@ interface QuickCreateProps {
14
14
  selector: 'app-quick-create',
15
15
  templateUrl: './quick-create.component.html',
16
16
  styleUrls: ['./quick-create.component.scss'],
17
- standalone: true,
18
17
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
19
18
  })
20
19
  export class QuickCreateComponent implements OnInit, OnChanges {
@@ -1,10 +1,9 @@
1
1
  <div class="psdk-todo">
2
- <div class="psdk-todo-header">
3
- <div *ngIf="showTodoList$" class="psdk-avatar">{{ this.currentUserInitials$ }}</div>
2
+ <div *ngIf="showTodoList$" class="psdk-todo-header">
3
+ <div 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 class="psdk-assignment-count">{{ count }}</div>
6
6
  </div>
7
- <br /><br />
8
7
  <div *ngIf="showTodoList$" class="psdk-display-divider"></div>
9
8
 
10
9
  <div class="psdk-todo-assignments">
@@ -27,7 +26,7 @@
27
26
  </div>
28
27
  </div>
29
28
  </div>
30
- <div class="psdk-todo-assignment-action" *ngIf="!isConfirm || canPerform">
29
+ <div *ngIf="!isConfirm || canPerform" class="psdk-todo-assignment-action">
31
30
  <button mat-flat-button color="primary" (click)="clickGo(assignment)">{{ localizedVal('Go', localeCategory) }}</button>
32
31
  </div>
33
32
  </div>
@@ -36,7 +35,7 @@
36
35
  </div>
37
36
  </div>
38
37
 
39
- <div *ngIf="assignmentCount$ > 3">
38
+ <div *ngIf="count > 3">
40
39
  <div *ngIf="bShowMore$; else showLess" class="psdk-todo-show-more">
41
40
  <button mat-stroked-button (click)="_showMore()">{{ showMoreLocalizedValue === 'show_more' ? 'Show more' : showMoreLocalizedValue }}</button>
42
41
  </div>
@@ -1,5 +1,12 @@
1
+ .psdk-todo-assignments > *:last-child {
2
+ .psdk-display-divider {
3
+ display: none;
4
+ }
5
+ }
6
+
1
7
  .psdk-display-divider {
2
8
  border-bottom: 0.0625rem solid var(--app-neutral-light-color);
9
+ margin-block: 0.5rem;
3
10
  }
4
11
 
5
12
  .psdk-todo {
@@ -12,6 +19,7 @@
12
19
 
13
20
  .psdk-todo-header {
14
21
  display: inline-flex;
22
+ margin-bottom: 1rem;
15
23
  }
16
24
 
17
25
  .psdk-todo-text {
@@ -58,6 +66,7 @@
58
66
  display: inline-flex;
59
67
  width: 100%;
60
68
  padding: 0.625rem 0rem;
69
+ align-items: center;
61
70
  }
62
71
 
63
72
  .psdk-todo-assignment-data {
@@ -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
@@ -20,10 +64,9 @@ interface ToDoProps {
20
64
  templateUrl: './todo.component.html',
21
65
  styleUrls: ['./todo.component.scss'],
22
66
  providers: [Utils],
23
- standalone: true,
24
67
  imports: [CommonModule, MatButtonModule]
25
68
  })
26
- export class TodoComponent implements OnInit, OnDestroy, OnChanges {
69
+ export class TodoComponent implements OnInit, OnDestroy {
27
70
  @Input() pConn$: typeof PConnect;
28
71
  @Input() caseInfoID$: string;
29
72
  @Input() datasource$: any;
@@ -36,9 +79,8 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
36
79
  @Input() isConfirm;
37
80
 
38
81
  configProps$: ToDoProps;
39
- currentUser$: string;
82
+ currentUser$: string | undefined;
40
83
  currentUserInitials$ = '--';
41
- assignmentCount$: number;
42
84
  bShowMore$ = true;
43
85
  arAssignments$: any[];
44
86
  assignmentsSource$: any;
@@ -48,100 +90,66 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
48
90
  localeCategory = 'Todo';
49
91
  showlessLocalizedValue = this.localizedVal('show_less', 'CosmosFields');
50
92
  showMoreLocalizedValue = this.localizedVal('show_more', 'CosmosFields');
51
- canPerform: boolean;
93
+ count: number;
52
94
 
53
95
  constructor(
54
96
  private psService: ProgressSpinnerService,
55
97
  private erService: ErrorMessagesService,
56
- private ngZone: NgZone,
57
98
  private utils: Utils
58
99
  ) {}
59
100
 
60
101
  ngOnInit() {
61
102
  this.CONSTS = PCore.getConstants();
62
- const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }: any = PCore.getEvents().getCaseEvent();
63
-
64
- PCore.getPubSubUtils().subscribe(
65
- PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
66
- () => {
67
- this.updateToDo();
68
- },
69
- 'updateToDo'
70
- );
71
-
72
- PCore.getPubSubUtils().subscribe(
73
- CREATE_STAGE_SAVED,
74
- () => {
75
- this.updateList();
76
- },
77
- CREATE_STAGE_SAVED
78
- );
103
+ const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent();
79
104
 
80
- PCore.getPubSubUtils().subscribe(
81
- CREATE_STAGE_DELETED,
82
- () => {
83
- this.updateList();
84
- },
85
- CREATE_STAGE_DELETED
86
- );
105
+ PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, () => this.updateToDo(), 'updateToDo');
106
+ PCore.getPubSubUtils().subscribe(CREATE_STAGE_SAVED, () => this.updateList(), CREATE_STAGE_SAVED);
107
+ PCore.getPubSubUtils().subscribe(CREATE_STAGE_DELETED, () => this.updateList(), CREATE_STAGE_DELETED);
87
108
 
88
109
  this.updateToDo();
89
110
  }
90
111
 
91
112
  ngOnDestroy() {
92
- const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }: any = PCore.getEvents().getCaseEvent();
113
+ const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent();
93
114
 
94
115
  PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'updateToDo');
95
-
96
116
  PCore.getPubSubUtils().unsubscribe(CREATE_STAGE_SAVED, CREATE_STAGE_SAVED);
97
-
98
117
  PCore.getPubSubUtils().unsubscribe(CREATE_STAGE_DELETED, CREATE_STAGE_DELETED);
99
118
  }
100
119
 
101
- ngOnChanges() {
102
- // don't update until we'va had an init
103
- if (PCore) {
104
- this.updateToDo();
105
- }
106
- }
107
-
108
- updateWorkList(key) {
109
- PCore.getDataApiUtils()
110
- // @ts-ignore - 2nd parameter "payload" and 3rd parameter "context" should be optional in getData method
111
- .getData(key)
112
- .then(responseData => {
113
- const dataObject = {};
114
- dataObject[key] = {
115
- pxResults: responseData.data.data
116
- };
117
-
118
- this.pConn$.updateState(dataObject);
119
- this.updateToDo();
120
- })
121
- .catch(err => {
122
- console.error(err?.stack);
123
- });
120
+ get canPerform() {
121
+ return this.assignmentsSource$?.[0]?.canPerform === 'true' || this.assignmentsSource$?.[0]?.canPerform === true;
124
122
  }
125
123
 
126
124
  updateList() {
127
- this.updateWorkList('D_pyMyWorkList');
125
+ const {
126
+ WORK_BASKET: {
127
+ DATA_PAGES: { D__PY_MY_WORK_LIST }
128
+ }
129
+ } = PCore.getConstants();
130
+ updateWorkList(getPConnect, getMappedValue(D__PY_MY_WORK_LIST));
128
131
  }
129
132
 
130
133
  updateToDo() {
131
134
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ToDoProps;
132
135
 
133
- if (this.headerText$ == undefined) {
134
- this.headerText$ = this.configProps$.headerText;
135
- }
136
-
137
- this.datasource$ = this.configProps$.datasource ? this.configProps$.datasource : this.datasource$;
138
- this.myWorkList$ = this.configProps$.myWorkList ? this.configProps$.myWorkList : this.myWorkList$;
136
+ this.headerText$ = this.headerText$ || this.configProps$.headerText;
137
+ this.datasource$ = this.datasource$ || this.configProps$.datasource;
138
+ this.myWorkList$ = this.myWorkList$ || this.configProps$.myWorkList;
139
139
 
140
140
  this.assignmentsSource$ = this.datasource$?.source || this.myWorkList$?.source;
141
141
 
142
142
  if (this.showTodoList$) {
143
- this.assignmentCount$ = this.assignmentsSource$ != null ? this.assignmentsSource$.length : 0;
144
- this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
143
+ if (this.assignmentsSource$) {
144
+ this.count = this.assignmentsSource$ ? this.assignmentsSource$.length : 0;
145
+ this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
146
+ } else if (this.myWorkList$.datapage) {
147
+ fetchMyWorkList(this.myWorkList$.datapage, this.pConn$.getComponentConfig()?.myWorkList.fields, 3, true, this.context$).then(responseData => {
148
+ this.deferLoadWorklistItems(responseData);
149
+ });
150
+ } else {
151
+ this.arAssignments$ = [];
152
+ }
145
153
  } else {
146
154
  // get caseInfoId assignment.
147
155
  // eslint-disable-next-line no-lonely-if
@@ -150,10 +158,13 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
150
158
  }
151
159
  }
152
160
 
153
- this.canPerform = this.arAssignments$?.[0]?.canPerform === 'true' || this.arAssignments$?.[0]?.canPerform === true;
154
-
155
161
  this.currentUser$ = PCore.getEnvironmentInfo().getOperatorName();
156
- 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;
157
168
  }
158
169
 
159
170
  getID(assignment: any) {
@@ -182,15 +193,6 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
182
193
  return this.type$ === this.CONSTS.TODO ? assignment.name : assignment.stepName;
183
194
  }
184
195
 
185
- initAssignments(): any[] {
186
- if (this.assignmentsSource$) {
187
- this.assignmentCount$ = this.assignmentsSource$.length;
188
- return this.topThreeAssignments(this.assignmentsSource$);
189
- }
190
- // turn off todolist
191
- return [];
192
- }
193
-
194
196
  getCaseInfoAssignment(assignmentsSource: any[], caseInfoID: string) {
195
197
  const result: any[] = [];
196
198
  for (const source of assignmentsSource) {
@@ -207,18 +209,26 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
207
209
  }
208
210
 
209
211
  _showMore() {
210
- this.ngZone.run(() => {
211
- 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 {
212
223
  this.arAssignments$ = this.assignmentsSource$;
213
- });
224
+ }
214
225
  }
215
226
 
216
227
  _showLess() {
217
- this.ngZone.run(() => {
218
- this.bShowMore$ = true;
228
+ this.bShowMore$ = true;
229
+ const { WORKLIST } = PCore.getConstants();
219
230
 
220
- this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
221
- });
231
+ this.arAssignments$ = this.type$ === WORKLIST ? this.arAssignments$.slice(0, 3) : this.topThreeAssignments(this.assignmentsSource$);
222
232
  }
223
233
 
224
234
  isChildCase(assignment) {
@@ -13,7 +13,6 @@ interface UtilityProps {
13
13
  selector: 'app-utility',
14
14
  templateUrl: './utility.component.html',
15
15
  styleUrls: ['./utility.component.scss'],
16
- standalone: true,
17
16
  imports: [forwardRef(() => ComponentMapperComponent)]
18
17
  })
19
18
  export class UtilityComponent implements OnInit, OnChanges {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.24.9",
3
+ "version": "0.25.1",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"