@pega/angular-sdk-overrides 24.2.10 → 24.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -1
  2. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
  3. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +6 -0
  4. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  5. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  6. package/lib/designSystemExtension/operator/operator.component.ts +4 -3
  7. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  8. package/lib/field/auto-complete/auto-complete.component.ts +15 -2
  9. package/lib/field/check-box/check-box.component.html +4 -0
  10. package/lib/field/currency/currency.component.ts +19 -13
  11. package/lib/field/date/date.component.html +2 -1
  12. package/lib/field/date-time/date-time.component.html +2 -2
  13. package/lib/field/date-time/date-time.component.ts +17 -3
  14. package/lib/field/decimal/decimal.component.html +1 -0
  15. package/lib/field/decimal/decimal.component.ts +38 -15
  16. package/lib/field/dropdown/dropdown.component.html +1 -0
  17. package/lib/field/dropdown/dropdown.component.ts +18 -4
  18. package/lib/field/email/email.component.ts +17 -7
  19. package/lib/field/integer/integer.component.html +1 -1
  20. package/lib/field/integer/integer.component.ts +16 -6
  21. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  22. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -2
  23. package/lib/field/percentage/percentage.component.html +1 -1
  24. package/lib/field/percentage/percentage.component.ts +27 -17
  25. package/lib/field/phone/config-ext.json +1 -1
  26. package/lib/field/phone/phone.component.html +3 -1
  27. package/lib/field/phone/phone.component.ts +6 -13
  28. package/lib/field/radio-buttons/radio-buttons.component.html +3 -6
  29. package/lib/field/rich-text/rich-text.component.ts +12 -3
  30. package/lib/field/text/text.component.ts +6 -4
  31. package/lib/field/text-area/text-area.component.html +4 -2
  32. package/lib/field/text-area/text-area.component.ts +16 -6
  33. package/lib/field/text-input/text-input.component.html +1 -1
  34. package/lib/field/text-input/text-input.component.ts +16 -6
  35. package/lib/field/time/time.component.html +2 -2
  36. package/lib/field/time/time.component.ts +21 -6
  37. package/lib/field/url/url.component.html +1 -1
  38. package/lib/field/url/url.component.ts +16 -6
  39. package/lib/field/user-reference/user-reference.component.html +40 -38
  40. package/lib/field/user-reference/user-reference.component.ts +70 -7
  41. package/lib/infra/Containers/flow-container/flow-container.component.ts +17 -43
  42. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  43. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  44. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +0 -7
  45. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  46. package/lib/infra/assignment/assignment.component.html +1 -1
  47. package/lib/infra/assignment/assignment.component.ts +82 -39
  48. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  49. package/lib/infra/defer-load/defer-load.component.ts +4 -1
  50. package/lib/infra/navbar/navbar.component.ts +0 -2
  51. package/lib/infra/reference/reference.component.ts +77 -90
  52. package/lib/infra/root-container/root-container.component.html +2 -15
  53. package/lib/infra/root-container/root-container.component.ts +24 -27
  54. package/lib/template/base/form-template-base.ts +6 -0
  55. package/lib/template/confirmation/confirmation.component.html +1 -1
  56. package/lib/template/default-form/default-form.component.ts +35 -2
  57. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  58. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  59. package/lib/template/field-group-template/field-group-template.component.ts +64 -41
  60. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  61. package/lib/template/field-value-list/field-value-list.component.scss +4 -0
  62. package/lib/template/list-view/list-view.component.html +3 -1
  63. package/lib/template/list-view/list-view.component.ts +1 -3
  64. package/lib/template/list-view/listViewHelpers.ts +2 -5
  65. package/lib/template/list-view/utils.ts +2 -5
  66. package/lib/template/simple-table-manual/helpers.ts +9 -7
  67. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  68. package/lib/template/simple-table-manual/simple-table-manual.component.scss +11 -3
  69. package/lib/template/simple-table-manual/simple-table-manual.component.ts +62 -24
  70. package/lib/template/utils.ts +16 -0
  71. package/lib/widget/feed-container/feed-container.component.ts +0 -2
  72. package/lib/widget/todo/todo.component.html +4 -5
  73. package/lib/widget/todo/todo.component.scss +9 -0
  74. package/lib/widget/todo/todo.component.ts +4 -3
  75. package/package.json +1 -1
@@ -6,7 +6,7 @@ import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
6
6
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
7
7
  import { ReferenceComponent } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
- import { getToDoAssignments, showBanner } from './helpers';
9
+ import { getToDoAssignments, hasAssignments, showBanner } from './helpers';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
12
12
 
@@ -121,6 +121,14 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
121
121
  },
122
122
  'cancelPressed'
123
123
  );
124
+
125
+ PCore.getPubSubUtils().subscribe(
126
+ 'clearBannerMessages',
127
+ () => {
128
+ this.banners = [];
129
+ },
130
+ 'clearBannerMessages'
131
+ );
124
132
  }
125
133
 
126
134
  ngOnDestroy() {
@@ -131,6 +139,8 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
131
139
  PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'cancelAssignment');
132
140
 
133
141
  PCore.getPubSubUtils().unsubscribe('cancelPressed', 'cancelPressed');
142
+
143
+ PCore.getPubSubUtils().unsubscribe('clearBannerMessages', 'clearBannerMessages');
134
144
  }
135
145
 
136
146
  handleCancel() {
@@ -155,13 +165,15 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
155
165
  const caseViewModeFromProps = this.angularPConnect.getComponentProp(this, 'caseViewMode');
156
166
  const caseViewModeFromRedux = pConn.getValue('context_data.caseViewMode', '');
157
167
 
168
+ const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
169
+
158
170
  // ONLY call updateSelf when the component should update
159
171
  // AND removing the "gate" that was put there since shouldComponentUpdate
160
172
  // should be the real "gate"
173
+ // eslint-disable-next-line sonarjs/no-collapsible-if
161
174
  if (bUpdateSelf || caseViewModeFromProps !== caseViewModeFromRedux) {
162
175
  // don't want to redraw the flow container when there are page messages, because
163
176
  // the redraw causes us to loose the errors on the elements
164
- const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
165
177
  if (!completeProps.pageMessages || completeProps.pageMessages.length == 0) {
166
178
  // with a cancel, need to timeout so todo will update correctly
167
179
  if (this.bHasCancel) {
@@ -172,10 +184,10 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
172
184
  } else {
173
185
  this.updateSelf();
174
186
  }
175
- } else {
176
- this.showPageMessages(completeProps);
177
187
  }
178
188
  }
189
+
190
+ this.showPageMessages(completeProps);
179
191
  }
180
192
 
181
193
  showPageMessages(completeProps: FlowContainerProps) {
@@ -277,41 +289,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
277
289
  this.psService.sendMessage(false);
278
290
  }
279
291
 
280
- hasAssignments() {
281
- let hasAssignments = false;
282
- const assignmentsList = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
283
- // const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
284
- // 8.7 includes assignments in Assignments List that may be assigned to
285
- // a different operator. So, see if there are any assignments for
286
- // the current operator
287
- const isEmbedded = window.location.href.includes('embedded');
288
- let bAssignmentsForThisOperator = false;
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
-
301
- // Bail if there is no assignmentsList
302
- if (!assignmentsList) {
303
- return hasAssignments;
304
- }
305
-
306
- const hasChildCaseAssignments = this.hasChildCaseAssignments();
307
-
308
- if (bAssignmentsForThisOperator || hasChildCaseAssignments || this.isCaseWideLocalAction()) {
309
- hasAssignments = true;
310
- }
311
-
312
- return hasAssignments;
313
- }
314
-
315
292
  isCaseWideLocalAction() {
316
293
  const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);
317
294
  const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS);
@@ -461,7 +438,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
461
438
  this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
462
439
  // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
463
440
  // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
464
- if (!this.hasAssignments()) {
441
+ if (!hasAssignments(this.pConn$)) {
465
442
  this.bHasCaseMessages$ = true;
466
443
  this.bShowConfirm = true;
467
444
  this.checkSvg$ = this.utils.getImageSrc('check', this.utils.getSDKStaticContentUrl());
@@ -471,9 +448,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
471
448
  this.caseMessages$ = this.localizedVal('Thank you! The next step in this case has been routed appropriately.', this.localeCategory);
472
449
  }
473
450
 
474
- // publish this "assignmentFinished" for mashup, need to get approved as a standard
475
- PCore.getPubSubUtils().publish('assignmentFinished');
476
-
477
451
  this.psService.sendMessage(false);
478
452
  } else {
479
453
  this.bHasCaseMessages$ = false;
@@ -28,12 +28,12 @@ function getChildCaseAssignments(pConnect) {
28
28
  return allAssignments;
29
29
  }
30
30
 
31
- function hasAssignments(pConnect) {
31
+ export function hasAssignments(pConnect) {
32
32
  const { CASE_INFO } = PCore.getConstants();
33
33
  const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
34
34
  const childCasesAssignments = getChildCaseAssignments(pConnect);
35
35
 
36
- return assignments || childCasesAssignments || isCaseWideLocalAction(pConnect);
36
+ return assignments || childCasesAssignments?.length || isCaseWideLocalAction(pConnect);
37
37
  }
38
38
 
39
39
  export const showBanner = getPConnect => {
@@ -1,4 +1,4 @@
1
- <div id="dialog" *ngIf="bShowModal$ && bShowAsModal$" class="psdk-dialog-background">
1
+ <div id="dialog" *ngIf="bShowModal$" class="psdk-dialog-background">
2
2
  <div class="psdk-modal-view-container-top" id="{{ buildName$ }}">
3
3
  <h3 *ngIf="title$ != ''">{{ title$ }}</h3>
4
4
  <component-mapper
@@ -15,16 +15,6 @@
15
15
  </div>
16
16
  </div>
17
17
 
18
- <div *ngIf="bShowModal$ && !bShowAsModal$">
19
- <div id="{{ buildName$ }}">
20
- <h3 *ngIf="title$ != ''">{{ title$ }}</h3>
21
- <component-mapper
22
- name="Assignment"
23
- [props]="{ pConn$: createdViewPConn$, formGroup$, arChildren$, itemKey$, isCreateStage$: true, updateToken$ }"
24
- ></component-mapper>
25
- </div>
26
- </div>
27
-
28
18
  <div *ngIf="bShowCancelAlert$">
29
19
  <component-mapper
30
20
  name="CancelAlert"
@@ -23,7 +23,6 @@ import { ReferenceComponent } from '@pega/angular-sdk-components';
23
23
  })
24
24
  export class ModalViewContainerComponent implements OnInit, OnDestroy {
25
25
  @Input() pConn$: typeof PConnect;
26
- @Input() displayOnlyFA$: boolean;
27
26
 
28
27
  // for when non modal
29
28
  @Output() modalVisibleChange = new EventEmitter<boolean>();
@@ -39,7 +38,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
39
38
  context$: string;
40
39
  title$ = '';
41
40
  bShowModal$ = false;
42
- bShowAsModal$ = true;
43
41
  itemKey$: string;
44
42
  formGroup$: FormGroup;
45
43
  oCaseInfo: Object = {};
@@ -73,11 +71,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
73
71
  }
74
72
 
75
73
  ngOnInit(): void {
76
- if (this.displayOnlyFA$) {
77
- // for when non modal
78
- this.bShowAsModal$ = false;
79
- }
80
-
81
74
  // First thing in initialization is registering and subscribing to the AngularPConnect service
82
75
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
83
76
 
@@ -1,4 +1,4 @@
1
- <mat-grid-list cols="2" rowHeight="6.25rem">
1
+ <mat-grid-list *ngIf="arMainButtons$ && arSecondaryButtons$" cols="2" rowHeight="6.25rem">
2
2
  <mat-grid-tile>
3
3
  <button *ngFor="let aButton of arSecondaryButtons$" mat-raised-button color="secondary" (click)="buttonClick(aButton.jsAction, 'secondary')">
4
4
  {{ localizedVal(aButton.name, localeCategory) }}
@@ -1,5 +1,5 @@
1
1
  <div>
2
- <div><component-mapper name="AlertBanner" [props]="{ banners }" [parent]="this"></component-mapper></div>
2
+ <div><component-mapper name="AlertBanner" [props]="{ banners: bannerService.banners }" [parent]="this"></component-mapper></div>
3
3
  <div *ngIf="bHasNavigation$" class="psdk-stepper">
4
4
  <component-mapper
5
5
  name="MultiStep"
@@ -6,9 +6,18 @@ import { FormGroup } from '@angular/forms';
6
6
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
7
7
  import { ErrorMessagesService } from '@pega/angular-sdk-components';
8
8
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
9
+ import { BannerService } from '@pega/angular-sdk-components';
9
10
  import { ReferenceComponent } from '@pega/angular-sdk-components';
10
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
12
 
13
+ function getRefreshProps(refreshConditions) {
14
+ // refreshConditions cuurently supports only "Changes" event
15
+ if (!refreshConditions) {
16
+ return [];
17
+ }
18
+ return refreshConditions.filter(item => item.event && item.event === 'Changes').map(item => [item.field, item.field?.substring(1)]) || [];
19
+ }
20
+
12
21
  interface AssignmentProps {
13
22
  // If any, enter additional props that only exist on this component
14
23
  template: string;
@@ -29,7 +38,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
29
38
  @Input() isCreateStage$: boolean;
30
39
  @Input() updateToken$: number;
31
40
  @Input() isInModal$ = false;
32
- @Input() banners;
33
41
 
34
42
  // For interaction with AngularPConnect
35
43
  angularPConnectData: AngularPConnectData = {};
@@ -69,12 +77,15 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
69
77
  localeCategory = 'Assignment';
70
78
  localeReference;
71
79
 
80
+ snackBarRef;
81
+
72
82
  constructor(
73
83
  private angularPConnect: AngularPConnectService,
74
84
  private psService: ProgressSpinnerService,
75
85
  private erService: ErrorMessagesService,
76
86
  private ngZone: NgZone,
77
- private snackBar: MatSnackBar
87
+ private snackBar: MatSnackBar,
88
+ public bannerService: BannerService
78
89
  ) {}
79
90
 
80
91
  ngOnInit(): void {
@@ -105,6 +116,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
105
116
  // Should always check the bridge to see if the component should update itself (re-render)
106
117
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
107
118
 
119
+ this.bannerService.updateBanners(this.itemKey$);
120
+
108
121
  // ONLY call updateSelf when the component should update
109
122
  // AND removing the "gate" that was put there since shouldComponentUpdate
110
123
  // should be the real "gate"
@@ -128,6 +141,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
128
141
  }
129
142
 
130
143
  updateChanges() {
144
+ this.registerForRefresh();
145
+
131
146
  // pConn$ may be a 'reference' component, so normalize it
132
147
  this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
133
148
 
@@ -285,6 +300,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
285
300
  }
286
301
 
287
302
  buttonClick(sAction, sButtonType) {
303
+ this.snackBarRef?.dismiss();
304
+ this.bannerService.clearBanners();
305
+ PCore.getPubSubUtils().publish('clearBannerMessages');
288
306
  // right now, done on an individual basis, setting bReInit to true
289
307
  // upon the next flow container state change, will cause the flow container
290
308
  // to re-initialize
@@ -308,21 +326,21 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
308
326
  switch (sAction) {
309
327
  case 'navigateToStep':
310
328
  this.erService.sendMessage('publish', '');
311
- if (this.formValid()) {
312
- this.bReInit = true;
313
- this.psService.sendMessage(true);
314
329
 
315
- const navigatePromise = this.navigateToStep('previous', this.itemKey$);
316
- navigatePromise
317
- .then(() => {
318
- this.updateChanges();
319
- this.psService.sendMessage(false);
320
- })
321
- .catch(() => {
322
- this.psService.sendMessage(false);
323
- this.snackBar.open(`${this.localizedVal('Navigation failed!', this.localeCategory)}`, 'Ok');
324
- });
325
- }
330
+ this.bReInit = true;
331
+ this.psService.sendMessage(true);
332
+
333
+ const navigatePromise = this.navigateToStep('previous', this.itemKey$);
334
+ navigatePromise
335
+ .then(() => {
336
+ this.updateChanges();
337
+ this.psService.sendMessage(false);
338
+ })
339
+ .catch(() => {
340
+ this.psService.sendMessage(false);
341
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Navigation failed!', this.localeCategory)}`, 'Ok');
342
+ });
343
+
326
344
  break;
327
345
 
328
346
  case 'saveAssignment': {
@@ -338,7 +356,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
338
356
  })
339
357
  .catch(() => {
340
358
  this.psService.sendMessage(false);
341
- this.snackBar.open(`${this.localizedVal('Save failed', this.localeCategory)}`, 'Ok');
359
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Save failed', this.localeCategory)}`, 'Ok');
342
360
  });
343
361
 
344
362
  break;
@@ -362,7 +380,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
362
380
  })
363
381
  .catch(() => {
364
382
  this.psService.sendMessage(false);
365
- this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
383
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
366
384
  });
367
385
  } else {
368
386
  this.psService.sendMessage(true);
@@ -379,7 +397,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
379
397
  })
380
398
  .catch(() => {
381
399
  this.psService.sendMessage(false);
382
- this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
400
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Cancel failed!', this.localeCategory)}`, 'Ok');
383
401
  });
384
402
  }
385
403
  break;
@@ -391,7 +409,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
391
409
  .then(() => {})
392
410
  .catch(() => {
393
411
  this.psService.sendMessage(false);
394
- this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
412
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
395
413
  });
396
414
 
397
415
  break;
@@ -404,23 +422,18 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
404
422
  switch (sAction) {
405
423
  case 'finishAssignment':
406
424
  this.erService.sendMessage('publish', '');
407
- if (this.formValid()) {
408
- this.bReInit = true;
409
- this.psService.sendMessage(true);
410
- const finishPromise = this.finishAssignment(this.itemKey$); // JA - was itemID but Nebula/Constellation uses itemKey
411
- finishPromise
412
- .then(() => {
413
- this.psService.sendMessage(false);
414
- this.updateChanges();
415
- })
416
- .catch(() => {
417
- this.psService.sendMessage(false);
418
- this.snackBar.open(`${this.localizedVal('Submit failed!', this.localeCategory)}`, 'Ok');
419
- });
420
- } else {
421
- // let snackBarRef = this.snackBar.open("Please fix errors on form.", "Ok");
422
- this.erService.sendMessage('show', this.localizedVal('Please fix errors on form.', this.localeCategory));
423
- }
425
+ this.bReInit = true;
426
+ this.psService.sendMessage(true);
427
+ const finishPromise = this.finishAssignment(this.itemKey$); // JA - was itemID but Nebula/Constellation uses itemKey
428
+ finishPromise
429
+ .then(() => {
430
+ this.psService.sendMessage(false);
431
+ this.updateChanges();
432
+ })
433
+ .catch(() => {
434
+ this.psService.sendMessage(false);
435
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Submit failed!', this.localeCategory)}`, 'Ok');
436
+ });
424
437
  break;
425
438
 
426
439
  case 'approveCase': {
@@ -430,7 +443,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
430
443
  .then(() => {})
431
444
  .catch(() => {
432
445
  this.psService.sendMessage(false);
433
- this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
446
+ this.snackBarRef = this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
434
447
  });
435
448
 
436
449
  break;
@@ -452,10 +465,40 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
452
465
  });
453
466
  }
454
467
 
455
- // eslint-disable-next-line sonarjs/no-identical-functions
456
468
  topViewRefresh(): void {
457
469
  Object.values(this.formGroup$.controls).forEach((control: any) => {
458
470
  control.markAsTouched();
459
471
  });
460
472
  }
473
+
474
+ registerForRefresh() {
475
+ const refreshConditions = this.pConn$.getCaseInfo()?.getActionRefreshConditions();
476
+ const pageReference = this.pConn$.getPageReference();
477
+ const context = this.pConn$.getContextName();
478
+
479
+ // refresh api de-registration
480
+ PCore.getRefreshManager().deRegisterForRefresh(context);
481
+
482
+ // refresh api registration
483
+ const refreshProps = getRefreshProps(refreshConditions);
484
+ const caseKey = this.pConn$.getCaseInfo().getKey();
485
+ const refreshOptions = {
486
+ autoDetectRefresh: true,
487
+ preserveClientChanges: false
488
+ };
489
+ if (refreshProps.length > 0) {
490
+ refreshProps.forEach(prop => {
491
+ PCore.getRefreshManager().registerForRefresh(
492
+ 'PROP_CHANGE',
493
+ this.pConn$.getActionsApi().refreshCaseView.bind(this.pConn$.getActionsApi(), caseKey, '', pageReference, {
494
+ ...refreshOptions,
495
+ refreshFor: prop[0]
496
+ }),
497
+ `${pageReference}.${prop[1]}`,
498
+ `${context}/${pageReference}`,
499
+ context
500
+ );
501
+ });
502
+ }
503
+ }
461
504
  }
@@ -18,6 +18,7 @@
18
18
  <div class="psdk-case-view-divider"></div>
19
19
 
20
20
  <component-mapper
21
+ *ngIf="arMainButtons$ && arSecondaryButtons$"
21
22
  name="ActionButtons"
22
23
  [props]="{ arMainButtons$, arSecondaryButtons$ }"
23
24
  [parent]="this"
@@ -38,6 +38,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
38
38
  CASE: any;
39
39
  PAGE: any;
40
40
  DATA: any;
41
+ lastUpdateCaseTime;
41
42
  constructor(private angularPConnect: AngularPConnectService) {
42
43
  this.constants = PCore.getConstants();
43
44
  }
@@ -58,8 +59,10 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
58
59
  // Should always check the bridge to see if the component should
59
60
  // update itself (re-render)
60
61
  const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
61
- if (theRequestedAssignment !== this.currentLoadedAssignment) {
62
+ const lastUpdateCaseTime = this.pConn$.getValue('caseInfo.lastUpdateTime');
63
+ if (theRequestedAssignment !== this.currentLoadedAssignment || (lastUpdateCaseTime && lastUpdateCaseTime !== this.lastUpdateCaseTime)) {
62
64
  this.currentLoadedAssignment = theRequestedAssignment;
65
+ this.lastUpdateCaseTime = lastUpdateCaseTime;
63
66
  this.loadActiveTab();
64
67
  }
65
68
  }
@@ -7,8 +7,6 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
7
7
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
 
10
- declare const window: any;
11
-
12
10
  interface NavBarProps {
13
11
  // If any, enter additional props that only exist on this component
14
12
  showAppName?: boolean;