@pega/angular-sdk-overrides 23.1.10 → 24.1.10
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-case-summary/material-case-summary.component.html +7 -4
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.ts +10 -5
- package/lib/field/auto-complete/auto-complete.component.ts +1 -1
- package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
- package/lib/field/check-box/check-box.component.html +16 -15
- package/lib/field/check-box/check-box.component.scss +14 -1
- package/lib/field/check-box/check-box.component.ts +126 -44
- package/lib/field/currency/currency.component.html +15 -6
- package/lib/field/currency/currency.component.ts +36 -18
- package/lib/field/date-time/date-time.component.html +5 -5
- package/lib/field/date-time/date-time.component.ts +15 -37
- package/lib/field/decimal/decimal.component.html +14 -4
- package/lib/field/decimal/decimal.component.ts +42 -5
- package/lib/field/dropdown/dropdown.component.ts +0 -3
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +4 -0
- package/lib/field/multiselect/multiselect.component.html +33 -0
- package/lib/field/multiselect/multiselect.component.scss +7 -0
- package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
- package/lib/field/multiselect/multiselect.component.ts +359 -0
- package/lib/field/multiselect/utils.ts +209 -0
- package/lib/field/percentage/percentage.component.html +15 -4
- package/lib/field/percentage/percentage.component.ts +29 -5
- package/lib/field/radio-buttons/radio-buttons.component.ts +0 -3
- package/lib/field/rich-text/config-ext.json +10 -0
- package/lib/field/rich-text/rich-text.component.html +1 -1
- package/lib/field/scalar-list/scalar-list.component.ts +2 -1
- package/lib/field/text-area/text-area.component.ts +0 -2
- package/lib/field/time/time.component.html +1 -0
- package/lib/field/time/time.component.ts +2 -0
- package/lib/field/url/url.component.html +1 -0
- package/lib/field/url/url.component.ts +2 -0
- package/lib/field/user-reference/user-reference.component.html +50 -45
- package/lib/field/user-reference/user-reference.component.ts +33 -15
- package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
- package/lib/infra/Containers/base-components/helper.ts +89 -0
- package/lib/infra/Containers/flow-container/flow-container.component.html +8 -3
- package/lib/infra/Containers/flow-container/flow-container.component.ts +30 -29
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +40 -8
- package/lib/infra/Containers/view-container/view-container.component.ts +0 -1
- package/lib/infra/assignment/assignment.component.ts +38 -39
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
- package/lib/infra/defer-load/defer-load.component.ts +5 -8
- package/lib/infra/multi-step/multi-step.component.html +1 -1
- package/lib/infra/multi-step/multi-step.component.scss +1 -0
- package/lib/infra/navbar/navbar.component.html +4 -4
- package/lib/infra/navbar/navbar.component.ts +6 -3
- package/lib/infra/view/view.component.ts +1 -1
- package/lib/template/banner-page/config-ext.json +9 -0
- package/lib/template/case-summary/case-summary.component.ts +37 -3
- package/lib/template/case-view/case-view.component.html +3 -3
- package/lib/template/case-view/case-view.component.scss +2 -0
- package/lib/template/case-view/case-view.component.ts +0 -6
- package/lib/template/data-reference/data-reference.component.ts +1 -3
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +0 -1
- package/lib/template/field-group-template/field-group-template.component.ts +4 -12
- package/lib/template/field-value-list/field-value-list.component.html +7 -2
- package/lib/template/field-value-list/field-value-list.component.ts +1 -0
- package/lib/template/inline-dashboard-page/config-ext.json +9 -0
- package/lib/template/list-view/list-view.component.html +6 -6
- package/lib/template/list-view/list-view.component.ts +36 -28
- package/lib/template/list-view/listViewHelpers.ts +0 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
- package/lib/template/simple-table/simple-table.component.ts +0 -2
- package/lib/template/simple-table-manual/helpers.ts +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +49 -19
- package/lib/template/simple-table-select/simple-table-select.component.ts +2 -4
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +2 -1
- package/lib/widget/attachment/attachment.component.html +50 -26
- package/lib/widget/attachment/attachment.component.scss +118 -0
- package/lib/widget/attachment/attachment.component.ts +256 -501
- package/lib/widget/case-history/case-history.component.ts +1 -2
- package/lib/widget/feed-container/feed-container.component.ts +0 -4
- package/lib/widget/file-utility/file-utility.component.html +2 -2
- package/lib/widget/file-utility/file-utility.component.ts +13 -17
- package/lib/widget/list-utility/list-utility.component.html +1 -1
- package/lib/widget/quick-create/config-ext.json +9 -0
- package/lib/widget/quick-create/quick-create.component.ts +1 -1
- package/lib/widget/todo/todo.component.html +6 -5
- package/lib/widget/todo/todo.component.ts +7 -6
- package/package.json +1 -1
|
@@ -166,7 +166,6 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
|
|
|
166
166
|
|
|
167
167
|
this.componentReference = (this.pConn$.getStateProps() as any).value;
|
|
168
168
|
|
|
169
|
-
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
|
|
170
169
|
this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject());
|
|
171
170
|
|
|
172
171
|
const propName = (this.pConn$.getStateProps() as any).value;
|
|
@@ -186,7 +185,6 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
|
|
|
186
185
|
this.localizedValue = this.pConn$.getLocalizedValue(
|
|
187
186
|
this.value$,
|
|
188
187
|
this.localePath,
|
|
189
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
190
188
|
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
191
189
|
);
|
|
192
190
|
// trigger display of error message with field control
|
|
@@ -217,7 +215,6 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
|
|
|
217
215
|
return this.pConn$.getLocalizedValue(
|
|
218
216
|
opt.value,
|
|
219
217
|
this.localePath,
|
|
220
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
221
218
|
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
222
219
|
);
|
|
223
220
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div *ngIf="displayMode$; else noDisplayMode">
|
|
2
|
-
<component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode
|
|
2
|
+
<component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$, isHtml$: true }"></component-mapper>
|
|
3
3
|
</div>
|
|
4
4
|
<ng-template #noDisplayMode>
|
|
5
5
|
<div *ngIf="!bReadonly$; else noEdit">
|
|
@@ -101,11 +101,12 @@ export class ScalarListComponent implements OnInit, OnDestroy {
|
|
|
101
101
|
{
|
|
102
102
|
type: componentType,
|
|
103
103
|
config: {
|
|
104
|
+
// @ts-ignore - Object literal may only specify known properties, and 'value' does not exist in type 'ComponentMetadataConfig'.
|
|
104
105
|
value: scalarValue,
|
|
105
106
|
displayMode: 'LABELS_LEFT',
|
|
106
107
|
label: this.label$,
|
|
107
108
|
...restProps,
|
|
108
|
-
readOnly:
|
|
109
|
+
readOnly: true
|
|
109
110
|
}
|
|
110
111
|
},
|
|
111
112
|
'',
|
|
@@ -107,8 +107,6 @@ export class TextAreaComponent implements OnInit, OnDestroy {
|
|
|
107
107
|
if (this.configProps$.value != undefined) {
|
|
108
108
|
this.value$ = this.configProps$.value;
|
|
109
109
|
}
|
|
110
|
-
// @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
|
|
111
|
-
// @ts-ignore - Property 'getRawConfigProps' is private and only accessible within class 'C11nEnv'
|
|
112
110
|
this.nMaxLength$ = this.pConn$.getFieldMetadata(this.pConn$.getRawConfigProps()?.value)?.maxLength || 100;
|
|
113
111
|
this.testId = this.configProps$.testId;
|
|
114
112
|
this.displayMode$ = this.configProps$.displayMode;
|
|
@@ -36,6 +36,7 @@ export class TimeComponent implements OnInit, OnDestroy {
|
|
|
36
36
|
bVisible$ = true;
|
|
37
37
|
displayMode$?: string = '';
|
|
38
38
|
controlName$: string;
|
|
39
|
+
testId = '';
|
|
39
40
|
bHasForm$ = true;
|
|
40
41
|
componentReference = '';
|
|
41
42
|
helperText: string;
|
|
@@ -100,6 +101,7 @@ export class TimeComponent implements OnInit, OnDestroy {
|
|
|
100
101
|
// moved this from ngOnInit() and call this from there instead...
|
|
101
102
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as TimeProps;
|
|
102
103
|
|
|
104
|
+
this.testId = this.configProps$.testId;
|
|
103
105
|
this.label$ = this.configProps$.label;
|
|
104
106
|
this.displayMode$ = this.configProps$.displayMode;
|
|
105
107
|
|
|
@@ -36,6 +36,7 @@ export class UrlComponent implements OnInit, OnDestroy {
|
|
|
36
36
|
bVisible$ = true;
|
|
37
37
|
displayMode$?: string = '';
|
|
38
38
|
controlName$: string;
|
|
39
|
+
testId = '';
|
|
39
40
|
bHasForm$ = true;
|
|
40
41
|
componentReference = '';
|
|
41
42
|
helperText: string;
|
|
@@ -106,6 +107,7 @@ export class UrlComponent implements OnInit, OnDestroy {
|
|
|
106
107
|
this.value$ = this.configProps$.value;
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
this.testId = this.configProps$.testId;
|
|
109
111
|
this.label$ = this.configProps$.label;
|
|
110
112
|
this.displayMode$ = this.configProps$.displayMode;
|
|
111
113
|
this.helperText = this.configProps$.helperText;
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
<div class="psdk-user-reference">
|
|
2
|
-
<div *ngIf="
|
|
3
|
-
<component-mapper name="
|
|
4
|
-
</div>
|
|
5
|
-
<div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
|
|
6
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
|
|
7
|
-
<mat-select
|
|
8
|
-
[value]="value$"
|
|
9
|
-
[required]="bRequired$"
|
|
10
|
-
[formControl]="fieldControl"
|
|
11
|
-
[attr.data-test-id]="testId"
|
|
12
|
-
(selectionChange)="fieldOnChange($event)"
|
|
13
|
-
>
|
|
14
|
-
<mat-option *ngFor="let opt of options$" [value]="opt.key">
|
|
15
|
-
{{ opt.value }}
|
|
16
|
-
</mat-option>
|
|
17
|
-
</mat-select>
|
|
18
|
-
<mat-label>{{ label$ }}</mat-label>
|
|
19
|
-
<mat-error *ngIf="fieldControl.invalid">
|
|
20
|
-
{{ getErrorMessage() }}
|
|
21
|
-
</mat-error>
|
|
22
|
-
</mat-form-field>
|
|
23
|
-
</div>
|
|
24
|
-
<div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
|
|
25
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
|
|
26
|
-
<mat-label>{{ label$ }}</mat-label>
|
|
27
|
-
<input
|
|
28
|
-
matInput
|
|
29
|
-
[placeholder]="placeholder"
|
|
30
|
-
[formControl]="fieldControl"
|
|
31
|
-
[value]="value$"
|
|
32
|
-
[required]="bRequired$"
|
|
33
|
-
[matAutocomplete]="auto"
|
|
34
|
-
[attr.data-test-id]="testId"
|
|
35
|
-
(change)="fieldOnChange($event)"
|
|
36
|
-
(blur)="fieldOnBlur($event)"
|
|
37
|
-
/>
|
|
38
|
-
<mat-autocomplete #auto="matAutocomplete">
|
|
39
|
-
<mat-option *ngFor="let opt of options$" [value]="opt.value">
|
|
40
|
-
<span>{{ opt.value }}</span>
|
|
41
|
-
</mat-option>
|
|
42
|
-
</mat-autocomplete>
|
|
43
|
-
<mat-error *ngIf="fieldControl.invalid">
|
|
44
|
-
{{ getErrorMessage() }}
|
|
45
|
-
</mat-error>
|
|
46
|
-
</mat-form-field>
|
|
2
|
+
<div *ngIf="displayMode$; else noDisplayMode">
|
|
3
|
+
<component-mapper name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
|
|
47
4
|
</div>
|
|
5
|
+
<ng-template #noDisplayMode>
|
|
6
|
+
<div *ngIf="type === 'operator'">
|
|
7
|
+
<component-mapper name="Operator" [props]="{ pConn$ }"></component-mapper>
|
|
8
|
+
</div>
|
|
9
|
+
<div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
|
|
10
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
|
|
11
|
+
<mat-select
|
|
12
|
+
[value]="value$"
|
|
13
|
+
[required]="bRequired$"
|
|
14
|
+
[formControl]="fieldControl"
|
|
15
|
+
[attr.data-test-id]="testId"
|
|
16
|
+
(selectionChange)="fieldOnChange($event)"
|
|
17
|
+
>
|
|
18
|
+
<mat-option *ngFor="let opt of options$" [value]="opt.key">
|
|
19
|
+
{{ opt.value }}
|
|
20
|
+
</mat-option>
|
|
21
|
+
</mat-select>
|
|
22
|
+
<mat-label>{{ label$ }}</mat-label>
|
|
23
|
+
<mat-error *ngIf="fieldControl.invalid">
|
|
24
|
+
{{ getErrorMessage() }}
|
|
25
|
+
</mat-error>
|
|
26
|
+
</mat-form-field>
|
|
27
|
+
</div>
|
|
28
|
+
<div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
|
|
29
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
|
|
30
|
+
<mat-label>{{ label$ }}</mat-label>
|
|
31
|
+
<input
|
|
32
|
+
matInput
|
|
33
|
+
[placeholder]="placeholder"
|
|
34
|
+
[formControl]="fieldControl"
|
|
35
|
+
[value]="value$"
|
|
36
|
+
[required]="bRequired$"
|
|
37
|
+
[matAutocomplete]="auto"
|
|
38
|
+
[attr.data-test-id]="testId"
|
|
39
|
+
(change)="fieldOnChange($event)"
|
|
40
|
+
(blur)="fieldOnBlur($event)"
|
|
41
|
+
/>
|
|
42
|
+
<mat-autocomplete #auto="matAutocomplete">
|
|
43
|
+
<mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
|
|
44
|
+
<span>{{ opt.value }}</span>
|
|
45
|
+
</mat-option>
|
|
46
|
+
</mat-autocomplete>
|
|
47
|
+
<mat-error *ngIf="fieldControl.invalid">
|
|
48
|
+
{{ getErrorMessage() }}
|
|
49
|
+
</mat-error>
|
|
50
|
+
</mat-form-field>
|
|
51
|
+
</div>
|
|
52
|
+
</ng-template>
|
|
48
53
|
</div>
|
|
@@ -10,6 +10,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
10
10
|
import { Utils } from '@pega/angular-sdk-components';
|
|
11
11
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
12
12
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
13
|
+
import { map, Observable, startWith } from 'rxjs';
|
|
13
14
|
|
|
14
15
|
const OPERATORS_DP = 'D_pyGetOperatorsForCurrentApplication';
|
|
15
16
|
const DROPDOWN_LIST = 'Drop-down list';
|
|
@@ -57,6 +58,9 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
57
58
|
testId: string;
|
|
58
59
|
helperText: string;
|
|
59
60
|
placeholder: string;
|
|
61
|
+
displayMode$?: string;
|
|
62
|
+
filteredOptions: Observable<any[]>;
|
|
63
|
+
filterValue = '';
|
|
60
64
|
|
|
61
65
|
fieldControl = new FormControl('', null);
|
|
62
66
|
|
|
@@ -65,19 +69,24 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
65
69
|
private utils: Utils
|
|
66
70
|
) {}
|
|
67
71
|
|
|
68
|
-
ngOnInit(): void {
|
|
72
|
+
async ngOnInit(): Promise<void> {
|
|
69
73
|
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
70
74
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
71
75
|
|
|
72
76
|
this.controlName$ = this.angularPConnect.getComponentID(this);
|
|
73
77
|
|
|
74
|
-
this.checkAndUpdate();
|
|
78
|
+
await this.checkAndUpdate();
|
|
75
79
|
|
|
76
80
|
if (this.formGroup$) {
|
|
77
81
|
// add control to formGroup
|
|
78
82
|
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
79
83
|
this.fieldControl.setValue(this.value$);
|
|
80
84
|
}
|
|
85
|
+
|
|
86
|
+
this.filteredOptions = this.fieldControl.valueChanges.pipe(
|
|
87
|
+
startWith(''),
|
|
88
|
+
map(value => this._filter(value || ''))
|
|
89
|
+
);
|
|
81
90
|
}
|
|
82
91
|
|
|
83
92
|
ngOnDestroy() {
|
|
@@ -105,32 +114,38 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
// Callback passed when subscribing to store change
|
|
108
|
-
onStateChange() {
|
|
109
|
-
this.checkAndUpdate();
|
|
117
|
+
async onStateChange() {
|
|
118
|
+
await this.checkAndUpdate();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private _filter(value: string): string[] {
|
|
122
|
+
const filterVal = (value || this.filterValue).toLowerCase();
|
|
123
|
+
return this.options$?.filter(option => option.value?.toLowerCase().includes(filterVal));
|
|
110
124
|
}
|
|
111
125
|
|
|
112
|
-
checkAndUpdate() {
|
|
126
|
+
async checkAndUpdate() {
|
|
113
127
|
// Should always check the bridge to see if the component should
|
|
114
128
|
// update itself (re-render)
|
|
115
129
|
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
116
130
|
|
|
117
131
|
// ONLY call updateSelf when the component should update
|
|
118
132
|
if (bUpdateSelf) {
|
|
119
|
-
this.updateSelf();
|
|
133
|
+
await this.updateSelf();
|
|
120
134
|
}
|
|
121
135
|
}
|
|
122
136
|
|
|
123
|
-
updateSelf() {
|
|
137
|
+
async updateSelf() {
|
|
124
138
|
const props = this.pConn$.getConfigProps() as UserReferenceProps;
|
|
125
139
|
this.testId = props.testId;
|
|
126
140
|
|
|
127
|
-
const { label, displayAs, value, showAsFormattedText, helperText, placeholder } = props;
|
|
141
|
+
const { label, displayAs, value, showAsFormattedText, helperText, placeholder, displayMode } = props;
|
|
128
142
|
|
|
129
143
|
this.label$ = label;
|
|
130
144
|
this.showAsFormattedText$ = showAsFormattedText;
|
|
131
145
|
this.displayAs$ = displayAs;
|
|
132
146
|
this.helperText = helperText;
|
|
133
147
|
this.placeholder = placeholder || '';
|
|
148
|
+
this.displayMode$ = displayMode;
|
|
134
149
|
|
|
135
150
|
const { readOnly, required } = props;
|
|
136
151
|
[this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
|
|
@@ -158,18 +173,18 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
158
173
|
const queryPayload = {
|
|
159
174
|
dataViewName: OPERATORS_DP
|
|
160
175
|
};
|
|
161
|
-
|
|
162
|
-
.invokeRestApi('getListData', { queryPayload } as any, '') // 3rd arg empty string until typedef marked correctly
|
|
163
|
-
|
|
176
|
+
try {
|
|
177
|
+
const resp: any = await PCore.getRestClient().invokeRestApi('getListData', { queryPayload } as any, ''); // 3rd arg empty string until typedef marked correctly
|
|
178
|
+
if (resp?.data) {
|
|
164
179
|
const ddDataSource = resp.data.data.map(listItem => ({
|
|
165
180
|
key: listItem.pyUserIdentifier,
|
|
166
181
|
value: listItem.pyUserName
|
|
167
182
|
}));
|
|
168
183
|
this.options$ = ddDataSource;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
}
|
|
185
|
+
} catch (error) {
|
|
186
|
+
console.log(error);
|
|
187
|
+
}
|
|
173
188
|
}
|
|
174
189
|
}
|
|
175
190
|
|
|
@@ -177,6 +192,9 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
177
192
|
if (event?.value === 'Select') {
|
|
178
193
|
event.value = '';
|
|
179
194
|
}
|
|
195
|
+
if (event?.target) {
|
|
196
|
+
this.filterValue = (event.target as HTMLInputElement).value;
|
|
197
|
+
}
|
|
180
198
|
this.angularPConnectData.actions?.onChange(this, event);
|
|
181
199
|
}
|
|
182
200
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { getPConnectOfActiveContainerItem } from './helper';
|
|
3
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
4
|
+
|
|
5
|
+
export class FlowContainerBaseComponent {
|
|
6
|
+
// For interaction with AngularPConnect
|
|
7
|
+
protected angularPConnectData: AngularPConnectData = {};
|
|
8
|
+
protected angularPConnect;
|
|
9
|
+
|
|
10
|
+
constructor(injector: Injector) {
|
|
11
|
+
this.angularPConnect = injector.get(AngularPConnectService);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getPConnectOfActiveContainerItem(parentPConnect) {
|
|
15
|
+
const routingInfo = this.angularPConnect.getComponentProp(this, 'routingInfo');
|
|
16
|
+
const isAssignmentView = this.angularPConnect.getComponentProp(this, 'isAssignmentView');
|
|
17
|
+
return getPConnectOfActiveContainerItem(routingInfo, {
|
|
18
|
+
isAssignmentView,
|
|
19
|
+
parentPConnect
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const processRootViewDetails = (rootView, containerItem, options) => {
|
|
2
|
+
const {
|
|
3
|
+
config: { context: viewContext, name: viewName }
|
|
4
|
+
} = rootView;
|
|
5
|
+
const { context: containerContext } = containerItem;
|
|
6
|
+
const { parentPConnect } = options;
|
|
7
|
+
let resolvedViewName = viewName;
|
|
8
|
+
let resolvedViewContext = viewContext;
|
|
9
|
+
|
|
10
|
+
const isAnnotedViewName = PCore.getAnnotationUtils().isProperty(viewName);
|
|
11
|
+
const isAnnotedViewContext = PCore.getAnnotationUtils().isProperty(viewContext);
|
|
12
|
+
|
|
13
|
+
// resolving annoted view context
|
|
14
|
+
if (isAnnotedViewContext) {
|
|
15
|
+
const viewContextProperty = PCore.getAnnotationUtils().getPropertyName(viewContext);
|
|
16
|
+
resolvedViewContext = PCore.getStoreValue(
|
|
17
|
+
`.${viewContextProperty}`,
|
|
18
|
+
viewContextProperty.startsWith('.') ? parentPConnect.getPageReference() : '',
|
|
19
|
+
containerContext
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!resolvedViewContext) {
|
|
24
|
+
resolvedViewContext = parentPConnect.getPageReference();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// resolving annoted view name
|
|
28
|
+
if (isAnnotedViewName) {
|
|
29
|
+
const viewNameProperty = PCore.getAnnotationUtils().getPropertyName(viewName);
|
|
30
|
+
resolvedViewName = PCore.getStoreValue(`.${viewNameProperty}`, resolvedViewContext, containerContext);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Special case where context and viewname are dynamic values
|
|
34
|
+
Use case - split for each shape
|
|
35
|
+
Ex - (caseInfo.content.SCRequestWorkQueues[1]):context --> .pyViewName:viewName
|
|
36
|
+
*/
|
|
37
|
+
if (isAnnotedViewName && isAnnotedViewContext && resolvedViewName !== '') {
|
|
38
|
+
/* Allow context processor to resolve view and context when both are dynamic */
|
|
39
|
+
resolvedViewName = viewName;
|
|
40
|
+
resolvedViewContext = viewContext;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
viewName: resolvedViewName,
|
|
45
|
+
viewContext: resolvedViewContext
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const getPConnectOfActiveContainerItem = (containerInfo, options) => {
|
|
50
|
+
const { accessedOrder, items } = containerInfo;
|
|
51
|
+
const { isAssignmentView = false, parentPConnect } = options;
|
|
52
|
+
const containerName = parentPConnect.getContainerName();
|
|
53
|
+
const { CONTAINER_NAMES } = PCore.getContainerUtils();
|
|
54
|
+
const { CREATE_DETAILS_VIEW_NAME } = PCore.getConstants();
|
|
55
|
+
|
|
56
|
+
if (accessedOrder && items) {
|
|
57
|
+
const activeContainerItemKey = accessedOrder[accessedOrder.length - 1];
|
|
58
|
+
|
|
59
|
+
if (items[activeContainerItemKey] && items[activeContainerItemKey].view && Object.keys(items[activeContainerItemKey].view).length > 0) {
|
|
60
|
+
const activeContainerItem = items[activeContainerItemKey];
|
|
61
|
+
const target = activeContainerItemKey.substring(0, activeContainerItemKey.lastIndexOf('_'));
|
|
62
|
+
|
|
63
|
+
const { view: rootView, context } = activeContainerItem;
|
|
64
|
+
const { viewName, viewContext } = processRootViewDetails(rootView, activeContainerItem, { parentPConnect });
|
|
65
|
+
|
|
66
|
+
if (!viewName) return null;
|
|
67
|
+
|
|
68
|
+
const config = {
|
|
69
|
+
meta: rootView,
|
|
70
|
+
options: {
|
|
71
|
+
context,
|
|
72
|
+
pageReference: viewContext || parentPConnect.getPageReference(),
|
|
73
|
+
containerName,
|
|
74
|
+
containerItemID: activeContainerItemKey,
|
|
75
|
+
parentPageReference: parentPConnect.getPageReference(),
|
|
76
|
+
hasForm:
|
|
77
|
+
isAssignmentView ||
|
|
78
|
+
containerName === CONTAINER_NAMES.WORKAREA ||
|
|
79
|
+
containerName === CONTAINER_NAMES.MODAL ||
|
|
80
|
+
viewName === CREATE_DETAILS_VIEW_NAME,
|
|
81
|
+
target
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return PCore.createPConnect(config).getPConnect();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
};
|
|
@@ -8,21 +8,26 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div *ngIf="todo_showTodo$">
|
|
10
10
|
<component-mapper
|
|
11
|
+
*ngIf="pConnectOfActiveContainerItem"
|
|
11
12
|
name="Todo"
|
|
12
13
|
[props]="{
|
|
13
|
-
pConn$:
|
|
14
|
+
pConn$: pConnectOfActiveContainerItem,
|
|
14
15
|
caseInfoID$: todo_caseInfoID$,
|
|
15
16
|
datasource$: todo_datasource$,
|
|
16
17
|
showTodoList$: todo_showTodoList$,
|
|
17
18
|
headerText$: todo_headerText$,
|
|
18
19
|
type$: 'TODO',
|
|
19
20
|
context$: todo_context$,
|
|
20
|
-
|
|
21
|
+
isConfirm: true
|
|
21
22
|
}"
|
|
22
23
|
></component-mapper>
|
|
23
24
|
</div>
|
|
24
25
|
<div *ngIf="!todo_showTodo$">
|
|
25
|
-
<component-mapper
|
|
26
|
+
<component-mapper
|
|
27
|
+
*ngIf="pConnectOfActiveContainerItem"
|
|
28
|
+
name="Assignment"
|
|
29
|
+
[props]="{ pConn$: pConnectOfActiveContainerItem, formGroup$, arChildren$, itemKey$ }"
|
|
30
|
+
></component-mapper>
|
|
26
31
|
</div>
|
|
27
32
|
</div>
|
|
28
33
|
<div *ngIf="bHasCaseMessages$">
|