@pega/angular-sdk-overrides 0.242.6 → 0.242.8

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 (59) 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/currency/currency.component.ts +19 -13
  8. package/lib/field/date-time/date-time.component.html +0 -1
  9. package/lib/field/date-time/date-time.component.ts +17 -3
  10. package/lib/field/decimal/decimal.component.html +1 -0
  11. package/lib/field/decimal/decimal.component.ts +38 -15
  12. package/lib/field/dropdown/dropdown.component.ts +18 -3
  13. package/lib/field/email/email.component.ts +17 -7
  14. package/lib/field/integer/integer.component.html +1 -1
  15. package/lib/field/integer/integer.component.ts +16 -6
  16. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  17. package/lib/field/percentage/percentage.component.html +1 -1
  18. package/lib/field/percentage/percentage.component.ts +27 -17
  19. package/lib/field/phone/phone.component.ts +6 -13
  20. package/lib/field/rich-text/rich-text.component.ts +12 -3
  21. package/lib/field/text/text.component.ts +2 -2
  22. package/lib/field/text-area/text-area.component.html +1 -1
  23. package/lib/field/text-area/text-area.component.ts +16 -6
  24. package/lib/field/text-input/text-input.component.html +1 -1
  25. package/lib/field/text-input/text-input.component.ts +16 -6
  26. package/lib/field/time/time.component.html +1 -1
  27. package/lib/field/time/time.component.ts +21 -6
  28. package/lib/field/url/url.component.html +1 -1
  29. package/lib/field/url/url.component.ts +16 -6
  30. package/lib/field/user-reference/user-reference.component.html +40 -38
  31. package/lib/field/user-reference/user-reference.component.ts +66 -7
  32. package/lib/infra/Containers/flow-container/flow-container.component.ts +2 -5
  33. package/lib/infra/Containers/flow-container/helpers.ts +1 -1
  34. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  35. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +0 -1
  36. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  37. package/lib/infra/assignment/assignment.component.ts +3 -5
  38. package/lib/infra/assignment-card/assignment-card.component.ts +4 -32
  39. package/lib/infra/defer-load/defer-load.component.ts +4 -1
  40. package/lib/infra/reference/reference.component.ts +77 -90
  41. package/lib/infra/root-container/root-container.component.ts +24 -17
  42. package/lib/template/base/form-template-base.ts +2 -2
  43. package/lib/template/default-form/default-form.component.ts +5 -7
  44. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  45. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  46. package/lib/template/field-group-template/field-group-template.component.ts +64 -41
  47. package/lib/template/field-group-template/utils.ts +9 -0
  48. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  49. package/lib/template/field-value-list/field-value-list.component.scss +4 -0
  50. package/lib/template/list-view/list-view.component.html +3 -1
  51. package/lib/template/list-view/list-view.component.ts +1 -1
  52. package/lib/template/simple-table-manual/helpers.ts +18 -2
  53. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  54. package/lib/template/simple-table-manual/simple-table-manual.component.scss +7 -3
  55. package/lib/template/simple-table-manual/simple-table-manual.component.ts +62 -23
  56. package/lib/widget/todo/todo.component.html +1 -2
  57. package/lib/widget/todo/todo.component.scss +2 -0
  58. package/lib/widget/todo/todo.component.ts +4 -3
  59. package/package.json +1 -1
@@ -159,15 +159,25 @@ export class TextAreaComponent implements OnInit, OnDestroy {
159
159
  }
160
160
  }
161
161
 
162
- fieldOnChange() {
163
- this.pConn$.clearErrorMessages({
164
- property: this.propName
165
- });
162
+ fieldOnChange(event: any) {
163
+ const oldVal = this.value$ ?? '';
164
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
165
+
166
+ if (isValueChanged) {
167
+ this.pConn$.clearErrorMessages({
168
+ property: this.propName
169
+ });
170
+ }
166
171
  }
167
172
 
168
173
  fieldOnBlur(event: any) {
169
- const value = event?.target?.value;
170
- handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
174
+ const oldVal = this.value$ ?? '';
175
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
176
+
177
+ if (isValueChanged) {
178
+ const value = event?.target?.value;
179
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
180
+ }
171
181
  }
172
182
 
173
183
  getErrorMessage() {
@@ -14,7 +14,7 @@
14
14
  [required]="bRequired$"
15
15
  [attr.data-test-id]="testId"
16
16
  [formControl]="fieldControl"
17
- (change)="fieldOnChange()"
17
+ (change)="fieldOnChange($event)"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
20
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -161,15 +161,25 @@ export class TextInputComponent implements OnInit, OnDestroy {
161
161
  }
162
162
  }
163
163
 
164
- fieldOnChange() {
165
- this.pConn$.clearErrorMessages({
166
- property: this.propName
167
- });
164
+ fieldOnChange(event: any) {
165
+ const oldVal = this.value$ ?? '';
166
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
167
+
168
+ if (isValueChanged) {
169
+ this.pConn$.clearErrorMessages({
170
+ property: this.propName
171
+ });
172
+ }
168
173
  }
169
174
 
170
175
  fieldOnBlur(event: any) {
171
- const value = event?.target?.value;
172
- handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
176
+ const oldVal = this.value$ ?? '';
177
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
178
+
179
+ if (isValueChanged) {
180
+ const value = event?.target?.value;
181
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
182
+ }
173
183
  }
174
184
 
175
185
  getErrorMessage() {
@@ -14,7 +14,7 @@
14
14
  [required]="bRequired$"
15
15
  [attr.data-test-id]="testId"
16
16
  [formControl]="fieldControl"
17
- (change)="fieldOnChange()"
17
+ (change)="fieldOnChange($event)"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
20
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -165,15 +165,30 @@ export class TimeComponent implements OnInit, OnDestroy {
165
165
  }
166
166
  }
167
167
 
168
- fieldOnChange() {
169
- this.pConn$.clearErrorMessages({
170
- property: this.propName
171
- });
168
+ fieldOnChange(event: any) {
169
+ const oldVal = this.value$ ?? '';
170
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
171
+
172
+ if (isValueChanged) {
173
+ this.pConn$.clearErrorMessages({
174
+ property: this.propName
175
+ });
176
+ }
172
177
  }
173
178
 
174
179
  fieldOnBlur(event: any) {
175
- const value = event?.target?.value;
176
- handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
180
+ const oldVal = this.value$ ?? '';
181
+ const isValueChanged = event?.target?.value.toString() !== oldVal.toString();
182
+
183
+ if (isValueChanged) {
184
+ let value = event?.target?.value;
185
+ const hhmmPattern = /^\d{2}:\d{2}$/;
186
+ if (hhmmPattern.test(value)) {
187
+ value = `${value}:00`; // append ":00"
188
+ }
189
+
190
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
191
+ }
177
192
  }
178
193
 
179
194
  getErrorMessage() {
@@ -14,7 +14,7 @@
14
14
  [required]="bRequired$"
15
15
  [attr.data-test-id]="testId"
16
16
  [formControl]="fieldControl"
17
- (change)="fieldOnChange()"
17
+ (change)="fieldOnChange($event)"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
20
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -159,15 +159,25 @@ export class UrlComponent implements OnInit, OnDestroy {
159
159
  }
160
160
  }
161
161
 
162
- fieldOnChange() {
163
- this.pConn$.clearErrorMessages({
164
- property: this.propName
165
- });
162
+ fieldOnChange(event: any) {
163
+ const oldVal = this.value$ ?? '';
164
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
165
+
166
+ if (isValueChanged) {
167
+ this.pConn$.clearErrorMessages({
168
+ property: this.propName
169
+ });
170
+ }
166
171
  }
167
172
 
168
173
  fieldOnBlur(event: any) {
169
- const value = event?.target?.value;
170
- handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
174
+ const oldVal = this.value$ ?? '';
175
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
176
+
177
+ if (isValueChanged) {
178
+ const value = event?.target?.value;
179
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
180
+ }
171
181
  }
172
182
 
173
183
  getErrorMessage() {
@@ -1,45 +1,47 @@
1
- <div class="psdk-user-reference">
1
+ <div>
2
2
  <div *ngIf="displayMode$; else noDisplayMode">
3
3
  <component-mapper name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
4
4
  </div>
5
5
  <ng-template #noDisplayMode>
6
- <div *ngIf="type === 'operator'">
7
- <component-mapper name="Operator" [props]="{ pConn$ }"></component-mapper>
8
- </div>
9
- <div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
10
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
11
- <mat-select [required]="bRequired$" [formControl]="fieldControl" [attr.data-test-id]="testId" (selectionChange)="fieldOnChange($event)">
12
- <mat-option *ngFor="let opt of options$" [value]="opt.key">
13
- {{ opt.value }}
14
- </mat-option>
15
- </mat-select>
16
- <mat-label>{{ label$ }}</mat-label>
17
- <mat-error *ngIf="fieldControl.invalid">
18
- {{ getErrorMessage() }}
19
- </mat-error>
20
- </mat-form-field>
21
- </div>
22
- <div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
23
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
24
- <mat-label>{{ label$ }}</mat-label>
25
- <input
26
- matInput
27
- [placeholder]="placeholder"
28
- [formControl]="fieldControl"
29
- [required]="bRequired$"
30
- [matAutocomplete]="auto"
31
- [attr.data-test-id]="testId"
32
- (blur)="fieldOnBlur($event)"
33
- />
34
- <mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption (optionSelected)="optionChanged($event)">
35
- <mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
36
- <span>{{ opt.value }}</span>
37
- </mat-option>
38
- </mat-autocomplete>
39
- <mat-error *ngIf="fieldControl.invalid">
40
- {{ getErrorMessage() }}
41
- </mat-error>
42
- </mat-form-field>
6
+ <div class="psdk-user-reference">
7
+ <div *ngIf="this.userID$ && type === 'operator'">
8
+ <component-mapper name="Operator" [props]="{ pConn$, name$: userName$ }"></component-mapper>
9
+ </div>
10
+ <div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
11
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
12
+ <mat-select [required]="bRequired$" [formControl]="fieldControl" [attr.data-test-id]="testId" (selectionChange)="fieldOnChange($event)">
13
+ <mat-option *ngFor="let opt of options$" [value]="opt.key">
14
+ {{ opt.value }}
15
+ </mat-option>
16
+ </mat-select>
17
+ <mat-label>{{ label$ }}</mat-label>
18
+ <mat-error *ngIf="fieldControl.invalid">
19
+ {{ getErrorMessage() }}
20
+ </mat-error>
21
+ </mat-form-field>
22
+ </div>
23
+ <div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
24
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
25
+ <mat-label>{{ label$ }}</mat-label>
26
+ <input
27
+ matInput
28
+ [placeholder]="placeholder"
29
+ [formControl]="fieldControl"
30
+ [required]="bRequired$"
31
+ [matAutocomplete]="auto"
32
+ [attr.data-test-id]="testId"
33
+ (blur)="fieldOnBlur($event)"
34
+ />
35
+ <mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption (optionSelected)="optionChanged($event)">
36
+ <mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
37
+ <span>{{ opt.value }}</span>
38
+ </mat-option>
39
+ </mat-autocomplete>
40
+ <mat-error *ngIf="fieldControl.invalid">
41
+ {{ getErrorMessage() }}
42
+ </mat-error>
43
+ </mat-form-field>
44
+ </div>
43
45
  </div>
44
46
  </ng-template>
45
47
  </div>
@@ -168,7 +168,7 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
168
168
  this.placeholder = placeholder || '';
169
169
  this.displayMode$ = displayMode;
170
170
 
171
- this.value$ = this.pConn$.getConfigProps()?.value;
171
+ this.value$ = value && typeof value === 'object' && value.userName ? value.userName : (value ?? '');
172
172
 
173
173
  const { readOnly, required } = props;
174
174
  [this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
@@ -184,12 +184,8 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
184
184
  } else {
185
185
  // if same user ref field is referred in view as editable & readonly formatted text
186
186
  // referenced users won't be available, so get user details from dx api
187
- const { getOperatorDetails } = PCore.getUserApi();
188
- getOperatorDetails(this.userID$).then((resp: any) => {
189
- if (resp.data && resp.data.pyOperatorInfo && resp.data.pyOperatorInfo.pyUserName) {
190
- this.userName$ = resp.data.pyOperatorInfo.pyUserName;
191
- }
192
- });
187
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
188
+ this.userName$ = await getUserName(this.pConn$, this.userID$);
193
189
  }
194
190
  } else if (displayAs === DROPDOWN_LIST || displayAs === SEARCH_BOX) {
195
191
  const queryPayload = {
@@ -257,3 +253,66 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
257
253
  return errMessage;
258
254
  }
259
255
  }
256
+
257
+ const buildColumnForDisplayValue = dataObj => {
258
+ if (dataObj.columns) {
259
+ dataObj.columns = dataObj.columns.map(column => {
260
+ const tempColObj = { ...column };
261
+ if (tempColObj.key === 'true') {
262
+ tempColObj.useForSearch = true;
263
+ } else {
264
+ tempColObj.useForSearch = false;
265
+ }
266
+ return tempColObj;
267
+ });
268
+ }
269
+ };
270
+
271
+ function getUserName(pConn, userId = ''): Promise<string> {
272
+ return new Promise(resolve => {
273
+ const { parameters = {}, referenceList } = pConn.getConfigProps();
274
+ const contextName = pConn.getContextName();
275
+
276
+ // eslint-disable-next-line @typescript-eslint/no-shadow
277
+ const OPERATORS_DP = referenceList || PCore.getEnvironmentInfo().getDefaultOperatorDP() || '';
278
+
279
+ const columns = [
280
+ {
281
+ value: 'pyUserName',
282
+ display: 'true',
283
+ useForSearch: true,
284
+ primary: 'true'
285
+ },
286
+ {
287
+ value: 'pyUserIdentifier',
288
+ setProperty: 'Associated property',
289
+ key: 'true',
290
+ display: 'true',
291
+ secondary: 'true',
292
+ useForSearch: true
293
+ }
294
+ ];
295
+
296
+ const dataConfig: any = {
297
+ dataSource: OPERATORS_DP,
298
+ parameters,
299
+ matchPosition: 'equals',
300
+ listType: 'datapage',
301
+ columns,
302
+ cacheLifeSpan: 'form',
303
+ deferDatasource: false,
304
+ maxResultsDisplay: '1',
305
+ ignoreCase: true
306
+ };
307
+
308
+ PCore.getDataApi()
309
+ .init(dataConfig, contextName)
310
+ .then(dataApiObj => {
311
+ buildColumnForDisplayValue(dataApiObj);
312
+ dataApiObj.registerForBufferedCall({ waitTime: 50 });
313
+ dataApiObj.fetchData(userId).then((response: any) => {
314
+ resolve(response.data?.[0]?.pyUserName || userId);
315
+ });
316
+ });
317
+ });
318
+ }
@@ -127,7 +127,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
127
127
  () => {
128
128
  this.banners = [];
129
129
  },
130
- 'CLEAR_BANNER_MESSAGES'
130
+ 'clearBannerMessages'
131
131
  );
132
132
  }
133
133
 
@@ -140,7 +140,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
140
140
 
141
141
  PCore.getPubSubUtils().unsubscribe('cancelPressed', 'cancelPressed');
142
142
 
143
- PCore.getPubSubUtils().unsubscribe('clearBannerMessages', 'CLEAR_BANNER_MESSAGES');
143
+ PCore.getPubSubUtils().unsubscribe('clearBannerMessages', 'clearBannerMessages');
144
144
  }
145
145
 
146
146
  handleCancel() {
@@ -448,9 +448,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
448
448
  this.caseMessages$ = this.localizedVal('Thank you! The next step in this case has been routed appropriately.', this.localeCategory);
449
449
  }
450
450
 
451
- // publish this "assignmentFinished" for mashup, need to get approved as a standard
452
- PCore.getPubSubUtils().publish('assignmentFinished');
453
-
454
451
  this.psService.sendMessage(false);
455
452
  } else {
456
453
  this.bHasCaseMessages$ = false;
@@ -33,7 +33,7 @@ export function hasAssignments(pConnect) {
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"
@@ -38,7 +38,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
38
38
  context$: string;
39
39
  title$ = '';
40
40
  bShowModal$ = false;
41
- bShowAsModal$ = true;
42
41
  itemKey$: string;
43
42
  formGroup$: FormGroup;
44
43
  oCaseInfo: Object = {};
@@ -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) }}
@@ -6,9 +6,9 @@ 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
- import { BannerService } from 'packages/angular-sdk-components/src/public-api';
12
12
 
13
13
  function getRefreshProps(refreshConditions) {
14
14
  // refreshConditions cuurently supports only "Changes" event
@@ -326,7 +326,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
326
326
  switch (sAction) {
327
327
  case 'navigateToStep':
328
328
  this.erService.sendMessage('publish', '');
329
- // if (this.formValid()) {
329
+
330
330
  this.bReInit = true;
331
331
  this.psService.sendMessage(true);
332
332
 
@@ -340,7 +340,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
340
340
  this.psService.sendMessage(false);
341
341
  this.snackBarRef = this.snackBar.open(`${this.localizedVal('Navigation failed!', this.localeCategory)}`, 'Ok');
342
342
  });
343
- // }
343
+
344
344
  break;
345
345
 
346
346
  case 'saveAssignment': {
@@ -434,7 +434,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
434
434
  this.psService.sendMessage(false);
435
435
  this.snackBarRef = this.snackBar.open(`${this.localizedVal('Submit failed!', this.localeCategory)}`, 'Ok');
436
436
  });
437
-
438
437
  break;
439
438
 
440
439
  case 'approveCase': {
@@ -473,7 +472,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
473
472
  }
474
473
 
475
474
  registerForRefresh() {
476
- // @ts-ignore - Property 'getActionRefreshConditions' is private and only accessible within class 'CaseInfo'
477
475
  const refreshConditions = this.pConn$.getCaseInfo()?.getActionRefreshConditions();
478
476
  const pageReference = this.pConn$.getPageReference();
479
477
  const context = this.pConn$.getContextName();
@@ -1,10 +1,8 @@
1
- import { Component, OnInit, Input, Output, EventEmitter, forwardRef, OnChanges, OnDestroy } from '@angular/core';
1
+ import { Component, OnInit, Input, Output, EventEmitter, forwardRef, OnChanges } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup, ReactiveFormsModule } from '@angular/forms';
4
4
  import { ReferenceComponent } from '@pega/angular-sdk-components';
5
5
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
- import { IdleDetectionService } from '@pega/angular-sdk-components';
7
- import { ServerConfigService } from '@pega/angular-sdk-components';
8
6
 
9
7
  @Component({
10
8
  selector: 'app-assignment-card',
@@ -13,7 +11,7 @@ import { ServerConfigService } from '@pega/angular-sdk-components';
13
11
  standalone: true,
14
12
  imports: [CommonModule, ReactiveFormsModule, forwardRef(() => ComponentMapperComponent)]
15
13
  })
16
- export class AssignmentCardComponent implements OnInit, OnChanges, OnDestroy {
14
+ export class AssignmentCardComponent implements OnInit, OnChanges {
17
15
  @Input() pConn$: typeof PConnect;
18
16
  @Input() formGroup$: FormGroup;
19
17
  @Input() arMainButtons$: any[];
@@ -23,16 +21,10 @@ export class AssignmentCardComponent implements OnInit, OnChanges, OnDestroy {
23
21
 
24
22
  @Output() actionButtonClick: EventEmitter<any> = new EventEmitter();
25
23
 
26
- constructor(
27
- private idleService: IdleDetectionService,
28
- private scservice: ServerConfigService
29
- ) {}
30
-
31
24
  ngOnInit(): void {
32
- // Children may contain 'reference' component, so we need to normalize them
25
+ // Children may contain 'reference' component, so we need to
26
+ // normalize them
33
27
  this.arChildren$ = ReferenceComponent.normalizePConnArray(this.arChildren$);
34
-
35
- this.checkAndEnableAutoSave();
36
28
  }
37
29
 
38
30
  ngOnChanges() {
@@ -41,27 +33,7 @@ export class AssignmentCardComponent implements OnInit, OnChanges, OnDestroy {
41
33
  this.arChildren$ = ReferenceComponent.normalizePConnArray(this.arChildren$);
42
34
  }
43
35
 
44
- ngOnDestroy() {
45
- this.idleService.stopWatching();
46
- }
47
-
48
- async checkAndEnableAutoSave() {
49
- const sdkConfig = await this.scservice.getSdkConfig();
50
- const autoSave = sdkConfig.serverConfig.autoSave;
51
-
52
- if (autoSave) {
53
- this.idleService.startWatching(() => this.autoSave(), autoSave);
54
- }
55
- }
56
-
57
36
  onActionButtonClick(oData: any) {
58
37
  this.actionButtonClick.emit(oData);
59
38
  }
60
-
61
- autoSave() {
62
- const context = this.pConn$.getContextName();
63
- if (PCore.getFormUtils().isStateModified(context)) {
64
- this.pConn$.getActionsApi().saveAssignment(context);
65
- }
66
- }
67
39
  }
@@ -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
  }