@pega/angular-sdk-overrides 0.26.1 → 0.26.2

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 (74) hide show
  1. package/lib/designSystemExtension/alert/alert.component.html +4 -1
  2. package/lib/designSystemExtension/alert/alert.component.scss +9 -10
  3. package/lib/designSystemExtension/alert/alert.component.ts +6 -2
  4. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +30 -21
  5. package/lib/designSystemExtension/operator/operator.component.ts +2 -1
  6. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.html +104 -10
  7. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +141 -1
  8. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +224 -72
  9. package/lib/field/auto-complete/auto-complete.component.html +2 -1
  10. package/lib/field/auto-complete/auto-complete.component.ts +8 -6
  11. package/lib/field/check-box/check-box.component.html +3 -1
  12. package/lib/field/check-box/check-box.component.ts +10 -1
  13. package/lib/field/currency/currency.component.html +2 -1
  14. package/lib/field/currency/currency.component.ts +10 -1
  15. package/lib/field/date/date.component.html +2 -1
  16. package/lib/field/date/date.component.ts +2 -0
  17. package/lib/field/date-time/date-time.component.html +2 -1
  18. package/lib/field/date-time/date-time.component.scss +46 -40
  19. package/lib/field/date-time/date-time.component.ts +2 -0
  20. package/lib/field/decimal/decimal.component.html +2 -1
  21. package/lib/field/decimal/decimal.component.ts +2 -0
  22. package/lib/field/dropdown/dropdown.component.html +2 -1
  23. package/lib/field/dropdown/dropdown.component.ts +10 -1
  24. package/lib/field/email/email.component.html +2 -1
  25. package/lib/field/email/email.component.ts +2 -2
  26. package/lib/field/field.base.ts +27 -1
  27. package/lib/field/integer/integer.component.html +2 -1
  28. package/lib/field/integer/integer.component.ts +4 -2
  29. package/lib/field/location/location.component.html +2 -1
  30. package/lib/field/location/location.component.ts +3 -1
  31. package/lib/field/object-reference/object-reference.component.html +1 -1
  32. package/lib/field/object-reference/object-reference.component.ts +3 -0
  33. package/lib/field/percentage/percentage.component.html +2 -1
  34. package/lib/field/percentage/percentage.component.ts +10 -1
  35. package/lib/field/phone/phone.component.html +2 -1
  36. package/lib/field/phone/phone.component.ts +2 -1
  37. package/lib/field/radio-buttons/radio-buttons.component.html +2 -1
  38. package/lib/field/radio-buttons/radio-buttons.component.ts +10 -1
  39. package/lib/field/rich-text/rich-text.component.scss +1 -166
  40. package/lib/field/rich-text/rich-text.component.ts +1 -1
  41. package/lib/field/semantic-link/semantic-link.component.ts +9 -5
  42. package/lib/field/text-area/text-area.component.html +2 -1
  43. package/lib/field/text-area/text-area.component.ts +2 -1
  44. package/lib/field/text-input/text-input.component.html +2 -1
  45. package/lib/field/text-input/text-input.component.ts +2 -1
  46. package/lib/field/time/time.component.html +2 -1
  47. package/lib/field/time/time.component.ts +2 -1
  48. package/lib/field/url/url.component.html +2 -1
  49. package/lib/field/url/url.component.ts +2 -1
  50. package/lib/field/user-reference/user-reference.component.html +4 -2
  51. package/lib/field/user-reference/user-reference.component.ts +10 -5
  52. package/lib/infra/Containers/flow-container/flow-container.component.ts +33 -40
  53. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +46 -50
  54. package/lib/infra/Containers/view-container/view-container.component.ts +32 -31
  55. package/lib/infra/navbar/navbar.component.ts +33 -35
  56. package/lib/infra/root-container/root-container.component.ts +33 -38
  57. package/lib/template/app-shell/app-shell.component.ts +12 -11
  58. package/lib/template/base/details-template-base.ts +2 -1
  59. package/lib/template/default-form/default-form.component.html +19 -3
  60. package/lib/template/default-form/default-form.component.ts +13 -3
  61. package/lib/template/simple-table-manual/helpers.ts +3 -3
  62. package/lib/template/simple-table-manual/simple-table-manual.component.html +29 -11
  63. package/lib/template/simple-table-manual/simple-table-manual.component.ts +69 -11
  64. package/lib/template/single-reference-readonly/single-reference-readonly.component.html +1 -1
  65. package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +4 -0
  66. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +4 -4
  67. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +18 -20
  68. package/lib/widget/attachment/AttachmentUtils.ts +18 -10
  69. package/lib/widget/attachment/attachment.component.html +16 -6
  70. package/lib/widget/attachment/attachment.component.ts +12 -2
  71. package/lib/widget/case-history/case-history.component.ts +6 -2
  72. package/lib/widget/file-utility/file-utility.component.ts +25 -29
  73. package/lib/widget/todo/todo.component.ts +7 -2
  74. package/package.json +1 -1
@@ -5,6 +5,7 @@ import { MatInputModule } from '@angular/material/input';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
 
7
7
  import { FieldBase } from '@pega/angular-sdk-components';
8
+ import { FieldWarningDirective } from '@pega/angular-sdk-components';
8
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
10
  import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
@@ -18,7 +19,7 @@ interface TextAreaProps extends PConnFieldProps {
18
19
  selector: 'app-text-area',
19
20
  templateUrl: './text-area.component.html',
20
21
  styleUrls: ['./text-area.component.scss'],
21
- imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
22
+ imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, FieldWarningDirective, forwardRef(() => ComponentMapperComponent)]
22
23
  })
23
24
  export class TextAreaComponent extends FieldBase {
24
25
  configProps$: TextAreaProps;
@@ -4,7 +4,7 @@
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
6
6
  <div [formGroup]="formGroup$" *ngIf="bVisible$">
7
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
7
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
8
8
  <mat-label>{{ label$ }}</mat-label>
9
9
  <input
10
10
  matInput
@@ -17,6 +17,7 @@
17
17
  (change)="fieldOnChange($event)"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
+ <mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
20
21
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
21
22
  </mat-form-field>
22
23
  </div>
@@ -5,6 +5,7 @@ import { MatInputModule } from '@angular/material/input';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
 
7
7
  import { FieldBase } from '@pega/angular-sdk-components';
8
+ import { FieldWarningDirective } from '@pega/angular-sdk-components';
8
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
10
  import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
@@ -18,7 +19,7 @@ interface TextInputProps extends PConnFieldProps {
18
19
  selector: 'app-text-input',
19
20
  templateUrl: './text-input.component.html',
20
21
  styleUrls: ['./text-input.component.scss'],
21
- imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
22
+ imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, FieldWarningDirective, forwardRef(() => ComponentMapperComponent)]
22
23
  })
23
24
  export class TextInputComponent extends FieldBase {
24
25
  configProps$: TextInputProps;
@@ -4,7 +4,7 @@
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
6
6
  <div [formGroup]="formGroup$" *ngIf="bVisible$">
7
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
7
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
8
8
  <mat-label>{{ label$ }}</mat-label>
9
9
  <input
10
10
  matInput
@@ -17,6 +17,7 @@
17
17
  (change)="fieldOnChange($event)"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
+ <mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
20
21
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
21
22
  </mat-form-field>
22
23
  </div>
@@ -5,6 +5,7 @@ import { MatInputModule } from '@angular/material/input';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
 
7
7
  import { FieldBase } from '@pega/angular-sdk-components';
8
+ import { FieldWarningDirective } from '@pega/angular-sdk-components';
8
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
10
  import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { format } from '@pega/angular-sdk-components';
@@ -18,7 +19,7 @@ interface TimeProps extends PConnFieldProps {
18
19
  selector: 'app-time',
19
20
  templateUrl: './time.component.html',
20
21
  styleUrls: ['./time.component.scss'],
21
- imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
22
+ imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, FieldWarningDirective, forwardRef(() => ComponentMapperComponent)]
22
23
  })
23
24
  export class TimeComponent extends FieldBase {
24
25
  configProps$: TimeProps;
@@ -4,7 +4,7 @@
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
6
6
  <div [formGroup]="formGroup$" *ngIf="bVisible$">
7
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
7
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
8
8
  <mat-label>{{ label$ }}</mat-label>
9
9
  <input
10
10
  matInput
@@ -17,6 +17,7 @@
17
17
  (change)="fieldOnChange($event)"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
+ <mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
20
21
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
21
22
  </mat-form-field>
22
23
  </div>
@@ -5,6 +5,7 @@ import { MatInputModule } from '@angular/material/input';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
 
7
7
  import { FieldBase } from '@pega/angular-sdk-components';
8
+ import { FieldWarningDirective } from '@pega/angular-sdk-components';
8
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
10
  import { handleEvent } from '@pega/angular-sdk-components';
10
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
@@ -17,7 +18,7 @@ interface URLProps extends PConnFieldProps {
17
18
  selector: 'app-url',
18
19
  templateUrl: './url.component.html',
19
20
  styleUrls: ['./url.component.scss'],
20
- imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
21
+ imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, FieldWarningDirective, forwardRef(() => ComponentMapperComponent)]
21
22
  })
22
23
  export class UrlComponent extends FieldBase {
23
24
  configProps$: URLProps;
@@ -8,7 +8,7 @@
8
8
  <component-mapper name="Operator" [props]="{ pConn$, name$: userName$ }"></component-mapper>
9
9
  </div>
10
10
  <div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
11
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
11
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
12
12
  <mat-select [required]="bRequired$" [formControl]="fieldControl" [attr.data-test-id]="testId" (selectionChange)="fieldOnChange($event)">
13
13
  <mat-option *ngFor="let opt of options$" [value]="opt.key">
14
14
  {{ opt.value }}
@@ -18,10 +18,11 @@
18
18
  <mat-error *ngIf="fieldControl.invalid">
19
19
  {{ getErrorMessage() }}
20
20
  </mat-error>
21
+ <mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
21
22
  </mat-form-field>
22
23
  </div>
23
24
  <div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
24
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
25
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
25
26
  <mat-label>{{ label$ }}</mat-label>
26
27
  <input
27
28
  matInput
@@ -40,6 +41,7 @@
40
41
  <mat-error *ngIf="fieldControl.invalid">
41
42
  {{ getErrorMessage() }}
42
43
  </mat-error>
44
+ <mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
43
45
  </mat-form-field>
44
46
  </div>
45
47
  </div>
@@ -9,6 +9,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
9
9
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
10
10
  import { Utils } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
+ import { FieldWarningDirective } from '@pega/angular-sdk-components';
12
13
  import { PConnFieldProps } from '@pega/angular-sdk-components';
13
14
  import { map, Observable, startWith } from 'rxjs';
14
15
  import { handleEvent } from '@pega/angular-sdk-components';
@@ -38,6 +39,7 @@ interface UserReferenceProps extends Omit<PConnFieldProps, 'value'> {
38
39
  MatOptionModule,
39
40
  MatInputModule,
40
41
  MatAutocompleteModule,
42
+ FieldWarningDirective,
41
43
  forwardRef(() => ComponentMapperComponent)
42
44
  ]
43
45
  })
@@ -54,6 +56,7 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
54
56
  options$: any;
55
57
  bReadonly$: boolean;
56
58
  bRequired$: boolean;
59
+ bFieldMessageVisible$ = false;
57
60
  showAsFormattedText$?: boolean;
58
61
  displayAs$?: string;
59
62
  testId: string;
@@ -158,12 +161,17 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
158
161
  this.testId = props.testId;
159
162
  this.onRecordChange = props?.onRecordChange;
160
163
 
161
- const { label, displayAs, value, showAsFormattedText, helperText, placeholder, displayMode } = props;
164
+ const { label, displayAs, value, showAsFormattedText, helperText, placeholder, displayMode, messageConfig = {}, showFieldMessage } = props;
165
+ const { readOnly, required } = props;
166
+ [this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
167
+
168
+ const isMessageVisible = this.utils.getBooleanValue(messageConfig.visibility);
169
+ this.bFieldMessageVisible$ = this.utils.getBooleanValue(showFieldMessage) && isMessageVisible && !this.bReadonly$;
162
170
 
163
171
  this.label$ = label;
164
172
  this.showAsFormattedText$ = showAsFormattedText;
165
173
  this.displayAs$ = displayAs;
166
- this.helperText = helperText;
174
+ this.helperText = this.bFieldMessageVisible$ ? (messageConfig.content ?? '') : helperText;
167
175
  this.placeholder = placeholder || '';
168
176
  this.displayMode$ = displayMode;
169
177
 
@@ -173,9 +181,6 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
173
181
  this.value$ = value || '';
174
182
  }
175
183
 
176
- const { readOnly, required } = props;
177
- [this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
178
-
179
184
  this.actionsApi = this.pConn$.getActionsApi();
180
185
  this.propName = this.pConn$.getStateProps().value;
181
186
 
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy, Injector } from '@angular/core';
1
+ import { Component, OnInit, Input, ChangeDetectorRef, forwardRef, OnDestroy, Injector } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormBuilder, FormGroup } from '@angular/forms';
4
4
  import { MatCardModule } from '@angular/material/card';
@@ -75,7 +75,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
75
75
  private cdRef: ChangeDetectorRef,
76
76
  private psService: ProgressSpinnerService,
77
77
  private fb: FormBuilder,
78
- private ngZone: NgZone,
79
78
  private utils: Utils
80
79
  ) {
81
80
  super(injector);
@@ -123,6 +122,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
123
122
  'clearBannerMessages',
124
123
  () => {
125
124
  this.banners = [];
125
+ this.cdRef.markForCheck();
126
126
  },
127
127
  'clearBannerMessages'
128
128
  );
@@ -188,10 +188,9 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
188
188
  }
189
189
 
190
190
  showPageMessages(completeProps: FlowContainerProps) {
191
- this.ngZone.run(() => {
192
- const pageMessages = completeProps.pageMessages;
193
- this.banners = [{ messages: pageMessages?.map(msg => this.localizedVal(msg.message, 'Messages')), variant: 'urgent' }];
194
- });
191
+ const pageMessages = completeProps.pageMessages;
192
+ this.banners = [{ messages: pageMessages?.map(msg => this.localizedVal(msg.message, 'Messages')), variant: 'urgent' }];
193
+ this.cdRef.markForCheck();
195
194
  }
196
195
 
197
196
  getTodoVisibilty() {
@@ -384,8 +383,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
384
383
  const { CASE_INFO: CASE_CONSTS } = PCore.getConstants();
385
384
 
386
385
  setTimeout(() => {
387
- this.ngZone.run(() => {
388
- /*
386
+ /*
389
387
  *** renove this commmented out code when React/WC is updated
390
388
  *** this code is replace with the call to "getToDoAssigments" function below
391
389
 
@@ -403,32 +401,32 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
403
401
  const caseActions = localPConn.getValue(CASE_CONSTS.CASE_INFO_ACTIONS);
404
402
  */
405
403
 
406
- const todoAssignments = getToDoAssignments(this.pConn$);
404
+ const todoAssignments = getToDoAssignments(this.pConn$);
407
405
 
408
- if (todoAssignments && todoAssignments.length > 0) {
409
- this.todo_caseInfoID$ = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ID);
410
- this.todo_datasource$ = { source: todoAssignments };
411
- }
406
+ if (todoAssignments && todoAssignments.length > 0) {
407
+ this.todo_caseInfoID$ = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ID);
408
+ this.todo_datasource$ = { source: todoAssignments };
409
+ }
412
410
 
413
- /* remove this commented out code when update React/WC */
414
- // let kid = this.pConn$.getChildren()[0];
411
+ /* remove this commented out code when update React/WC */
412
+ // let kid = this.pConn$.getChildren()[0];
415
413
 
416
- // kid.getPConnect() can be a Reference component. So normalize it just in case
417
- // let todoKid = kid.getPConnect().getChildren()[0];
414
+ // kid.getPConnect() can be a Reference component. So normalize it just in case
415
+ // let todoKid = kid.getPConnect().getChildren()[0];
418
416
 
419
- // this.todo_pConn$ = todoKid.getPConnect();
417
+ // this.todo_pConn$ = todoKid.getPConnect();
420
418
 
421
- /* code change here to note for React/WC */
422
- // todo now needs pConn to open the work item on click "go"
423
- this.todo_pConn$ = this.pConn$;
419
+ /* code change here to note for React/WC */
420
+ // todo now needs pConn to open the work item on click "go"
421
+ this.todo_pConn$ = this.pConn$;
424
422
 
425
- // still needs the context of the original work item
426
- this.todo_context$ = localPConn.getContextName();
423
+ // still needs the context of the original work item
424
+ this.todo_context$ = localPConn.getContextName();
427
425
 
428
- this.todo_showTodo$ = true;
426
+ this.todo_showTodo$ = true;
429
427
 
430
- this.psService.sendMessage(false);
431
- });
428
+ this.psService.sendMessage(false);
429
+ this.cdRef.markForCheck();
432
430
  });
433
431
  }
434
432
 
@@ -533,24 +531,19 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
533
531
  const normalizedConfigObjectAsPConnect = normalizedConfigObject.getComponent();
534
532
 
535
533
  // makes sure Angular tracks these changes
536
- this.ngZone.run(() => {
537
- this.buildName$ = this.getBuildName();
538
- // what comes back now in configObject is the children of the flowContainer
534
+ this.buildName$ = this.getBuildName();
535
+ // what comes back now in configObject is the children of the flowContainer
539
536
 
540
- this.arChildren$ = [];
541
- this.arChildren$.push(normalizedConfigObjectAsPConnect);
537
+ this.arChildren$ = [];
538
+ this.arChildren$.push(normalizedConfigObjectAsPConnect);
542
539
 
543
- this.psService.sendMessage(false);
540
+ this.psService.sendMessage(false);
544
541
 
545
- const oWorkItem = configObject.getPConnect();
546
- const oWorkData: any = oWorkItem.getDataObject();
542
+ const oWorkItem = configObject.getPConnect();
543
+ const oWorkData: any = oWorkItem.getDataObject();
547
544
 
548
- this.containerName$ = this.localizedVal(
549
- this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0]?.name,
550
- undefined,
551
- this.localeReference
552
- );
553
- });
545
+ this.containerName$ = this.localizedVal(this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0]?.name, undefined, this.localeReference);
546
+ this.cdRef.markForCheck();
554
547
  }
555
548
 
556
549
  getBuildName(): string {
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, Output, EventEmitter, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, Component, OnInit, Input, Output, EventEmitter, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormBuilder, FormGroup } from '@angular/forms';
4
4
  import isEqual from 'fast-deep-equal';
@@ -59,7 +59,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
59
59
 
60
60
  constructor(
61
61
  private angularPConnect: AngularPConnectService,
62
- private ngZone: NgZone,
62
+ private cdRef: ChangeDetectorRef,
63
63
  private psService: ProgressSpinnerService,
64
64
  private fb: FormBuilder
65
65
  ) {
@@ -214,46 +214,45 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
214
214
  if (newComp && caseInfo && this.compareCaseInfoIsDifferent(caseInfo)) {
215
215
  this.psService.sendMessage(false);
216
216
 
217
- this.ngZone.run(() => {
218
- this.createdViewPConn$ = newComp;
219
- const newConfigProps = newComp.getConfigProps();
220
- this.templateName$ = 'template' in newConfigProps ? (newConfigProps.template as string) : '';
221
-
222
- const { actionName } = latestItem;
223
- const theNewCaseInfo = newComp.getCaseInfo();
224
- // const caseName = theNewCaseInfo.getName();
225
- const ID = theNewCaseInfo.getBusinessID() || theNewCaseInfo.getID();
226
-
227
- const caseTypeName = theNewCaseInfo.getCaseTypeName();
228
- const isDataObject = routingInfo.items[latestItem.context].resourceType === PCore.getConstants().RESOURCE_TYPES.DATA;
229
- const dataObjectAction = routingInfo.items[latestItem.context].resourceStatus;
230
- this.isMultiRecord = routingInfo.items[latestItem.context].isMultiRecordData;
231
- this.context$ = latestItem.context;
232
- this.title$ =
233
- isDataObject || this.isMultiRecord
234
- ? this.getModalHeading(dataObjectAction)
235
- : this.determineModalHeaderByAction(actionName, caseTypeName, ID, this.createdViewPConn$?.getCaseLocaleReference());
236
-
237
- const bIsRefComponent = this.checkIfRefComponent(newComp);
238
-
239
- if (bIsRefComponent) {
240
- this.arChildren$ = [newComp.getComponent()];
241
- } else {
242
- // update children with new view's children
243
- this.arChildren$ = newComp.getChildren();
244
- }
217
+ this.createdViewPConn$ = newComp;
218
+ const newConfigProps = newComp.getConfigProps();
219
+ this.templateName$ = 'template' in newConfigProps ? (newConfigProps.template as string) : '';
220
+
221
+ const { actionName } = latestItem;
222
+ const theNewCaseInfo = newComp.getCaseInfo();
223
+ // const caseName = theNewCaseInfo.getName();
224
+ const ID = theNewCaseInfo.getBusinessID() || theNewCaseInfo.getID();
225
+
226
+ const caseTypeName = theNewCaseInfo.getCaseTypeName();
227
+ const isDataObject = routingInfo.items[latestItem.context].resourceType === PCore.getConstants().RESOURCE_TYPES.DATA;
228
+ const dataObjectAction = routingInfo.items[latestItem.context].resourceStatus;
229
+ this.isMultiRecord = routingInfo.items[latestItem.context].isMultiRecordData;
230
+ this.context$ = latestItem.context;
231
+ this.title$ =
232
+ isDataObject || this.isMultiRecord
233
+ ? this.getModalHeading(dataObjectAction)
234
+ : this.determineModalHeaderByAction(actionName, caseTypeName, ID, this.createdViewPConn$?.getCaseLocaleReference());
235
+
236
+ const bIsRefComponent = this.checkIfRefComponent(newComp);
237
+
238
+ if (bIsRefComponent) {
239
+ this.arChildren$ = [newComp.getComponent()];
240
+ } else {
241
+ // update children with new view's children
242
+ this.arChildren$ = newComp.getChildren();
243
+ }
245
244
 
246
- this.bShowModal$ = true;
245
+ this.bShowModal$ = true;
247
246
 
248
- // for when non modal
249
- this.modalVisibleChange.emit(this.bShowModal$);
247
+ // for when non modal
248
+ this.modalVisibleChange.emit(this.bShowModal$);
250
249
 
251
- // save off itemKey to be used for finishAssignment, etc.
252
- this.itemKey$ = key;
250
+ // save off itemKey to be used for finishAssignment, etc.
251
+ this.itemKey$ = key;
253
252
 
254
- // cause a change for assignment
255
- this.updateToken$ = new Date().getTime();
256
- });
253
+ // cause a change for assignment
254
+ this.updateToken$ = new Date().getTime();
255
+ this.cdRef.markForCheck();
257
256
  }
258
257
  }
259
258
 
@@ -263,14 +262,13 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
263
262
  // should put here
264
263
  }
265
264
 
266
- this.ngZone.run(() => {
267
- this.bShowModal$ = false;
265
+ this.bShowModal$ = false;
268
266
 
269
- // for when non modal
270
- this.modalVisibleChange.emit(this.bShowModal$);
267
+ // for when non modal
268
+ this.modalVisibleChange.emit(this.bShowModal$);
271
269
 
272
- this.oCaseInfo = {};
273
- });
270
+ this.oCaseInfo = {};
271
+ this.cdRef.markForCheck();
274
272
  }
275
273
 
276
274
  getConfigObject(item, pConnect, isReverseCoexistence = false) {
@@ -331,10 +329,9 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
331
329
  */
332
330
  if (latestItem && isModalAction && !this.actionsDialog) {
333
331
  const configObject = this.getConfigObject(latestItem, this.pConn$);
334
- this.ngZone.run(() => {
335
- this.cancelPConn$ = configObject?.getPConnect();
336
- this.bShowCancelAlert$ = true;
337
- });
332
+ this.cancelPConn$ = configObject?.getPConnect();
333
+ this.bShowCancelAlert$ = true;
334
+ this.cdRef.markForCheck();
338
335
  }
339
336
  }
340
337
 
@@ -398,13 +395,12 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
398
395
 
399
396
  closeActionsDialog = () => {
400
397
  this.actionsDialog = true;
401
- // this.ngZone.run(() => {
402
398
  this.bShowModal$ = false;
403
399
 
404
400
  // for when non modal
405
401
  this.modalVisibleChange.emit(this.bShowModal$);
406
402
 
407
403
  this.oCaseInfo = {};
408
- // });
404
+ this.cdRef.markForCheck();
409
405
  };
410
406
  }
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
@@ -56,7 +56,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
56
56
  constructor(
57
57
  private angularPConnect: AngularPConnectService,
58
58
  private psService: ProgressSpinnerService,
59
- private ngZone: NgZone
59
+ private cdRef: ChangeDetectorRef
60
60
  ) {}
61
61
 
62
62
  ngOnInit() {
@@ -174,13 +174,15 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
174
174
  const latestItem = items[key];
175
175
  const rootView = latestItem.view;
176
176
  const { context, name: viewName } = rootView.config;
177
+ const target = key.substring(0, key.lastIndexOf('_'));
177
178
  const config: any = { meta: rootView };
178
179
  config.options = {
179
180
  context: latestItem.context,
180
181
  pageReference: context || this.pConn$.getPageReference(),
181
182
  containerName: this.pConn$.getContainerName(),
182
183
  containerItemName: key,
183
- hasForm: viewName === CREATE_DETAILS_VIEW_NAME
184
+ hasForm: viewName === CREATE_DETAILS_VIEW_NAME,
185
+ target
184
186
  };
185
187
  const configObject = PCore.createPConnect(config);
186
188
 
@@ -201,23 +203,22 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
201
203
  // ViewContainer HTML template to guide what's rendered similar to what
202
204
  // the Nebula/Constellation return of React.Fragment does
203
205
 
204
- this.ngZone.run(() => {
205
- if (newComp.getComponentName() === 'reference') {
206
- // if a refernece, it will de reference to a "view"
207
- // so hand this off to the "View" component to do that
208
- this.isViewContainer$ = false;
209
- this.viewPConn$ = newComp;
206
+ if (newComp.getComponentName() === 'reference') {
207
+ // if a refernece, it will de reference to a "view"
208
+ // so hand this off to the "View" component to do that
209
+ this.isViewContainer$ = false;
210
+ this.viewPConn$ = newComp;
210
211
 
211
- /*
212
- *** this commmented out code should be removed, once we test out that
213
- *** handing off refernce to View component always works
214
- */
212
+ /*
213
+ *** this commmented out code should be removed, once we test out that
214
+ *** handing off refernce to View component always works
215
+ */
215
216
 
216
- // When newComp is a reference, we want to de-reference
217
- // it (to get the View) and then use that View to get the
218
- // template, title, children, etc.
217
+ // When newComp is a reference, we want to de-reference
218
+ // it (to get the View) and then use that View to get the
219
+ // template, title, children, etc.
219
220
 
220
- /*
221
+ /*
221
222
 
222
223
  const theDereferencedView = newComp;
223
224
  const newConfigProps = theDereferencedView.getConfigProps();
@@ -230,20 +231,20 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
230
231
  this.arChildren$ = theDereferencedViewChildren;
231
232
  this.createdViewPConn$ = theDereferencedView;
232
233
  */
233
- } else {
234
- // old style when newComp is NOT a 'reference'
235
- this.isViewContainer$ = true;
236
-
237
- console.error(`ViewContainer has a newComp that is NOT a reference!`);
238
-
239
- this.createdViewPConn$ = newComp;
240
- const newConfigProps = newComp.getConfigProps();
241
- this.templateName$ = newConfigProps.template || '';
242
- this.title$ = newConfigProps.title || '';
243
- // update children with new view's children
244
- this.arChildren$ = newComp.getChildren();
245
- }
246
- });
234
+ } else {
235
+ // old style when newComp is NOT a 'reference'
236
+ this.isViewContainer$ = true;
237
+
238
+ console.error(`ViewContainer has a newComp that is NOT a reference!`);
239
+
240
+ this.createdViewPConn$ = newComp;
241
+ const newConfigProps = newComp.getConfigProps();
242
+ this.templateName$ = newConfigProps.template || '';
243
+ this.title$ = newConfigProps.title || '';
244
+ // update children with new view's children
245
+ this.arChildren$ = newComp.getChildren();
246
+ }
247
+ this.cdRef.markForCheck();
247
248
  }
248
249
  }
249
250
  }