@pega/angular-sdk-overrides 0.25.12 → 0.25.14
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 +1 -1
- package/lib/field/group/group.component.ts +1 -2
- 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 +1 -6
- package/lib/template/banner-page/banner-page.component.ts +1 -2
- 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/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/dynamic-tabs/dynamic-tabs.component.html +1 -0
- 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 +5 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +12 -4
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +0 -3
- package/package.json +1 -1
package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
<ng-template #noGroup>
|
|
7
7
|
<div *ngIf="field.type === 'reference'; else showDetails">
|
|
8
|
-
<component-mapper name="
|
|
8
|
+
<component-mapper name="reference" [props]="{ pConn$: field.pConn }"></component-mapper>
|
|
9
9
|
</div>
|
|
10
10
|
</ng-template>
|
|
11
11
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import { Component, forwardRef, Input, OnInit } from '@angular/core';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
6
5
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
6
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
@@ -64,7 +63,7 @@ export class GroupComponent implements OnInit {
|
|
|
64
63
|
*/
|
|
65
64
|
updateSelf(): void {
|
|
66
65
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as GroupProps;
|
|
67
|
-
this.arChildren$ =
|
|
66
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
68
67
|
this.visibility$ = this.configProps$.visibility;
|
|
69
68
|
this.showHeading$ = this.configProps$.showHeading;
|
|
70
69
|
this.heading$ = this.configProps$.heading;
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
</mat-card>
|
|
40
40
|
</div>
|
|
41
41
|
<div *ngIf="bShowBanner && bShowConfirm && confirm_pconn">
|
|
42
|
-
<component-mapper name="
|
|
42
|
+
<component-mapper name="reference" [props]="{ formGroup$, pConn$: confirm_pconn }"></component-mapper>
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
@@ -4,7 +4,6 @@ import { FormBuilder, FormGroup } from '@angular/forms';
|
|
|
4
4
|
import { MatCardModule } from '@angular/material/card';
|
|
5
5
|
import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
|
|
6
6
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
7
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
8
7
|
import { Utils } from '@pega/angular-sdk-components';
|
|
9
8
|
import { getToDoAssignments, hasAssignments, showBanner } from './helpers';
|
|
10
9
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
@@ -415,7 +414,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
|
|
|
415
414
|
// let kid = this.pConn$.getChildren()[0];
|
|
416
415
|
|
|
417
416
|
// kid.getPConnect() can be a Reference component. So normalize it just in case
|
|
418
|
-
// let todoKid =
|
|
417
|
+
// let todoKid = kid.getPConnect().getChildren()[0];
|
|
419
418
|
|
|
420
419
|
// this.todo_pConn$ = todoKid.getPConnect();
|
|
421
420
|
|
|
@@ -528,7 +527,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
|
|
|
528
527
|
// the View if it is a Reference component. And need to pass in the getPConnect
|
|
529
528
|
// to have normalize do a c11Env createComponent (that makes sure options.hasForm
|
|
530
529
|
// is passed along to all the component's children)
|
|
531
|
-
const normalizedConfigObject =
|
|
530
|
+
const normalizedConfigObject = configObject.getPConnect();
|
|
532
531
|
// We want the children to be the PConnect itself, not the result of calling getPConnect(),
|
|
533
532
|
// So need to get the PConnect of the normalized component we just created...
|
|
534
533
|
const normalizedConfigObjectAsPConnect = normalizedConfigObject.getComponent();
|
|
@@ -6,7 +6,6 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
6
6
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
7
7
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
8
8
|
import { getBanners } from '@pega/angular-sdk-components';
|
|
9
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
|
|
@@ -238,8 +237,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
|
|
|
238
237
|
const bIsRefComponent = this.checkIfRefComponent(newComp);
|
|
239
238
|
|
|
240
239
|
if (bIsRefComponent) {
|
|
241
|
-
|
|
242
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(newPConn.getChildren());
|
|
240
|
+
this.arChildren$ = [newComp.getComponent()];
|
|
243
241
|
} else {
|
|
244
242
|
// update children with new view's children
|
|
245
243
|
this.arChildren$ = newComp.getChildren();
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
</ng-template>
|
|
27
27
|
</div>
|
|
28
28
|
<ng-template #isReference>
|
|
29
|
-
<component-mapper name="
|
|
29
|
+
<component-mapper name="reference" [props]="{ pConn$: viewPConn$, formGroup$, displayOnlyFA$ }"></component-mapper>
|
|
30
30
|
</ng-template>
|
|
31
31
|
</div>
|
|
@@ -3,7 +3,6 @@ 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 { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
6
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
7
6
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
8
7
|
import { configureBrowserBookmark } from './helper';
|
|
9
8
|
|
|
@@ -73,8 +72,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
|
|
|
73
72
|
// Then, continue on with other initialization
|
|
74
73
|
|
|
75
74
|
// this.configProps$ = this.pConn$.getConfigProps();
|
|
76
|
-
|
|
77
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
75
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
78
76
|
|
|
79
77
|
this.buildName$ = this.buildName();
|
|
80
78
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ViewContainerProps;
|
|
@@ -146,8 +144,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
|
|
|
146
144
|
// *** DON'T call updateSelf in ngInit!! ***
|
|
147
145
|
|
|
148
146
|
if (this.arChildren$ == null) {
|
|
149
|
-
|
|
150
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
147
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
// routingInfo was added as component prop in populateAdditionalProps
|
|
@@ -222,12 +219,12 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
|
|
|
222
219
|
|
|
223
220
|
/*
|
|
224
221
|
|
|
225
|
-
const theDereferencedView =
|
|
222
|
+
const theDereferencedView = newComp;
|
|
226
223
|
const newConfigProps = theDereferencedView.getConfigProps();
|
|
227
224
|
|
|
228
225
|
// children may have a 'reference' so normalize the children arra
|
|
229
226
|
|
|
230
|
-
const theDereferencedViewChildren =
|
|
227
|
+
const theDereferencedViewChildren = theDereferencedView.getChildren();
|
|
231
228
|
this.templateName$ = ('template' in newConfigProps) ? newConfigProps["template"] : "";
|
|
232
229
|
this.title$ = ('title' in newConfigProps) ? newConfigProps["title"] : "";
|
|
233
230
|
this.arChildren$ = theDereferencedViewChildren;
|
|
@@ -244,8 +241,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
|
|
|
244
241
|
this.templateName$ = newConfigProps.template || '';
|
|
245
242
|
this.title$ = newConfigProps.title || '';
|
|
246
243
|
// update children with new view's children
|
|
247
|
-
|
|
248
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(newComp.getChildren());
|
|
244
|
+
this.arChildren$ = newComp.getChildren();
|
|
249
245
|
}
|
|
250
246
|
});
|
|
251
247
|
}
|
|
@@ -7,7 +7,6 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
7
7
|
import { ErrorMessagesService } from '@pega/angular-sdk-components';
|
|
8
8
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
9
9
|
import { BannerService } from '@pega/angular-sdk-components';
|
|
10
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
11
10
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
12
11
|
|
|
13
12
|
function getRefreshProps(refreshConditions) {
|
|
@@ -149,8 +148,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
149
148
|
|
|
150
149
|
this.registerForRefresh();
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
151
|
+
this.newPConn$ = this.pConn$;
|
|
154
152
|
|
|
155
153
|
if (this.arChildren$) {
|
|
156
154
|
this.createButtons();
|
|
@@ -158,9 +156,7 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
158
156
|
}
|
|
159
157
|
|
|
160
158
|
initComponent() {
|
|
161
|
-
|
|
162
|
-
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
163
|
-
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
159
|
+
this.newPConn$ = this.pConn$;
|
|
164
160
|
|
|
165
161
|
// prevent re-intializing with flowContainer update unless an action is taken
|
|
166
162
|
this.bReInit = false;
|
|
@@ -203,7 +199,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
203
199
|
this.cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);
|
|
204
200
|
this.approveCase = actionsAPI.approveCase?.bind(actionsAPI);
|
|
205
201
|
this.rejectCase = actionsAPI.rejectCase?.bind(actionsAPI);
|
|
206
|
-
|
|
207
202
|
if (this.arChildren$) {
|
|
208
203
|
this.createButtons();
|
|
209
204
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<div *ngFor="let kid of childrenArray" class="psdk-assignment-card-child">
|
|
3
3
|
<div [ngSwitch]="kid.getPConnect().getComponentName()">
|
|
4
4
|
<component-mapper *ngSwitchCase="'View'" name="View" [props]="{ formGroup$, pConn$: kid.getPConnect() }"></component-mapper>
|
|
5
|
+
<component-mapper *ngSwitchCase="'reference'" name="reference" [props]="{ formGroup$, pConn$: kid.getPConnect() }"></component-mapper>
|
|
5
6
|
<component-mapper
|
|
6
7
|
*ngSwitchCase="'CaseCreateStage'"
|
|
7
8
|
name="CaseCreateStage"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, OnInit, Input, Output, EventEmitter, forwardRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
5
|
|
|
7
6
|
function isChildrenUpdated(children) {
|
|
@@ -34,18 +33,13 @@ export class AssignmentCardComponent implements OnInit, OnChanges {
|
|
|
34
33
|
@Output() actionButtonClick: EventEmitter<any> = new EventEmitter();
|
|
35
34
|
|
|
36
35
|
ngOnInit(): void {
|
|
37
|
-
|
|
38
|
-
// normalize them
|
|
39
|
-
this.childrenArray = ReferenceComponent.normalizePConnArray(this.arChildren$);
|
|
36
|
+
this.childrenArray = this.arChildren$;
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
ngOnChanges(changes: SimpleChanges) {
|
|
43
|
-
// Children may contain 'reference' component, so we need to
|
|
44
|
-
// normalize them
|
|
45
|
-
|
|
46
40
|
const { arChildren$ } = changes;
|
|
47
41
|
if (isChildrenUpdated(arChildren$)) {
|
|
48
|
-
this.childrenArray =
|
|
42
|
+
this.childrenArray = this.arChildren$;
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
45
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
|
|
4
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
5
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
7
6
|
|
|
@@ -127,7 +126,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
127
126
|
const configObject = PCore.createPConnect(config);
|
|
128
127
|
configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
129
128
|
|
|
130
|
-
this.childComponentPConnect =
|
|
129
|
+
this.childComponentPConnect = configObject.getPConnect();
|
|
131
130
|
|
|
132
131
|
if (this.deferLoadId) {
|
|
133
132
|
PCore.getDeferLoadManager().stop(this.deferLoadId, this.pConn$.getContextName());
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
<div *ngIf="viewComponentPConnect">
|
|
2
|
+
<component-mapper
|
|
3
|
+
[name]="viewComponentPConnect.getComponentName()"
|
|
4
|
+
[props]="{ pConn$: viewComponentPConnect, formGroup$ }"
|
|
5
|
+
errorMsg="Reference Missing: {{ viewComponentPConnect.getComponentName() }}"
|
|
6
|
+
></component-mapper>
|
|
7
|
+
</div>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
4
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
|
|
@@ -9,45 +12,74 @@ import { Component } from '@angular/core';
|
|
|
9
12
|
selector: 'app-reference',
|
|
10
13
|
templateUrl: './reference.component.html',
|
|
11
14
|
styleUrls: ['./reference.component.scss'],
|
|
12
|
-
|
|
15
|
+
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
13
16
|
})
|
|
14
|
-
export class ReferenceComponent {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
export class ReferenceComponent implements OnInit, OnDestroy, OnChanges {
|
|
18
|
+
@Input() pConn$: typeof PConnect;
|
|
19
|
+
@Input() formGroup$: any;
|
|
20
|
+
|
|
21
|
+
angularPConnectData: AngularPConnectData = {};
|
|
22
|
+
viewComponentPConnect: typeof PConnect | null = null;
|
|
23
|
+
|
|
24
|
+
constructor(private angularPConnect: AngularPConnectService) {}
|
|
25
|
+
|
|
26
|
+
ngOnInit(): void {
|
|
27
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
28
|
+
this.updateSelf();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ngOnDestroy(): void {
|
|
32
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
33
|
+
this.angularPConnectData.unsubscribeFn();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
38
|
+
const { pConn$ } = changes;
|
|
39
|
+
if (!pConn$.firstChange && pConn$.previousValue !== pConn$.currentValue) {
|
|
40
|
+
this.checkAndUpdate();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onStateChange() {
|
|
45
|
+
this.checkAndUpdate();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Should always check the bridge to see if the component should update itself (re-render)
|
|
49
|
+
checkAndUpdate() {
|
|
50
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
51
|
+
|
|
52
|
+
// ONLY call updateSelf when the component should update
|
|
53
|
+
if (bUpdateSelf) {
|
|
54
|
+
this.updateSelf();
|
|
30
55
|
}
|
|
56
|
+
}
|
|
31
57
|
|
|
32
|
-
|
|
33
|
-
const
|
|
58
|
+
updateSelf() {
|
|
59
|
+
const pConnect = this.pConn$;
|
|
60
|
+
|
|
61
|
+
const resolvedConfigProps = pConnect.resolveConfigProps(pConnect.getConfigProps()) as {
|
|
62
|
+
visibility?: boolean;
|
|
63
|
+
context?: string;
|
|
64
|
+
readOnly?: boolean;
|
|
65
|
+
displayMode?: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const { visibility = true, context = '', readOnly = false, displayMode = '' } = resolvedConfigProps;
|
|
69
|
+
|
|
70
|
+
const referenceConfig = { ...pConnect.getComponentConfig() };
|
|
34
71
|
|
|
35
|
-
// Remove properties that should not be inherited by the referenced view
|
|
36
|
-
// (Maintained from React SDK implementation)
|
|
37
72
|
delete referenceConfig?.name;
|
|
38
73
|
delete referenceConfig?.type;
|
|
39
74
|
delete referenceConfig?.visibility;
|
|
40
75
|
|
|
41
|
-
|
|
42
|
-
const viewMetadata = inPConn.getReferencedView();
|
|
76
|
+
const viewMetadata: any = pConnect.getReferencedView();
|
|
43
77
|
|
|
44
|
-
// Return null if view metadata is not found
|
|
45
78
|
if (!viewMetadata) {
|
|
46
|
-
|
|
47
|
-
return
|
|
79
|
+
this.viewComponentPConnect = null;
|
|
80
|
+
return;
|
|
48
81
|
}
|
|
49
82
|
|
|
50
|
-
// Create the view object by merging metadata with reference config
|
|
51
83
|
const viewObject = {
|
|
52
84
|
...viewMetadata,
|
|
53
85
|
config: {
|
|
@@ -56,101 +88,24 @@ export class ReferenceComponent {
|
|
|
56
88
|
}
|
|
57
89
|
};
|
|
58
90
|
|
|
59
|
-
//
|
|
60
|
-
const
|
|
61
|
-
const { visibility = true, context, readOnly = false, displayMode = '' } = resolvedConfigProps;
|
|
62
|
-
|
|
63
|
-
// Log debug information if logging is enabled
|
|
64
|
-
if (ReferenceComponent.bLogging) {
|
|
65
|
-
console.log(`Reference: about to call createComponent with pageReference: context: ${inPConn.getContextName()}`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Create the component with the right context
|
|
69
|
-
const viewComponent = inPConn.createComponent(viewObject, null, null, {
|
|
91
|
+
// @ts-expect-error - createComponent expects string but null is passed for unused parameters (matches React SDK pattern)
|
|
92
|
+
const viewComponent: any = pConnect.createComponent(viewObject, null, null, {
|
|
70
93
|
pageReference: context && context.startsWith('@CLASS') ? '' : context
|
|
71
94
|
});
|
|
72
95
|
|
|
73
96
|
if (referenceConfig.inheritedProps && referenceConfig.inheritedProps.length > 0) {
|
|
74
|
-
const inheritedProps =
|
|
97
|
+
const inheritedProps = pConnect.getInheritedProps();
|
|
75
98
|
referenceConfig.inheritedProps = Object.keys(inheritedProps).map(prop => ({ prop, value: inheritedProps[prop] }));
|
|
76
99
|
}
|
|
77
100
|
|
|
78
|
-
// Get the PConnect object from the created component
|
|
79
101
|
const newCompPConnect = viewComponent.getPConnect();
|
|
80
102
|
|
|
81
|
-
// Set inherited configuration on the new component
|
|
82
103
|
newCompPConnect.setInheritedConfig({
|
|
83
104
|
...referenceConfig,
|
|
84
105
|
readOnly,
|
|
85
106
|
displayMode
|
|
86
107
|
});
|
|
87
108
|
|
|
88
|
-
|
|
89
|
-
if (ReferenceComponent.bLogging) {
|
|
90
|
-
console.log(
|
|
91
|
-
`Angular Reference component: createFullReferencedViewFromRef -> newCompPConnect configProps: ${JSON.stringify(
|
|
92
|
-
newCompPConnect.getConfigProps()
|
|
93
|
-
)}`
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Return the component if it should be visible, otherwise null
|
|
98
|
-
return visibility !== false ? newCompPConnect : null;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Normalizes a PConn object that might be a 'reference'.
|
|
103
|
-
* If the incoming PConn is a reference, returns its dereferenced View.
|
|
104
|
-
* Otherwise, returns the passed in PConn unchanged.
|
|
105
|
-
*
|
|
106
|
-
* @param inPConn - A PConn object (ex: { getPConnect() } or direct PConnect)
|
|
107
|
-
* @returns The normalized PConn object with references resolved
|
|
108
|
-
*/
|
|
109
|
-
static normalizePConn(inPConn: any): any {
|
|
110
|
-
// Early return for null or undefined input
|
|
111
|
-
if (!inPConn) {
|
|
112
|
-
return inPConn;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Determine if we have an object with getPConnect method or direct PConnect
|
|
116
|
-
const hasGetPConnectMethod = !!inPConn.getPConnect;
|
|
117
|
-
|
|
118
|
-
// Get the component name in the appropriate way based on the object type
|
|
119
|
-
const componentName = hasGetPConnectMethod ? inPConn.getPConnect().getComponentName() : inPConn.getComponentName();
|
|
120
|
-
|
|
121
|
-
// Only process if this is a reference component
|
|
122
|
-
if (componentName === 'reference') {
|
|
123
|
-
if (hasGetPConnectMethod) {
|
|
124
|
-
// For objects with getPConnect method, get the referenced view and its component
|
|
125
|
-
const refViewPConn = this.createFullReferencedViewFromRef(inPConn.getPConnect());
|
|
126
|
-
return refViewPConn?.getComponent();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// For direct PConnect objects, just create the referenced view
|
|
130
|
-
return this.createFullReferencedViewFromRef(inPConn);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Not a reference component, return unchanged
|
|
134
|
-
return inPConn;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Normalizes an array of PConn objects by replacing any 'reference' components
|
|
139
|
-
* with their referenced views.
|
|
140
|
-
*
|
|
141
|
-
* @param inPConnArray - Array of PConn objects to normalize
|
|
142
|
-
* @returns Normalized array with references resolved, or empty array if input is invalid
|
|
143
|
-
*/
|
|
144
|
-
static normalizePConnArray(inPConnArray: any[]): any[] {
|
|
145
|
-
// Handle null, undefined, or empty array case
|
|
146
|
-
if (!inPConnArray?.length) {
|
|
147
|
-
return inPConnArray || [];
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Process array: normalize each item and filter out any null/undefined results
|
|
151
|
-
const normalizedArray = inPConnArray.map(child => ReferenceComponent.normalizePConn(child)).filter(Boolean);
|
|
152
|
-
|
|
153
|
-
// Ensure we always return an array (even if filter removes all items)
|
|
154
|
-
return normalizedArray || [];
|
|
109
|
+
this.viewComponentPConnect = visibility !== false ? newCompPConnect : null;
|
|
155
110
|
}
|
|
156
111
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
5
|
|
|
7
6
|
@Component({
|
|
@@ -30,7 +29,6 @@ export class RegionComponent implements OnInit, OnChanges {
|
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
updateSelf() {
|
|
33
|
-
|
|
34
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
32
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
35
33
|
}
|
|
36
34
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
name="ViewContainer"
|
|
11
11
|
[props]="{ pConn$: viewContainerPConn$, displayOnlyFA$ }"
|
|
12
12
|
></component-mapper>
|
|
13
|
+
<component-mapper *ngSwitchCase="'reference'" name="reference" [props]="{ pConn$ }"></component-mapper>
|
|
13
14
|
<div *ngSwitchDefault>{{ localizedVal('RootContainer Missing: ' + componentName$, localeCategory) }}.</div>
|
|
14
15
|
</div>
|
|
15
16
|
</div>
|
|
@@ -5,7 +5,6 @@ import { interval, Subscription } from 'rxjs';
|
|
|
5
5
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
6
6
|
import { ServerConfigService } from '@pega/angular-sdk-components';
|
|
7
7
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
8
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
9
8
|
import { PreviewViewContainerComponent } from '@pega/angular-sdk-components';
|
|
10
9
|
import { ModalViewContainerComponent } from '@pega/angular-sdk-components';
|
|
11
10
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
@@ -39,7 +38,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
39
38
|
// For interaction with AngularPConnect
|
|
40
39
|
angularPConnectData: AngularPConnectData = {};
|
|
41
40
|
|
|
42
|
-
componentName
|
|
41
|
+
componentName$: any;
|
|
43
42
|
bIsProgress$ = false;
|
|
44
43
|
|
|
45
44
|
// preview and modalview pConn
|
|
@@ -140,9 +139,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
140
139
|
setTimeout(() => {
|
|
141
140
|
// makes sure Angular tracks these changes
|
|
142
141
|
this.ngZone.run(() => {
|
|
143
|
-
|
|
144
|
-
// normalize it to get the referencedView if that's the case
|
|
145
|
-
const theNewPConn = ReferenceComponent.normalizePConn(rootObject.getPConnect());
|
|
142
|
+
const theNewPConn = rootObject.getPConnect();
|
|
146
143
|
// update ComponentName$ before we update pConn$ to make sure they're in sync
|
|
147
144
|
// when rendering...
|
|
148
145
|
this.componentName$ = theNewPConn.getComponentName();
|
|
@@ -4,7 +4,6 @@ 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
6
|
import { getAllFields } from '@pega/angular-sdk-components';
|
|
7
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
8
7
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
9
8
|
|
|
10
9
|
const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs', 'ListView'];
|
|
@@ -145,9 +144,6 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
145
144
|
|
|
146
145
|
// debugger;
|
|
147
146
|
|
|
148
|
-
// normalize this.pConn$ in case it contains a 'reference'
|
|
149
|
-
this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
150
|
-
|
|
151
147
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ViewProps;
|
|
152
148
|
this.inheritedProps$ = this.pConn$.getInheritedProps();
|
|
153
149
|
|
|
@@ -160,8 +156,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
160
156
|
// label & showLabel within inheritedProps takes precedence over configProps
|
|
161
157
|
this.label$ = this.inheritedProps$.label || this.configProps$.label || '';
|
|
162
158
|
this.showLabel$ = this.inheritedProps$.showLabel || this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
|
|
163
|
-
|
|
164
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
159
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
165
160
|
this.visibility$ = this.configProps$.visibility ?? this.visibility$;
|
|
166
161
|
|
|
167
162
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Component, Input, OnChanges, OnInit, SimpleChanges, forwardRef } from '@angular/core';
|
|
2
2
|
|
|
3
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
4
3
|
import { CommonModule } from '@angular/common';
|
|
5
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
5
|
|
|
@@ -59,6 +58,6 @@ export class BannerPageComponent implements OnInit, OnChanges {
|
|
|
59
58
|
this.backgroundImage = this.configProps$.backgroundImage;
|
|
60
59
|
|
|
61
60
|
// The children may contain 'reference' components, so normalize the children...
|
|
62
|
-
this.arChildren$ =
|
|
61
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
63
62
|
}
|
|
64
63
|
}
|
|
@@ -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
|
|
@@ -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
|
}
|
|
@@ -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>
|
|
@@ -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
|
}
|
|
@@ -159,12 +159,15 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
159
159
|
referenceListStr: any;
|
|
160
160
|
bUseSeparateViewForEdit: any;
|
|
161
161
|
editView: any;
|
|
162
|
+
defaultActionId: any;
|
|
163
|
+
editActionId: any;
|
|
162
164
|
settingsSvgIcon$: string;
|
|
163
165
|
|
|
164
166
|
isInitialized = false;
|
|
165
167
|
targetClassLabel: string;
|
|
166
168
|
localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
167
169
|
localeCategory = 'SimpleTable';
|
|
170
|
+
editType: any;
|
|
168
171
|
constructor(
|
|
169
172
|
private angularPConnect: AngularPConnectService,
|
|
170
173
|
public utils: Utils,
|
|
@@ -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
|
|
|
@@ -958,17 +965,18 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
958
965
|
}
|
|
959
966
|
|
|
960
967
|
addRecord() {
|
|
961
|
-
if (this.allowEditingInModal && this.defaultView) {
|
|
968
|
+
if (this.allowEditingInModal && (this.defaultView || this.defaultActionId)) {
|
|
962
969
|
this.pConn$
|
|
963
970
|
.getActionsApi()
|
|
964
|
-
// @ts-expect-error
|
|
965
971
|
.openEmbeddedDataModal(
|
|
966
972
|
this.defaultView,
|
|
967
973
|
this.pConn$ as any,
|
|
968
974
|
this.referenceListStr,
|
|
969
975
|
this.referenceList.length,
|
|
970
976
|
PCore.getConstants().RESOURCE_STATUS.CREATE,
|
|
971
|
-
this.targetClassLabel
|
|
977
|
+
this.targetClassLabel,
|
|
978
|
+
this.editType,
|
|
979
|
+
this.defaultActionId
|
|
972
980
|
);
|
|
973
981
|
} else {
|
|
974
982
|
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
|
|
@@ -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();
|