@pega/angular-sdk-overrides 0.25.1 → 0.25.2
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/alert.component.scss +3 -3
- package/lib/designSystemExtension/banner/banner.component.scss +12 -2
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +6 -3
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +5 -34
- package/lib/designSystemExtension/material-details/material-details.component.scss +0 -5
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +4 -3
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.scss +2 -17
- package/lib/designSystemExtension/material-utility/material-utility.component.scss +1 -2
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.scss +1 -1
- package/lib/designSystemExtension/operator/operator.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.scss +3 -10
- package/lib/designSystemExtension/operator/operator.component.ts +0 -1
- package/lib/designSystemExtension/pulse/pulse.component.scss +2 -2
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +0 -1
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.scss +16 -8
- package/lib/field/auto-complete/auto-complete.component.html +0 -1
- package/lib/field/auto-complete/auto-complete.component.ts +35 -172
- package/lib/field/cancel-alert/cancel-alert.component.html +8 -12
- package/lib/field/cancel-alert/cancel-alert.component.scss +2 -3
- package/lib/field/cancel-alert/cancel-alert.component.ts +24 -36
- package/lib/field/check-box/check-box.component.html +0 -1
- package/lib/field/check-box/check-box.component.scss +0 -1
- package/lib/field/check-box/check-box.component.ts +19 -149
- package/lib/field/currency/currency.component.ts +36 -168
- package/lib/field/date/date.component.html +1 -1
- package/lib/field/date/date.component.ts +30 -150
- package/lib/field/date-time/date-time.component.ts +31 -149
- package/lib/field/decimal/decimal.component.ts +38 -163
- package/lib/field/dropdown/dropdown.component.ts +29 -151
- package/lib/field/email/email.component.ts +16 -155
- package/lib/field/field.base.ts +149 -0
- package/lib/field/group/group.component.ts +7 -4
- package/lib/field/integer/integer.component.ts +18 -157
- package/lib/field/location/location.component.ts +1 -1
- package/lib/field/multiselect/multiselect.component.ts +46 -148
- package/lib/field/multiselect/utils.ts +55 -47
- package/lib/field/object-reference/object-reference.component.html +17 -0
- package/lib/field/object-reference/object-reference.component.scss +0 -0
- package/lib/field/object-reference/object-reference.component.spec.ts +22 -0
- package/lib/field/object-reference/object-reference.component.ts +237 -0
- package/lib/field/percentage/percentage.component.ts +37 -154
- package/lib/field/phone/phone.component.ts +28 -142
- package/lib/field/radio-buttons/radio-buttons.component.scss +4 -2
- package/lib/field/radio-buttons/radio-buttons.component.ts +35 -161
- package/lib/field/rich-text/rich-text.component.ts +19 -90
- package/lib/field/scalar-list/scalar-list.component.ts +17 -72
- package/lib/field/selectable-card/selectable-card.component.html +54 -24
- package/lib/field/selectable-card/selectable-card.component.scss +11 -0
- package/lib/field/selectable-card/selectable-card.component.ts +16 -52
- package/lib/field/semantic-link/semantic-link.component.html +4 -8
- package/lib/field/semantic-link/semantic-link.component.scss +0 -13
- package/lib/field/semantic-link/semantic-link.component.ts +165 -5
- package/lib/field/text/text.component.scss +0 -1
- package/lib/field/text-area/text-area.component.ts +18 -152
- package/lib/field/text-input/text-input.component.ts +16 -155
- package/lib/field/time/time.component.ts +17 -151
- package/lib/field/url/url.component.ts +16 -154
- package/lib/field/user-reference/user-reference.component.scss +0 -1
- package/lib/field/user-reference/user-reference.component.ts +2 -3
- package/lib/infra/Containers/flow-container/flow-container.component.ts +5 -7
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +5 -10
- package/lib/infra/Containers/view-container/helper.ts +35 -2
- package/lib/infra/Containers/view-container/view-container.component.ts +1 -1
- package/lib/infra/action-buttons/action-buttons.component.html +13 -8
- package/lib/infra/action-buttons/action-buttons.component.scss +23 -0
- package/lib/infra/action-buttons/action-buttons.component.ts +1 -2
- package/lib/infra/assignment/assignment.component.ts +8 -6
- package/lib/infra/assignment-card/assignment-card.component.html +1 -2
- package/lib/infra/assignment-card/assignment-card.component.scss +0 -4
- package/lib/infra/assignment-card/assignment-card.component.ts +21 -4
- package/lib/infra/defer-load/defer-load.component.html +6 -2
- package/lib/infra/defer-load/defer-load.component.ts +16 -10
- package/lib/infra/multi-step/multi-step.component.scss +1 -21
- package/lib/infra/navbar/navbar.component.html +25 -28
- package/lib/infra/navbar/navbar.component.scss +16 -4
- package/lib/infra/navbar/navbar.component.ts +8 -3
- package/lib/infra/root-container/root-container.component.scss +0 -1
- package/lib/infra/root-container/root-container.component.ts +1 -2
- package/lib/infra/stages/stages.component.html +2 -2
- package/lib/infra/stages/stages.component.scss +7 -35
- package/lib/infra/stages/stages.component.ts +4 -2
- package/lib/infra/view/view.component.html +1 -1
- package/lib/infra/view/view.component.ts +0 -2
- package/lib/template/advanced-search/advanced-search.component.html +12 -0
- package/lib/template/advanced-search/advanced-search.component.scss +0 -0
- package/lib/template/advanced-search/advanced-search.component.spec.ts +0 -0
- package/lib/template/advanced-search/advanced-search.component.ts +112 -0
- package/lib/template/advanced-search/advanced-search.service.ts +27 -0
- package/lib/template/advanced-search/search-group/persist-utils.ts +56 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.html +32 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.scss +0 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.spec.ts +0 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.ts +294 -0
- package/lib/template/advanced-search/search-groups/utils.ts +29 -0
- package/lib/template/app-shell/app-shell.component.html +4 -1
- package/lib/template/app-shell/app-shell.component.scss +0 -3
- package/lib/template/app-shell/app-shell.component.ts +46 -7
- package/lib/template/case-summary/case-summary.component.scss +0 -2
- package/lib/template/case-view/case-view.component.html +3 -3
- package/lib/template/case-view/case-view.component.scss +18 -10
- package/lib/template/case-view/case-view.component.ts +1 -1
- package/lib/template/data-reference/data-reference-advanced-search.service.ts +16 -0
- package/lib/template/data-reference/data-reference.component.html +11 -8
- package/lib/template/data-reference/data-reference.component.ts +346 -112
- package/lib/template/data-reference/search-form/search-form.component.html +39 -0
- package/lib/template/data-reference/search-form/search-form.component.scss +11 -0
- package/lib/template/data-reference/search-form/search-form.component.spec.ts +0 -0
- package/lib/template/data-reference/search-form/search-form.component.ts +167 -0
- package/lib/template/data-reference/search-form/tabsData.ts +160 -0
- package/lib/template/data-reference/utils.ts +92 -0
- package/lib/template/default-form/default-form.component.ts +10 -2
- package/lib/template/default-page/default-page.component.html +34 -0
- package/lib/template/default-page/default-page.component.scss +31 -0
- package/lib/template/default-page/default-page.component.spec.ts +24 -0
- package/lib/template/default-page/default-page.component.ts +64 -0
- package/lib/template/field-group-list/field-group-list.component.scss +0 -1
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +1 -1
- package/lib/template/list-view/list-view.component.html +9 -4
- package/lib/template/list-view/list-view.component.scss +21 -21
- package/lib/template/list-view/list-view.component.ts +154 -84
- package/lib/template/list-view/utils.ts +25 -2
- package/lib/template/object-page/object-page.component.html +1 -0
- package/lib/template/object-page/object-page.component.scss +0 -0
- package/lib/template/object-page/object-page.component.spec.ts +22 -0
- package/lib/template/object-page/object-page.component.ts +14 -0
- package/lib/template/one-column-tab/one-column-tab.component.scss +1 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +0 -1
- package/lib/template/self-service-case-view/self-service-case-view.component.html +80 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.scss +124 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.spec.ts +24 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.ts +216 -0
- package/lib/template/simple-table/simple-table.component.ts +0 -1
- package/lib/template/simple-table-manual/helpers.ts +2 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.html +4 -4
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +4 -14
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +8 -4
- package/lib/template/single-reference-readonly/single-reference-readonly.component.html +4 -1
- package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +21 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +104 -3
- package/lib/template/utils.ts +42 -0
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +5 -4
- package/lib/template/wss-nav-bar/wss-nav-bar.component.scss +2 -8
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +1 -8
- package/lib/widget/app-announcement/app-announcement.component.html +1 -2
- package/lib/widget/app-announcement/app-announcement.component.scss +2 -2
- package/lib/widget/attachment/Attachment.types.ts +92 -0
- package/lib/widget/attachment/AttachmentUtils.ts +287 -0
- package/lib/widget/attachment/attachment.component.html +3 -3
- package/lib/widget/attachment/attachment.component.scss +2 -5
- package/lib/widget/attachment/attachment.component.ts +255 -254
- package/lib/widget/feed-container/feed-container.component.scss +3 -9
- package/lib/widget/feed-container/feed-container.component.ts +2 -2
- package/lib/widget/file-utility/file-utility.component.html +3 -3
- package/lib/widget/file-utility/file-utility.component.scss +5 -16
- package/lib/widget/list-utility/list-utility.component.scss +3 -5
- package/lib/widget/todo/todo.component.html +8 -5
- package/lib/widget/todo/todo.component.scss +10 -11
- package/lib/widget/todo/todo.component.ts +6 -2
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
.psdk-list-header {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
border-radius: 0.6125rem;
|
|
2
|
+
border: 1px solid var(--mat-sys-outline-variant);
|
|
3
|
+
background-color: var(--mat-sys-surface-container);
|
|
4
|
+
padding: 0.5rem 0rem;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
table {
|
|
9
8
|
width: 100%;
|
|
9
|
+
border-bottom: 1px solid var(--app-neutral-light-color);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
::ng-deep .mat-sort-header-content {
|
|
@@ -69,6 +69,7 @@ td.mat-mdc-footer-cell {
|
|
|
69
69
|
padding: 0.125rem 0.125rem;
|
|
70
70
|
min-width: unset;
|
|
71
71
|
width: 1.1rem;
|
|
72
|
+
margin-right: 1rem;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
.psdk-outer-div-in-form {
|
|
@@ -110,11 +111,11 @@ td.mat-mdc-footer-cell {
|
|
|
110
111
|
display: table;
|
|
111
112
|
margin: auto;
|
|
112
113
|
min-width: 100px;
|
|
113
|
-
background-color: var(--
|
|
114
|
-
border: 1px solid var(--
|
|
114
|
+
background-color: var(--mat-sys-surface);
|
|
115
|
+
border: 1px solid var(--mat-sys-outline-variant);
|
|
115
116
|
border-radius: 10px;
|
|
116
117
|
padding: 20px;
|
|
117
|
-
box-shadow: 0 0 10px 3px var(--
|
|
118
|
+
box-shadow: 0 0 10px 3px var(--mat-sys-level3);
|
|
118
119
|
position: absolute;
|
|
119
120
|
z-index: 99;
|
|
120
121
|
}
|
|
@@ -126,7 +127,7 @@ td.mat-mdc-footer-cell {
|
|
|
126
127
|
align-items: center;
|
|
127
128
|
height: 100%;
|
|
128
129
|
width: 100%;
|
|
129
|
-
background-color:
|
|
130
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
130
131
|
position: fixed;
|
|
131
132
|
z-index: 999;
|
|
132
133
|
top: 0px;
|
|
@@ -137,11 +138,11 @@ td.mat-mdc-footer-cell {
|
|
|
137
138
|
display: table;
|
|
138
139
|
margin: auto;
|
|
139
140
|
min-width: 150px;
|
|
140
|
-
background-color: var(--
|
|
141
|
-
border: 1px solid var(--
|
|
141
|
+
background-color: var(--mat-sys-surface-container);
|
|
142
|
+
border: 1px solid var(--mat-sys-outline-variant);
|
|
142
143
|
border-radius: 10px;
|
|
143
144
|
padding: 20px;
|
|
144
|
-
box-shadow: 0 0 10px 3px var(--
|
|
145
|
+
box-shadow: 0 0 10px 3px var(--mat-sys-level3);
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
tr.mat-mdc-row {
|
|
@@ -153,19 +154,10 @@ tr.mat-mdc-row {
|
|
|
153
154
|
justify-content: center;
|
|
154
155
|
display: flex;
|
|
155
156
|
align-items: center;
|
|
156
|
-
border: 1px solid var(--
|
|
157
|
+
border: 1px solid var(--mat-sys-outline-variant);
|
|
157
158
|
border-top: none;
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
.psdk-table-field-link {
|
|
161
|
-
color: var(--app-primary-color);
|
|
162
|
-
padding: 0;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
border: 0;
|
|
165
|
-
background-color: transparent;
|
|
166
|
-
align-items: center;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
161
|
.results-count {
|
|
170
162
|
opacity: 0.7;
|
|
171
163
|
font-size: 0.8rem;
|
|
@@ -176,3 +168,11 @@ tr.mat-mdc-row {
|
|
|
176
168
|
.label {
|
|
177
169
|
margin: 8px;
|
|
178
170
|
}
|
|
171
|
+
|
|
172
|
+
::ng-deep th.mat-mdc-header-cell,
|
|
173
|
+
td.mat-mdc-cell,
|
|
174
|
+
td.mat-mdc-footer-cell {
|
|
175
|
+
border-right: 1px solid var(--app-neutral-light-color);
|
|
176
|
+
padding: 8px !important;
|
|
177
|
+
// min-width: 10rem;
|
|
178
|
+
}
|
|
@@ -42,6 +42,9 @@ interface ListViewProps {
|
|
|
42
42
|
value: any;
|
|
43
43
|
readonlyContextList: any;
|
|
44
44
|
label?: string;
|
|
45
|
+
displayAs?: string;
|
|
46
|
+
showRecords: boolean;
|
|
47
|
+
viewName?: string;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export class Group {
|
|
@@ -157,7 +160,11 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
157
160
|
fieldDefs: any;
|
|
158
161
|
checkBoxValue: string;
|
|
159
162
|
label?: string = '';
|
|
160
|
-
|
|
163
|
+
uniqueId = crypto.randomUUID();
|
|
164
|
+
displayAs: any;
|
|
165
|
+
showRecords: any;
|
|
166
|
+
identifier: string;
|
|
167
|
+
promotedFiltersId: string;
|
|
161
168
|
constructor(
|
|
162
169
|
private psService: ProgressSpinnerService,
|
|
163
170
|
public utils: Utils
|
|
@@ -169,12 +176,13 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
169
176
|
const defRowID = this.configProps$?.referenceType === 'Case' ? 'pyID' : 'pyGUID';
|
|
170
177
|
/** If compositeKeys is defined, use dynamic value, else fallback to pyID or pyGUID. */
|
|
171
178
|
this.compositeKeys = this.configProps$?.compositeKeys;
|
|
172
|
-
this.rowID = this.compositeKeys
|
|
179
|
+
this.rowID = this.payload?.compositeKeys?.length === 1 ? this.payload?.compositeKeys[0] : defRowID;
|
|
173
180
|
this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$?.globalSearch ? this.configProps$.globalSearch : this.payload?.globalSearch);
|
|
174
181
|
this.bColumnReorder$ = this.utils.getBooleanValue(this.configProps$.reorderFields);
|
|
175
182
|
this.bGrouping$ = this.utils.getBooleanValue(this.configProps$.grouping);
|
|
176
183
|
this.showDynamicFields = this.configProps$?.showDynamicFields;
|
|
177
|
-
|
|
184
|
+
this.displayAs = this.configProps$.displayAs;
|
|
185
|
+
this.showRecords = this.configProps$.showRecords;
|
|
178
186
|
this.menuSvgIcon$ = this.utils.getImageSrc('more', this.utils.getSDKStaticContentUrl());
|
|
179
187
|
this.arrowDownSvgIcon$ = this.utils.getImageSrc('arrow-down', this.utils.getSDKStaticContentUrl());
|
|
180
188
|
this.arrowUpSvgIcon$ = this.utils.getImageSrc('arrow-up', this.utils.getSDKStaticContentUrl());
|
|
@@ -203,6 +211,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
203
211
|
this.label = title;
|
|
204
212
|
|
|
205
213
|
this.searchIcon$ = this.utils.getImageSrc('search', this.utils.getSDKStaticContentUrl());
|
|
214
|
+
this.promotedFiltersId = `promoted-filters-queryable-${this.uniqueId}`;
|
|
206
215
|
setTimeout(() => {
|
|
207
216
|
PCore.getPubSubUtils().subscribe(
|
|
208
217
|
PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CHANGE,
|
|
@@ -223,6 +232,15 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
223
232
|
false,
|
|
224
233
|
this.pConn$.getContextName()
|
|
225
234
|
);
|
|
235
|
+
PCore.getPubSubUtils().subscribe(
|
|
236
|
+
PCore.getEvents().getTransientEvent().UPDATE_PROMOTED_FILTERS,
|
|
237
|
+
data => {
|
|
238
|
+
this.showRecords = data.showRecords;
|
|
239
|
+
const filterData = this.prepareFilters(data);
|
|
240
|
+
this.processFilterChange(filterData);
|
|
241
|
+
},
|
|
242
|
+
this.promotedFiltersId
|
|
243
|
+
);
|
|
226
244
|
}, 0);
|
|
227
245
|
if (this.configProps$) {
|
|
228
246
|
if (!this.payload) {
|
|
@@ -242,6 +260,29 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
242
260
|
this.getListData();
|
|
243
261
|
});
|
|
244
262
|
}
|
|
263
|
+
this.clearSelectionsAndUpdateTable(this.pConn$, this.uniqueId, this.configProps$?.viewName);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
clearSelectionsAndUpdateTable(getPConnect: any, uniqueId: string, viewName): void {
|
|
267
|
+
const clearSelectionsAndRefreshList = ({ viewName: name, clearSelections }: any) => {
|
|
268
|
+
if (name === viewName) {
|
|
269
|
+
const { selectionMode } = getPConnect.getRawConfigProps();
|
|
270
|
+
if (!selectionMode) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (clearSelections) {
|
|
274
|
+
if (selectionMode === 'single') {
|
|
275
|
+
getPConnect.getListActions().setSelectedRows({});
|
|
276
|
+
} else {
|
|
277
|
+
getPConnect.getListActions().clearSelectedRows();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
this.identifier = `clear-and-update-advanced-search-selections-${uniqueId}`;
|
|
284
|
+
|
|
285
|
+
PCore.getPubSubUtils().subscribe('update-advanced-search-selections', clearSelectionsAndRefreshList, this.identifier);
|
|
245
286
|
}
|
|
246
287
|
|
|
247
288
|
getFieldFromFilter(filter, dateRange = false) {
|
|
@@ -256,82 +297,22 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
256
297
|
|
|
257
298
|
// Will be triggered when EVENT_DASHBOARD_FILTER_CHANGE fires
|
|
258
299
|
processFilterChange(data) {
|
|
259
|
-
|
|
260
|
-
let dashboardFilterPayload: any = {
|
|
261
|
-
query: {
|
|
262
|
-
filter: {},
|
|
263
|
-
select: []
|
|
264
|
-
}
|
|
265
|
-
};
|
|
300
|
+
this.updateFiltersFromData(data);
|
|
266
301
|
|
|
267
|
-
this.
|
|
268
|
-
let isDateRange = !!data.filterExpression?.AND;
|
|
269
|
-
// Will be AND by default but making it dynamic in case we support dynamic relational ops in future
|
|
270
|
-
const relationalOp = 'AND';
|
|
302
|
+
const selectParam = this.displayedColumns$?.map(col => ({ field: col })) || [];
|
|
271
303
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
selectParam.push({
|
|
277
|
-
field: col
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
// Checking if the triggered filter is applicable for this list
|
|
282
|
-
if (data.filterExpression !== null && !(this.displayedColumns$?.length && this.displayedColumns$?.includes(field))) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
// This is a flag which will be used to reset dashboardFilterPayload in case we don't find any valid filters
|
|
286
|
-
let validFilter = false;
|
|
287
|
-
|
|
288
|
-
let index = 1;
|
|
289
|
-
// Iterating over the current filters list to create filter data which will be POSTed
|
|
290
|
-
const filterKeys: any[] = Object.keys(this.filters);
|
|
291
|
-
const filterValues: any[] = Object.values(this.filters);
|
|
292
|
-
for (let filterIndex = 0; filterIndex < filterKeys.length; filterIndex++) {
|
|
293
|
-
const filter = filterValues[filterIndex];
|
|
294
|
-
// If the filter is null then we can skip this iteration
|
|
295
|
-
if (filter === null) {
|
|
296
|
-
// eslint-disable-next-line no-continue
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// Checking if the filter is of type- Date Range
|
|
301
|
-
isDateRange = !!filter?.AND;
|
|
302
|
-
field = this.getFieldFromFilter(filter, isDateRange);
|
|
303
|
-
|
|
304
|
-
if (!(this.displayedColumns$?.length && this.displayedColumns$?.includes(field))) {
|
|
305
|
-
// eslint-disable-next-line no-continue
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
// If we reach here that implies we've at least one valid filter, hence setting the flag
|
|
309
|
-
validFilter = true;
|
|
310
|
-
/** Below are the 2 cases for- Text & Date-Range filter types where we'll construct filter data which will be sent in the dashboardFilterPayload
|
|
311
|
-
* In Constellation DX Components, through Repeating Structures they might be using several APIs to do it. We're doing it here
|
|
312
|
-
*/
|
|
313
|
-
if (isDateRange) {
|
|
314
|
-
dashboardFilterPayload = this.filterBasedOnDateRange(dashboardFilterPayload, filter, relationalOp, selectParam, index);
|
|
315
|
-
} else {
|
|
316
|
-
dashboardFilterPayload.query.filter.filterConditions = {
|
|
317
|
-
...dashboardFilterPayload.query.filter.filterConditions,
|
|
318
|
-
[`T${index++}`]: { ...filter.condition, ignoreCase: true }
|
|
319
|
-
};
|
|
304
|
+
if (this.displayAs !== 'advancedSearch') {
|
|
305
|
+
const { filterExpression } = data;
|
|
306
|
+
const isDateRange = !!filterExpression?.AND;
|
|
307
|
+
const field = this.getFieldFromFilter(filterExpression, isDateRange);
|
|
320
308
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
} else {
|
|
324
|
-
dashboardFilterPayload.query.filter.logic = `T${index - 1}`;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
dashboardFilterPayload.query.select = selectParam;
|
|
309
|
+
if (filterExpression !== null && !this.displayedColumns$?.includes(field)) {
|
|
310
|
+
return;
|
|
328
311
|
}
|
|
329
312
|
}
|
|
330
313
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
dashboardFilterPayload = undefined;
|
|
334
|
-
}
|
|
314
|
+
const dashboardFilterPayload = this.buildFilterPayload(selectParam);
|
|
315
|
+
|
|
335
316
|
this.filterPayload = dashboardFilterPayload;
|
|
336
317
|
this.getListData();
|
|
337
318
|
}
|
|
@@ -366,10 +347,22 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
366
347
|
return PCore.getAnalyticsUtils().getDataViewMetadata(refList, this.showDynamicFields);
|
|
367
348
|
}
|
|
368
349
|
|
|
350
|
+
getValue(col) {
|
|
351
|
+
return this.fieldDefs.find(f => f.name === col)?.label;
|
|
352
|
+
}
|
|
353
|
+
|
|
369
354
|
getListData() {
|
|
355
|
+
this.preparePayload();
|
|
370
356
|
const componentConfig = this.pConn$.getComponentConfig();
|
|
371
|
-
|
|
372
|
-
|
|
357
|
+
const columnFields = componentConfig.presets[0].children[0].children;
|
|
358
|
+
const columns = this.getHeaderCells(columnFields, this.fieldDefs);
|
|
359
|
+
this.fields$ = this.configProps$.presets[0].children[0].children;
|
|
360
|
+
this.displayedColumns$ = columns.map(col => {
|
|
361
|
+
return col.id;
|
|
362
|
+
});
|
|
363
|
+
if (this.displayAs === 'advancedSearch' && !this.showRecords) {
|
|
364
|
+
Promise.resolve({ data: null });
|
|
365
|
+
} else if (this.configProps$) {
|
|
373
366
|
const refList = this.configProps$.referenceList;
|
|
374
367
|
const fieldsMetaDataPromise = this.getFieldsMetadata(refList);
|
|
375
368
|
// returns a promise
|
|
@@ -395,17 +388,9 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
395
388
|
const fieldsMetaData = results[0];
|
|
396
389
|
const workListData = results[1];
|
|
397
390
|
|
|
398
|
-
this.fields$ = this.configProps$.presets[0].children[0].children;
|
|
399
|
-
// this is an unresovled version of this.fields$, need unresolved, so can get the property reference
|
|
400
|
-
const columnFields = componentConfig.presets[0].children[0].children;
|
|
401
|
-
|
|
402
391
|
const tableDataResults = !this.bInForm$ ? workListData.data.data : workListData.data;
|
|
403
392
|
|
|
404
|
-
const columns = this.getHeaderCells(columnFields, this.fieldDefs);
|
|
405
393
|
this.fields$ = this.updateFields(this.fields$, fieldsMetaData.data.fields, columns);
|
|
406
|
-
this.displayedColumns$ = columns.map(col => {
|
|
407
|
-
return col.id;
|
|
408
|
-
});
|
|
409
394
|
this.response = tableDataResults;
|
|
410
395
|
this.updatedRefList = this.updateData(tableDataResults, this.fields$);
|
|
411
396
|
if (this.selectionMode === SELECTION_MODE.SINGLE && this.updatedRefList?.length > 0) {
|
|
@@ -433,6 +418,33 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
433
418
|
}
|
|
434
419
|
}
|
|
435
420
|
|
|
421
|
+
prepareFilters(data) {
|
|
422
|
+
return Object.entries(data.payload).reduce((acc, [field, value]) => {
|
|
423
|
+
if (value) {
|
|
424
|
+
let comparator = 'EQ';
|
|
425
|
+
const filterRecord = this.listContext.meta.fieldDefs.filter(item => item.id === field);
|
|
426
|
+
if (filterRecord?.[0]?.meta.type === 'TextInput') {
|
|
427
|
+
comparator = 'CONTAINS';
|
|
428
|
+
}
|
|
429
|
+
acc[field] = {
|
|
430
|
+
filterExpression: {
|
|
431
|
+
condition: {
|
|
432
|
+
lhs: {
|
|
433
|
+
field
|
|
434
|
+
},
|
|
435
|
+
comparator,
|
|
436
|
+
rhs: {
|
|
437
|
+
value
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
filterId: field
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
return acc;
|
|
445
|
+
}, {});
|
|
446
|
+
}
|
|
447
|
+
|
|
436
448
|
preparePayload() {
|
|
437
449
|
const { fieldDefs, itemKey, patchQueryFields } = this.listContext.meta;
|
|
438
450
|
this.fieldDefs = fieldDefs;
|
|
@@ -474,6 +486,8 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
474
486
|
`dashboard-component-${'id'}`,
|
|
475
487
|
this.pConn$.getContextName()
|
|
476
488
|
);
|
|
489
|
+
PCore.getPubSubUtils().unsubscribe('update-advanced-search-selections', this.identifier);
|
|
490
|
+
PCore.getPubSubUtils().unsubscribe(PCore.getEvents().getTransientEvent().UPDATE_PROMOTED_FILTERS, this.promotedFiltersId);
|
|
477
491
|
}
|
|
478
492
|
|
|
479
493
|
// ngAfterViewInit() {
|
|
@@ -1153,7 +1167,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
1153
1167
|
const seen = {};
|
|
1154
1168
|
return a.filter(item => {
|
|
1155
1169
|
const k = key(item);
|
|
1156
|
-
// eslint-disable-next-line no-
|
|
1170
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
1157
1171
|
return seen.hasOwnProperty(k) ? false : (seen[k] = true);
|
|
1158
1172
|
});
|
|
1159
1173
|
}
|
|
@@ -1427,4 +1441,60 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
1427
1441
|
|
|
1428
1442
|
return select;
|
|
1429
1443
|
}
|
|
1444
|
+
|
|
1445
|
+
private updateFiltersFromData(data) {
|
|
1446
|
+
if (this.displayAs === 'advancedSearch') {
|
|
1447
|
+
this.filters = {};
|
|
1448
|
+
Object.values(data).forEach((value: any) => {
|
|
1449
|
+
this.filters[value.filterId] = value.filterExpression;
|
|
1450
|
+
});
|
|
1451
|
+
} else {
|
|
1452
|
+
const { filterId, filterExpression } = data;
|
|
1453
|
+
this.filters[filterId] = filterExpression;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
private buildFilterPayload(selectParam: any[]) {
|
|
1458
|
+
const filterConditions = {};
|
|
1459
|
+
let logic = '';
|
|
1460
|
+
let index = 1;
|
|
1461
|
+
const relationalOp = 'AND';
|
|
1462
|
+
|
|
1463
|
+
for (const currentFilter of Object.values(this.filters)) {
|
|
1464
|
+
const filter: any = currentFilter;
|
|
1465
|
+
if (!filter) continue;
|
|
1466
|
+
|
|
1467
|
+
const isDateRange = !!filter.AND;
|
|
1468
|
+
const field = this.getFieldFromFilter(filter, isDateRange);
|
|
1469
|
+
|
|
1470
|
+
if (!this.displayedColumns$?.includes(field)) continue;
|
|
1471
|
+
|
|
1472
|
+
if (logic) {
|
|
1473
|
+
logic += ` ${relationalOp} `;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
if (isDateRange) {
|
|
1477
|
+
const dateRelationalOp = filter.AND ? 'AND' : 'OR';
|
|
1478
|
+
filterConditions[`T${index}`] = { ...filter[relationalOp][0].condition };
|
|
1479
|
+
filterConditions[`T${index + 1}`] = { ...filter[relationalOp][1].condition };
|
|
1480
|
+
logic += `(T${index} ${dateRelationalOp} T${index + 1})`;
|
|
1481
|
+
index += 2;
|
|
1482
|
+
} else {
|
|
1483
|
+
filterConditions[`T${index}`] = { ...filter.condition, ...(filter.condition.comparator === 'CONTAINS' && { ignoreCase: true }) };
|
|
1484
|
+
logic += `T${index}`;
|
|
1485
|
+
index++;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
if (!logic) {
|
|
1490
|
+
return undefined;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
return {
|
|
1494
|
+
query: {
|
|
1495
|
+
filter: { filterConditions, logic },
|
|
1496
|
+
select: selectParam
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1430
1500
|
}
|
|
@@ -550,6 +550,27 @@ function populateRenderingOptions(name, config, field) {
|
|
|
550
550
|
config.cellRenderer = formatConstants.Integer;
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
+
function isFLProperty(label) {
|
|
554
|
+
return label?.startsWith('@FL');
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function getFieldLabel(fieldConfig) {
|
|
558
|
+
const { label, classID, caption } = fieldConfig;
|
|
559
|
+
let fieldLabel = (label ?? caption)?.substring(4);
|
|
560
|
+
const labelSplit = fieldLabel?.split('.');
|
|
561
|
+
const propertyName = labelSplit?.pop();
|
|
562
|
+
const fieldMetaData: any = PCore.getMetadataUtils().getPropertyMetadata(propertyName, classID) ?? {};
|
|
563
|
+
fieldLabel = fieldMetaData.label ?? fieldMetaData.caption ?? propertyName;
|
|
564
|
+
|
|
565
|
+
const definedOnClassID = fieldMetaData.definedOnClassID;
|
|
566
|
+
const localeValue = PCore.getLocaleUtils().getLocaleValue(
|
|
567
|
+
fieldLabel,
|
|
568
|
+
`${definedOnClassID ?? fieldMetaData.classID ?? classID}.${propertyName}`,
|
|
569
|
+
PCore.getLocaleUtils().FIELD_LABELS_BUNDLE_KEY,
|
|
570
|
+
null
|
|
571
|
+
);
|
|
572
|
+
return localeValue || fieldLabel;
|
|
573
|
+
}
|
|
553
574
|
export function initializeColumns(fields: any[] = [], getMappedProperty: any = null) {
|
|
554
575
|
return fields.map((field, originalColIndex) => {
|
|
555
576
|
let name = field.config.value;
|
|
@@ -562,7 +583,9 @@ export function initializeColumns(fields: any[] = [], getMappedProperty: any = n
|
|
|
562
583
|
|
|
563
584
|
let label = field.config.label || field.config.caption;
|
|
564
585
|
const { show = true, displayAs } = field.config;
|
|
565
|
-
if (label
|
|
586
|
+
if (isFLProperty(label)) {
|
|
587
|
+
label = getFieldLabel(field.config);
|
|
588
|
+
} else if (label.startsWith('@')) {
|
|
566
589
|
label = label.substring(3);
|
|
567
590
|
}
|
|
568
591
|
|
|
@@ -653,7 +676,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
653
676
|
const { pConn$, apiContext, children, showDynamicFields, referenceList, isDataObject } = params;
|
|
654
677
|
// let { listContext } = params;
|
|
655
678
|
const { promisesResponseArray, apiContext: otherContext } = context;
|
|
656
|
-
|
|
679
|
+
|
|
657
680
|
const listOfComponents: any[] = [];
|
|
658
681
|
const {
|
|
659
682
|
data: { fields: metaFields, classID, isQueryable }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<component-mapper name="CaseView" [props]="{ pConn$, formGroup$ }"></component-mapper>
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ObjectPageComponent } from './object-page.component';
|
|
4
|
+
|
|
5
|
+
describe('ObjectPageComponent', () => {
|
|
6
|
+
let component: ObjectPageComponent;
|
|
7
|
+
let fixture: ComponentFixture<ObjectPageComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ObjectPageComponent]
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
|
|
14
|
+
fixture = TestBed.createComponent(ObjectPageComponent);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
fixture.detectChanges();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create', () => {
|
|
20
|
+
expect(component).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component, forwardRef, Input } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'lib-object-page',
|
|
7
|
+
imports: [forwardRef(() => ComponentMapperComponent)],
|
|
8
|
+
templateUrl: './object-page.component.html',
|
|
9
|
+
styleUrl: './object-page.component.scss'
|
|
10
|
+
})
|
|
11
|
+
export class ObjectPageComponent {
|
|
12
|
+
@Input() pConn$: typeof PConnect;
|
|
13
|
+
@Input() formGroup$: FormGroup;
|
|
14
|
+
}
|
|
@@ -68,7 +68,6 @@ export class RepeatingStructuresComponent implements OnInit, AfterViewInit {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
rowClick(row) {
|
|
71
|
-
// eslint-disable-next-line sonarjs/no-small-switch
|
|
72
71
|
switch (this.configProps$.rowClickAction) {
|
|
73
72
|
case 'openAssignment':
|
|
74
73
|
this.psService.sendMessage(true);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<div *ngIf="showCaseActions" class="psdk-self-service-case-view-header">
|
|
2
|
+
<div>{{ this.heading$ }}</div>
|
|
3
|
+
<div class="psdk-case-view-buttons">
|
|
4
|
+
<button mat-raised-button color="secondary" [matMenuTriggerFor]="actionMenu">{{ localizedVal('Actions...', localeCategory) }}</button>
|
|
5
|
+
<mat-menu #actionMenu="matMenu" overlapTrigger="false">
|
|
6
|
+
<ng-container *ngFor="let action of arAvailableActions$">
|
|
7
|
+
<button mat-menu-item (click)="_menuActionClick(action)">
|
|
8
|
+
{{ localizedVal(action.name, '', localeKey) }}
|
|
9
|
+
</button>
|
|
10
|
+
</ng-container>
|
|
11
|
+
<ng-container *ngFor="let process of arAvailabeProcesses$">
|
|
12
|
+
<button mat-menu-item (click)="_menuProcessClick(process)">
|
|
13
|
+
{{ process.name }}
|
|
14
|
+
</button>
|
|
15
|
+
</ng-container>
|
|
16
|
+
</mat-menu>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="psdk-case-view" id="case-view">
|
|
20
|
+
<div class="psdk-case-view-info">
|
|
21
|
+
<div *ngIf="showSummaryRegion && (primarySummaryFields.length > 0 || secondarySummaryFields.length > 0)">
|
|
22
|
+
<mat-toolbar class="psdk-case-view-toolbar">
|
|
23
|
+
<mat-toolbar-row class="psdk-case-view-toolbar-row">
|
|
24
|
+
<div class="psdk-case-view-heading">
|
|
25
|
+
<div>
|
|
26
|
+
<h1 id="case-name">{{ heading$ }}</h1>
|
|
27
|
+
</div>
|
|
28
|
+
<div id="current-caseID" [hidden]="true">{{ currentCaseID }}</div>
|
|
29
|
+
<div class="psdk-case-view-heading-id" id="caseId">{{ id$ }}</div>
|
|
30
|
+
</div>
|
|
31
|
+
</mat-toolbar-row>
|
|
32
|
+
</mat-toolbar>
|
|
33
|
+
<div class="psdk-case-view-divider"></div>
|
|
34
|
+
<div class="psdk-case-view-summary">
|
|
35
|
+
<component-mapper
|
|
36
|
+
name="CaseSummaryFields"
|
|
37
|
+
[props]="{ primaryFields$: primarySummaryFields, secondaryFields$: secondarySummaryFields }"
|
|
38
|
+
></component-mapper>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="psdk-case-view-main">
|
|
43
|
+
<div>
|
|
44
|
+
<div *ngFor="let kid of arChildren$">
|
|
45
|
+
<div
|
|
46
|
+
*ngIf="
|
|
47
|
+
kid.getPConnect().getRawMetadata().type.toLowerCase() == 'region' &&
|
|
48
|
+
kid.getPConnect().getRawMetadata().name.toLowerCase() == 'stages' &&
|
|
49
|
+
showCaseLifecycle
|
|
50
|
+
"
|
|
51
|
+
>
|
|
52
|
+
<component-mapper name="Region" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div *ngFor="let kid of arChildren$">
|
|
58
|
+
<div
|
|
59
|
+
*ngIf="kid.getPConnect().getRawMetadata().type.toLowerCase() == 'region' && kid.getPConnect().getRawMetadata().name.toLowerCase() == 'todo'"
|
|
60
|
+
>
|
|
61
|
+
<component-mapper name="Region" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div *ngFor="let kid of arChildren$">
|
|
66
|
+
<div *ngIf="kid.getPConnect().getRawMetadata().type.toLowerCase() == 'region' && kid.getPConnect().getRawMetadata().name == 'Main'">
|
|
67
|
+
<component-mapper name="Region" [props]="{ pConn$: kid.getPConnect(), formGroup$ }"></component-mapper>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="psdk-case-view-utilities">
|
|
72
|
+
<div *ngIf="arChildren$ && showUtilitiesRegion && isUtilitiesRegionNotEmpty()">
|
|
73
|
+
<div *ngFor="let kid of arChildren$">
|
|
74
|
+
<div *ngIf="kid.getPConnect().getRawMetadata()?.type.toLowerCase() == 'region' && kid.getPConnect().getRawMetadata()?.name == 'Utilities'">
|
|
75
|
+
<component-mapper name="Region" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|