@pega/angular-sdk-overrides 0.24.9 → 0.25.1

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 (172) hide show
  1. package/lib/designSystemExtension/alert/alert.component.ts +0 -1
  2. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -2
  3. package/lib/designSystemExtension/banner/banner.component.ts +0 -1
  4. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -2
  5. package/lib/designSystemExtension/field-group/field-group.component.ts +0 -1
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -2
  8. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -1
  9. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  10. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -2
  11. package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +0 -1
  12. package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +0 -1
  13. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +0 -1
  14. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  15. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  16. package/lib/designSystemExtension/operator/operator.component.ts +5 -5
  17. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -8
  18. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +0 -1
  19. package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +0 -1
  20. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  21. package/lib/field/auto-complete/auto-complete.component.ts +31 -16
  22. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -1
  23. package/lib/field/check-box/check-box.component.html +18 -6
  24. package/lib/field/check-box/check-box.component.ts +17 -12
  25. package/lib/field/currency/currency.component.html +4 -4
  26. package/lib/field/currency/currency.component.ts +42 -20
  27. package/lib/field/date/date.component.html +3 -7
  28. package/lib/field/date/date.component.ts +22 -40
  29. package/lib/field/date-time/date-time.component.html +3 -4
  30. package/lib/field/date-time/date-time.component.ts +35 -17
  31. package/lib/field/decimal/decimal.component.html +4 -3
  32. package/lib/field/decimal/decimal.component.ts +47 -22
  33. package/lib/field/dropdown/dropdown.component.html +1 -0
  34. package/lib/field/dropdown/dropdown.component.ts +146 -19
  35. package/lib/field/email/email.component.ts +24 -5
  36. package/lib/field/group/group.component.ts +2 -3
  37. package/lib/field/integer/integer.component.ts +22 -5
  38. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  39. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -3
  40. package/lib/field/location/config-ext.json +8 -0
  41. package/lib/field/location/location.component.html +45 -0
  42. package/lib/field/location/location.component.scss +18 -0
  43. package/lib/field/location/location.component.spec.ts +22 -0
  44. package/lib/field/location/location.component.ts +385 -0
  45. package/lib/field/multiselect/multiselect.component.ts +17 -10
  46. package/lib/field/percentage/percentage.component.html +3 -3
  47. package/lib/field/percentage/percentage.component.ts +45 -21
  48. package/lib/field/phone/config-ext.json +1 -1
  49. package/lib/field/phone/phone.component.html +9 -6
  50. package/lib/field/phone/phone.component.scss +9 -0
  51. package/lib/field/phone/phone.component.ts +30 -27
  52. package/lib/field/radio-buttons/radio-buttons.component.html +17 -12
  53. package/lib/field/radio-buttons/radio-buttons.component.ts +13 -10
  54. package/lib/field/rich-text/rich-text.component.ts +19 -9
  55. package/lib/field/scalar-list/scalar-list.component.ts +3 -5
  56. package/lib/field/selectable-card/selectable-card.component.html +40 -0
  57. package/lib/field/selectable-card/selectable-card.component.scss +0 -0
  58. package/lib/field/selectable-card/selectable-card.component.spec.ts +22 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +255 -0
  60. package/lib/field/semantic-link/semantic-link.component.ts +0 -1
  61. package/lib/field/text/text.component.ts +8 -5
  62. package/lib/field/text-area/text-area.component.html +4 -1
  63. package/lib/field/text-area/text-area.component.ts +22 -6
  64. package/lib/field/text-content/text-content.component.ts +0 -1
  65. package/lib/field/text-input/text-input.component.ts +22 -5
  66. package/lib/field/time/time.component.html +2 -2
  67. package/lib/field/time/time.component.ts +35 -7
  68. package/lib/field/url/url.component.ts +22 -5
  69. package/lib/field/user-reference/user-reference.component.html +40 -46
  70. package/lib/field/user-reference/user-reference.component.ts +111 -21
  71. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  72. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -48
  73. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  74. package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +0 -1
  75. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  76. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -9
  77. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  78. package/lib/infra/Containers/view-container/helper.ts +22 -0
  79. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  80. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  81. package/lib/infra/action-buttons/action-buttons.component.ts +0 -1
  82. package/lib/infra/assignment/assignment.component.html +1 -1
  83. package/lib/infra/assignment/assignment.component.ts +82 -41
  84. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  85. package/lib/infra/assignment-card/assignment-card.component.ts +0 -1
  86. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  87. package/lib/infra/defer-load/defer-load.component.ts +8 -6
  88. package/lib/infra/error-boundary/error-boundary.component.ts +0 -1
  89. package/lib/infra/multi-step/multi-step.component.ts +0 -1
  90. package/lib/infra/navbar/navbar.component.ts +3 -6
  91. package/lib/infra/reference/reference.component.ts +77 -90
  92. package/lib/infra/region/region.component.ts +0 -1
  93. package/lib/infra/root-container/root-container.component.html +2 -15
  94. package/lib/infra/root-container/root-container.component.ts +27 -33
  95. package/lib/infra/stages/stages.component.scss +2 -2
  96. package/lib/infra/stages/stages.component.ts +0 -1
  97. package/lib/infra/view/view.component.html +7 -20
  98. package/lib/infra/view/view.component.ts +20 -3
  99. package/lib/template/app-shell/app-shell.component.ts +20 -3
  100. package/lib/template/banner-page/banner-page.component.ts +0 -1
  101. package/lib/template/base/details-template-base.ts +67 -0
  102. package/lib/template/base/form-template-base.ts +16 -0
  103. package/lib/template/case-summary/case-summary.component.ts +7 -23
  104. package/lib/template/case-view/case-view.component.html +4 -4
  105. package/lib/template/case-view/case-view.component.ts +8 -14
  106. package/lib/template/confirmation/confirmation.component.html +1 -1
  107. package/lib/template/confirmation/confirmation.component.ts +1 -2
  108. package/lib/template/data-reference/data-reference.component.ts +36 -41
  109. package/lib/template/default-form/default-form.component.html +0 -4
  110. package/lib/template/default-form/default-form.component.ts +41 -25
  111. package/lib/template/details/details.component.ts +7 -42
  112. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -40
  113. package/lib/template/details-one-column/details-one-column.component.ts +7 -43
  114. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  115. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -38
  116. package/lib/template/details-three-column/details-three-column.component.ts +7 -44
  117. package/lib/template/details-two-column/details-two-column.component.ts +8 -45
  118. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -43
  119. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  120. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  121. package/lib/template/field-group-list/field-group-list.component.ts +0 -1
  122. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  123. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  124. package/lib/template/field-group-template/field-group-template.component.ts +68 -48
  125. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  126. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  127. package/lib/template/field-value-list/field-value-list.component.ts +0 -1
  128. package/lib/template/inline-dashboard/inline-dashboard.component.ts +0 -1
  129. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -3
  130. package/lib/template/list-page/list-page.component.ts +0 -1
  131. package/lib/template/list-view/list-view.component.html +6 -1
  132. package/lib/template/list-view/list-view.component.scss +11 -0
  133. package/lib/template/list-view/list-view.component.ts +25 -11
  134. package/lib/template/list-view/listViewHelpers.ts +4 -10
  135. package/lib/template/list-view/utils.ts +2 -5
  136. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +0 -1
  137. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -2
  138. package/lib/template/one-column/one-column.component.ts +4 -4
  139. package/lib/template/one-column-page/one-column-page.component.ts +0 -1
  140. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -2
  141. package/lib/template/page/page.component.ts +1 -2
  142. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -2
  143. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  144. package/lib/template/simple-table/simple-table.component.ts +0 -1
  145. package/lib/template/simple-table-manual/helpers.ts +126 -10
  146. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  147. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  148. package/lib/template/simple-table-manual/simple-table-manual.component.ts +110 -54
  149. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -4
  150. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +0 -1
  151. package/lib/template/sub-tabs/sub-tabs.component.ts +0 -1
  152. package/lib/template/three-column/three-column.component.ts +4 -4
  153. package/lib/template/three-column-page/three-column-page.component.ts +0 -1
  154. package/lib/template/two-column/two-column.component.ts +4 -4
  155. package/lib/template/two-column-page/two-column-page.component.ts +0 -1
  156. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -2
  157. package/lib/template/utils.ts +16 -0
  158. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -4
  159. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -2
  160. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -4
  161. package/lib/widget/app-announcement/app-announcement.component.ts +0 -1
  162. package/lib/widget/attachment/attachment.component.ts +9 -13
  163. package/lib/widget/case-history/case-history.component.ts +0 -1
  164. package/lib/widget/feed-container/feed-container.component.ts +7 -10
  165. package/lib/widget/file-utility/file-utility.component.ts +2 -6
  166. package/lib/widget/list-utility/list-utility.component.ts +0 -1
  167. package/lib/widget/quick-create/quick-create.component.ts +0 -1
  168. package/lib/widget/todo/todo.component.html +5 -6
  169. package/lib/widget/todo/todo.component.scss +9 -0
  170. package/lib/widget/todo/todo.component.ts +95 -85
  171. package/lib/widget/utility/utility.component.ts +0 -1
  172. package/package.json +1 -1
@@ -1,13 +1,13 @@
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';
9
10
  import { ModalViewContainerComponent } from '@pega/angular-sdk-components';
10
- import { HybridViewContainerComponent } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
@@ -22,11 +22,9 @@ const options = { context: 'app' };
22
22
  selector: 'app-root-container',
23
23
  templateUrl: './root-container.component.html',
24
24
  styleUrls: ['./root-container.component.scss'],
25
- standalone: true,
26
25
  imports: [
27
26
  CommonModule,
28
27
  MatProgressSpinnerModule,
29
- HybridViewContainerComponent,
30
28
  ModalViewContainerComponent,
31
29
  PreviewViewContainerComponent,
32
30
  forwardRef(() => ComponentMapperComponent)
@@ -37,6 +35,8 @@ export class RootContainerComponent implements OnInit, OnDestroy {
37
35
  @Input() displayOnlyFA$: boolean;
38
36
  @Input() isMashup$: boolean;
39
37
 
38
+ scService = inject(ServerConfigService);
39
+
40
40
  // For interaction with AngularPConnect
41
41
  angularPConnectData: AngularPConnectData = {};
42
42
 
@@ -62,12 +62,10 @@ export class RootContainerComponent implements OnInit, OnDestroy {
62
62
  ) {}
63
63
 
64
64
  ngOnInit(): void {
65
- const myContext = 'app';
66
-
67
65
  const { containers } = PCore.getStore().getState();
68
66
  const items = Object.keys(containers).filter(item => item.includes('root'));
69
67
 
70
- (PCore.getContainerUtils().getContainerAPI() as any).addContainerItems(items);
68
+ PCore.getContainerUtils().getContainerAPI().addContainerItems(items);
71
69
 
72
70
  // add preview and modalview containers to redux
73
71
  // keep local copies of the the pConnect that is related
@@ -84,24 +82,11 @@ export class RootContainerComponent implements OnInit, OnDestroy {
84
82
 
85
83
  this.pvConn$ = configObjPreview.getPConnect();
86
84
 
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
- });
85
+ this.configureModalContainer();
99
86
 
100
87
  // clear out hasViewContainer
101
88
  sessionStorage.setItem('hasViewContainer', 'false');
102
89
 
103
- this.mConn$ = configObjModal.getPConnect();
104
-
105
90
  // First thing in initialization is registering and subscribing to the AngularPConnect service
106
91
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
107
92
 
@@ -128,16 +113,6 @@ export class RootContainerComponent implements OnInit, OnDestroy {
128
113
  }
129
114
  }
130
115
 
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
116
  updateSelf() {
142
117
  // need to call this.getCurrentCompleteProps (not this.thePConn.getConfigProps)
143
118
  // to get full set of props that affect this component in Redux
@@ -156,7 +131,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
156
131
  if (items[key] && items[key].view && Object.keys(items[key].view).length > 0) {
157
132
  const itemView = items[key].view;
158
133
 
159
- const rootObject: any = PCore.createPConnect({
134
+ const rootObject = PCore.createPConnect({
160
135
  meta: itemView,
161
136
  options: {
162
137
  context: items[key].context
@@ -191,6 +166,25 @@ export class RootContainerComponent implements OnInit, OnDestroy {
191
166
  }
192
167
  }
193
168
 
169
+ async configureModalContainer() {
170
+ const sdkConfig = await this.scService.getSdkConfig();
171
+ const showModalsInEmbeddedMode = sdkConfig.serverConfig.showModalsInEmbeddedMode;
172
+
173
+ if (!this.displayOnlyFA$ || showModalsInEmbeddedMode) {
174
+ const configObjModal = PCore.createPConnect({
175
+ meta: {
176
+ type: 'ModalViewContainer',
177
+ config: {
178
+ name: 'modal'
179
+ }
180
+ },
181
+ options
182
+ });
183
+
184
+ this.mConn$ = configObjModal.getPConnect();
185
+ }
186
+ }
187
+
194
188
  generateViewContainerForNoPortal() {
195
189
  // bootstrap loadMashup resolves to here
196
190
  const arChildren = this.pConn$.getChildren() as any[];
@@ -202,7 +196,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
202
196
 
203
197
  this.componentName$ = localPConn.getComponentName();
204
198
  if (this.componentName$ === 'ViewContainer') {
205
- const configProps: any = this.pConn$.getConfigProps();
199
+ const configProps = this.pConn$.getConfigProps();
206
200
  const viewContConfig = {
207
201
  meta: {
208
202
  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;
@@ -13,7 +13,6 @@ interface StagesProps {
13
13
  selector: 'app-stages',
14
14
  templateUrl: './stages.component.html',
15
15
  styleUrls: ['./stages.component.scss'],
16
- standalone: true,
17
16
  imports: [CommonModule]
18
17
  })
19
18
  export class StagesComponent implements OnInit, OnDestroy {
@@ -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
@@ -66,7 +82,6 @@ interface ViewProps {
66
82
  selector: 'app-view',
67
83
  templateUrl: './view.component.html',
68
84
  styleUrls: ['./view.component.scss'],
69
- standalone: true,
70
85
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
71
86
  })
72
87
  export class ViewComponent implements OnInit, OnDestroy, OnChanges {
@@ -77,13 +92,15 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
77
92
 
78
93
  angularPConnectData: AngularPConnectData = {};
79
94
 
95
+ noHeaderTemplates = NO_HEADER_TEMPLATES;
96
+
80
97
  configProps$: ViewProps;
81
98
  inheritedProps$: any;
82
99
  arChildren$: any[];
83
100
  templateName$: string;
84
101
  title$ = '';
85
102
  label$ = '';
86
- showLabel$ = true;
103
+ showLabel$ = false;
87
104
  visibility$ = true;
88
105
 
89
106
  constructor(
@@ -142,7 +159,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
142
159
  this.templateName$ = this.configProps$.template || '';
143
160
  this.title$ = this.configProps$.title || '';
144
161
  this.label$ = this.configProps$.label || '';
145
- this.showLabel$ = this.configProps$.showLabel || this.showLabel$;
162
+ this.showLabel$ = this.configProps$.showLabel || isDetailsTemplate(this.templateName$) || this.showLabel$;
146
163
  // label & showLabel within inheritedProps takes precedence over configProps
147
164
  this.label$ = this.inheritedProps$.label || this.label$;
148
165
  this.showLabel$ = this.inheritedProps$.showLabel || this.showLabel$;
@@ -31,7 +31,6 @@ interface AppShellProps {
31
31
  selector: 'app-app-shell',
32
32
  templateUrl: './app-shell.component.html',
33
33
  styleUrls: ['./app-shell.component.scss'],
34
- standalone: true,
35
34
  imports: [CommonModule, MatSnackBarModule, forwardRef(() => ComponentMapperComponent)]
36
35
  })
37
36
  export class AppShellComponent implements OnInit, OnDestroy {
@@ -78,9 +77,27 @@ export class AppShellComponent implements OnInit, OnDestroy {
78
77
  if (this.pages$) {
79
78
  this.bShowAppShell$ = true;
80
79
  }
80
+
81
+ // @ts-ignore - Property 'pyCaseTypesAvailableToCreateDP' does not exist on type pxApplication
82
+ const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
83
+ if (caseTypesAvailableToCreateDP) {
84
+ const portalID = this.pConn$.getValue('.pyOwner');
85
+ PCore.getDataPageUtils()
86
+ .getPageDataAsync(caseTypesAvailableToCreateDP, this.pConn$.getContextName(), {
87
+ PortalName: portalID
88
+ })
89
+ .then((response: any) => {
90
+ if (response?.pyCaseTypesAvailableToCreate) {
91
+ this.pConn$.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
92
+ skipDirtyValidation: true
93
+ });
94
+ }
95
+ });
96
+ }
97
+
81
98
  this.caseTypes$ = this.configProps$.caseTypes;
82
99
 
83
- this.arChildren$ = this.pConn$.getChildren() as any[];
100
+ this.arChildren$ = this.pConn$.getChildren();
84
101
 
85
102
  this.portalTemplate = this.configProps$.portalTemplate;
86
103
 
@@ -129,7 +146,7 @@ export class AppShellComponent implements OnInit, OnDestroy {
129
146
  }
130
147
 
131
148
  this.caseTypes$ = this.configProps$.caseTypes;
132
- this.arChildren$ = this.pConn$.getChildren() as any[];
149
+ this.arChildren$ = this.pConn$.getChildren();
133
150
  });
134
151
  }
135
152
 
@@ -16,7 +16,6 @@ interface BannerPageProps {
16
16
  selector: 'app-banner-page',
17
17
  templateUrl: './banner-page.component.html',
18
18
  styleUrls: ['./banner-page.component.scss'],
19
- standalone: true,
20
19
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
21
20
  })
22
21
  export class BannerPageComponent implements OnInit, OnChanges {
@@ -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
+ }
@@ -3,6 +3,7 @@ import { FormGroup } from '@angular/forms';
3
3
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
4
  import { ReferenceComponent } from '@pega/angular-sdk-components';
5
5
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
+ import { Utils } from '@pega/angular-sdk-components';
6
7
 
7
8
  interface CaseSummaryProps {
8
9
  // If any, enter additional props that only exist on this component
@@ -16,7 +17,6 @@ interface CaseSummaryProps {
16
17
  selector: 'app-case-summary',
17
18
  templateUrl: './case-summary.component.html',
18
19
  styleUrls: ['./case-summary.component.scss'],
19
- standalone: true,
20
20
  imports: [forwardRef(() => ComponentMapperComponent)]
21
21
  })
22
22
  export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
@@ -33,7 +33,10 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
33
33
  primaryFields$: any[] = [];
34
34
  secondaryFields$: any[] = [];
35
35
 
36
- constructor(private angularPConnect: AngularPConnectService) {}
36
+ constructor(
37
+ private angularPConnect: AngularPConnectService,
38
+ private utils: Utils
39
+ ) {}
37
40
 
38
41
  ngOnInit(): void {
39
42
  // First thing in initialization is registering and subscribing to the AngularPConnect service
@@ -55,7 +58,7 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
55
58
  // Then, continue on with other initialization
56
59
 
57
60
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
58
- this.arChildren$ = this.pConn$.getChildren() as any[];
61
+ this.arChildren$ = this.pConn$.getChildren();
59
62
 
60
63
  this.generatePrimaryAndSecondaryFields();
61
64
 
@@ -101,30 +104,11 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
101
104
  });
102
105
  }
103
106
 
104
- prepareComponentInCaseSummary(pConnectMeta, getPConnect) {
105
- const { config, children } = pConnectMeta;
106
- const pConnect = getPConnect();
107
-
108
- const caseSummaryComponentObject: any = {};
109
-
110
- const { type } = pConnectMeta;
111
- const createdComponent = pConnect.createComponent({
112
- type,
113
- children: children ? [...children] : [],
114
- config: {
115
- ...config
116
- }
117
- });
118
-
119
- caseSummaryComponentObject.value = createdComponent;
120
- return caseSummaryComponentObject;
121
- }
122
-
123
107
  prepareCaseSummaryData(summaryFieldChildren) {
124
108
  const convertChildrenToSummaryData = kid => {
125
109
  return kid?.map((childItem, index) => {
126
110
  const childMeta = childItem.getPConnect().meta;
127
- const caseSummaryComponentObject = this.prepareComponentInCaseSummary(childMeta, childItem.getPConnect);
111
+ const caseSummaryComponentObject = this.utils.prepareComponentInCaseSummary(childMeta, childItem.getPConnect);
128
112
  caseSummaryComponentObject.id = index + 1;
129
113
  return caseSummaryComponentObject;
130
114
  });
@@ -1,5 +1,5 @@
1
1
  <div class="psdk-case-view" id="case-view">
2
- <div *ngIf="!displayOnlyFA$" class="psdk-case-view-info">
2
+ <div class="psdk-case-view-info">
3
3
  <mat-toolbar color="primary" class="psdk-case-view-toolbar">
4
4
  <mat-toolbar-row style="padding-left: 1rem">
5
5
  <div class="psdk-case-icon-div">
@@ -47,7 +47,7 @@
47
47
  ></component-mapper>
48
48
  </div>
49
49
  <div class="psdk-case-view-main">
50
- <div *ngIf="!displayOnlyFA$">
50
+ <div>
51
51
  <div *ngFor="let kid of arChildren$">
52
52
  <div
53
53
  *ngIf="
@@ -73,11 +73,11 @@
73
73
  </div>
74
74
  </div>
75
75
 
76
- <div *ngIf="!displayOnlyFA$">
76
+ <div>
77
77
  <component-mapper name="DeferLoad" [props]="{ pConn$, loadData$: tabData$, name: tabData$?.config?.name }"></component-mapper>
78
78
  </div>
79
79
  </div>
80
- <div *ngIf="!displayOnlyFA$">
80
+ <div>
81
81
  <div *ngIf="arChildren$" class="psdk-case-view-utilities">
82
82
  <div *ngFor="let kid of arChildren$">
83
83
  <div *ngIf="kid.getPConnect().getRawMetadata()?.type.toLowerCase() == 'region' && kid.getPConnect().getRawMetadata()?.name == 'Utilities'">
@@ -21,13 +21,11 @@ interface CaseViewProps {
21
21
  templateUrl: './case-view.component.html',
22
22
  styleUrls: ['./case-view.component.scss'],
23
23
  providers: [Utils],
24
- standalone: true,
25
24
  imports: [CommonModule, MatToolbarModule, MatButtonModule, MatMenuModule, forwardRef(() => ComponentMapperComponent)]
26
25
  })
27
26
  export class CaseViewComponent implements OnInit, OnDestroy {
28
27
  @Input() pConn$: typeof PConnect;
29
28
  @Input() formGroup$: FormGroup;
30
- @Input() displayOnlyFA$: boolean;
31
29
 
32
30
  // Used with AngularPConnect
33
31
  angularPConnectData: AngularPConnectData = {};
@@ -120,7 +118,7 @@ export class CaseViewComponent implements OnInit, OnDestroy {
120
118
  if (hasNewAttachments !== this.bHasNewAttachments) {
121
119
  this.bHasNewAttachments = hasNewAttachments;
122
120
  if (this.bHasNewAttachments) {
123
- PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
121
+ PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
124
122
  }
125
123
  }
126
124
 
@@ -161,19 +159,15 @@ export class CaseViewComponent implements OnInit, OnDestroy {
161
159
 
162
160
  this.svgCase$ = this.utils.getImageSrc(this.configProps$.icon, this.utils.getSDKStaticContentUrl());
163
161
 
164
- // this.utils.consoleKidDump(this.pConn$);
165
-
166
- if (!this.displayOnlyFA$) {
167
- for (const kid of this.arChildren$) {
168
- const kidPConn = kid.getPConnect();
169
- if (kidPConn.getRawMetadata().name == 'Tabs') {
170
- this.mainTabs = kid;
171
- this.mainTabData = this.mainTabs.getPConnect().getChildren();
172
- }
162
+ for (const kid of this.arChildren$) {
163
+ const kidPConn = kid.getPConnect();
164
+ if (kidPConn.getRawMetadata().name == 'Tabs') {
165
+ this.mainTabs = kid;
166
+ this.mainTabData = this.mainTabs.getPConnect().getChildren();
173
167
  }
174
-
175
- this.generateTabsData();
176
168
  }
169
+
170
+ this.generateTabsData();
177
171
  }
178
172
 
179
173
  generateTabsData() {
@@ -14,7 +14,7 @@
14
14
  <button mat-raised-button color="primary" (click)="onConfirmViewClose()">Done</button>
15
15
  </div>
16
16
  </div>
17
- <div *ngIf="toDoList?.length > 0">
17
+ <div *ngIf="!showConfirmView && toDoList?.length > 0">
18
18
  <component-mapper
19
19
  name="Todo"
20
20
  [props]="{ pConn$, datasource$: { source: toDoList }, headerText$: 'Tasks', type$: CONSTS.TODO, isConfirm: true }"
@@ -18,7 +18,6 @@ interface ConfirmationProps {
18
18
  selector: 'app-confirmation',
19
19
  templateUrl: './confirmation.component.html',
20
20
  styleUrls: ['./confirmation.component.scss'],
21
- standalone: true,
22
21
  imports: [CommonModule, MatButtonModule, forwardRef(() => ComponentMapperComponent)]
23
22
  })
24
23
  export class ConfirmationComponent implements OnInit, OnDestroy {
@@ -43,7 +42,7 @@ export class ConfirmationComponent implements OnInit, OnDestroy {
43
42
  // First thing in initialization is registering and subscribing to the AngularPConnect service
44
43
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
45
44
  this.CONSTS = PCore.getConstants();
46
- const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(this.pConn$.getTarget());
45
+ const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(this.pConn$.getTarget() ?? null);
47
46
  this.rootInfo = PCore.getContainerUtils().getContainerItemData(this.pConn$.getTarget(), activeContainerItemID);
48
47
  this.checkAndUpdate();
49
48
  }