@pega/angular-sdk-overrides 0.242.1 → 0.242.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 (26) hide show
  1. package/lib/field/group/group.component.ts +2 -2
  2. package/lib/field/scalar-list/scalar-list.component.ts +2 -2
  3. package/lib/infra/Containers/flow-container/flow-container.component.ts +5 -2
  4. package/lib/infra/Containers/view-container/view-container.component.ts +14 -9
  5. package/lib/infra/defer-load/defer-load.component.ts +1 -1
  6. package/lib/infra/root-container/root-container.component.ts +3 -0
  7. package/lib/infra/view/view.component.html +6 -19
  8. package/lib/template/data-reference/data-reference.component.ts +1 -1
  9. package/lib/template/default-form/default-form.component.ts +6 -3
  10. package/lib/template/details/details.component.ts +1 -1
  11. package/lib/template/details-one-column/details-one-column.component.ts +1 -1
  12. package/lib/template/details-three-column/details-three-column.component.ts +1 -1
  13. package/lib/template/details-two-column/details-two-column.component.ts +1 -1
  14. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +1 -1
  15. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +1 -1
  16. package/lib/template/field-group-template/field-group-template.component.ts +2 -2
  17. package/lib/template/field-value-list/field-value-list.component.html +1 -1
  18. package/lib/template/form-template-base/form-template-base.component.ts +10 -0
  19. package/lib/template/list-view/list-view.component.ts +1 -1
  20. package/lib/template/one-column/one-column.component.ts +3 -2
  21. package/lib/template/page/page.component.ts +3 -0
  22. package/lib/template/simple-table-manual/helpers.ts +1 -1
  23. package/lib/template/three-column/three-column.component.ts +3 -2
  24. package/lib/template/two-column/two-column.component.ts +3 -2
  25. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +3 -2
  26. package/package.json +1 -1
@@ -73,12 +73,12 @@ export class GroupComponent implements OnInit {
73
73
  this.visibility$ = this.pConn$.getComputedVisibility();
74
74
  }
75
75
 
76
- if (this.configProps$.displayMode === 'LABELS_LEFT') {
76
+ if (this.configProps$.displayMode === 'DISPLAY_ONLY') {
77
77
  if (this.configProps$.visibility === undefined) this.visibility$ = true;
78
78
 
79
79
  this.arChildren$.forEach(child => {
80
80
  const pConn = child.getPConnect();
81
- pConn.setInheritedProp('displayMode', 'LABELS_LEFT');
81
+ pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
82
82
  pConn.setInheritedProp('readOnly', true);
83
83
 
84
84
  return child;
@@ -102,7 +102,7 @@ export class ScalarListComponent implements OnInit, OnDestroy {
102
102
  type: componentType,
103
103
  config: {
104
104
  value: scalarValue,
105
- displayMode: 'LABELS_LEFT',
105
+ displayMode: 'DISPLAY_ONLY',
106
106
  label: this.label$,
107
107
  ...restProps,
108
108
  readOnly: true
@@ -113,7 +113,7 @@ export class ScalarListComponent implements OnInit, OnDestroy {
113
113
  {}
114
114
  ); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
115
115
  });
116
- this.isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(this.displayMode$ as string);
116
+ this.isDisplayModeEnabled = ['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(this.displayMode$ as string);
117
117
  this.value$ = this.items;
118
118
  }
119
119
  }
@@ -104,6 +104,8 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
104
104
 
105
105
  this.initContainer();
106
106
 
107
+ this.checkAndUpdate();
108
+
107
109
  PCore.getPubSubUtils().subscribe(
108
110
  PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
109
111
  () => {
@@ -457,7 +459,9 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
457
459
 
458
460
  showCaseMessages() {
459
461
  this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
460
- if (this.caseMessages$ || !this.hasAssignments()) {
462
+ // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
463
+ // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
464
+ if (!this.hasAssignments()) {
461
465
  this.bHasCaseMessages$ = true;
462
466
  this.bShowConfirm = true;
463
467
  this.checkSvg$ = this.utils.getImageSrc('check', this.utils.getSDKStaticContentUrl());
@@ -593,7 +597,6 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
593
597
  });
594
598
  }
595
599
 
596
- // eslint-disable-next-line sonarjs/no-identical-functions
597
600
  topViewRefresh(): void {
598
601
  Object.values(this.formGroup$.controls).forEach(control => {
599
602
  control.markAsTouched();
@@ -99,17 +99,22 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
99
99
  dispatchObject: this.dispatchObject,
100
100
  visible: !PCore.checkIfSemanticURL()
101
101
  };
102
- containerMgr.initializeContainers({
103
- type: mode === CONTAINER_TYPE.MULTIPLE ? CONTAINER_TYPE.MULTIPLE : CONTAINER_TYPE.SINGLE
104
- });
105
102
 
106
- if (mode === CONTAINER_TYPE.MULTIPLE && limit) {
107
- /* NOTE: setContainerLimit use is temporary. It is a non-public, unsupported API. */
108
- PCore.getContainerUtils().setContainerLimit(`${APP.APP}/${name}`, limit);
109
- }
103
+ if (sessionStorage.getItem('hasViewContainer') == 'false') {
104
+ containerMgr.initializeContainers({
105
+ type: mode === CONTAINER_TYPE.MULTIPLE ? CONTAINER_TYPE.MULTIPLE : CONTAINER_TYPE.SINGLE
106
+ });
107
+
108
+ if (mode === CONTAINER_TYPE.MULTIPLE && limit) {
109
+ /* NOTE: setContainerLimit use is temporary. It is a non-public, unsupported API. */
110
+ PCore.getContainerUtils().setContainerLimit(`${APP.APP}/${name}`, limit);
111
+ }
110
112
 
111
- if (!PCore.checkIfSemanticURL()) containerMgr.addContainerItem(this.pConn$ as any);
112
- if (!this.displayOnlyFA$) configureBrowserBookmark(this.pConn$);
113
+ if (!PCore.checkIfSemanticURL()) containerMgr.addContainerItem(this.pConn$ as any);
114
+ if (!this.displayOnlyFA$) configureBrowserBookmark(this.pConn$);
115
+
116
+ sessionStorage.setItem('hasViewContainer', 'true');
117
+ }
113
118
 
114
119
  // cannot call checkAndUpdate becasue first time through, will call updateSelf and that is incorrect (causes issues).
115
120
  // however, need angularPConnect to be initialized with currentProps for future updates, so calling shouldComponentUpdate directly
@@ -116,7 +116,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
116
116
  }
117
117
  };
118
118
  const configObject = PCore.createPConnect(config);
119
- configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
119
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
120
120
  this.loadedPConn$ = ReferenceComponent.normalizePConn(configObject.getPConnect());
121
121
  this.componentName$ = this.loadedPConn$.getComponentName();
122
122
  if (this.deferLoadId) {
@@ -97,6 +97,9 @@ export class RootContainerComponent implements OnInit, OnDestroy {
97
97
  }
98
98
  });
99
99
 
100
+ // clear out hasViewContainer
101
+ sessionStorage.setItem('hasViewContainer', 'false');
102
+
100
103
  this.mConn$ = configObjModal.getPConnect();
101
104
 
102
105
  // First thing in initialization is registering and subscribing to the AngularPConnect service
@@ -14,25 +14,12 @@
14
14
  </ng-container>
15
15
 
16
16
  <ng-template #noTemplate>
17
- <div *ngIf="displayOnlyFA$; else displayAll">
18
- <div *ngFor="let kid of arChildren$">
19
- <div [ngSwitch]="kid.getPConnect().getComponentName()">
20
- <component-mapper
21
- [name]="kid.getPConnect().getComponentName()"
22
- [props]="{ pConn$: kid.getPConnect() }"
23
- errorMsg="View Missing (displayOnlyFA): {{ kid.getPConnect().getComponentName() }}"
24
- ></component-mapper>
25
- </div>
26
- </div>
17
+ <div *ngFor="let kid of arChildren$">
18
+ <component-mapper
19
+ [name]="kid.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: kid.getPConnect() }"
21
+ errorMsg="View Missing (displayAll): {{ kid.getPConnect().getComponentName() }}"
22
+ ></component-mapper>
27
23
  </div>
28
- <ng-template #displayAll>
29
- <div *ngFor="let kid of arChildren$">
30
- <component-mapper
31
- [name]="kid.getPConnect().getComponentName()"
32
- [props]="{ pConn$: kid.getPConnect() }"
33
- errorMsg="View Missing (displayAll): {{ kid.getPConnect().getComponentName() }}"
34
- ></component-mapper>
35
- </div>
36
- </ng-template>
37
24
  </ng-template>
38
25
  </div>
@@ -113,7 +113,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
113
113
  this.refList = this.rawViewMetadata.config.referenceList;
114
114
  this.canBeChangedInReviewMode = theConfigProps.allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');
115
115
  // this.childrenToRender = this.children;
116
- this.isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);
116
+ this.isDisplayModeEnabled = ['DISPLAY_ONLY', 'STACKED_LARGE_VAL'].includes(displayMode);
117
117
 
118
118
  if (this.firstChildMeta?.type !== 'Region') {
119
119
  this.firstChildPConnect = this.pConn$.getChildren()[0].getPConnect;
@@ -4,6 +4,7 @@ import { FormGroup } from '@angular/forms';
4
4
  import { ReferenceComponent } from '@pega/angular-sdk-components';
5
5
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
6
  import { TemplateUtils } from '@pega/angular-sdk-components';
7
+ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
7
8
 
8
9
  interface DefaultFormProps {
9
10
  // If any, enter additional props that only exist on this component
@@ -19,8 +20,8 @@ interface DefaultFormProps {
19
20
  standalone: true,
20
21
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
21
22
  })
22
- export class DefaultFormComponent implements OnInit {
23
- @Input() pConn$: typeof PConnect;
23
+ export class DefaultFormComponent extends FormTemplateBaseComponent implements OnInit {
24
+ @Input() override pConn$: typeof PConnect;
24
25
  @Input() formGroup$: FormGroup;
25
26
 
26
27
  arChildren$: any[];
@@ -41,7 +42,9 @@ export class DefaultFormComponent implements OnInit {
41
42
  'Confirmation'
42
43
  ];
43
44
 
44
- constructor(private templateUtils: TemplateUtils) {}
45
+ constructor(private templateUtils: TemplateUtils) {
46
+ super();
47
+ }
45
48
 
46
49
  ngOnInit(): void {
47
50
  const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
@@ -79,7 +79,7 @@ export class DetailsComponent implements OnInit, OnDestroy {
79
79
  if (theCompType === 'reference' || theCompType === 'group') {
80
80
  const configProps = thePConn.getConfigProps();
81
81
  configProps.readOnly = true;
82
- configProps.displayMode = 'LABELS_LEFT';
82
+ configProps.displayMode = 'DISPLAY_ONLY';
83
83
  const propToUse = { ...thePConn.getInheritedProps() };
84
84
  configProps.label = propToUse?.label;
85
85
  const options = {
@@ -70,7 +70,7 @@ export class DetailsOneColumnComponent implements OnInit, OnDestroy {
70
70
  });
71
71
  }
72
72
 
73
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
73
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
74
74
  this.pConn$.setInheritedProp('readOnly', true);
75
75
 
76
76
  const kids = this.pConn$.getChildren() as any[];
@@ -75,7 +75,7 @@ export class DetailsThreeColumnComponent implements OnInit, OnDestroy {
75
75
  });
76
76
  }
77
77
 
78
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
78
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
79
79
  this.pConn$.setInheritedProp('readOnly', true);
80
80
 
81
81
  const kids = this.pConn$.getChildren() as any[];
@@ -75,7 +75,7 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
75
75
  });
76
76
  }
77
77
 
78
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
78
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
79
79
  this.pConn$.setInheritedProp('readOnly', true);
80
80
 
81
81
  const kids = this.pConn$.getChildren() as any[];
@@ -71,7 +71,7 @@ export class DetailsWideNarrowComponent implements OnInit, OnDestroy {
71
71
  });
72
72
  }
73
73
 
74
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
74
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
75
75
  this.pConn$.setInheritedProp('readOnly', true);
76
76
 
77
77
  const kids = this.pConn$.getChildren() as any[];
@@ -59,7 +59,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
59
59
  const { tablabel } = this.pConn$.getComponentConfig();
60
60
  const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
61
61
 
62
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
62
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
63
63
  this.pConn$.setInheritedProp('readOnly', true);
64
64
 
65
65
  const referenceListData = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
@@ -105,7 +105,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
105
105
 
106
106
  const renderMode = this.configProps$.renderMode;
107
107
  const displayMode = this.configProps$.displayMode;
108
- this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';
108
+ this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
109
109
  this.contextClass = this.configProps$.contextClass;
110
110
  const lookForChildInConfig = this.configProps$.lookForChildInConfig;
111
111
  this.heading = this.configProps$.heading ?? 'Row';
@@ -114,7 +114,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
114
114
  this.pageReference = `${this.pConn$.getPageReference()}${resolvedList}`;
115
115
  this.pConn$.setReferenceList(resolvedList);
116
116
  if (this.readonlyMode) {
117
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
117
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
118
118
  }
119
119
  this.referenceList = this.configProps$.referenceList;
120
120
  if (this.prevRefLength != this.referenceList.length) {
@@ -1,4 +1,4 @@
1
- <div *ngIf="displayMode$ === 'LABELS_LEFT'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
1
+ <div *ngIf="displayMode$ === 'DISPLAY_ONLY'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
2
2
  <div class="psdk-grid-label">{{ label$ }}</div>
3
3
  <div class="psdk-val-labels-left">
4
4
  <ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
@@ -0,0 +1,10 @@
1
+ import { Directive, OnDestroy } from '@angular/core';
2
+
3
+ @Directive()
4
+ export class FormTemplateBaseComponent implements OnDestroy {
5
+ pConn$: any;
6
+
7
+ ngOnDestroy(): void {
8
+ PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
9
+ }
10
+ }
@@ -961,7 +961,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
961
961
 
962
962
  filterDataWithDate(item, filterObj, filterValue) {
963
963
  let bKeep;
964
- let value = item[filterObj.ref] != null ?? item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
964
+ let value = item[filterObj.ref] != null || item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
965
965
  filterValue = filterObj.containsFilterValue != null && filterObj.containsFilterValue != '' ? getSeconds(filterObj.containsFilterValue) : null;
966
966
 
967
967
  switch (filterObj.containsFilter) {
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
6
 
6
7
  @Component({
7
8
  selector: 'app-one-column',
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
11
  standalone: true,
11
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
12
13
  })
13
- export class OneColumnComponent implements OnInit, OnChanges {
14
- @Input() pConn$: typeof PConnect;
14
+ export class OneColumnComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
15
+ @Input() override pConn$: typeof PConnect;
15
16
  @Input() formGroup$: FormGroup;
16
17
 
17
18
  arChildren$: any[];
@@ -42,6 +42,9 @@ export class PageComponent implements OnInit, OnDestroy {
42
42
  if (operator && operator != '') {
43
43
  this.title$ += `, ${operator}`;
44
44
  }
45
+
46
+ // when showing a page, similar to updating root, need to cause viewContainer to call "initContainer"
47
+ sessionStorage.setItem('hasViewContainer', 'false');
45
48
  }
46
49
 
47
50
  ngOnDestroy(): void {
@@ -190,7 +190,7 @@ export const createMetaForTable = (fields, renderMode) => {
190
190
 
191
191
  export const filterDataByDate = (item, filterObj) => {
192
192
  let bKeep;
193
- let value = item[filterObj.ref] != null ?? item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
193
+ let value = item[filterObj.ref] != null || item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
194
194
  let filterValue = filterObj.containsFilterValue != null && filterObj.containsFilterValue != '' ? getSeconds(filterObj.containsFilterValue) : null;
195
195
 
196
196
  switch (filterObj.containsFilter) {
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
6
 
6
7
  @Component({
7
8
  selector: 'app-three-column',
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
11
  standalone: true,
11
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
12
13
  })
13
- export class ThreeColumnComponent implements OnInit, OnChanges {
14
- @Input() pConn$: typeof PConnect;
14
+ export class ThreeColumnComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
15
+ @Input() override pConn$: typeof PConnect;
15
16
  @Input() formGroup$: FormGroup;
16
17
 
17
18
  arChildren$: any[];
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, SimpleChanges, OnChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
6
 
6
7
  @Component({
7
8
  selector: 'app-two-column',
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
11
  standalone: true,
11
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
12
13
  })
13
- export class TwoColumnComponent implements OnInit, OnChanges {
14
- @Input() pConn$: typeof PConnect;
14
+ export class TwoColumnComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
15
+ @Input() override pConn$: typeof PConnect;
15
16
  @Input() formGroup$: FormGroup;
16
17
 
17
18
  arChildren$: any[];
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
6
 
6
7
  @Component({
7
8
  selector: 'app-wide-narrow-form',
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
11
  standalone: true,
11
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
12
13
  })
13
- export class WideNarrowFormComponent implements OnInit, OnChanges {
14
- @Input() pConn$: typeof PConnect;
14
+ export class WideNarrowFormComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
15
+ @Input() override pConn$: typeof PConnect;
15
16
  @Input() formGroup$: FormGroup;
16
17
 
17
18
  arChildren$: any[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.242.1",
3
+ "version": "0.242.2",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"