@pega/angular-sdk-overrides 24.1.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 (125) hide show
  1. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -1
  2. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
  3. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  4. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -1
  5. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  6. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -1
  7. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  8. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  9. package/lib/designSystemExtension/operator/operator.component.ts +5 -4
  10. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
  11. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  12. package/lib/field/auto-complete/auto-complete.component.ts +31 -15
  13. package/lib/field/check-box/check-box.component.html +4 -0
  14. package/lib/field/check-box/check-box.component.ts +11 -10
  15. package/lib/field/currency/currency.component.html +4 -4
  16. package/lib/field/currency/currency.component.ts +42 -19
  17. package/lib/field/date/date.component.html +3 -7
  18. package/lib/field/date/date.component.ts +22 -39
  19. package/lib/field/date-time/date-time.component.html +3 -4
  20. package/lib/field/date-time/date-time.component.ts +35 -16
  21. package/lib/field/decimal/decimal.component.html +4 -3
  22. package/lib/field/decimal/decimal.component.ts +47 -21
  23. package/lib/field/dropdown/dropdown.component.html +1 -0
  24. package/lib/field/dropdown/dropdown.component.ts +146 -18
  25. package/lib/field/email/email.component.ts +24 -4
  26. package/lib/field/group/group.component.ts +2 -2
  27. package/lib/field/integer/integer.component.ts +22 -4
  28. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  29. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -2
  30. package/lib/field/multiselect/multiselect.component.ts +15 -5
  31. package/lib/field/percentage/percentage.component.html +3 -3
  32. package/lib/field/percentage/percentage.component.ts +45 -20
  33. package/lib/field/phone/config-ext.json +1 -1
  34. package/lib/field/phone/phone.component.html +4 -2
  35. package/lib/field/phone/phone.component.ts +16 -26
  36. package/lib/field/radio-buttons/radio-buttons.component.html +3 -6
  37. package/lib/field/radio-buttons/radio-buttons.component.ts +9 -9
  38. package/lib/field/rich-text/rich-text.component.ts +19 -8
  39. package/lib/field/scalar-list/scalar-list.component.ts +3 -4
  40. package/lib/field/text/text.component.ts +8 -4
  41. package/lib/field/text-area/text-area.component.html +4 -1
  42. package/lib/field/text-area/text-area.component.ts +22 -5
  43. package/lib/field/text-input/text-input.component.ts +22 -4
  44. package/lib/field/time/time.component.html +2 -2
  45. package/lib/field/time/time.component.ts +35 -6
  46. package/lib/field/url/url.component.ts +22 -4
  47. package/lib/field/user-reference/user-reference.component.html +40 -46
  48. package/lib/field/user-reference/user-reference.component.ts +111 -20
  49. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  50. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -47
  51. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  52. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  53. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -8
  54. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  55. package/lib/infra/Containers/view-container/helper.ts +22 -0
  56. package/lib/infra/Containers/view-container/view-container.component.ts +5 -17
  57. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  58. package/lib/infra/assignment/assignment.component.html +1 -1
  59. package/lib/infra/assignment/assignment.component.ts +82 -40
  60. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  61. package/lib/infra/defer-load/defer-load.component.ts +8 -5
  62. package/lib/infra/navbar/navbar.component.ts +3 -5
  63. package/lib/infra/reference/reference.component.ts +77 -90
  64. package/lib/infra/root-container/root-container.component.html +2 -15
  65. package/lib/infra/root-container/root-container.component.ts +27 -30
  66. package/lib/infra/stages/stages.component.scss +2 -2
  67. package/lib/infra/view/view.component.html +7 -20
  68. package/lib/infra/view/view.component.ts +20 -2
  69. package/lib/template/app-shell/app-shell.component.ts +20 -2
  70. package/lib/template/base/details-template-base.ts +67 -0
  71. package/lib/template/base/form-template-base.ts +16 -0
  72. package/lib/template/case-summary/case-summary.component.ts +1 -1
  73. package/lib/template/case-view/case-view.component.html +4 -4
  74. package/lib/template/case-view/case-view.component.ts +8 -13
  75. package/lib/template/confirmation/confirmation.component.html +1 -1
  76. package/lib/template/confirmation/confirmation.component.ts +1 -1
  77. package/lib/template/data-reference/data-reference.component.ts +36 -40
  78. package/lib/template/default-form/default-form.component.html +0 -4
  79. package/lib/template/default-form/default-form.component.ts +41 -24
  80. package/lib/template/details/details.component.ts +7 -41
  81. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
  82. package/lib/template/details-one-column/details-one-column.component.ts +7 -42
  83. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  84. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  85. package/lib/template/details-three-column/details-three-column.component.ts +7 -43
  86. package/lib/template/details-two-column/details-two-column.component.ts +8 -44
  87. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
  88. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  89. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -3
  90. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  91. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  92. package/lib/template/field-group-template/field-group-template.component.ts +68 -47
  93. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  94. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  95. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
  96. package/lib/template/list-view/list-view.component.html +6 -1
  97. package/lib/template/list-view/list-view.component.scss +11 -0
  98. package/lib/template/list-view/list-view.component.ts +25 -7
  99. package/lib/template/list-view/listViewHelpers.ts +3 -6
  100. package/lib/template/list-view/utils.ts +2 -5
  101. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
  102. package/lib/template/one-column/one-column.component.ts +4 -3
  103. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
  104. package/lib/template/page/page.component.ts +1 -1
  105. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
  106. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -1
  107. package/lib/template/simple-table-manual/helpers.ts +10 -8
  108. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  109. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  110. package/lib/template/simple-table-manual/simple-table-manual.component.ts +77 -37
  111. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -3
  112. package/lib/template/three-column/three-column.component.ts +4 -3
  113. package/lib/template/two-column/two-column.component.ts +4 -3
  114. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
  115. package/lib/template/utils.ts +16 -0
  116. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
  117. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
  118. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -3
  119. package/lib/widget/attachment/attachment.component.ts +7 -9
  120. package/lib/widget/feed-container/feed-container.component.ts +7 -9
  121. package/lib/widget/file-utility/file-utility.component.ts +2 -5
  122. package/lib/widget/todo/todo.component.html +5 -6
  123. package/lib/widget/todo/todo.component.scss +9 -0
  124. package/lib/widget/todo/todo.component.ts +95 -84
  125. package/package.json +1 -1
@@ -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;
@@ -36,11 +34,11 @@ export class NavbarComponent implements OnInit, OnDestroy {
36
34
  navExpandCollapse$: string;
37
35
  bShowCaseTypes$ = false;
38
36
 
39
- portalApp$ = '';
37
+ portalApp$: string | undefined = '';
40
38
  portalLogoImage$: string;
41
39
  showAppName$?: boolean = false;
42
40
 
43
- portalOperator$: string;
41
+ portalOperator$: string | undefined;
44
42
  portalOperatorInitials$: string;
45
43
 
46
44
  actionsAPI: any;
@@ -131,7 +129,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
131
129
 
132
130
  this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');
133
131
  this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName();
134
- this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$);
132
+ this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? '');
135
133
  this.showAppName$ = this.configProps$.showAppName;
136
134
 
137
135
  this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel();
@@ -13,53 +13,42 @@ import { Component } from '@angular/core';
13
13
  standalone: true
14
14
  })
15
15
  export class ReferenceComponent {
16
- referencedComponent: any = null;
17
-
18
16
  /* Used to toggle some class-wide logging */
19
17
  private static bLogging = false;
20
18
 
21
- constructor() {
22
- // With new static method approach, this shouldn't be called any more
23
- window.alert(`in ReferenceComponent constructor!`);
24
-
25
- console.error(`in ReferenceComponent constructor!`);
26
- }
27
-
28
- // onStateChange and updateSelf methods removed from original implementation
29
- // when we moved to the static method implementation.
30
-
31
- // STATIC method to create a normalized PConn (a fully realized View that the 'reference'
32
- // component refers to) from the given pConn. Has to add in some stuff as in the constructor
33
- static createFullReferencedViewFromRef(inPConn: any) {
34
- // BAIL and ERROR if inPConn is NOT a reference!
19
+ /**
20
+ * Creates a normalized PConn from a reference component.
21
+ * Resolves the reference to its fully realized View with proper configuration.
22
+ *
23
+ * @param inPConn - The PConn object that represents a reference component
24
+ * @returns The dereferenced PConnect object, or null if reference can't be resolved
25
+ */
26
+ static createFullReferencedViewFromRef(inPConn: any): any {
27
+ // Validate that inPConn is a reference component
35
28
  if (inPConn.getComponentName() !== 'reference') {
36
- // debugger;
37
-
38
29
  console.error(`Reference component: createFullReferencedViewFromRef inPConn is NOT a reference! ${inPConn.getComponentName()}`);
30
+ return null;
39
31
  }
40
32
 
41
- const theResolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
42
-
43
- const referenceConfig = { ...inPConn.getComponentConfig() } || {};
33
+ // Get reference configuration and make a copy
34
+ const referenceConfig = { ...inPConn.getComponentConfig() };
44
35
 
45
- // Since SDK-A implements Reference as static methods and we don't rely on
46
- // the Reference component's handling of the visibility prop, we leave it in
47
- // (and also leaving the others in for now) so the referenced View can act on
48
- // the visibility prop. (The following 3 lines were carried over from React SDK)
36
+ // Remove properties that should not be inherited by the referenced view
37
+ // (Maintained from React SDK implementation)
49
38
  delete referenceConfig?.name;
50
- // delete referenceConfig?.type;
51
- // delete referenceConfig?.visibility;
39
+ delete referenceConfig?.type;
40
+ delete referenceConfig?.visibility;
52
41
 
42
+ // Get the metadata for the referenced view
53
43
  const viewMetadata = inPConn.getReferencedView();
54
44
 
45
+ // Return null if view metadata is not found
55
46
  if (!viewMetadata) {
56
47
  console.log('View not found ', inPConn.getComponentConfig());
57
48
  return null;
58
49
  }
59
50
 
60
- // If we get here, we have metadata for a View component...
61
- // const referencedComponentName = viewMetadata.type;
62
-
51
+ // Create the view object by merging metadata with reference config
63
52
  const viewObject = {
64
53
  ...viewMetadata,
65
54
  config: {
@@ -68,23 +57,31 @@ export class ReferenceComponent {
68
57
  }
69
58
  };
70
59
 
60
+ // Resolve configuration properties
61
+ const resolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
62
+ const { visibility = true, context, readOnly = false, displayMode = '' } = resolvedConfigProps;
63
+
64
+ // Log debug information if logging is enabled
71
65
  if (ReferenceComponent.bLogging) {
72
- console.log(`Reference: about to call createComponent with pageReference: context: ${theResolvedConfigProps.context}`);
66
+ console.log(`Reference: about to call createComponent with pageReference: context: ${inPConn.getContextName()}`);
73
67
  }
74
68
 
69
+ // Create the component with the right context
75
70
  const viewComponent = inPConn.createComponent(viewObject, null, null, {
76
- pageReference: theResolvedConfigProps.context
71
+ pageReference: context && context.startsWith('@CLASS') ? '' : context
77
72
  });
78
73
 
79
- // updating the referencedComponent should trigger a render
74
+ // Get the PConnect object from the created component
80
75
  const newCompPConnect = viewComponent.getPConnect();
81
76
 
77
+ // Set inherited configuration on the new component
82
78
  newCompPConnect.setInheritedConfig({
83
79
  ...referenceConfig,
84
- readOnly: theResolvedConfigProps.readOnly ? theResolvedConfigProps.readOnly : false,
85
- displayMode: theResolvedConfigProps.displayMode ? theResolvedConfigProps.displayMode : null
80
+ readOnly,
81
+ displayMode
86
82
  });
87
83
 
84
+ // Log debug information if logging is enabled
88
85
  if (ReferenceComponent.bLogging) {
89
86
  console.log(
90
87
  `Angular Reference component: createFullReferencedViewFromRef -> newCompPConnect configProps: ${JSON.stringify(
@@ -93,73 +90,63 @@ export class ReferenceComponent {
93
90
  );
94
91
  }
95
92
 
96
- return newCompPConnect;
93
+ // Return the component if it should be visible, otherwise null
94
+ return visibility !== false ? newCompPConnect : null;
97
95
  }
98
96
 
99
- // STATIC method that other components can call to normalize
100
- // a pConn object that might be a 'reference'. If the incoming
101
- // pConn is a reference, return its dereferenced View PConnect's
102
- // getPConnect. Otherwise, return the passed in pConn unchanged
103
- // inPConn = a PConn object (ex: { getPConnect()} )
104
- static normalizePConn(inPConn: any) {
105
- // debugger;
106
-
107
- let returnObj = false;
108
- let thePConnType = '';
109
-
110
- if (inPConn.getPConnect) {
111
- // inPConn is an object (ex: { getPConnect()} ), so we want to return
112
- // any referenced view as the object containing the
113
- // the getPConnect function
114
- returnObj = true;
115
- thePConnType = inPConn.getPConnect().getComponentName();
116
- } else {
117
- // inPConn is an object with the PConnect function, so we want
118
- // to return any referenced view as the object containing the
119
- // the c11n function
120
- returnObj = false;
121
- thePConnType = inPConn.getComponentName();
97
+ /**
98
+ * Normalizes a PConn object that might be a 'reference'.
99
+ * If the incoming PConn is a reference, returns its dereferenced View.
100
+ * Otherwise, returns the passed in PConn unchanged.
101
+ *
102
+ * @param inPConn - A PConn object (ex: { getPConnect() } or direct PConnect)
103
+ * @returns The normalized PConn object with references resolved
104
+ */
105
+ static normalizePConn(inPConn: any): any {
106
+ // Early return for null or undefined input
107
+ if (!inPConn) {
108
+ return inPConn;
122
109
  }
123
110
 
124
- if (thePConnType === 'reference') {
125
- if (returnObj) {
126
- // WAS...
127
- // const theRefViewPConn = inPConn.getPConnect().getReferencedViewPConnect(true);
128
- // Now: ALWAYS calling createFullReferencedViewFromRef to have options, PageReference, etc.
129
- // set correctly in the C11nEnv (PConnect) object
130
- // debugger;
131
- let theRefViewPConn = this.createFullReferencedViewFromRef(inPConn.getPConnect());
132
- // now return its PConnect
133
- theRefViewPConn = theRefViewPConn.getComponent();
134
-
135
- // const theFullReference = theRefViewPConn.getPConnect().getFullReference();
136
- // console.log(`theFullReference: ${theFullReference}`);
137
-
138
- return theRefViewPConn;
111
+ // Determine if we have an object with getPConnect method or direct PConnect
112
+ const hasGetPConnectMethod = !!inPConn.getPConnect;
113
+
114
+ // Get the component name in the appropriate way based on the object type
115
+ const componentName = hasGetPConnectMethod ? inPConn.getPConnect().getComponentName() : inPConn.getComponentName();
116
+
117
+ // Only process if this is a reference component
118
+ if (componentName === 'reference') {
119
+ if (hasGetPConnectMethod) {
120
+ // For objects with getPConnect method, get the referenced view and its component
121
+ const refViewPConn = this.createFullReferencedViewFromRef(inPConn.getPConnect());
122
+ return refViewPConn?.getComponent();
139
123
  }
140
- // console.log(`created theFullRefView full reference: ${theFullRefView.getFullReference()}`);
141
- // debugger;
142
124
 
125
+ // For direct PConnect objects, just create the referenced view
143
126
  return this.createFullReferencedViewFromRef(inPConn);
144
127
  }
128
+
129
+ // Not a reference component, return unchanged
145
130
  return inPConn;
146
131
  }
147
132
 
148
- // STATIC method that other components can call to normalize
149
- // an array of pConn objects where any of the children might
150
- // be a 'reference'. The array returns an array of children
151
- // where any 'reference' is replaced with its ReferencedView
152
- // inPConnArray is an array of PConn objects or functions.
153
- // Its value is passed to normalizePConn
154
-
155
- static normalizePConnArray(inPConnArray: any) {
156
- if (!(inPConnArray?.length > 0)) {
157
- // null or empty array, return what was passed in
158
- return inPConnArray;
133
+ /**
134
+ * Normalizes an array of PConn objects by replacing any 'reference' components
135
+ * with their referenced views.
136
+ *
137
+ * @param inPConnArray - Array of PConn objects to normalize
138
+ * @returns Normalized array with references resolved, or empty array if input is invalid
139
+ */
140
+ static normalizePConnArray(inPConnArray: any[]): any[] {
141
+ // Handle null, undefined, or empty array case
142
+ if (!inPConnArray?.length) {
143
+ return inPConnArray || [];
159
144
  }
160
145
 
161
- return inPConnArray.map(child => {
162
- return ReferenceComponent.normalizePConn(child);
163
- });
146
+ // Process array: normalize each item and filter out any null/undefined results
147
+ const normalizedArray = inPConnArray.map(child => ReferenceComponent.normalizePConn(child)).filter(Boolean);
148
+
149
+ // Ensure we always return an array (even if filter removes all items)
150
+ return normalizedArray || [];
164
151
  }
165
152
  }
@@ -5,20 +5,11 @@
5
5
  <div *ngIf="bShowRoot$">
6
6
  <div [ngSwitch]="componentName$">
7
7
  <component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$, displayOnlyFA$ }"></component-mapper>
8
- <!-- <app-reference *ngSwitchCase="'reference'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-reference> -->
9
8
  <component-mapper
10
9
  *ngSwitchCase="'ViewContainer'"
11
10
  name="ViewContainer"
12
- [props]="{ pConn$: displayOnlyFA$ ? viewContainerPConn$ : pConn$, displayOnlyFA$ }"
11
+ [props]="{ pConn$: viewContainerPConn$, displayOnlyFA$ }"
13
12
  ></component-mapper>
14
- <app-hybrid-view-container *ngSwitchCase="'HybridViewContainer'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-hybrid-view-container>
15
- <app-modal-view-container
16
- *ngSwitchCase="'ModalViewContainer'"
17
- [pConn$]="pConn$"
18
- [displayOnlyFA$]="displayOnlyFA$"
19
- (modalVisibleChange)="modalVisibleChanged($event)"
20
- ></app-modal-view-container>
21
- <div *ngSwitchCase="''"></div>
22
13
  <div *ngSwitchDefault>{{ localizedVal('RootContainer Missing: ' + componentName$, localeCategory) }}.</div>
23
14
  </div>
24
15
  </div>
@@ -28,9 +19,5 @@
28
19
  </div>
29
20
 
30
21
  <div *ngIf="mConn$ != null">
31
- <app-modal-view-container
32
- [pConn$]="mConn$"
33
- [displayOnlyFA$]="displayOnlyFA$"
34
- (modalVisibleChange)="modalVisibleChanged($event)"
35
- ></app-modal-view-container>
22
+ <app-modal-view-container [pConn$]="mConn$"></app-modal-view-container>
36
23
  </div>
@@ -1,8 +1,9 @@
1
- import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy, inject } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
4
4
  import { interval, Subscription } from 'rxjs';
5
5
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
6
+ import { ServerConfigService } from '@pega/angular-sdk-components';
6
7
  import { ProgressSpinnerService } from '@pega/angular-sdk-components';
7
8
  import { ReferenceComponent } from '@pega/angular-sdk-components';
8
9
  import { PreviewViewContainerComponent } from '@pega/angular-sdk-components';
@@ -37,6 +38,8 @@ export class RootContainerComponent implements OnInit, OnDestroy {
37
38
  @Input() displayOnlyFA$: boolean;
38
39
  @Input() isMashup$: boolean;
39
40
 
41
+ scService = inject(ServerConfigService);
42
+
40
43
  // For interaction with AngularPConnect
41
44
  angularPConnectData: AngularPConnectData = {};
42
45
 
@@ -62,12 +65,10 @@ export class RootContainerComponent implements OnInit, OnDestroy {
62
65
  ) {}
63
66
 
64
67
  ngOnInit(): void {
65
- const myContext = 'app';
66
-
67
68
  const { containers } = PCore.getStore().getState();
68
69
  const items = Object.keys(containers).filter(item => item.includes('root'));
69
70
 
70
- (PCore.getContainerUtils().getContainerAPI() as any).addContainerItems(items);
71
+ PCore.getContainerUtils().getContainerAPI().addContainerItems(items);
71
72
 
72
73
  // add preview and modalview containers to redux
73
74
  // keep local copies of the the pConnect that is related
@@ -84,24 +85,11 @@ export class RootContainerComponent implements OnInit, OnDestroy {
84
85
 
85
86
  this.pvConn$ = configObjPreview.getPConnect();
86
87
 
87
- const configObjModal = PCore.createPConnect({
88
- meta: {
89
- type: 'ModalViewContainer',
90
- config: {
91
- name: 'modal'
92
- }
93
- },
94
- options: {
95
- pageReference: 'pyPortal',
96
- context: myContext
97
- }
98
- });
88
+ this.configureModalContainer();
99
89
 
100
90
  // clear out hasViewContainer
101
91
  sessionStorage.setItem('hasViewContainer', 'false');
102
92
 
103
- this.mConn$ = configObjModal.getPConnect();
104
-
105
93
  // First thing in initialization is registering and subscribing to the AngularPConnect service
106
94
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
107
95
 
@@ -128,16 +116,6 @@ export class RootContainerComponent implements OnInit, OnDestroy {
128
116
  }
129
117
  }
130
118
 
131
- modalVisibleChanged(isVisible) {
132
- if (this.displayOnlyFA$) {
133
- if (isVisible) {
134
- this.bShowRoot$ = false;
135
- } else {
136
- this.bShowRoot$ = true;
137
- }
138
- }
139
- }
140
-
141
119
  updateSelf() {
142
120
  // need to call this.getCurrentCompleteProps (not this.thePConn.getConfigProps)
143
121
  // to get full set of props that affect this component in Redux
@@ -156,7 +134,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
156
134
  if (items[key] && items[key].view && Object.keys(items[key].view).length > 0) {
157
135
  const itemView = items[key].view;
158
136
 
159
- const rootObject: any = PCore.createPConnect({
137
+ const rootObject = PCore.createPConnect({
160
138
  meta: itemView,
161
139
  options: {
162
140
  context: items[key].context
@@ -191,6 +169,25 @@ export class RootContainerComponent implements OnInit, OnDestroy {
191
169
  }
192
170
  }
193
171
 
172
+ async configureModalContainer() {
173
+ const sdkConfig = await this.scService.getSdkConfig();
174
+ const showModalsInEmbeddedMode = sdkConfig.serverConfig.showModalsInEmbeddedMode;
175
+
176
+ if (!this.displayOnlyFA$ || showModalsInEmbeddedMode) {
177
+ const configObjModal = PCore.createPConnect({
178
+ meta: {
179
+ type: 'ModalViewContainer',
180
+ config: {
181
+ name: 'modal'
182
+ }
183
+ },
184
+ options
185
+ });
186
+
187
+ this.mConn$ = configObjModal.getPConnect();
188
+ }
189
+ }
190
+
194
191
  generateViewContainerForNoPortal() {
195
192
  // bootstrap loadMashup resolves to here
196
193
  const arChildren = this.pConn$.getChildren() as any[];
@@ -202,7 +199,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
202
199
 
203
200
  this.componentName$ = localPConn.getComponentName();
204
201
  if (this.componentName$ === 'ViewContainer') {
205
- const configProps: any = this.pConn$.getConfigProps();
202
+ const configProps = this.pConn$.getConfigProps();
206
203
  const viewContConfig = {
207
204
  meta: {
208
205
  type: 'ViewContainer',
@@ -59,13 +59,13 @@
59
59
  border-radius: 0.5rem;
60
60
  border: 0.0625rem solid var(--app-neutral-light-color);
61
61
  overflow: hidden;
62
- height: 2rem;
63
62
  display: flex;
63
+ flex-wrap: wrap;
64
64
  }
65
65
 
66
66
  .psdk-stages-chevron {
67
67
  position: relative;
68
- padding: calc(1rem);
68
+ padding: calc(0.5rem);
69
69
  display: flex;
70
70
  justify-content: center;
71
71
  align-items: center;
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="visibility$ !== false" class="ng-view-top">
2
- <div *ngIf="showLabel$ && label$ && templateName$ !== 'SimpleTable' && templateName$ !== 'DefaultForm'" class="template-title-container">
2
+ <div *ngIf="showLabel$ && label$ && !noHeaderTemplates.includes(templateName$)" class="template-title-container">
3
3
  <span>{{ label$ }}</span>
4
4
  </div>
5
5
 
@@ -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>
@@ -7,6 +7,22 @@ import { getAllFields } from '@pega/angular-sdk-components';
7
7
  import { ReferenceComponent } from '@pega/angular-sdk-components';
8
8
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
9
 
10
+ const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs'];
11
+ const DETAILS_TEMPLATES = [
12
+ 'Details',
13
+ 'DetailsFields',
14
+ 'DetailsOneColumn',
15
+ 'DetailsSubTabs',
16
+ 'DetailsThreeColumn',
17
+ 'DetailsTwoColumn',
18
+ 'NarrowWideDetails',
19
+ 'WideNarrowDetails'
20
+ ];
21
+
22
+ function isDetailsTemplate(template) {
23
+ return DETAILS_TEMPLATES.includes(template);
24
+ }
25
+
10
26
  /**
11
27
  * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
12
28
  * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
@@ -77,13 +93,15 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
77
93
 
78
94
  angularPConnectData: AngularPConnectData = {};
79
95
 
96
+ noHeaderTemplates = NO_HEADER_TEMPLATES;
97
+
80
98
  configProps$: ViewProps;
81
99
  inheritedProps$: any;
82
100
  arChildren$: any[];
83
101
  templateName$: string;
84
102
  title$ = '';
85
103
  label$ = '';
86
- showLabel$ = true;
104
+ showLabel$ = false;
87
105
  visibility$ = true;
88
106
 
89
107
  constructor(
@@ -142,7 +160,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
142
160
  this.templateName$ = this.configProps$.template || '';
143
161
  this.title$ = this.configProps$.title || '';
144
162
  this.label$ = this.configProps$.label || '';
145
- this.showLabel$ = this.configProps$.showLabel || this.showLabel$;
163
+ this.showLabel$ = this.configProps$.showLabel || isDetailsTemplate(this.templateName$) || this.showLabel$;
146
164
  // label & showLabel within inheritedProps takes precedence over configProps
147
165
  this.label$ = this.inheritedProps$.label || this.label$;
148
166
  this.showLabel$ = this.inheritedProps$.showLabel || this.showLabel$;
@@ -78,9 +78,27 @@ export class AppShellComponent implements OnInit, OnDestroy {
78
78
  if (this.pages$) {
79
79
  this.bShowAppShell$ = true;
80
80
  }
81
+
82
+ // @ts-ignore - Property 'pyCaseTypesAvailableToCreateDP' does not exist on type pxApplication
83
+ const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
84
+ if (caseTypesAvailableToCreateDP) {
85
+ const portalID = this.pConn$.getValue('.pyOwner');
86
+ PCore.getDataPageUtils()
87
+ .getPageDataAsync(caseTypesAvailableToCreateDP, this.pConn$.getContextName(), {
88
+ PortalName: portalID
89
+ })
90
+ .then((response: any) => {
91
+ if (response?.pyCaseTypesAvailableToCreate) {
92
+ this.pConn$.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
93
+ skipDirtyValidation: true
94
+ });
95
+ }
96
+ });
97
+ }
98
+
81
99
  this.caseTypes$ = this.configProps$.caseTypes;
82
100
 
83
- this.arChildren$ = this.pConn$.getChildren() as any[];
101
+ this.arChildren$ = this.pConn$.getChildren();
84
102
 
85
103
  this.portalTemplate = this.configProps$.portalTemplate;
86
104
 
@@ -129,7 +147,7 @@ export class AppShellComponent implements OnInit, OnDestroy {
129
147
  }
130
148
 
131
149
  this.caseTypes$ = this.configProps$.caseTypes;
132
- this.arChildren$ = this.pConn$.getChildren() as any[];
150
+ this.arChildren$ = this.pConn$.getChildren();
133
151
  });
134
152
  }
135
153
 
@@ -0,0 +1,67 @@
1
+ import { Directive, OnInit, OnDestroy, Injector, Input } from '@angular/core';
2
+ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
3
+
4
+ @Directive()
5
+ export class DetailsTemplateBase implements OnInit, OnDestroy {
6
+ @Input() pConn$: typeof PConnect;
7
+
8
+ // For interaction with AngularPConnect
9
+ protected angularPConnectData: AngularPConnectData = {};
10
+ protected angularPConnect;
11
+
12
+ childrenMetadataOld;
13
+
14
+ constructor(injector: Injector) {
15
+ this.angularPConnect = injector.get(AngularPConnectService);
16
+ }
17
+
18
+ ngOnInit(): void {
19
+ // First thing in initialization is registering and subscribing to the AngularPConnect service
20
+ this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
21
+
22
+ this.checkAndUpdate();
23
+ }
24
+
25
+ ngOnDestroy() {
26
+ if (this.angularPConnectData.unsubscribeFn) {
27
+ this.angularPConnectData.unsubscribeFn();
28
+ }
29
+ }
30
+
31
+ onStateChange() {
32
+ this.checkAndUpdate();
33
+ }
34
+
35
+ checkAndUpdate() {
36
+ // Should always check the bridge to see if the component should update itself (re-render)
37
+ const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
38
+
39
+ // Only call updateSelf when the component should update
40
+ if (bUpdateSelf || this.hasRawMetadataChanged()) {
41
+ this.updateSelf();
42
+ }
43
+ }
44
+
45
+ // this method will get overriden by the child component
46
+ updateSelf() {}
47
+
48
+ hasRawMetadataChanged(): boolean {
49
+ const newChildrenMetadata = this.fetchChildrenMetadata();
50
+
51
+ if (!PCore.isDeepEqual(newChildrenMetadata, this.childrenMetadataOld)) {
52
+ this.childrenMetadataOld = newChildrenMetadata;
53
+ return true;
54
+ }
55
+
56
+ return false;
57
+ }
58
+
59
+ fetchChildrenMetadata() {
60
+ const children = this.pConn$.getChildren() || [];
61
+
62
+ return children.map(child => {
63
+ const pConnect = child.getPConnect();
64
+ return pConnect.resolveConfigProps(pConnect.getRawMetadata());
65
+ });
66
+ }
67
+ }
@@ -0,0 +1,16 @@
1
+ import { Directive, OnDestroy } from '@angular/core';
2
+ import { AngularPConnectData } from '@pega/angular-sdk-components';
3
+
4
+ @Directive()
5
+ export class FormTemplateBase implements OnDestroy {
6
+ pConn$: any;
7
+ angularPConnectData: AngularPConnectData;
8
+
9
+ ngOnDestroy(): void {
10
+ PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
11
+
12
+ if (this.angularPConnectData?.unsubscribeFn) {
13
+ this.angularPConnectData.unsubscribeFn();
14
+ }
15
+ }
16
+ }
@@ -55,7 +55,7 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
55
55
  // Then, continue on with other initialization
56
56
 
57
57
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
58
- this.arChildren$ = this.pConn$.getChildren() as any[];
58
+ this.arChildren$ = this.pConn$.getChildren();
59
59
 
60
60
  this.generatePrimaryAndSecondaryFields();
61
61