@pega/angular-sdk-overrides 0.25.15 → 0.25.17

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 (44) hide show
  1. package/lib/designSystemExtension/operator/operator.component.ts +2 -1
  2. package/lib/infra/Containers/flow-container/flow-container.component.ts +33 -40
  3. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +46 -50
  4. package/lib/infra/Containers/view-container/view-container.component.ts +29 -30
  5. package/lib/infra/defer-load/defer-load.component.ts +6 -3
  6. package/lib/infra/navbar/navbar.component.ts +33 -35
  7. package/lib/infra/root-container/root-container.component.ts +33 -38
  8. package/lib/infra/view/view.component.ts +17 -39
  9. package/lib/template/app-shell/app-shell.component.ts +12 -11
  10. package/lib/template/base/details-template-base.ts +35 -53
  11. package/lib/template/case-summary/case-summary.component.ts +14 -0
  12. package/lib/template/details/details.component.html +23 -3
  13. package/lib/template/details/details.component.scss +9 -2
  14. package/lib/template/details/details.component.ts +3 -32
  15. package/lib/template/details-narrow-wide/details-narrow-wide.component.html +21 -2
  16. package/lib/template/details-narrow-wide/details-narrow-wide.component.scss +8 -1
  17. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +3 -37
  18. package/lib/template/details-one-column/details-one-column.component.html +23 -1
  19. package/lib/template/details-one-column/details-one-column.component.scss +14 -0
  20. package/lib/template/details-one-column/details-one-column.component.ts +3 -38
  21. package/lib/template/details-three-column/details-three-column.component.html +21 -2
  22. package/lib/template/details-three-column/details-three-column.component.scss +8 -1
  23. package/lib/template/details-three-column/details-three-column.component.ts +3 -46
  24. package/lib/template/details-two-column/details-two-column.component.html +21 -2
  25. package/lib/template/details-two-column/details-two-column.component.scss +8 -1
  26. package/lib/template/details-two-column/details-two-column.component.ts +3 -44
  27. package/lib/template/details-wide-narrow/details-wide-narrow.component.html +21 -2
  28. package/lib/template/details-wide-narrow/details-wide-narrow.component.scss +8 -1
  29. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +3 -41
  30. package/lib/template/field-value-list/field-value-list.component.scss +17 -0
  31. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +18 -20
  32. package/lib/widget/attachment/attachment.component.ts +5 -2
  33. package/lib/widget/case-history/case-history.component.ts +6 -2
  34. package/lib/widget/file-utility/file-utility.component.ts +25 -29
  35. package/lib/widget/todo/todo.component.ts +7 -2
  36. package/package.json +1 -1
  37. package/lib/designSystemExtension/material-details/material-details.component.html +0 -40
  38. package/lib/designSystemExtension/material-details/material-details.component.scss +0 -116
  39. package/lib/designSystemExtension/material-details/material-details.component.spec.ts +0 -24
  40. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -31
  41. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +0 -41
  42. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +0 -34
  43. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.spec.ts +0 -22
  44. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +0 -61
@@ -3,17 +3,28 @@ import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
5
5
  import { Utils } from '@pega/angular-sdk-components';
6
- import { getAllFields } from '@pega/angular-sdk-components';
7
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
7
 
9
- const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs', 'ListView'];
8
+ const NO_HEADER_TEMPLATES = [
9
+ 'SubTabs',
10
+ 'SimpleTable',
11
+ 'Details',
12
+ 'DetailsTwoColumn',
13
+ 'DetailsThreeColumn',
14
+ 'NarrowWideDetails',
15
+ 'WideNarrowDetails',
16
+ 'Confirmation',
17
+ 'DynamicTabs',
18
+ 'DetailsSubTabs',
19
+ 'ListView'
20
+ ];
21
+
10
22
  const DETAILS_TEMPLATES = [
11
23
  'Details',
12
- 'DetailsFields',
13
24
  'DetailsOneColumn',
14
- 'DetailsSubTabs',
15
- 'DetailsThreeColumn',
16
25
  'DetailsTwoColumn',
26
+ 'DetailsThreeColumn',
27
+ 'DetailsSubTabs',
17
28
  'NarrowWideDetails',
18
29
  'WideNarrowDetails'
19
30
  ];
@@ -157,7 +168,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
157
168
  this.showLabel$ =
158
169
  this.inheritedProps$.showLabel !== undefined
159
170
  ? this.inheritedProps$.showLabel
160
- : this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
171
+ : (this.configProps$.showLabel ?? isDetailsTemplate(this.templateName$));
161
172
  this.arChildren$ = this.pConn$.getChildren();
162
173
  this.visibility$ = this.configProps$.visibility ?? this.visibility$;
163
174
 
@@ -183,39 +194,6 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
183
194
  // console.log("-->view update: " + this.angularPConnect.getComponentID(this) + ", template: " + this.templateName$ + ", kids: " + kidList);
184
195
  }
185
196
 
186
- // JA - adapting additionalProps from Nebula/Constellation version which uses static methods
187
- // on the component classes stored in PComponents (that Angular doesn't have)...
188
- additionalProps(state: any, getPConnect: any) {
189
- let propObj = {};
190
-
191
- // We already have the template name in this.templateName$
192
- if (this.templateName$ !== '') {
193
- let allFields = {};
194
-
195
- // These uses are adapted from Nebula/Constellation CaseSummary.additionalProps
196
- switch (this.templateName$) {
197
- case 'CaseSummary':
198
- allFields = getAllFields(getPConnect);
199
- // eslint-disable-next-line no-case-declarations
200
- const unresFields = {
201
- primaryFields: allFields[0],
202
- secondaryFields: allFields[1]
203
- };
204
- propObj = getPConnect.resolveConfigProps(unresFields);
205
- break;
206
-
207
- case 'Details':
208
- allFields = getAllFields(getPConnect);
209
- propObj = { fields: allFields[0] };
210
- break;
211
- default:
212
- break;
213
- }
214
- }
215
-
216
- return propObj;
217
- }
218
-
219
197
  ngOnDestroy(): void {
220
198
  if (this.angularPConnectData.unsubscribeFn) {
221
199
  this.angularPConnectData.unsubscribeFn();
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { MatSnackBarModule, MatSnackBar } from '@angular/material/snack-bar';
4
4
  import { Subscription } from 'rxjs';
@@ -59,7 +59,7 @@ export class AppShellComponent implements OnInit, OnDestroy {
59
59
  private angularPConnect: AngularPConnectService,
60
60
  private erService: ErrorMessagesService,
61
61
  private snackBar: MatSnackBar,
62
- private ngZone: NgZone,
62
+ private cdRef: ChangeDetectorRef,
63
63
  private utils: Utils
64
64
  ) {}
65
65
 
@@ -152,17 +152,15 @@ export class AppShellComponent implements OnInit, OnDestroy {
152
152
  const portalClass = this.pConn$.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
153
153
  const envPortalName = envInfo.getPortalName();
154
154
 
155
- this.ngZone.run(() => {
156
- // making a copy, so can add info
157
- this.pages$ = this.configProps$.pages;
155
+ // making a copy, so can add info
156
+ this.pages$ = this.configProps$.pages;
158
157
 
159
- if (this.pages$) {
160
- this.bShowAppShell$ = true;
161
- }
158
+ if (this.pages$) {
159
+ this.bShowAppShell$ = true;
160
+ }
162
161
 
163
- this.caseTypes$ = this.configProps$.caseTypes;
164
- this.arChildren$ = this.pConn$.getChildren();
165
- });
162
+ this.caseTypes$ = this.configProps$.caseTypes;
163
+ this.arChildren$ = this.pConn$.getChildren();
166
164
 
167
165
  const portalLogo = this.configProps$.portalLogo;
168
166
  // using the default icon then fetch it from the static folder (not auth involved)
@@ -181,12 +179,14 @@ export class AppShellComponent implements OnInit, OnDestroy {
181
179
  .getSvcImageUrl(portalLogo)
182
180
  .then(data => {
183
181
  this.imageURL = data;
182
+ this.cdRef.markForCheck();
184
183
  })
185
184
  .catch(() => {
186
185
  console.error(`${this.localizedVal('Unable to load the image for the portal logo/icon with the insName', 'AppShell')}:${portalLogo}`);
187
186
  });
188
187
  }
189
188
  this.appName$ = this.localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase());
189
+ this.cdRef.markForCheck();
190
190
  }
191
191
 
192
192
  // fpr show/hiding error messages in the SnackBar component
@@ -244,5 +244,6 @@ export class AppShellComponent implements OnInit, OnDestroy {
244
244
  default:
245
245
  break;
246
246
  }
247
+ this.cdRef.markForCheck();
247
248
  }
248
249
  }
@@ -11,7 +11,10 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
11
11
  protected angularPConnectData: AngularPConnectData = {};
12
12
  protected angularPConnect;
13
13
 
14
- childrenMetadataOld;
14
+ children: any[] = [];
15
+ propsToUse: any = {};
16
+ showHighlightedData: boolean;
17
+ highlightedDataArr: any = [];
15
18
 
16
19
  constructor(injector: Injector) {
17
20
  this.angularPConnect = injector.get(AngularPConnectService);
@@ -39,23 +42,13 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
39
42
  const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
40
43
 
41
44
  // Only call updateSelf when the component should update
42
- if (bUpdateSelf || this.hasRawMetadataChanged()) {
45
+ if (bUpdateSelf) {
43
46
  this.updateSelf();
44
47
  }
45
48
  }
46
49
 
47
- // this method will get overriden by the child component
48
- updateSelf() {}
49
-
50
- hasRawMetadataChanged(): boolean {
51
- const newChildrenMetadata = this.fetchChildrenMetadata();
52
-
53
- if (!PCore.isDeepEqual(newChildrenMetadata, this.childrenMetadataOld)) {
54
- this.childrenMetadataOld = newChildrenMetadata;
55
- return true;
56
- }
57
-
58
- return false;
50
+ updateSelf() {
51
+ this.updateDetailsProps();
59
52
  }
60
53
 
61
54
  fetchChildrenMetadata() {
@@ -67,46 +60,35 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
67
60
  });
68
61
  }
69
62
 
70
- processDetailFields(kid: any): any[] {
71
- const pKid = kid.getPConnect();
72
- const fields = pKid.getChildren();
73
- const processedFields: any[] = [];
74
-
75
- fields?.forEach(field => {
76
- const thePConn = field.getPConnect();
77
- const theCompType = thePConn.getComponentName().toLowerCase();
78
- if (theCompType === 'reference' || theCompType === 'group') {
79
- const configProps = thePConn.getConfigProps();
80
- configProps.readOnly = true;
81
- configProps.displayMode = 'DISPLAY_ONLY';
82
- const propToUse = { ...thePConn.getInheritedProps() };
83
- configProps.label = propToUse?.label;
84
- const options = {
85
- context: thePConn.getContextName(),
86
- pageReference: thePConn.getPageReference(),
87
- referenceList: thePConn.getReferenceList()
88
- };
89
- const viewContConfig = {
90
- meta: {
91
- ...thePConn.getMetadata(),
92
- type: theCompType,
93
- config: configProps
94
- },
95
- options
96
- };
97
- const theViewCont = PCore.createPConnect(viewContConfig);
98
- processedFields.push({
99
- type: theCompType,
100
- pConn: theViewCont?.getPConnect()
101
- });
102
- } else {
103
- processedFields.push({
104
- type: theCompType,
105
- config: thePConn.getConfigProps()
106
- });
63
+ updateDetailsProps() {
64
+ const { label, showLabel, showHighlightedData } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
65
+ this.propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
66
+ this.showHighlightedData = showHighlightedData;
67
+
68
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
69
+ this.pConn$.setInheritedProp('readOnly', true);
70
+
71
+ this.children = this.pConn$.getChildren() as any[];
72
+
73
+ // Process highlighted fields for display in the highlighted section
74
+ this.highlightedDataArr = this.processHighlightedFields();
75
+ }
76
+
77
+ processHighlightedFields(): any[] {
78
+ if (!this.showHighlightedData) return [];
79
+
80
+ const { highlightedData = [] } = (this.pConn$.getRawMetadata() as any).config;
81
+
82
+ return (highlightedData ?? []).map(field => {
83
+ field.config.displayMode = 'STACKED_LARGE_VAL';
84
+ field.config.readOnly = true;
85
+
86
+ if (field.config.value === '@P .pyStatusWork') {
87
+ field.type = 'TextInput';
88
+ field.config.displayAsStatus = true;
107
89
  }
108
- });
109
90
 
110
- return processedFields;
91
+ return this.pConn$.createComponent(field, '', 0, {}).getPConnect();
92
+ });
111
93
  }
112
94
  }
@@ -3,6 +3,7 @@ import { FormGroup } from '@angular/forms';
3
3
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
5
  import { Utils } from '@pega/angular-sdk-components';
6
+ import { getAllFields } from '@pega/angular-sdk-components';
6
7
 
7
8
  interface CaseSummaryProps {
8
9
  // If any, enter additional props that only exist on this component
@@ -73,7 +74,20 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
73
74
  }
74
75
 
75
76
  updateSelf() {
77
+ this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
76
78
  this.generatePrimaryAndSecondaryFields();
79
+ this.status$ = this.configProps$.status;
80
+ this.bShowStatus$ = this.configProps$.showStatus;
81
+ }
82
+
83
+ additionalProps() {
84
+ const allFields = getAllFields(this.pConn$);
85
+ const fields = {
86
+ primaryFields: allFields[0],
87
+ secondaryFields: allFields[1]
88
+ };
89
+
90
+ return this.pConn$.resolveConfigProps(fields);
77
91
  }
78
92
 
79
93
  ngOnChanges() {
@@ -1,3 +1,23 @@
1
- <div>
2
- <component-mapper name="MaterialDetails" [props]="{ arFields$, arHighlightedFields: highlightedDataArr, layout: 'one-column' }"></component-mapper>
3
- </div>
1
+ <component-mapper
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
+ ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-1">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -1,7 +1,14 @@
1
- .psdk-grid-filter {
1
+ .psdk-grid-filter-1 {
2
2
  display: grid;
3
- grid-template-columns: repeat(2, minmax(0, 1fr));
3
+ grid-template-columns: repeat(1, minmax(0, 1fr));
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
7
7
  }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,36 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details',
7
8
  templateUrl: './details.component.html',
8
9
  styleUrls: ['./details.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- highlightedDataArr: any[] = [];
15
- showHighlightedData: boolean;
16
- arFields$: any[] = [];
17
-
18
- override updateSelf() {
19
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
20
- this.showHighlightedData = rawMetaData?.showHighlightedData;
21
-
22
- if (this.showHighlightedData) {
23
- const highlightedData = rawMetaData?.highlightedData;
24
- this.highlightedDataArr = highlightedData.map(field => {
25
- field.config.displayMode = 'STACKED_LARGE_VAL';
26
-
27
- if (field.config.value === '@P .pyStatusWork') {
28
- field.type = 'TextInput';
29
- field.config.displayAsStatus = true;
30
- }
31
-
32
- return field;
33
- });
34
- }
35
-
36
- const kids = this.pConn$.getChildren() as any[];
37
- for (const kid of kids) {
38
- this.arFields$ = this.processDetailFields(kid);
39
- }
40
- }
41
- }
12
+ export class DetailsComponent extends DetailsTemplateBase {}
@@ -1,4 +1,23 @@
1
1
  <component-mapper
2
- name="MaterialDetails"
3
- [props]="{ arFields$, arFields2$, arHighlightedFields: highlightedDataArr, layout: 'narrow-wide' }"
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
4
  ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-narrow-wide">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -1,7 +1,14 @@
1
- .psdk-grid-filter {
1
+ .psdk-grid-filter-narrow-wide {
2
2
  display: grid;
3
3
  grid-template-columns: 3fr 7fr;
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
7
7
  }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,41 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details-narrow-wide',
7
8
  templateUrl: './details-narrow-wide.component.html',
8
9
  styleUrls: ['./details-narrow-wide.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsNarrowWideComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- arFields$: any[] = [];
15
- arFields2$: any[] = [];
16
- highlightedDataArr: any[] = [];
17
- showHighlightedData: boolean;
18
-
19
- override updateSelf() {
20
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
21
- this.showHighlightedData = rawMetaData?.showHighlightedData;
22
-
23
- if (this.showHighlightedData) {
24
- const highlightedData = rawMetaData?.highlightedData;
25
- this.highlightedDataArr = highlightedData.map(field => {
26
- field.config.displayMode = 'STACKED_LARGE_VAL';
27
-
28
- if (field.config.value === '@P .pyStatusWork') {
29
- field.type = 'TextInput';
30
- field.config.displayAsStatus = true;
31
- }
32
-
33
- return field;
34
- });
35
- }
36
-
37
- const kids = this.pConn$.getChildren() as any[];
38
- for (const kid of kids) {
39
- if (kids.indexOf(kid) == 0) {
40
- this.arFields$ = this.processDetailFields(kid);
41
- } else {
42
- this.arFields2$ = this.processDetailFields(kid);
43
- }
44
- }
45
- }
46
- }
12
+ export class DetailsNarrowWideComponent extends DetailsTemplateBase {}
@@ -1 +1,23 @@
1
- <component-mapper name="MaterialDetails" [props]="{ arFields$, arHighlightedFields: highlightedDataArr, layout: 'one-column' }"></component-mapper>
1
+ <component-mapper
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
+ ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-1">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -0,0 +1,14 @@
1
+ .psdk-grid-filter-1 {
2
+ display: grid;
3
+ grid-template-columns: repeat(1, minmax(0, 1fr));
4
+ column-gap: calc(2 * 0.5rem);
5
+ row-gap: calc(2 * 0.5rem);
6
+ align-items: start;
7
+ }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,42 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details-one-column',
7
8
  templateUrl: './details-one-column.component.html',
8
9
  styleUrls: ['./details-one-column.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsOneColumnComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- showHighlightedData: boolean;
15
- highlightedDataArr: any;
16
-
17
- arFields$: any[] = [];
18
-
19
- override updateSelf() {
20
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
21
- this.showHighlightedData = rawMetaData?.showHighlightedData;
22
-
23
- if (this.showHighlightedData) {
24
- const highlightedData = rawMetaData?.highlightedData;
25
- this.highlightedDataArr = highlightedData.map(field => {
26
- field.config.displayMode = 'STACKED_LARGE_VAL';
27
-
28
- if (field.config.value === '@P .pyStatusWork') {
29
- field.type = 'TextInput';
30
- field.config.displayAsStatus = true;
31
- }
32
-
33
- return field;
34
- });
35
- }
36
-
37
- this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
38
- this.pConn$.setInheritedProp('readOnly', true);
39
-
40
- const kids = this.pConn$.getChildren() as any[];
41
- for (const kid of kids) {
42
- if (kids.indexOf(kid) == 0) {
43
- this.arFields$ = this.processDetailFields(kid);
44
- }
45
- }
46
- }
47
- }
12
+ export class DetailsOneColumnComponent extends DetailsTemplateBase {}
@@ -1,4 +1,23 @@
1
1
  <component-mapper
2
- name="MaterialDetails"
3
- [props]="{ arFields$, arFields2$, arFields3$, arHighlightedFields: highlightedDataArr, layout: 'three-column' }"
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
4
  ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-3">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -1,7 +1,14 @@
1
- .psdk-grid-filter {
1
+ .psdk-grid-filter-3 {
2
2
  display: grid;
3
3
  grid-template-columns: repeat(3, minmax(0, 1fr));
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
7
7
  }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,50 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details-three-column',
7
8
  templateUrl: './details-three-column.component.html',
8
9
  styleUrls: ['./details-three-column.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsThreeColumnComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- showHighlightedData: boolean;
15
- highlightedDataArr: any;
16
-
17
- arFields$: any[] = [];
18
- arFields2$: any[] = [];
19
- arFields3$: any[] = [];
20
-
21
- propsToUse: any = {};
22
-
23
- override updateSelf() {
24
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
25
- this.showHighlightedData = rawMetaData?.showHighlightedData;
26
-
27
- if (this.showHighlightedData) {
28
- const highlightedData = rawMetaData?.highlightedData;
29
- this.highlightedDataArr = highlightedData.map(field => {
30
- field.config.displayMode = 'STACKED_LARGE_VAL';
31
-
32
- if (field.config.value === '@P .pyStatusWork') {
33
- field.type = 'TextInput';
34
- field.config.displayAsStatus = true;
35
- }
36
-
37
- return field;
38
- });
39
- }
40
-
41
- this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
42
- this.pConn$.setInheritedProp('readOnly', true);
43
-
44
- const kids = this.pConn$.getChildren() as any[];
45
- for (const kid of kids) {
46
- if (kids.indexOf(kid) == 0) {
47
- this.arFields$ = this.processDetailFields(kid);
48
- } else if (kids.indexOf(kid) == 1) {
49
- this.arFields2$ = this.processDetailFields(kid);
50
- } else {
51
- this.arFields3$ = this.processDetailFields(kid);
52
- }
53
- }
54
- }
55
- }
12
+ export class DetailsThreeColumnComponent extends DetailsTemplateBase {}