@pega/angular-sdk-overrides 0.25.13 → 0.26.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.
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +14 -2
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +25 -1
- package/lib/field/check-box/check-box.component.html +1 -1
- package/lib/field/embedded-data-multi/embedded-data-multi.component.html +3 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.scss +0 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.ts +173 -0
- package/lib/field/group/group.component.ts +15 -4
- package/lib/field/multiselect/multiselect.component.ts +22 -3
- package/lib/field/multiselect/utils.ts +5 -3
- package/lib/field/object-reference/object-reference.component.html +30 -15
- package/lib/field/object-reference/object-reference.component.ts +816 -94
- package/lib/field/selectable-card/selectable-card.component.html +1 -0
- package/lib/field/selectable-card/selectable-card.component.ts +31 -16
- package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
- package/lib/infra/Containers/flow-container/flow-container.component.ts +2 -3
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -3
- package/lib/infra/Containers/view-container/view-container.component.html +1 -1
- package/lib/infra/Containers/view-container/view-container.component.ts +5 -9
- package/lib/infra/assignment/assignment.component.ts +2 -7
- package/lib/infra/assignment-card/assignment-card.component.html +1 -0
- package/lib/infra/assignment-card/assignment-card.component.ts +2 -8
- package/lib/infra/defer-load/defer-load.component.ts +1 -2
- package/lib/infra/reference/reference.component.html +7 -1
- package/lib/infra/reference/reference.component.ts +64 -109
- package/lib/infra/region/region.component.ts +1 -3
- package/lib/infra/root-container/root-container.component.html +1 -0
- package/lib/infra/root-container/root-container.component.ts +2 -5
- package/lib/infra/view/view.component.ts +5 -8
- package/lib/template/banner-page/banner-page.component.ts +1 -2
- package/lib/template/base/details-template-base.ts +45 -0
- package/lib/template/base/form-template-base.ts +0 -2
- package/lib/template/case-summary/case-summary.component.ts +0 -6
- package/lib/template/case-view/case-view.component.html +1 -1
- package/lib/template/data-reference/search-form/search-form.component.ts +7 -1
- package/lib/template/default-form/default-form.component.html +1 -1
- package/lib/template/default-form/default-form.component.ts +1 -2
- package/lib/template/default-page/default-page.component.ts +1 -2
- package/lib/template/details/details.component.ts +1 -39
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +2 -4
- package/lib/template/details-one-column/details-one-column.component.ts +1 -3
- package/lib/template/details-three-column/details-three-column.component.ts +3 -5
- package/lib/template/details-two-column/details-two-column.component.ts +2 -4
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +2 -4
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +1 -0
- package/lib/template/field-group-template/field-group-template.component.ts +18 -4
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -10
- package/lib/template/one-column/one-column.component.html +3 -0
- package/lib/template/one-column-tab/one-column-tab.component.html +1 -0
- package/lib/template/page/page.component.html +1 -0
- package/lib/template/simple-table/simple-table.component.ts +11 -1
- package/lib/template/simple-table-manual/helpers.ts +2 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +4 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +27 -19
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +0 -3
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Directive, OnInit, OnDestroy, Injector, Input } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
2
3
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
3
4
|
|
|
4
5
|
@Directive()
|
|
5
6
|
export class DetailsTemplateBase implements OnInit, OnDestroy {
|
|
6
7
|
@Input() pConn$: typeof PConnect;
|
|
8
|
+
@Input() formGroup$: FormGroup;
|
|
7
9
|
|
|
8
10
|
// For interaction with AngularPConnect
|
|
9
11
|
protected angularPConnectData: AngularPConnectData = {};
|
|
@@ -64,4 +66,47 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
|
|
|
64
66
|
return pConnect.resolveConfigProps(pConnect.getRawMetadata());
|
|
65
67
|
});
|
|
66
68
|
}
|
|
69
|
+
|
|
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
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
return processedFields;
|
|
111
|
+
}
|
|
67
112
|
}
|
|
@@ -7,8 +7,6 @@ export class FormTemplateBase implements OnDestroy {
|
|
|
7
7
|
angularPConnectData: AngularPConnectData;
|
|
8
8
|
|
|
9
9
|
ngOnDestroy(): void {
|
|
10
|
-
PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
|
|
11
|
-
|
|
12
10
|
if (this.angularPConnectData?.unsubscribeFn) {
|
|
13
11
|
this.angularPConnectData.unsubscribeFn();
|
|
14
12
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges } from '@angular/core';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
3
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
4
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
5
|
import { Utils } from '@pega/angular-sdk-components';
|
|
7
6
|
|
|
@@ -52,11 +51,6 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
initComponent() {
|
|
55
|
-
// dereference the View in case the incoming pConn$ is a 'reference'
|
|
56
|
-
this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
57
|
-
|
|
58
|
-
// Then, continue on with other initialization
|
|
59
|
-
|
|
60
54
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps;
|
|
61
55
|
this.arChildren$ = this.pConn$.getChildren();
|
|
62
56
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<div class="psdk-case-view-divider"></div>
|
|
36
36
|
|
|
37
37
|
<div class="psdk-case-view-summary">
|
|
38
|
-
<component-mapper name="
|
|
38
|
+
<component-mapper name="reference" [props]="{ pConn$: caseSummaryPConn$ }"></component-mapper>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
41
|
<component-mapper
|
|
@@ -37,6 +37,7 @@ export class SearchFormComponent implements OnInit, OnChanges {
|
|
|
37
37
|
@Input() pConn$: typeof PConnect;
|
|
38
38
|
@Input() formGroup$: FormGroup;
|
|
39
39
|
@Input() searchSelectCacheKey;
|
|
40
|
+
@Input() type: string;
|
|
40
41
|
|
|
41
42
|
configProps$: any;
|
|
42
43
|
isInitialized = false;
|
|
@@ -58,7 +59,12 @@ export class SearchFormComponent implements OnInit, OnChanges {
|
|
|
58
59
|
this.isInitialized = true;
|
|
59
60
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
|
|
60
61
|
this.propsToUse = { ...this.pConn$.getInheritedProps() };
|
|
61
|
-
|
|
62
|
+
// When called from ObjectReference, pConn$ itself acts as deferLoadedTabs (no children[2])
|
|
63
|
+
if (this.type === 'ObjectReference') {
|
|
64
|
+
this.deferLoadedTabs = { getPConnect: () => this.pConn$ };
|
|
65
|
+
} else {
|
|
66
|
+
this.deferLoadedTabs = this.pConn$.getChildren()[2];
|
|
67
|
+
}
|
|
62
68
|
const cache: any = PCore.getNavigationUtils().getComponentCache(this.searchSelectCacheKey) ?? {};
|
|
63
69
|
const { selectedCategory } = cache;
|
|
64
70
|
const firstTabId = getFirstVisibleTabId(this.deferLoadedTabs, selectedCategory);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
|
|
3
3
|
</div>
|
|
4
4
|
<div [className]="divClass$">
|
|
5
|
-
<div *ngFor="let kid of arChildren$" [ngClass]="{ 'grid-column': kid.getPConnect().getComponentName() === '
|
|
5
|
+
<div *ngFor="let kid of arChildren$" [ngClass]="{ 'grid-column': kid.getPConnect().getComponentName() === 'reference' }">
|
|
6
6
|
<component-mapper
|
|
7
7
|
[name]="kid.getPConnect().getComponentName()"
|
|
8
8
|
[props]="{
|
|
@@ -2,7 +2,6 @@ import { Component, OnInit, Input, forwardRef, OnChanges } from '@angular/core';
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
5
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
6
5
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
6
|
import { TemplateUtils } from '@pega/angular-sdk-components';
|
|
8
7
|
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
@@ -91,7 +90,7 @@ export class DefaultFormComponent extends FormTemplateBase implements OnInit, On
|
|
|
91
90
|
// repoint children before getting templateArray
|
|
92
91
|
// Children may contain 'reference' component, so we need to
|
|
93
92
|
// normalize them
|
|
94
|
-
const children =
|
|
93
|
+
const children = kids[0].getPConnect().getChildren();
|
|
95
94
|
|
|
96
95
|
if (areViewsChanged(this.arChildren$, children)) {
|
|
97
96
|
this.arChildren$ = children;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
4
3
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
|
|
6
5
|
interface DefaultPageProps {
|
|
@@ -59,6 +58,6 @@ export class DefaultPageComponent implements OnInit, OnChanges {
|
|
|
59
58
|
this.backgroundImage = this.configProps$.backgroundImage;
|
|
60
59
|
this.enableBanner$ = this.configProps$.enableBanner;
|
|
61
60
|
|
|
62
|
-
this.arChildren$ =
|
|
61
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
63
62
|
}
|
|
64
63
|
}
|
|
@@ -35,45 +35,7 @@ export class DetailsComponent extends DetailsTemplateBase {
|
|
|
35
35
|
|
|
36
36
|
const kids = this.pConn$.getChildren() as any[];
|
|
37
37
|
for (const kid of kids) {
|
|
38
|
-
this.arFields$ =
|
|
39
|
-
const pKid = kid.getPConnect();
|
|
40
|
-
const fields = pKid.getChildren();
|
|
41
|
-
fields?.forEach(field => {
|
|
42
|
-
const thePConn = field.getPConnect();
|
|
43
|
-
const theCompType = thePConn.getComponentName().toLowerCase();
|
|
44
|
-
if (theCompType === 'reference' || theCompType === 'group') {
|
|
45
|
-
const configProps = thePConn.getConfigProps();
|
|
46
|
-
configProps.readOnly = true;
|
|
47
|
-
configProps.displayMode = 'DISPLAY_ONLY';
|
|
48
|
-
const propToUse = { ...thePConn.getInheritedProps() };
|
|
49
|
-
configProps.label = propToUse?.label;
|
|
50
|
-
const options = {
|
|
51
|
-
context: thePConn.getContextName(),
|
|
52
|
-
pageReference: thePConn.getPageReference(),
|
|
53
|
-
referenceList: thePConn.getReferenceList()
|
|
54
|
-
};
|
|
55
|
-
const viewContConfig = {
|
|
56
|
-
meta: {
|
|
57
|
-
...thePConn.getMetadata(),
|
|
58
|
-
type: theCompType,
|
|
59
|
-
config: configProps
|
|
60
|
-
},
|
|
61
|
-
options
|
|
62
|
-
};
|
|
63
|
-
const theViewCont = PCore.createPConnect(viewContConfig);
|
|
64
|
-
const data = {
|
|
65
|
-
type: theCompType,
|
|
66
|
-
pConn: theViewCont?.getPConnect()
|
|
67
|
-
};
|
|
68
|
-
this.arFields$.push(data);
|
|
69
|
-
} else {
|
|
70
|
-
const data = {
|
|
71
|
-
type: theCompType,
|
|
72
|
-
config: thePConn.getConfigProps()
|
|
73
|
-
};
|
|
74
|
-
this.arFields$.push(data);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
38
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
77
39
|
}
|
|
78
40
|
}
|
|
79
41
|
}
|
|
@@ -36,12 +36,10 @@ export class DetailsNarrowWideComponent extends DetailsTemplateBase {
|
|
|
36
36
|
|
|
37
37
|
const kids = this.pConn$.getChildren() as any[];
|
|
38
38
|
for (const kid of kids) {
|
|
39
|
-
const pKid = kid.getPConnect();
|
|
40
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
41
39
|
if (kids.indexOf(kid) == 0) {
|
|
42
|
-
this.arFields$ =
|
|
40
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
43
41
|
} else {
|
|
44
|
-
this.arFields2$ =
|
|
42
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
}
|
|
@@ -39,10 +39,8 @@ export class DetailsOneColumnComponent extends DetailsTemplateBase {
|
|
|
39
39
|
|
|
40
40
|
const kids = this.pConn$.getChildren() as any[];
|
|
41
41
|
for (const kid of kids) {
|
|
42
|
-
const pKid = kid.getPConnect();
|
|
43
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
44
42
|
if (kids.indexOf(kid) == 0) {
|
|
45
|
-
this.arFields$ =
|
|
43
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
}
|
|
@@ -43,14 +43,12 @@ export class DetailsThreeColumnComponent extends DetailsTemplateBase {
|
|
|
43
43
|
|
|
44
44
|
const kids = this.pConn$.getChildren() as any[];
|
|
45
45
|
for (const kid of kids) {
|
|
46
|
-
const pKid = kid.getPConnect();
|
|
47
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
48
46
|
if (kids.indexOf(kid) == 0) {
|
|
49
|
-
this.arFields$ =
|
|
47
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
50
48
|
} else if (kids.indexOf(kid) == 1) {
|
|
51
|
-
this.arFields2$ =
|
|
49
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
52
50
|
} else {
|
|
53
|
-
this.arFields3$ =
|
|
51
|
+
this.arFields3$ = this.processDetailFields(kid);
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
}
|
|
@@ -43,12 +43,10 @@ export class DetailsTwoColumnComponent extends DetailsTemplateBase {
|
|
|
43
43
|
|
|
44
44
|
const kids = this.pConn$.getChildren() as any[];
|
|
45
45
|
for (const kid of kids) {
|
|
46
|
-
const pKid = kid.getPConnect();
|
|
47
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
48
46
|
if (kids.indexOf(kid) == 0) {
|
|
49
|
-
this.arFields$ =
|
|
47
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
50
48
|
} else {
|
|
51
|
-
this.arFields2$ =
|
|
49
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
}
|
|
@@ -40,12 +40,10 @@ export class DetailsWideNarrowComponent extends DetailsTemplateBase {
|
|
|
40
40
|
|
|
41
41
|
const kids = this.pConn$.getChildren() as any[];
|
|
42
42
|
for (const kid of kids) {
|
|
43
|
-
const pKid = kid.getPConnect();
|
|
44
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
45
43
|
if (kids.indexOf(kid) == 0) {
|
|
46
|
-
this.arFields$ =
|
|
44
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
47
45
|
} else {
|
|
48
|
-
this.arFields2$ =
|
|
46
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
}
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
<mat-tab-group id="dynamic-tabs" mat-stretch-tabs="false" animationDuration="0">
|
|
5
5
|
<mat-tab *ngFor="let tab of tabsItems" [label]="tab.name">
|
|
6
6
|
<component-mapper name="View" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>
|
|
7
|
+
<component-mapper name="reference" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>
|
|
7
8
|
</mat-tab>
|
|
8
9
|
</mat-tab-group>
|
|
@@ -43,6 +43,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
43
43
|
readonlyMode: boolean;
|
|
44
44
|
contextClass: any;
|
|
45
45
|
heading: any;
|
|
46
|
+
headingPath: string[] = [];
|
|
46
47
|
children: any;
|
|
47
48
|
menuIconOverride$: any;
|
|
48
49
|
referenceListLength = signal<number | null>(null);
|
|
@@ -150,11 +151,24 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
150
151
|
return `${heading} ${index + 1}`;
|
|
151
152
|
};
|
|
152
153
|
|
|
153
|
-
getDynamicHeader = (item, index) => {
|
|
154
|
-
if (this.heading
|
|
155
|
-
|
|
154
|
+
getDynamicHeader = (item: Record<string, unknown>, index: number): string => {
|
|
155
|
+
if (this.heading) {
|
|
156
|
+
let value: any = item;
|
|
157
|
+
this.headingPath = this.heading.substring(1).split('.');
|
|
158
|
+
|
|
159
|
+
for (const key of this.headingPath) {
|
|
160
|
+
if (value === null || typeof value !== 'object' || !(key in value)) {
|
|
161
|
+
value = undefined;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
value = Reflect.get(value, key);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
168
|
+
return value.toString();
|
|
169
|
+
}
|
|
156
170
|
}
|
|
157
|
-
return
|
|
171
|
+
return `${PCore.getLocaleUtils().getLocaleValue('Row', 'SimpleTable')} ${index + 1}`;
|
|
158
172
|
};
|
|
159
173
|
|
|
160
174
|
addFieldGroupItem() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input, forwardRef
|
|
1
|
+
import { Component, OnInit, Input, forwardRef } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
4
4
|
import { buildFilterComponents } from '@pega/angular-sdk-components';
|
|
@@ -17,7 +17,7 @@ interface InlineDashboardPageProps {
|
|
|
17
17
|
styleUrls: ['./inline-dashboard-page.component.scss'],
|
|
18
18
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
19
19
|
})
|
|
20
|
-
export class InlineDashboardPageComponent implements OnInit
|
|
20
|
+
export class InlineDashboardPageComponent implements OnInit {
|
|
21
21
|
@Input() pConn$: typeof PConnect;
|
|
22
22
|
|
|
23
23
|
configProps$: InlineDashboardPageProps;
|
|
@@ -34,14 +34,6 @@ export class InlineDashboardPageComponent implements OnInit, OnChanges {
|
|
|
34
34
|
this.updateSelf();
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
38
|
-
const { pConn$ } = changes;
|
|
39
|
-
|
|
40
|
-
if (pConn$.previousValue && pConn$.previousValue !== pConn$.currentValue) {
|
|
41
|
-
this.updateSelf();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
37
|
updateSelf() {
|
|
46
38
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as InlineDashboardPageProps;
|
|
47
39
|
const arChildren$ = this.pConn$.getChildren();
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
<div *ngIf="kid.getPConnect().getRawMetadata()['type'] === 'View'">
|
|
6
6
|
<component-mapper name="View" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
|
|
7
7
|
</div>
|
|
8
|
+
<div *ngIf="kid.getPConnect().getRawMetadata()['type'] === 'reference'">
|
|
9
|
+
<component-mapper name="reference" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
|
|
10
|
+
</div>
|
|
8
11
|
<div *ngIf="kid.getPConnect().getRawMetadata()['type'] === 'CaseCreateStage'">
|
|
9
12
|
<component-mapper name="CaseCreateStage" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
|
|
10
13
|
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<div *ngFor="let kid of arChildren$">
|
|
3
3
|
<div [ngSwitch]="kid.getPConnect().getComponentName()">
|
|
4
4
|
<component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
5
|
+
<component-mapper *ngSwitchCase="'reference'" name="reference" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
5
6
|
<component-mapper *ngSwitchCase="'Region'" name="Region" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
6
7
|
<div *ngSwitchDefault>Page Missing: {{ kid.getPConnect().getComponentName() }}</div>
|
|
7
8
|
</div>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<div *ngFor="let kid of arChildren$">
|
|
6
6
|
<div [ngSwitch]="kid.getPConnect().getComponentName()">
|
|
7
7
|
<component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
8
|
+
<component-mapper *ngSwitchCase="'reference'" name="reference" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
8
9
|
<component-mapper *ngSwitchCase="'Region'" name="Region" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
9
10
|
<div *ngSwitchDefault>Page Missing: {{ kid.getPConnect().getComponentName() }}</div>
|
|
10
11
|
</div>
|
|
@@ -5,6 +5,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
5
5
|
import { Utils } from '@pega/angular-sdk-components';
|
|
6
6
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
7
|
import { buildMetaForListView, getContext } from '@pega/angular-sdk-components';
|
|
8
|
+
import { getReferenceList } from '@pega/angular-sdk-components';
|
|
8
9
|
|
|
9
10
|
interface SimpleTableProps {
|
|
10
11
|
// If any, enter additional props that only exist on this component
|
|
@@ -66,9 +67,12 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
|
|
|
66
67
|
// Should always check the bridge to see if the component should
|
|
67
68
|
// update itself (re-render)
|
|
68
69
|
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
69
|
-
|
|
70
|
+
const resolvedList = getReferenceList(this.pConn$);
|
|
71
|
+
this.pConn$.setReferenceList(resolvedList);
|
|
70
72
|
// ONLY call updateSelf when the component should update
|
|
71
73
|
if (bUpdateSelf) {
|
|
74
|
+
const resolvedList = getReferenceList(this.pConn$);
|
|
75
|
+
this.pConn$.setReferenceList(resolvedList);
|
|
72
76
|
this.updateSelf();
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -78,6 +82,11 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
|
|
|
78
82
|
// moved this from ngOnInit() and call this from there instead...
|
|
79
83
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as SimpleTableProps;
|
|
80
84
|
|
|
85
|
+
// Reset rendering state on every update
|
|
86
|
+
this.fieldGroupProps = null;
|
|
87
|
+
this.listViewProps = null;
|
|
88
|
+
this.refToPConnect = null;
|
|
89
|
+
|
|
81
90
|
if (this.configProps$.visibility != null) {
|
|
82
91
|
this.bVisible$ = this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
83
92
|
}
|
|
@@ -91,6 +100,7 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
|
|
|
91
100
|
}
|
|
92
101
|
if (multiRecordDisplayAs === 'fieldGroup') {
|
|
93
102
|
this.fieldGroupProps = { ...this.configProps$, contextClass };
|
|
103
|
+
return;
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
const {
|
|
@@ -354,8 +354,8 @@ export const filterDataByDate = (item, filterObj) => {
|
|
|
354
354
|
|
|
355
355
|
export const filterDataByCommonFields = (item, filterObj) => {
|
|
356
356
|
let bKeep = true;
|
|
357
|
-
const value = item[filterObj.ref].toLowerCase();
|
|
358
|
-
const filterValue = filterObj.containsFilterValue.toLowerCase();
|
|
357
|
+
const value = String(item?.[filterObj.ref] ?? '').toLowerCase();
|
|
358
|
+
const filterValue = String(filterObj.containsFilterValue ?? '').toLowerCase();
|
|
359
359
|
|
|
360
360
|
switch (filterObj.containsFilter) {
|
|
361
361
|
case 'contains':
|
|
@@ -130,6 +130,7 @@ td.mat-mdc-cell:last-child {
|
|
|
130
130
|
align-items: center;
|
|
131
131
|
height: 100%;
|
|
132
132
|
width: 100%;
|
|
133
|
+
background-color: var(--app-dialog-background-color);
|
|
133
134
|
position: fixed;
|
|
134
135
|
z-index: 999;
|
|
135
136
|
top: 0px;
|
|
@@ -140,10 +141,11 @@ td.mat-mdc-cell:last-child {
|
|
|
140
141
|
display: table;
|
|
141
142
|
margin: auto;
|
|
142
143
|
min-width: 150px;
|
|
143
|
-
|
|
144
|
+
background-color: var(--mat-sys-surface-container);
|
|
145
|
+
border: 1px solid var(--mat-sys-outline-variant);
|
|
144
146
|
border-radius: 10px;
|
|
145
147
|
padding: 20px;
|
|
146
|
-
box-shadow: 0 0 10px 3px var(--
|
|
148
|
+
box-shadow: 0 0 10px 3px var(--mat-sys-level3);
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
tr.mat-mdc-row {
|
|
@@ -92,7 +92,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
92
92
|
|
|
93
93
|
bVisible$ = true;
|
|
94
94
|
displayedColumns: string[] = [];
|
|
95
|
-
rowData
|
|
95
|
+
rowData = new MatTableDataSource<any>([]);
|
|
96
96
|
originalData: any[] = [];
|
|
97
97
|
processedFields: any[] = [];
|
|
98
98
|
fieldDefs: any[] = [];
|
|
@@ -159,6 +159,9 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
159
159
|
referenceListStr: any;
|
|
160
160
|
bUseSeparateViewForEdit: any;
|
|
161
161
|
editView: any;
|
|
162
|
+
editType: any;
|
|
163
|
+
defaultActionId: any;
|
|
164
|
+
editActionId: any;
|
|
162
165
|
settingsSvgIcon$: string;
|
|
163
166
|
|
|
164
167
|
isInitialized = false;
|
|
@@ -308,6 +311,10 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
308
311
|
this.defaultView = editModeConfig ? editModeConfig.defaultView : viewForAddAndEditModal;
|
|
309
312
|
this.bUseSeparateViewForEdit = editModeConfig ? editModeConfig.useSeparateViewForEdit : useSeparateViewForEdit;
|
|
310
313
|
this.editView = editModeConfig ? editModeConfig.editView : viewForEditModal;
|
|
314
|
+
this.editType = editModeConfig?.editType;
|
|
315
|
+
this.defaultActionId = this.editType === 'action' ? editModeConfig?.defaultAction : undefined;
|
|
316
|
+
this.editActionId =
|
|
317
|
+
this.editType === 'action' && editModeConfig?.useSeparateActionForEdit ? editModeConfig?.editAction : editModeConfig?.defaultAction;
|
|
311
318
|
const primaryFieldsViewIndex = resolvedFields.findIndex(field => field.config.value === 'pyPrimaryFields');
|
|
312
319
|
// const showDeleteButton = !this.readOnlyMode && !hideDeleteRow;
|
|
313
320
|
|
|
@@ -384,17 +391,15 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
384
391
|
}
|
|
385
392
|
|
|
386
393
|
initializeDefaultPageInstructions() {
|
|
387
|
-
if (this.
|
|
394
|
+
if (this.allowEditingInModal) {
|
|
395
|
+
this.pConn$.getListActions().initDefaultPageInstructions(
|
|
396
|
+
this.pConn$.getReferenceList(),
|
|
397
|
+
this.fieldDefs.filter(item => item.name).map(item => item.name)
|
|
398
|
+
);
|
|
399
|
+
} else if (this.isInitialized) {
|
|
388
400
|
this.isInitialized = false;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
this.pConn$.getReferenceList(),
|
|
392
|
-
this.fieldDefs.filter(item => item.name).map(item => item.name)
|
|
393
|
-
);
|
|
394
|
-
} else {
|
|
395
|
-
// @ts-ignore - An argument for 'propertyNames' was not provided.
|
|
396
|
-
this.pConn$.getListActions().initDefaultPageInstructions(this.pConn$.getReferenceList());
|
|
397
|
-
}
|
|
401
|
+
// @ts-ignore - An argument for 'propertyNames' was not provided.
|
|
402
|
+
this.pConn$.getListActions().initDefaultPageInstructions(this.pConn$.getReferenceList());
|
|
398
403
|
}
|
|
399
404
|
}
|
|
400
405
|
|
|
@@ -923,7 +928,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
923
928
|
const refKeys: string[] = inColKey.split('.');
|
|
924
929
|
let valBuilder = inRowData;
|
|
925
930
|
for (const key of refKeys) {
|
|
926
|
-
valBuilder = valBuilder[key];
|
|
931
|
+
valBuilder = valBuilder[key] ? valBuilder[key] : valBuilder;
|
|
927
932
|
}
|
|
928
933
|
return valBuilder;
|
|
929
934
|
}
|
|
@@ -958,17 +963,18 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
958
963
|
}
|
|
959
964
|
|
|
960
965
|
addRecord() {
|
|
961
|
-
if (this.allowEditingInModal && this.defaultView) {
|
|
966
|
+
if (this.allowEditingInModal && (this.defaultView || this.defaultActionId)) {
|
|
962
967
|
this.pConn$
|
|
963
968
|
.getActionsApi()
|
|
964
|
-
// @ts-expect-error
|
|
965
969
|
.openEmbeddedDataModal(
|
|
966
970
|
this.defaultView,
|
|
967
971
|
this.pConn$ as any,
|
|
968
972
|
this.referenceListStr,
|
|
969
973
|
this.referenceList.length,
|
|
970
974
|
PCore.getConstants().RESOURCE_STATUS.CREATE,
|
|
971
|
-
this.targetClassLabel
|
|
975
|
+
this.targetClassLabel,
|
|
976
|
+
this.editType,
|
|
977
|
+
this.defaultActionId
|
|
972
978
|
);
|
|
973
979
|
} else {
|
|
974
980
|
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
|
|
@@ -981,16 +987,18 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
981
987
|
|
|
982
988
|
editRecord(data, index) {
|
|
983
989
|
if (data) {
|
|
990
|
+
const viewForEdit = this.bUseSeparateViewForEdit ? this.editView : this.defaultView;
|
|
984
991
|
this.pConn$
|
|
985
992
|
.getActionsApi()
|
|
986
|
-
// @ts-expect-error
|
|
987
993
|
.openEmbeddedDataModal(
|
|
988
|
-
|
|
994
|
+
viewForEdit,
|
|
989
995
|
this.pConn$ as any,
|
|
990
996
|
this.referenceListStr,
|
|
991
997
|
index,
|
|
992
998
|
PCore.getConstants().RESOURCE_STATUS.UPDATE,
|
|
993
|
-
this.targetClassLabel
|
|
999
|
+
this.targetClassLabel,
|
|
1000
|
+
this.editType,
|
|
1001
|
+
this.editActionId
|
|
994
1002
|
);
|
|
995
1003
|
}
|
|
996
1004
|
}
|
|
@@ -1018,7 +1026,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
1018
1026
|
const isDatapage = referenceListData.startsWith('D_');
|
|
1019
1027
|
const pageReferenceValue = isDatapage
|
|
1020
1028
|
? `${referenceListData}[${index}]`
|
|
1021
|
-
: `${this.pConn$.getPageReference()}${referenceListData}[${index}]`;
|
|
1029
|
+
: `${this.pConn$.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
|
|
1022
1030
|
const config = {
|
|
1023
1031
|
meta: item,
|
|
1024
1032
|
options: {
|
|
@@ -22,9 +22,6 @@ export class WideNarrowPageComponent implements OnInit, OnDestroy {
|
|
|
22
22
|
constructor(private angularPConnect: AngularPConnectService) {}
|
|
23
23
|
|
|
24
24
|
ngOnInit(): void {
|
|
25
|
-
// normalize the pConn$ in case the incoming pConn$ is a 'reference'
|
|
26
|
-
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
27
|
-
|
|
28
25
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
29
26
|
|
|
30
27
|
// this.updateSelf();
|