@pega/angular-sdk-overrides 25.1.11 → 25.1.13
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/date-time/date-time.component.html +1 -1
- package/lib/field/group/group.component.ts +1 -2
- package/lib/infra/Containers/flow-container/flow-container.component.html +2 -2
- package/lib/infra/Containers/flow-container/flow-container.component.ts +16 -10
- package/lib/infra/Containers/flow-container/helpers.ts +1 -1
- package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +2 -3
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +3 -6
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +2 -3
- package/lib/infra/Containers/view-container/view-container.component.html +1 -1
- package/lib/infra/Containers/view-container/view-container.component.ts +7 -12
- package/lib/infra/assignment/assignment.component.ts +3 -8
- 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 +3 -5
- package/lib/infra/reference/reference.component.html +7 -1
- package/lib/infra/reference/reference.component.ts +66 -112
- 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 +4 -8
- package/lib/infra/view/view.component.ts +3 -9
- 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/data-reference/data-reference.component.ts +27 -18
- 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/field-group-template/field-group-template.component.html +1 -1
- package/lib/template/field-group-template/field-group-template.component.scss +1 -0
- package/lib/template/field-group-template/field-group-template.component.ts +24 -19
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -10
- package/lib/template/list-view/list-view.component.html +2 -2
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.html +1 -1
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +27 -0
- 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/helpers.ts +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +13 -5
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +0 -3
- package/package.json +1 -1
|
@@ -5,15 +5,13 @@ 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';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
* WARNING:
|
|
15
|
-
*
|
|
16
|
-
* is totally at your own risk.
|
|
13
|
+
* 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.
|
|
14
|
+
* You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
|
|
17
15
|
*/
|
|
18
16
|
|
|
19
17
|
const options = { context: 'app' };
|
|
@@ -40,7 +38,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
40
38
|
// For interaction with AngularPConnect
|
|
41
39
|
angularPConnectData: AngularPConnectData = {};
|
|
42
40
|
|
|
43
|
-
componentName
|
|
41
|
+
componentName$: any;
|
|
44
42
|
bIsProgress$ = false;
|
|
45
43
|
|
|
46
44
|
// preview and modalview pConn
|
|
@@ -141,9 +139,7 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
141
139
|
setTimeout(() => {
|
|
142
140
|
// makes sure Angular tracks these changes
|
|
143
141
|
this.ngZone.run(() => {
|
|
144
|
-
|
|
145
|
-
// normalize it to get the referencedView if that's the case
|
|
146
|
-
const theNewPConn = ReferenceComponent.normalizePConn(rootObject.getPConnect());
|
|
142
|
+
const theNewPConn = rootObject.getPConnect();
|
|
147
143
|
// update ComponentName$ before we update pConn$ to make sure they're in sync
|
|
148
144
|
// when rendering...
|
|
149
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'];
|
|
@@ -24,9 +23,8 @@ function isDetailsTemplate(template) {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
* WARNING:
|
|
28
|
-
*
|
|
29
|
-
* is totally at your own risk.
|
|
26
|
+
* 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.
|
|
27
|
+
* You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
|
|
30
28
|
*/
|
|
31
29
|
|
|
32
30
|
/**
|
|
@@ -146,9 +144,6 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
146
144
|
|
|
147
145
|
// debugger;
|
|
148
146
|
|
|
149
|
-
// normalize this.pConn$ in case it contains a 'reference'
|
|
150
|
-
this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
151
|
-
|
|
152
147
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ViewProps;
|
|
153
148
|
this.inheritedProps$ = this.pConn$.getInheritedProps();
|
|
154
149
|
|
|
@@ -161,8 +156,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
161
156
|
// label & showLabel within inheritedProps takes precedence over configProps
|
|
162
157
|
this.label$ = this.inheritedProps$.label || this.configProps$.label || '';
|
|
163
158
|
this.showLabel$ = this.inheritedProps$.showLabel || this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
|
|
164
|
-
|
|
165
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
159
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
166
160
|
this.visibility$ = this.configProps$.visibility ?? this.visibility$;
|
|
167
161
|
|
|
168
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
|
|
@@ -58,6 +58,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
|
|
|
58
58
|
dataRelationshipContext: any;
|
|
59
59
|
imagePosition: any;
|
|
60
60
|
showImageDescription: any;
|
|
61
|
+
private isUpdatingFromDataCallback = false;
|
|
61
62
|
|
|
62
63
|
constructor(
|
|
63
64
|
private angularPConnect: AngularPConnectService,
|
|
@@ -69,7 +70,30 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
|
|
|
69
70
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
70
71
|
this.children = this.pConn$.getChildren();
|
|
71
72
|
this.updateSelf();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
ngOnDestroy(): void {
|
|
76
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
77
|
+
this.angularPConnectData.unsubscribeFn();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Callback passed when subscribing to store change
|
|
82
|
+
onStateChange() {
|
|
83
|
+
// Should always check the bridge to see if the component should
|
|
84
|
+
// update itself (re-render)
|
|
85
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
86
|
+
|
|
87
|
+
// ONLY call updateSelf when the component should update
|
|
88
|
+
if (bUpdateSelf) {
|
|
89
|
+
this.updateSelf();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
72
92
|
|
|
93
|
+
getData() {
|
|
94
|
+
if (this.isUpdatingFromDataCallback) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
73
97
|
if (
|
|
74
98
|
this.rawViewMetadata.config?.parameters &&
|
|
75
99
|
!this.isDDSourceDeferred &&
|
|
@@ -94,7 +118,9 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
|
|
|
94
118
|
}))
|
|
95
119
|
.filter(item => item.key); // Filtering out undefined entries
|
|
96
120
|
this.dropDownDataSource = ddDataSource;
|
|
121
|
+
this.isUpdatingFromDataCallback = true;
|
|
97
122
|
this.updateSelf();
|
|
123
|
+
this.isUpdatingFromDataCallback = false;
|
|
98
124
|
} else {
|
|
99
125
|
const ddDataSource: any = [];
|
|
100
126
|
this.dropDownDataSource = ddDataSource;
|
|
@@ -110,24 +136,6 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
|
|
|
110
136
|
}
|
|
111
137
|
}
|
|
112
138
|
|
|
113
|
-
ngOnDestroy(): void {
|
|
114
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
115
|
-
this.angularPConnectData.unsubscribeFn();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Callback passed when subscribing to store change
|
|
120
|
-
onStateChange() {
|
|
121
|
-
// Should always check the bridge to see if the component should
|
|
122
|
-
// update itself (re-render)
|
|
123
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
124
|
-
|
|
125
|
-
// ONLY call updateSelf when the component should update
|
|
126
|
-
if (bUpdateSelf) {
|
|
127
|
-
this.updateSelf();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
139
|
updateSelf() {
|
|
132
140
|
// Update properties based on configProps
|
|
133
141
|
const theConfigProps = this.pConn$.getConfigProps();
|
|
@@ -186,6 +194,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
|
|
|
186
194
|
|
|
187
195
|
this.generateChildrenToRender();
|
|
188
196
|
this.displayChild = !(this.displaySingleRef || this.displayMultiRef);
|
|
197
|
+
this.getData();
|
|
189
198
|
}
|
|
190
199
|
|
|
191
200
|
updatePropertiesFromProps(theConfigProps) {
|
|
@@ -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>
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
|
-
<button *ngIf="allowAdd" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">{{ getAddBtnLabel() }}</button>
|
|
31
|
+
<button *ngIf="allowAdd()" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">{{ getAddBtnLabel() }}</button>
|
|
32
32
|
</ng-template>
|
|
33
33
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, signal } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, signal, effect } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -48,32 +48,26 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
48
48
|
referenceListLength = signal<number | null>(null);
|
|
49
49
|
fieldHeader: any;
|
|
50
50
|
|
|
51
|
-
allowAdd = true;
|
|
52
|
-
allowEdit = true;
|
|
51
|
+
allowAdd = signal(true);
|
|
52
|
+
allowEdit = signal(true);
|
|
53
53
|
allowDelete = true;
|
|
54
54
|
|
|
55
55
|
constructor(
|
|
56
56
|
private angularPConnect: AngularPConnectService,
|
|
57
57
|
private utils: Utils
|
|
58
|
-
) {
|
|
58
|
+
) {
|
|
59
|
+
effect(() => {
|
|
60
|
+
const allowAdd = this.allowAdd();
|
|
61
|
+
const allowEdit = this.allowEdit();
|
|
62
|
+
const referenceList = this.configProps$?.referenceList;
|
|
63
|
+
if (referenceList?.length === 0 && (allowAdd || allowEdit)) {
|
|
64
|
+
this.pConn$.getListActions().insert({ classID: this.contextClass }, referenceList.length);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
59
68
|
|
|
60
69
|
ngOnInit(): void {
|
|
61
70
|
this.menuIconOverride$ = this.utils.getImageSrc('trash', this.utils.getSDKStaticContentUrl());
|
|
62
|
-
|
|
63
|
-
const { allowActions, allowTableEdit, referenceList } = this.configProps$;
|
|
64
|
-
|
|
65
|
-
if (allowActions && Object.keys(allowActions).length > 0) {
|
|
66
|
-
this.allowAdd = allowActions.allowAdd ?? allowTableEdit ?? true;
|
|
67
|
-
this.allowEdit = allowActions.allowEdit ?? true;
|
|
68
|
-
this.allowDelete = allowActions.allowDelete ?? allowTableEdit ?? true;
|
|
69
|
-
} else {
|
|
70
|
-
this.allowAdd = allowTableEdit ?? true;
|
|
71
|
-
this.allowDelete = allowTableEdit ?? true;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (referenceList?.length === 0 && (this.allowAdd || this.allowEdit)) {
|
|
75
|
-
this.pConn$.getListActions().insert({ classID: this.contextClass }, referenceList.length);
|
|
76
|
-
}
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
ngOnDestroy(): void {
|
|
@@ -121,6 +115,17 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
121
115
|
const resolvedList = getReferenceList(this.pConn$);
|
|
122
116
|
this.pConn$.setReferenceList(resolvedList);
|
|
123
117
|
|
|
118
|
+
const { allowActions, allowTableEdit } = this.configProps$;
|
|
119
|
+
|
|
120
|
+
if (allowActions && Object.keys(allowActions).length > 0) {
|
|
121
|
+
this.allowAdd.set(allowActions.allowAdd ?? allowTableEdit ?? true);
|
|
122
|
+
this.allowEdit.set(allowActions.allowEdit ?? true);
|
|
123
|
+
this.allowDelete = allowActions.allowDelete ?? allowTableEdit ?? true;
|
|
124
|
+
} else {
|
|
125
|
+
this.allowAdd.set(allowTableEdit ?? true);
|
|
126
|
+
this.allowDelete = allowTableEdit ?? true;
|
|
127
|
+
}
|
|
128
|
+
|
|
124
129
|
if (this.readonlyMode) {
|
|
125
130
|
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
126
131
|
}
|
|
@@ -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();
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
<tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
|
|
177
177
|
<tr mat-row *matRowDef="let row; columns: displayedColumns$"></tr>
|
|
178
178
|
</table>
|
|
179
|
-
<div *ngIf="repeatListData
|
|
179
|
+
<div *ngIf="repeatListData.length === 0">
|
|
180
180
|
<table id="list-view" mat-table [dataSource]="[]">
|
|
181
181
|
<!-- Define columns for headers -->
|
|
182
182
|
<ng-container *ngFor="let col of displayedColumns$" [matColumnDef]="col">
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
<tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
|
|
190
190
|
</table>
|
|
191
191
|
</div>
|
|
192
|
-
<div class="psdk-no-records" *ngIf="repeatListData
|
|
192
|
+
<div class="psdk-no-records" *ngIf="repeatListData.length === 0">
|
|
193
193
|
{{ utils.getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.') }}
|
|
194
194
|
</div>
|
|
195
195
|
</div>
|
|
@@ -4,6 +4,8 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
4
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
5
5
|
|
|
6
6
|
interface MultiReferenceReadOnlyProps {
|
|
7
|
+
readonlyContextList: string;
|
|
8
|
+
referenceList: string;
|
|
7
9
|
label: string;
|
|
8
10
|
hideLabel: boolean;
|
|
9
11
|
}
|
|
@@ -21,6 +23,7 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
|
|
|
21
23
|
angularPConnectData: AngularPConnectData = {};
|
|
22
24
|
configProps$: MultiReferenceReadOnlyProps;
|
|
23
25
|
label: string;
|
|
26
|
+
newPConn: any;
|
|
24
27
|
|
|
25
28
|
constructor(private angularPConnect: AngularPConnectService) {}
|
|
26
29
|
|
|
@@ -49,5 +52,29 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
|
|
|
49
52
|
updateSelf() {
|
|
50
53
|
this.configProps$ = this.pConn$.getConfigProps() as MultiReferenceReadOnlyProps;
|
|
51
54
|
this.label = this.configProps$.label;
|
|
55
|
+
|
|
56
|
+
const config = (this.pConn$.getMetadata() as any)?.config;
|
|
57
|
+
const { referenceList, readonlyContextList } = config;
|
|
58
|
+
let readonlyContextObject;
|
|
59
|
+
if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
|
|
60
|
+
readonlyContextObject = {
|
|
61
|
+
referenceList: readonlyContextList
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const hideLabel = this.configProps$.hideLabel ?? false;
|
|
65
|
+
this.newPConn = this.pConn$.createComponent(
|
|
66
|
+
{
|
|
67
|
+
type: 'SimpleTable',
|
|
68
|
+
config: {
|
|
69
|
+
...config,
|
|
70
|
+
...readonlyContextObject,
|
|
71
|
+
label: this.label,
|
|
72
|
+
hideLabel
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
'',
|
|
76
|
+
0,
|
|
77
|
+
{}
|
|
78
|
+
);
|
|
52
79
|
}
|
|
53
80
|
}
|
|
@@ -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
|
}
|
|
@@ -46,7 +46,7 @@ export const getContext = thePConn => {
|
|
|
46
46
|
const pageReference = thePConn.getPageReference();
|
|
47
47
|
const { readonlyContextList, referenceList = readonlyContextList } = thePConn.getStateProps()?.config || thePConn.getStateProps();
|
|
48
48
|
|
|
49
|
-
const pageReferenceForRows = referenceList
|
|
49
|
+
const pageReferenceForRows = referenceList?.startsWith('.') ? `${pageReference}.${referenceList?.substring(1)}` : referenceList;
|
|
50
50
|
const viewName = thePConn.viewName;
|
|
51
51
|
|
|
52
52
|
// removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions
|
|
@@ -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
|
|
|
@@ -923,7 +930,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
923
930
|
const refKeys: string[] = inColKey.split('.');
|
|
924
931
|
let valBuilder = inRowData;
|
|
925
932
|
for (const key of refKeys) {
|
|
926
|
-
valBuilder = valBuilder[key];
|
|
933
|
+
valBuilder = valBuilder[key] ? valBuilder[key] : valBuilder;
|
|
927
934
|
}
|
|
928
935
|
return valBuilder;
|
|
929
936
|
}
|
|
@@ -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();
|