@pega/angular-sdk-overrides 23.1.10 → 24.2.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/alert-banner/alert-banner.component.ts +1 -1
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +7 -4
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.ts +11 -6
- package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
- package/lib/field/auto-complete/auto-complete.component.ts +17 -14
- 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 +128 -45
- package/lib/field/currency/currency.component.html +16 -7
- package/lib/field/currency/currency.component.ts +55 -20
- package/lib/field/date/date.component.html +1 -6
- package/lib/field/date/date.component.ts +22 -39
- package/lib/field/date-time/date-time.component.html +6 -7
- package/lib/field/date-time/date-time.component.ts +28 -45
- package/lib/field/decimal/decimal.component.html +14 -4
- package/lib/field/decimal/decimal.component.ts +47 -7
- package/lib/field/dropdown/dropdown.component.ts +132 -21
- package/lib/field/email/email.component.ts +14 -4
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +6 -2
- package/lib/field/integer/integer.component.html +1 -1
- package/lib/field/integer/integer.component.ts +13 -5
- 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 +369 -0
- package/lib/field/multiselect/utils.ts +209 -0
- package/lib/field/percentage/percentage.component.html +17 -6
- package/lib/field/percentage/percentage.component.ts +51 -12
- package/lib/field/phone/phone.component.html +1 -1
- package/lib/field/phone/phone.component.ts +11 -14
- package/lib/field/radio-buttons/radio-buttons.component.ts +9 -12
- package/lib/field/rich-text/config-ext.json +10 -0
- package/lib/field/rich-text/rich-text.component.html +1 -1
- package/lib/field/rich-text/rich-text.component.ts +8 -6
- package/lib/field/scalar-list/scalar-list.component.ts +4 -4
- package/lib/field/text/text.component.ts +2 -0
- package/lib/field/text-area/text-area.component.html +2 -1
- package/lib/field/text-area/text-area.component.ts +13 -8
- package/lib/field/text-input/text-input.component.html +1 -1
- package/lib/field/text-input/text-input.component.ts +13 -5
- package/lib/field/time/time.component.html +3 -2
- package/lib/field/time/time.component.ts +23 -7
- package/lib/field/url/url.component.html +2 -1
- package/lib/field/url/url.component.ts +15 -5
- package/lib/field/user-reference/user-reference.component.html +42 -45
- package/lib/field/user-reference/user-reference.component.ts +73 -27
- 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 +9 -4
- package/lib/infra/Containers/flow-container/flow-container.component.ts +38 -33
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +41 -9
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
- package/lib/infra/Containers/view-container/helper.ts +22 -0
- package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
- package/lib/infra/assignment/assignment.component.ts +37 -39
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
- package/lib/infra/defer-load/defer-load.component.ts +9 -12
- 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 +9 -6
- package/lib/infra/root-container/root-container.component.ts +3 -3
- package/lib/infra/stages/stages.component.scss +2 -2
- package/lib/infra/view/view.component.html +7 -20
- package/lib/infra/view/view.component.ts +21 -3
- package/lib/template/app-shell/app-shell.component.ts +20 -2
- package/lib/template/banner-page/config-ext.json +9 -0
- package/lib/template/base/details-template-base.ts +67 -0
- package/lib/template/base/form-template-base.ts +10 -0
- package/lib/template/case-summary/case-summary.component.ts +38 -4
- package/lib/template/case-view/case-view.component.html +7 -7
- package/lib/template/case-view/case-view.component.scss +2 -0
- package/lib/template/case-view/case-view.component.ts +8 -19
- package/lib/template/confirmation/confirmation.component.ts +1 -1
- package/lib/template/data-reference/data-reference.component.ts +37 -43
- package/lib/template/default-form/default-form.component.html +0 -4
- package/lib/template/default-form/default-form.component.ts +7 -23
- package/lib/template/details/details.component.ts +7 -41
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
- package/lib/template/details-one-column/details-one-column.component.ts +7 -42
- package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
- package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
- package/lib/template/details-three-column/details-three-column.component.ts +7 -43
- package/lib/template/details-two-column/details-two-column.component.ts +8 -44
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
- package/lib/template/field-group-template/field-group-template.component.ts +4 -14
- package/lib/template/field-value-list/field-value-list.component.html +8 -3
- package/lib/template/field-value-list/field-value-list.component.scss +2 -1
- 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/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
- package/lib/template/list-view/list-view.component.html +9 -6
- package/lib/template/list-view/list-view.component.scss +11 -0
- package/lib/template/list-view/list-view.component.ts +60 -32
- package/lib/template/list-view/listViewHelpers.ts +1 -2
- package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
- package/lib/template/one-column/one-column.component.ts +4 -3
- package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
- package/lib/template/page/page.component.ts +1 -1
- package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +2 -3
- package/lib/template/simple-table/simple-table.component.ts +0 -2
- package/lib/template/simple-table-manual/helpers.ts +2 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +60 -28
- package/lib/template/simple-table-select/simple-table-select.component.ts +5 -7
- package/lib/template/three-column/three-column.component.ts +4 -3
- package/lib/template/two-column/two-column.component.ts +4 -3
- package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +5 -4
- 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 -503
- package/lib/widget/case-history/case-history.component.ts +1 -2
- package/lib/widget/feed-container/feed-container.component.ts +7 -11
- package/lib/widget/file-utility/file-utility.component.html +2 -2
- package/lib/widget/file-utility/file-utility.component.ts +15 -22
- 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 +8 -7
- package/lib/widget/todo/todo.component.ts +97 -86
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
8
8
|
import { Utils } from '@pega/angular-sdk-components';
|
|
9
9
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
10
10
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
11
|
+
import { handleEvent } from '@pega/angular-sdk-components';
|
|
11
12
|
|
|
12
13
|
interface URLProps extends PConnFieldProps {
|
|
13
14
|
// If any, enter additional props that only exist on URL here
|
|
@@ -36,12 +37,15 @@ export class UrlComponent implements OnInit, OnDestroy {
|
|
|
36
37
|
bVisible$ = true;
|
|
37
38
|
displayMode$?: string = '';
|
|
38
39
|
controlName$: string;
|
|
40
|
+
testId = '';
|
|
39
41
|
bHasForm$ = true;
|
|
40
42
|
componentReference = '';
|
|
41
43
|
helperText: string;
|
|
42
44
|
placeholder: string;
|
|
43
45
|
|
|
44
46
|
fieldControl = new FormControl('', null);
|
|
47
|
+
actionsApi: Object;
|
|
48
|
+
propName: string;
|
|
45
49
|
|
|
46
50
|
constructor(
|
|
47
51
|
private angularPConnect: AngularPConnectService,
|
|
@@ -106,11 +110,15 @@ export class UrlComponent implements OnInit, OnDestroy {
|
|
|
106
110
|
this.value$ = this.configProps$.value;
|
|
107
111
|
}
|
|
108
112
|
|
|
113
|
+
this.testId = this.configProps$.testId;
|
|
109
114
|
this.label$ = this.configProps$.label;
|
|
110
115
|
this.displayMode$ = this.configProps$.displayMode;
|
|
111
116
|
this.helperText = this.configProps$.helperText;
|
|
112
117
|
this.placeholder = this.configProps$.placeholder || '';
|
|
113
118
|
|
|
119
|
+
this.actionsApi = this.pConn$.getActionsApi();
|
|
120
|
+
this.propName = this.pConn$.getStateProps().value;
|
|
121
|
+
|
|
114
122
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
115
123
|
setTimeout(() => {
|
|
116
124
|
if (this.configProps$.required != null) {
|
|
@@ -138,7 +146,7 @@ export class UrlComponent implements OnInit, OnDestroy {
|
|
|
138
146
|
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
139
147
|
}
|
|
140
148
|
|
|
141
|
-
this.componentReference =
|
|
149
|
+
this.componentReference = this.pConn$.getStateProps().value;
|
|
142
150
|
|
|
143
151
|
// trigger display of error message with field control
|
|
144
152
|
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
@@ -151,13 +159,15 @@ export class UrlComponent implements OnInit, OnDestroy {
|
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
161
|
|
|
154
|
-
fieldOnChange(
|
|
155
|
-
this.
|
|
162
|
+
fieldOnChange() {
|
|
163
|
+
this.pConn$.clearErrorMessages({
|
|
164
|
+
property: this.propName
|
|
165
|
+
});
|
|
156
166
|
}
|
|
157
167
|
|
|
158
168
|
fieldOnBlur(event: any) {
|
|
159
|
-
|
|
160
|
-
this.
|
|
169
|
+
const value = event?.target?.value;
|
|
170
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
161
171
|
}
|
|
162
172
|
|
|
163
173
|
getErrorMessage() {
|
|
@@ -1,48 +1,45 @@
|
|
|
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 [required]="bRequired$" [formControl]="fieldControl" [attr.data-test-id]="testId" (selectionChange)="fieldOnChange($event)">
|
|
12
|
+
<mat-option *ngFor="let opt of options$" [value]="opt.key">
|
|
13
|
+
{{ opt.value }}
|
|
14
|
+
</mat-option>
|
|
15
|
+
</mat-select>
|
|
16
|
+
<mat-label>{{ label$ }}</mat-label>
|
|
17
|
+
<mat-error *ngIf="fieldControl.invalid">
|
|
18
|
+
{{ getErrorMessage() }}
|
|
19
|
+
</mat-error>
|
|
20
|
+
</mat-form-field>
|
|
21
|
+
</div>
|
|
22
|
+
<div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
|
|
23
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
|
|
24
|
+
<mat-label>{{ label$ }}</mat-label>
|
|
25
|
+
<input
|
|
26
|
+
matInput
|
|
27
|
+
[placeholder]="placeholder"
|
|
28
|
+
[formControl]="fieldControl"
|
|
29
|
+
[required]="bRequired$"
|
|
30
|
+
[matAutocomplete]="auto"
|
|
31
|
+
[attr.data-test-id]="testId"
|
|
32
|
+
(blur)="fieldOnBlur($event)"
|
|
33
|
+
/>
|
|
34
|
+
<mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption (optionSelected)="optionChanged($event)">
|
|
35
|
+
<mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
|
|
36
|
+
<span>{{ opt.value }}</span>
|
|
37
|
+
</mat-option>
|
|
38
|
+
</mat-autocomplete>
|
|
39
|
+
<mat-error *ngIf="fieldControl.invalid">
|
|
40
|
+
{{ getErrorMessage() }}
|
|
41
|
+
</mat-error>
|
|
42
|
+
</mat-form-field>
|
|
43
|
+
</div>
|
|
44
|
+
</ng-template>
|
|
48
45
|
</div>
|
|
@@ -10,6 +10,8 @@ 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';
|
|
14
|
+
import { handleEvent } from '@pega/angular-sdk-components';
|
|
13
15
|
|
|
14
16
|
const OPERATORS_DP = 'D_pyGetOperatorsForCurrentApplication';
|
|
15
17
|
const DROPDOWN_LIST = 'Drop-down list';
|
|
@@ -21,6 +23,7 @@ interface UserReferenceProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
21
23
|
value?: any;
|
|
22
24
|
showAsFormattedText?: boolean;
|
|
23
25
|
additionalProps?: object;
|
|
26
|
+
onRecordChange?: any;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
@Component({
|
|
@@ -57,27 +60,38 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
57
60
|
testId: string;
|
|
58
61
|
helperText: string;
|
|
59
62
|
placeholder: string;
|
|
63
|
+
displayMode$?: string;
|
|
64
|
+
filteredOptions: Observable<any[]>;
|
|
65
|
+
filterValue = '';
|
|
60
66
|
|
|
61
67
|
fieldControl = new FormControl('', null);
|
|
68
|
+
actionsApi: Object;
|
|
69
|
+
propName: string;
|
|
70
|
+
onRecordChange: any;
|
|
62
71
|
|
|
63
72
|
constructor(
|
|
64
73
|
private angularPConnect: AngularPConnectService,
|
|
65
74
|
private utils: Utils
|
|
66
75
|
) {}
|
|
67
76
|
|
|
68
|
-
ngOnInit(): void {
|
|
77
|
+
async ngOnInit(): Promise<void> {
|
|
69
78
|
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
70
79
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
71
80
|
|
|
72
81
|
this.controlName$ = this.angularPConnect.getComponentID(this);
|
|
73
82
|
|
|
74
|
-
this.checkAndUpdate();
|
|
83
|
+
await this.checkAndUpdate();
|
|
75
84
|
|
|
76
85
|
if (this.formGroup$) {
|
|
77
86
|
// add control to formGroup
|
|
78
87
|
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
79
|
-
this.fieldControl.setValue(this.value$);
|
|
88
|
+
this.fieldControl.setValue(this.getValue(this.value$));
|
|
80
89
|
}
|
|
90
|
+
|
|
91
|
+
this.filteredOptions = this.fieldControl.valueChanges.pipe(
|
|
92
|
+
startWith(this.getValue(this.value$) || ''),
|
|
93
|
+
map(value => this._filter(value || ''))
|
|
94
|
+
);
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
ngOnDestroy() {
|
|
@@ -105,44 +119,67 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
105
119
|
}
|
|
106
120
|
|
|
107
121
|
// Callback passed when subscribing to store change
|
|
108
|
-
onStateChange() {
|
|
109
|
-
this.checkAndUpdate();
|
|
122
|
+
async onStateChange() {
|
|
123
|
+
await this.checkAndUpdate();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private _filter(value: string): string[] {
|
|
127
|
+
const filterVal = (value || this.filterValue).toLowerCase();
|
|
128
|
+
return this.options$?.filter(option => option.value?.toLowerCase().includes(filterVal));
|
|
110
129
|
}
|
|
111
130
|
|
|
112
|
-
|
|
131
|
+
isUserNameAvailable = user => {
|
|
132
|
+
return typeof user === 'object' && user !== null && user.userName;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
getUserName = user => {
|
|
136
|
+
return user.userName;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
getValue = user => {
|
|
140
|
+
if (this.displayAs$ === DROPDOWN_LIST) {
|
|
141
|
+
return this.utils.getUserId(user) || this.getUserName(user);
|
|
142
|
+
}
|
|
143
|
+
return this.isUserNameAvailable(user) ? this.getUserName(user) : this.utils.getUserId(user);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
async checkAndUpdate() {
|
|
113
147
|
// Should always check the bridge to see if the component should
|
|
114
148
|
// update itself (re-render)
|
|
115
149
|
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
116
150
|
|
|
117
151
|
// ONLY call updateSelf when the component should update
|
|
118
152
|
if (bUpdateSelf) {
|
|
119
|
-
this.updateSelf();
|
|
153
|
+
await this.updateSelf();
|
|
120
154
|
}
|
|
121
155
|
}
|
|
122
156
|
|
|
123
|
-
updateSelf() {
|
|
157
|
+
async updateSelf() {
|
|
124
158
|
const props = this.pConn$.getConfigProps() as UserReferenceProps;
|
|
125
159
|
this.testId = props.testId;
|
|
160
|
+
this.onRecordChange = props?.onRecordChange;
|
|
126
161
|
|
|
127
|
-
const { label, displayAs, value, showAsFormattedText, helperText, placeholder } = props;
|
|
162
|
+
const { label, displayAs, value, showAsFormattedText, helperText, placeholder, displayMode } = props;
|
|
128
163
|
|
|
129
164
|
this.label$ = label;
|
|
130
165
|
this.showAsFormattedText$ = showAsFormattedText;
|
|
131
166
|
this.displayAs$ = displayAs;
|
|
132
167
|
this.helperText = helperText;
|
|
133
168
|
this.placeholder = placeholder || '';
|
|
169
|
+
this.displayMode$ = displayMode;
|
|
170
|
+
|
|
171
|
+
this.value$ = this.pConn$.getConfigProps()?.value;
|
|
134
172
|
|
|
135
173
|
const { readOnly, required } = props;
|
|
136
174
|
[this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
|
|
137
175
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
};
|
|
176
|
+
this.actionsApi = this.pConn$.getActionsApi();
|
|
177
|
+
this.propName = this.pConn$.getStateProps().value;
|
|
141
178
|
|
|
142
179
|
this.userID$ = this.utils.getUserId(value);
|
|
143
180
|
|
|
144
181
|
if (this.userID$ && this.bReadonly$ && this.showAsFormattedText$) {
|
|
145
|
-
if (isUserNameAvailable(value)) {
|
|
182
|
+
if (this.isUserNameAvailable(value)) {
|
|
146
183
|
this.userName$ = value.userName;
|
|
147
184
|
} else {
|
|
148
185
|
// if same user ref field is referred in view as editable & readonly formatted text
|
|
@@ -158,18 +195,18 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
158
195
|
const queryPayload = {
|
|
159
196
|
dataViewName: OPERATORS_DP
|
|
160
197
|
};
|
|
161
|
-
|
|
162
|
-
.invokeRestApi('getListData', { queryPayload }
|
|
163
|
-
|
|
198
|
+
try {
|
|
199
|
+
const resp = await PCore.getRestClient().invokeRestApi('getListData', { queryPayload }, ''); // 3rd arg empty string until typedef marked correctly
|
|
200
|
+
if (resp?.data) {
|
|
164
201
|
const ddDataSource = resp.data.data.map(listItem => ({
|
|
165
202
|
key: listItem.pyUserIdentifier,
|
|
166
203
|
value: listItem.pyUserName
|
|
167
204
|
}));
|
|
168
205
|
this.options$ = ddDataSource;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
206
|
+
}
|
|
207
|
+
} catch (error) {
|
|
208
|
+
console.log(error);
|
|
209
|
+
}
|
|
173
210
|
}
|
|
174
211
|
}
|
|
175
212
|
|
|
@@ -177,7 +214,16 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
177
214
|
if (event?.value === 'Select') {
|
|
178
215
|
event.value = '';
|
|
179
216
|
}
|
|
180
|
-
|
|
217
|
+
if (event?.target) {
|
|
218
|
+
this.filterValue = (event.target as HTMLInputElement).value;
|
|
219
|
+
}
|
|
220
|
+
const value = event?.value;
|
|
221
|
+
handleEvent(this.actionsApi, 'change', this.propName, value);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
optionChanged(event: any) {
|
|
225
|
+
const value = event?.option?.value;
|
|
226
|
+
handleEvent(this.actionsApi, 'change', this.propName, value);
|
|
181
227
|
}
|
|
182
228
|
|
|
183
229
|
fieldOnBlur(event: any) {
|
|
@@ -186,12 +232,12 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
186
232
|
const index = this.options$?.findIndex(element => element.value === event.target.value);
|
|
187
233
|
key = index > -1 ? (key = this.options$[index].key) : event.target.value;
|
|
188
234
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
235
|
+
const value = key;
|
|
236
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
237
|
+
if (this.onRecordChange) {
|
|
238
|
+
event.target.value = value;
|
|
239
|
+
this.onRecordChange(event);
|
|
240
|
+
}
|
|
195
241
|
}
|
|
196
242
|
|
|
197
243
|
getErrorMessage() {
|
|
@@ -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$">
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
</div>
|
|
34
39
|
</mat-card>
|
|
35
40
|
</div>
|
|
36
|
-
<div *ngIf="bShowBanner && bShowConfirm">
|
|
41
|
+
<div *ngIf="bShowBanner && bShowConfirm && confirm_pconn">
|
|
37
42
|
<component-mapper name="View" [props]="{ formGroup$, pConn$: confirm_pconn }"></component-mapper>
|
|
38
43
|
</div>
|
|
39
44
|
</div>
|