@pega/react-sdk-overrides 0.24.4 → 0.25.1
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/AlertBanner/AlertBanner.tsx +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +11 -2
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +4 -4
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +6 -6
- package/lib/designSystemExtension/Operator/Operator.tsx +6 -5
- package/lib/designSystemExtension/Pulse/Pulse.tsx +2 -2
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
- package/lib/field/AutoComplete/AutoComplete.tsx +4 -4
- package/lib/field/CancelAlert/CancelAlert.tsx +4 -7
- package/lib/field/Checkbox/Checkbox.tsx +4 -4
- package/lib/field/Currency/Currency.tsx +10 -7
- package/lib/field/Date/Date.tsx +27 -42
- package/lib/field/DateTime/DateTime.tsx +39 -36
- package/lib/field/Decimal/Decimal.tsx +9 -4
- package/lib/field/Dropdown/Dropdown.tsx +29 -22
- package/lib/field/Email/Email.tsx +29 -8
- package/lib/field/Group/Group.tsx +2 -2
- package/lib/field/Integer/Integer.tsx +22 -8
- package/lib/field/Multiselect/Multiselect.tsx +8 -14
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/Percentage/Percentage.tsx +8 -4
- package/lib/field/Phone/Phone.tsx +6 -5
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +3 -6
- package/lib/field/RichText/RichText.tsx +1 -1
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/ScalarList/ScalarList.tsx +3 -4
- package/lib/field/SemanticLink/SemanticLink.tsx +4 -4
- package/lib/field/TextArea/TextArea.tsx +26 -8
- package/lib/field/TextContent/TextContent.tsx +1 -1
- package/lib/field/TextInput/TextInput.tsx +2 -2
- package/lib/field/Time/Time.tsx +28 -21
- package/lib/field/URL/URL.tsx +26 -7
- package/lib/field/UserReference/UserReference.tsx +3 -5
- package/lib/helpers/common-utils.ts +24 -1
- package/lib/helpers/field-group-utils.ts +2 -2
- package/lib/helpers/formatters/Currency.ts +11 -16
- package/lib/helpers/formatters/common.ts +2 -1
- package/lib/helpers/formatters/index.ts +2 -4
- package/lib/helpers/simpleTableHelpers.ts +1 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
- package/lib/infra/Assignment/Assignment.tsx +12 -12
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +16 -28
- package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +9 -4
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
- package/lib/infra/Containers/SimpleView/helper.ts +1 -1
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +4 -6
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
- package/lib/infra/DeferLoad/DeferLoad.tsx +8 -8
- package/lib/infra/MultiStep/MultiStep.tsx +15 -14
- package/lib/infra/NavBar/NavBar.css +1 -0
- package/lib/infra/NavBar/NavBar.tsx +25 -17
- package/lib/infra/RootContainer/RootContainer.tsx +5 -6
- package/lib/infra/Stages/Stages.tsx +4 -4
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
- package/lib/infra/View/View.tsx +37 -3
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +87 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +58 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +245 -0
- package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/lib/template/AdvancedSearch/config-ext.json +9 -0
- package/lib/template/AdvancedSearch/index.tsx +1 -0
- package/lib/template/AppShell/AppShell.tsx +60 -10
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/CaseView/CaseView.tsx +10 -9
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +7 -7
- package/lib/template/Confirmation/Confirmation.tsx +3 -2
- package/lib/template/DataReference/DataReference.tsx +317 -107
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.js +10 -0
- package/lib/template/DataReference/SearchForm.tsx +148 -0
- package/lib/template/DataReference/utils.js +90 -0
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/Details/Details/Details.tsx +2 -2
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +3 -3
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +2 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +2 -2
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +4 -4
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -5
- package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/template/ListView/ListView.tsx +200 -94
- package/lib/template/ListView/utils.ts +38 -6
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +2 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +0 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +110 -86
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +2 -4
- package/lib/template/SubTabs/SubTabs.tsx +2 -2
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +2 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.tsx +9 -9
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +2 -2
- package/lib/widget/Attachment/Attachment.css +1 -0
- package/lib/widget/Attachment/Attachment.tsx +7 -9
- package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +5 -4
- package/lib/widget/Followers/Followers.tsx +2 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +0 -1
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/lib/widget/SummaryItem/SummaryItem.tsx +4 -3
- package/lib/widget/ToDo/ToDo.tsx +92 -22
- package/package.json +1 -1
- /package/lib/infra/Containers/{helpers.ts → container-helpers.ts} +0 -0
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/* eslint-disable no-nested-ternary */
|
|
2
1
|
import React, { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import Table from '@material
|
|
4
|
-
import TableBody from '@material
|
|
5
|
-
import TableCell from '@material
|
|
6
|
-
import TableContainer from '@material
|
|
7
|
-
import TableHead from '@material
|
|
8
|
-
import TableRow from '@material
|
|
9
|
-
import Paper from '@material
|
|
10
|
-
import
|
|
11
|
-
import Link from '@material
|
|
2
|
+
import Table from '@mui/material/Table';
|
|
3
|
+
import TableBody from '@mui/material/TableBody';
|
|
4
|
+
import TableCell from '@mui/material/TableCell';
|
|
5
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
6
|
+
import TableHead from '@mui/material/TableHead';
|
|
7
|
+
import TableRow from '@mui/material/TableRow';
|
|
8
|
+
import Paper from '@mui/material/Paper';
|
|
9
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
10
|
+
import Link from '@mui/material/Link';
|
|
12
11
|
import { createElement } from 'react';
|
|
13
|
-
import TableSortLabel from '@material
|
|
14
|
-
import MoreIcon from '@
|
|
15
|
-
import Menu from '@material
|
|
16
|
-
import MenuItem from '@material
|
|
17
|
-
import FilterListIcon from '@
|
|
18
|
-
import SubjectIcon from '@
|
|
19
|
-
import Dialog from '@material
|
|
20
|
-
import DialogActions from '@material
|
|
21
|
-
import DialogContent from '@material
|
|
22
|
-
import DialogTitle from '@material
|
|
23
|
-
import Select from '@material
|
|
24
|
-
import Button from '@material
|
|
25
|
-
import TextField from '@material
|
|
12
|
+
import TableSortLabel from '@mui/material/TableSortLabel';
|
|
13
|
+
import MoreIcon from '@mui/icons-material/MoreVert';
|
|
14
|
+
import Menu from '@mui/material/Menu';
|
|
15
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
16
|
+
import FilterListIcon from '@mui/icons-material/FilterList';
|
|
17
|
+
import SubjectIcon from '@mui/icons-material/Subject';
|
|
18
|
+
import Dialog from '@mui/material/Dialog';
|
|
19
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
20
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
21
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
22
|
+
import Select from '@mui/material/Select';
|
|
23
|
+
import Button from '@mui/material/Button';
|
|
24
|
+
import TextField from '@mui/material/TextField';
|
|
26
25
|
|
|
27
26
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
28
27
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
29
28
|
import { getReferenceList } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
30
29
|
import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
|
|
30
|
+
import { getGenericFieldsLocalizedValue } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
31
31
|
import { buildFieldsForTable, filterData, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
|
|
32
32
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
33
33
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
@@ -52,12 +52,27 @@ interface SimpleTableManualProps extends PConnProps {
|
|
|
52
52
|
displayMode?: string;
|
|
53
53
|
useSeparateViewForEdit: any;
|
|
54
54
|
viewForEditModal: any;
|
|
55
|
+
validatemessage?: string;
|
|
56
|
+
required?: boolean;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
const useStyles = makeStyles((/* theme */) => ({
|
|
58
60
|
label: {
|
|
59
61
|
margin: '8px'
|
|
60
62
|
},
|
|
63
|
+
tableLabel: {
|
|
64
|
+
'&::after': {
|
|
65
|
+
display: 'inline',
|
|
66
|
+
content: '" *"',
|
|
67
|
+
verticalAlign: 'top',
|
|
68
|
+
color: 'var(--app-error-color)'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
message: {
|
|
72
|
+
margin: '8px',
|
|
73
|
+
color: 'var(--app-error-color)',
|
|
74
|
+
fontSize: '14px'
|
|
75
|
+
},
|
|
61
76
|
header: {
|
|
62
77
|
background: '#f5f5f5'
|
|
63
78
|
},
|
|
@@ -110,7 +125,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
110
125
|
editModeConfig,
|
|
111
126
|
displayMode,
|
|
112
127
|
useSeparateViewForEdit,
|
|
113
|
-
viewForEditModal
|
|
128
|
+
viewForEditModal,
|
|
129
|
+
required,
|
|
130
|
+
validatemessage
|
|
114
131
|
} = props;
|
|
115
132
|
const pConn = getPConnect();
|
|
116
133
|
const [rowData, setRowData] = useState([]);
|
|
@@ -130,7 +147,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
130
147
|
const [displayDialogDateFilter, setDisplayDialogDateFilter] = useState<string>('notequal');
|
|
131
148
|
const [displayDialogDateValue, setDisplayDialogDateValue] = useState<string>('');
|
|
132
149
|
const selectedRowIndex: any = useRef(null);
|
|
133
|
-
|
|
150
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
151
|
+
const localeCategory = 'SimpleTable';
|
|
134
152
|
const parameters = fieldMetadata?.datasource?.parameters;
|
|
135
153
|
const { referenceListStr } = getContext(getPConnect());
|
|
136
154
|
const label = labelProp || propertyLabel;
|
|
@@ -176,13 +194,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
176
194
|
});
|
|
177
195
|
|
|
178
196
|
useEffect(() => {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
buildElementsForTable();
|
|
182
|
-
}
|
|
183
|
-
}, [referenceList.length]);
|
|
184
|
-
|
|
185
|
-
useEffect(() => {
|
|
197
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
198
|
+
buildElementsForTable();
|
|
186
199
|
if (readOnlyMode || allowEditingInModal) {
|
|
187
200
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
188
201
|
generateRowsData();
|
|
@@ -201,7 +214,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
201
214
|
if (allowEditingInModal) {
|
|
202
215
|
getPConnect()
|
|
203
216
|
.getListActions()
|
|
204
|
-
// @ts-ignore - An argument for 'uniqueField' was not provided.
|
|
205
217
|
.initDefaultPageInstructions(
|
|
206
218
|
getPConnect().getReferenceList(),
|
|
207
219
|
fieldDefs.filter(item => item.name).map(item => item.name)
|
|
@@ -258,11 +270,16 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
258
270
|
function generateRowsData() {
|
|
259
271
|
// if referenceList is empty and dataPageName property value exists then make a datapage fetch call and get the list of data.
|
|
260
272
|
if (!referenceList.length && dataPageName) {
|
|
261
|
-
getDataPage(dataPageName, parameters, context)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
273
|
+
getDataPage(dataPageName, parameters, context)
|
|
274
|
+
.then(listData => {
|
|
275
|
+
const data = formatRowsData(listData);
|
|
276
|
+
myRows = data;
|
|
277
|
+
setRowData(data);
|
|
278
|
+
})
|
|
279
|
+
.catch(e => {
|
|
280
|
+
// eslint-disable-next-line no-console
|
|
281
|
+
console.log(e);
|
|
282
|
+
});
|
|
266
283
|
} else {
|
|
267
284
|
// The referenceList prop has the JSON data for each row to be displayed
|
|
268
285
|
// in the table. So, iterate over referenceList to create the dataRows that
|
|
@@ -301,9 +318,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
301
318
|
if (allowEditingInModal && defaultView) {
|
|
302
319
|
pConn
|
|
303
320
|
.getActionsApi()
|
|
321
|
+
// @ts-ignore
|
|
304
322
|
.openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
|
|
305
323
|
} else {
|
|
306
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
307
324
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
|
|
308
325
|
}
|
|
309
326
|
|
|
@@ -317,6 +334,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
317
334
|
if (typeof selectedRowIndex.current === 'number') {
|
|
318
335
|
pConn
|
|
319
336
|
.getActionsApi()
|
|
337
|
+
// @ts-ignore
|
|
320
338
|
.openEmbeddedDataModal(
|
|
321
339
|
bUseSeparateViewForEdit ? editView : defaultView,
|
|
322
340
|
pConn,
|
|
@@ -329,12 +347,10 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
329
347
|
|
|
330
348
|
const deleteRecord = () => {
|
|
331
349
|
setEditAnchorEl(null);
|
|
332
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
333
350
|
pConn.getListActions().deleteEntry(selectedRowIndex.current);
|
|
334
351
|
};
|
|
335
352
|
|
|
336
353
|
const deleteRecordFromInlineEditable = (index: number) => {
|
|
337
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
338
354
|
pConn.getListActions().deleteEntry(index);
|
|
339
355
|
};
|
|
340
356
|
|
|
@@ -344,7 +360,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
344
360
|
const data: any = [];
|
|
345
361
|
rawFields.forEach(item => {
|
|
346
362
|
// removing label field from config to hide title in the table cell
|
|
347
|
-
item = { ...item, config: { ...item.config, label: '' } };
|
|
363
|
+
item = { ...item, config: { ...item.config, label: '', displayMode: readOnlyMode || allowEditingInModal ? 'DISPLAY_ONLY' : undefined } };
|
|
348
364
|
const referenceListData = getReferenceList(pConn);
|
|
349
365
|
const isDatapage = referenceListData.startsWith('D_');
|
|
350
366
|
const pageReferenceValue = isDatapage
|
|
@@ -378,6 +394,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
378
394
|
};
|
|
379
395
|
|
|
380
396
|
function descendingComparator<T>(a: T, b: T, orderedBy: keyof T) {
|
|
397
|
+
if (!orderedBy || (!a[orderedBy] && !b[orderedBy])) {
|
|
398
|
+
return 0;
|
|
399
|
+
}
|
|
381
400
|
if (!b[orderedBy] || b[orderedBy] < a[orderedBy]) {
|
|
382
401
|
return -1;
|
|
383
402
|
}
|
|
@@ -389,11 +408,12 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
389
408
|
|
|
390
409
|
type Order = 'asc' | 'desc';
|
|
391
410
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
411
|
+
interface Comparator<T> {
|
|
412
|
+
(a: T, b: T): number;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function getComparator<Key extends keyof any, T extends Record<Key, any>>(theOrder: Order, orderedBy: Key): Comparator<T> {
|
|
416
|
+
return theOrder === 'desc' ? (a: T, b: T) => descendingComparator<T>(a, b, orderedBy) : (a: T, b: T) => -descendingComparator<T>(a, b, orderedBy);
|
|
397
417
|
}
|
|
398
418
|
|
|
399
419
|
function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
|
|
@@ -405,7 +425,11 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
405
425
|
return a[1] - b[1];
|
|
406
426
|
});
|
|
407
427
|
|
|
408
|
-
|
|
428
|
+
const newElements = new Array(stabilizedThis.length);
|
|
429
|
+
stabilizedThis.forEach((el, index) => {
|
|
430
|
+
newElements[index] = elements[el[1]];
|
|
431
|
+
});
|
|
432
|
+
return newElements;
|
|
409
433
|
}
|
|
410
434
|
|
|
411
435
|
function _menuClick(event, columnId: string, columnType: string, labelValue: string) {
|
|
@@ -575,19 +599,21 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
575
599
|
<>
|
|
576
600
|
<TableContainer component={Paper} style={{ margin: '4px 0px' }} id='simple-table-manual'>
|
|
577
601
|
{propsToUse.label && (
|
|
578
|
-
<h3 className={classes.label}>
|
|
602
|
+
<h3 className={`${classes.label} ${required ? classes.tableLabel : ''}`}>
|
|
579
603
|
{propsToUse.label} {results()}
|
|
580
604
|
</h3>
|
|
581
605
|
)}
|
|
606
|
+
{validatemessage && <div className={classes.message}>{validatemessage}</div>}
|
|
582
607
|
<Table>
|
|
583
608
|
<TableHead className={classes.header}>
|
|
584
609
|
<TableRow>
|
|
585
610
|
{fieldDefs.map((field: any, index) => {
|
|
586
611
|
return (
|
|
587
612
|
<TableCell key={`head-${displayedColumns[index]}`} className={classes.tableCell}>
|
|
588
|
-
{readOnlyMode ? (
|
|
589
|
-
<div>
|
|
613
|
+
{(readOnlyMode || allowEditingInModal) && field.cellRenderer !== 'DeleteIcon' ? (
|
|
614
|
+
<div style={{ display: 'flex' }}>
|
|
590
615
|
<TableSortLabel
|
|
616
|
+
style={{ width: '75%' }}
|
|
591
617
|
active={orderBy === displayedColumns[index]}
|
|
592
618
|
direction={orderBy === displayedColumns[index] ? order : 'asc'}
|
|
593
619
|
onClick={createSortHandler(displayedColumns[index])}
|
|
@@ -599,8 +625,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
599
625
|
) : null}
|
|
600
626
|
</TableSortLabel>
|
|
601
627
|
<MoreIcon
|
|
628
|
+
style={{ cursor: 'pointer', zIndex: 1000 }}
|
|
602
629
|
id='menu-icon'
|
|
603
|
-
className={classes.moreIcon}
|
|
604
630
|
onClick={event => {
|
|
605
631
|
_menuClick(event, field.name, field.meta.type, field.label);
|
|
606
632
|
}}
|
|
@@ -616,6 +642,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
616
642
|
</TableHead>
|
|
617
643
|
<TableBody>
|
|
618
644
|
{editableMode &&
|
|
645
|
+
!allowEditingInModal &&
|
|
619
646
|
elements.map((row: any, index) => {
|
|
620
647
|
const theKey = `row-${index}`;
|
|
621
648
|
return (
|
|
@@ -653,53 +680,46 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
653
680
|
return (
|
|
654
681
|
// eslint-disable-next-line react/no-array-index-key
|
|
655
682
|
<TableRow key={index}>
|
|
656
|
-
{
|
|
683
|
+
{row.map((item, childIndex) => {
|
|
684
|
+
const theColKey = displayedColumns[childIndex];
|
|
657
685
|
return (
|
|
658
|
-
<TableCell key={
|
|
659
|
-
{
|
|
660
|
-
<div>
|
|
661
|
-
<MoreIcon
|
|
662
|
-
id='table-edit-menu-icon'
|
|
663
|
-
className={classes.moreIcon}
|
|
664
|
-
onClick={event => {
|
|
665
|
-
editMenuClick(event, index);
|
|
666
|
-
}}
|
|
667
|
-
/>
|
|
668
|
-
<Menu id='table-edit-menu' anchorEl={editAnchorEl} keepMounted open={Boolean(editAnchorEl)} onClose={_menuClose}>
|
|
669
|
-
<MenuItem onClick={() => editRecord()}>Edit</MenuItem>
|
|
670
|
-
<MenuItem onClick={() => deleteRecord()}>Delete</MenuItem>
|
|
671
|
-
</Menu>
|
|
672
|
-
</div>
|
|
673
|
-
) : typeof row[colKey] === 'boolean' && !row[colKey] ? (
|
|
674
|
-
'False'
|
|
675
|
-
) : typeof row[colKey] === 'boolean' && row[colKey] ? (
|
|
676
|
-
'True'
|
|
677
|
-
) : (
|
|
678
|
-
row[colKey] || '---'
|
|
679
|
-
)}
|
|
686
|
+
<TableCell key={theColKey} className={classes.tableCell}>
|
|
687
|
+
{item}
|
|
680
688
|
</TableCell>
|
|
681
689
|
);
|
|
682
690
|
})}
|
|
691
|
+
{showDeleteButton && (
|
|
692
|
+
<TableCell key='DeleteIcon' className={classes.tableCell}>
|
|
693
|
+
<div>
|
|
694
|
+
<MoreIcon
|
|
695
|
+
id='table-edit-menu-icon'
|
|
696
|
+
className={classes.moreIcon}
|
|
697
|
+
onClick={event => {
|
|
698
|
+
editMenuClick(event, index);
|
|
699
|
+
}}
|
|
700
|
+
/>
|
|
701
|
+
<Menu id='table-edit-menu' anchorEl={editAnchorEl} keepMounted open={Boolean(editAnchorEl)} onClose={_menuClose}>
|
|
702
|
+
<MenuItem onClick={() => editRecord()}>Edit</MenuItem>
|
|
703
|
+
<MenuItem onClick={() => deleteRecord()}>Delete</MenuItem>
|
|
704
|
+
</Menu>
|
|
705
|
+
</div>
|
|
706
|
+
</TableCell>
|
|
707
|
+
)}
|
|
683
708
|
</TableRow>
|
|
684
709
|
);
|
|
685
710
|
})}
|
|
686
711
|
</TableBody>
|
|
687
712
|
</Table>
|
|
688
|
-
{readOnlyMode && rowData
|
|
689
|
-
<div className='no-records' id='no-records'>
|
|
690
|
-
No records found.
|
|
691
|
-
</div>
|
|
692
|
-
)}
|
|
693
|
-
{editableMode && referenceList && referenceList.length === 0 && (
|
|
713
|
+
{((readOnlyMode && (!rowData || rowData?.length === 0)) || (editableMode && (!referenceList || referenceList?.length === 0))) && (
|
|
694
714
|
<div className='no-records' id='no-records'>
|
|
695
|
-
No records found.
|
|
715
|
+
{getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}
|
|
696
716
|
</div>
|
|
697
717
|
)}
|
|
698
718
|
</TableContainer>
|
|
699
719
|
{showAddRowButton && (
|
|
700
720
|
<div style={{ fontSize: '1rem' }}>
|
|
701
|
-
<Link style={{ cursor: 'pointer' }} onClick={addRecord}>
|
|
702
|
-
+ Add
|
|
721
|
+
<Link style={{ cursor: 'pointer' }} onClick={addRecord} underline='hover'>
|
|
722
|
+
+ {localizedVal('Add', localeCategory)}
|
|
703
723
|
</Link>
|
|
704
724
|
</div>
|
|
705
725
|
)}
|
|
@@ -716,7 +736,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
716
736
|
<DialogContent>
|
|
717
737
|
{containsDateOrTime ? (
|
|
718
738
|
<>
|
|
719
|
-
<Select value={displayDialogDateFilter} onChange={_dialogDateFilter} fullWidth>
|
|
739
|
+
<Select variant='standard' value={displayDialogDateFilter} onChange={_dialogDateFilter} fullWidth>
|
|
720
740
|
<MenuItem value='notequal'>is not equal to</MenuItem>
|
|
721
741
|
<MenuItem value='equal'>is equal to</MenuItem>
|
|
722
742
|
<MenuItem value='after'>after</MenuItem>
|
|
@@ -726,6 +746,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
726
746
|
</Select>
|
|
727
747
|
{filterType === 'Date' && (
|
|
728
748
|
<TextField
|
|
749
|
+
variant='standard'
|
|
729
750
|
autoFocus
|
|
730
751
|
margin='dense'
|
|
731
752
|
id='containsFilter'
|
|
@@ -737,6 +758,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
737
758
|
)}
|
|
738
759
|
{filterType === 'DateTime' && (
|
|
739
760
|
<TextField
|
|
761
|
+
variant='standard'
|
|
740
762
|
autoFocus
|
|
741
763
|
margin='dense'
|
|
742
764
|
id='containsFilter'
|
|
@@ -748,6 +770,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
748
770
|
)}
|
|
749
771
|
{filterType === 'Time' && (
|
|
750
772
|
<TextField
|
|
773
|
+
variant='standard'
|
|
751
774
|
autoFocus
|
|
752
775
|
margin='dense'
|
|
753
776
|
id='containsFilter'
|
|
@@ -760,12 +783,13 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
760
783
|
</>
|
|
761
784
|
) : (
|
|
762
785
|
<>
|
|
763
|
-
<Select id='filter' fullWidth onChange={_dialogContainsFilter} value={displayDialogContainsFilter}>
|
|
786
|
+
<Select variant='standard' id='filter' fullWidth onChange={_dialogContainsFilter} value={displayDialogContainsFilter}>
|
|
764
787
|
<MenuItem value='contains'>Contains</MenuItem>
|
|
765
788
|
<MenuItem value='equals'>Equals</MenuItem>
|
|
766
789
|
<MenuItem value='startswith'>Starts with</MenuItem>
|
|
767
790
|
</Select>
|
|
768
791
|
<TextField
|
|
792
|
+
variant='standard'
|
|
769
793
|
autoFocus
|
|
770
794
|
margin='dense'
|
|
771
795
|
id='containsFilter'
|
|
@@ -57,10 +57,8 @@ export default function SimpleTableSelect(props: SimpleTableSelectProps) {
|
|
|
57
57
|
|
|
58
58
|
// Need to get this written so typedefs work
|
|
59
59
|
const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode
|
|
60
|
-
?
|
|
61
|
-
|
|
62
|
-
: // @ts-ignore - Property 'getCurrentPageFieldMetadata' is private and only accessible within class 'C11nEnv'.
|
|
63
|
-
pConn.getCurrentPageFieldMetadata(contextPageReference);
|
|
60
|
+
? pConn.getFieldMetadata(`@P .${referenceProp}`)
|
|
61
|
+
: pConn.getCurrentPageFieldMetadata(contextPageReference);
|
|
64
62
|
|
|
65
63
|
const compositeKeys: any[] = [];
|
|
66
64
|
Object.values(fieldParameters).forEach((param: any) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
-
import { Tab, Tabs } from '@material
|
|
3
|
-
import { TabContext, TabPanel } from '@
|
|
2
|
+
import { Tab, Tabs } from '@mui/material';
|
|
3
|
+
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
4
|
|
|
5
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
6
6
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
@@ -19,7 +19,8 @@ export const getVisibleTabs = (allTabs, uuid) => {
|
|
|
19
19
|
const { name: viewName, deferLoadId = `${viewName}_${uuid}_${index}` } = config;
|
|
20
20
|
child.getPConnect().registerAdditionalProps({
|
|
21
21
|
deferLoadId,
|
|
22
|
-
isChildDeferLoad: true
|
|
22
|
+
isChildDeferLoad: true,
|
|
23
|
+
lastUpdateCaseTime: '@P caseInfo.lastUpdateTime'
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
index += 1;
|
|
@@ -66,3 +67,119 @@ export const tabClick = (id, availableTabs, currentTabId, setCurrentTabId, tabIt
|
|
|
66
67
|
PCore.getDeferLoadManager().activate(activeId, nextPConn?.getContextName());
|
|
67
68
|
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn?.getContextName());
|
|
68
69
|
};
|
|
70
|
+
|
|
71
|
+
export const searchtabsClick = (id, mainTabs, currentTabId, setCurrentTabId) => {
|
|
72
|
+
const currentTab = mainTabs.find(item => item.id === currentTabId && item.visibility());
|
|
73
|
+
const currentPConn = currentTab?.getPConnect();
|
|
74
|
+
const { deferLoadId } = currentPConn?.getConfigProps() ?? {};
|
|
75
|
+
PCore.getDeferLoadManager().deactivate(deferLoadId, currentPConn.getContextName());
|
|
76
|
+
|
|
77
|
+
setCurrentTabId(id);
|
|
78
|
+
const nextActiveTab = mainTabs.find(item => item.id === id && item.visibility());
|
|
79
|
+
if (mainTabs && nextActiveTab?.content === null) {
|
|
80
|
+
nextActiveTab.content = nextActiveTab.getPConnect().getComponent();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const nextPConn = nextActiveTab.getPConnect();
|
|
84
|
+
const { deferLoadId: activeId } = nextPConn.getConfigProps();
|
|
85
|
+
PCore.getDeferLoadManager().activate(activeId, nextPConn.getContextName());
|
|
86
|
+
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn.getContextName());
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const getTabLabel = tabPConnect => {
|
|
90
|
+
const config = tabPConnect.getConfigProps();
|
|
91
|
+
|
|
92
|
+
const label = config.inheritedProps?.find(obj => obj.prop === 'label')?.value;
|
|
93
|
+
|
|
94
|
+
if (label) {
|
|
95
|
+
return label;
|
|
96
|
+
}
|
|
97
|
+
if (config.label) {
|
|
98
|
+
return config.label;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (tabPConnect.getReferencedView()?.config?.label) {
|
|
102
|
+
return tabPConnect.getReferencedView()?.config?.label;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const getActiveTabId = (mainTabs, currentTabId) => {
|
|
109
|
+
let firstVisibleTabId = null;
|
|
110
|
+
let updatedActiveId = currentTabId;
|
|
111
|
+
let isCurrentTabFound = false;
|
|
112
|
+
|
|
113
|
+
if (!mainTabs?.length) {
|
|
114
|
+
return updatedActiveId;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (let i = 0; i < mainTabs.length; i += 1) {
|
|
118
|
+
const tab = mainTabs[i];
|
|
119
|
+
const tabConfig = tab.getPConnect().getConfigProps();
|
|
120
|
+
const tabId = tab?.id || `${tab.getPConnect().viewName}-${tabConfig.name || getTabLabel(tab.getPConnect())}-${i}`;
|
|
121
|
+
const isTabVisible = !Object.hasOwn(tabConfig, 'visibility') || tabConfig.visibility === true;
|
|
122
|
+
if (isTabVisible && !firstVisibleTabId) {
|
|
123
|
+
firstVisibleTabId = tabId;
|
|
124
|
+
if (isCurrentTabFound) {
|
|
125
|
+
updatedActiveId = firstVisibleTabId;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (tabId === currentTabId) {
|
|
130
|
+
isCurrentTabFound = true;
|
|
131
|
+
if (isTabVisible) {
|
|
132
|
+
break;
|
|
133
|
+
} else if (firstVisibleTabId) {
|
|
134
|
+
updatedActiveId = firstVisibleTabId;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return updatedActiveId;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param {*} deferLoadedTabs list of deferLoadedTabs
|
|
144
|
+
* @param {string} tabViewName (optional) if provided, tabId of the given tabView will be returned
|
|
145
|
+
* @returns {string} a tab id is returned
|
|
146
|
+
*/
|
|
147
|
+
export const getFirstVisibleTabId = (deferLoadedTabs, tabViewName) => {
|
|
148
|
+
let tabIndex = 0;
|
|
149
|
+
|
|
150
|
+
const viewName = deferLoadedTabs?.props?.getPConnect()?.options?.viewName;
|
|
151
|
+
|
|
152
|
+
const deferTabsChildren = deferLoadedTabs.props.getPConnect().getChildren();
|
|
153
|
+
if (tabViewName) {
|
|
154
|
+
const firstVisibleTab = deferTabsChildren?.find((item, index) => {
|
|
155
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
156
|
+
if (tabViewName === tabConfig.name) {
|
|
157
|
+
tabIndex = index;
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
});
|
|
162
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
163
|
+
|
|
164
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const firstVisibleTab = deferLoadedTabs.props
|
|
168
|
+
.getPConnect()
|
|
169
|
+
.getChildren()
|
|
170
|
+
?.find((item, index) => {
|
|
171
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
172
|
+
if (!('visibility' in tabConfig) || tabConfig.visibility === true) {
|
|
173
|
+
tabIndex = index;
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if (!firstVisibleTab) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
184
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
185
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid, GridSize } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Grid, GridSize } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface TwoColumnProps extends PConnProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid, GridSize } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Grid, GridSize } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface TwoColumnTabProps extends PConnProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid, { GridSize } from '@material
|
|
2
|
+
import Grid, { GridSize } from '@mui/material/Grid';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -26,7 +26,7 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
|
26
26
|
|
|
27
27
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
28
28
|
// in a readonly (display) mode instead of a editable
|
|
29
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
29
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
30
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
31
31
|
const children = (getPConnect().getChildren() as any[])?.map((configObject, index) => {
|
|
32
32
|
let theConfigObject: object = configObject;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import AppBar from '@material
|
|
4
|
-
import Box from '@material
|
|
5
|
-
import Toolbar from '@material
|
|
6
|
-
import Container from '@material
|
|
7
|
-
import { IconButton, Menu, MenuItem, Typography, Button } from '@material
|
|
8
|
-
import Avatar from '@material
|
|
9
|
-
import MenuIcon from '@
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
|
+
import AppBar from '@mui/material/AppBar';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import Toolbar from '@mui/material/Toolbar';
|
|
6
|
+
import Container from '@mui/material/Container';
|
|
7
|
+
import { IconButton, Menu, MenuItem, Typography, Button } from '@mui/material';
|
|
8
|
+
import Avatar from '@mui/material/Avatar';
|
|
9
|
+
import MenuIcon from '@mui/icons-material/Menu';
|
|
10
10
|
import { logout } from '@pega/auth/lib/sdk-auth-manager';
|
|
11
11
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
12
|
import './WssNavBar.css';
|
|
@@ -128,7 +128,7 @@ export default function WssNavBar(props: WssNavBarProps) {
|
|
|
128
128
|
{position === 'inline' && <>{navLinksContent}</>}
|
|
129
129
|
|
|
130
130
|
<Box sx={{ flexGrow: 0 }}>
|
|
131
|
-
<IconButton onClick={handleOpenUserMenu}>
|
|
131
|
+
<IconButton onClick={handleOpenUserMenu} size='large'>
|
|
132
132
|
<Avatar>{operator.currentUserInitials}</Avatar>
|
|
133
133
|
</IconButton>
|
|
134
134
|
<Menu
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@material
|
|
2
|
-
import
|
|
1
|
+
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@mui/material';
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
3
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
4
|
|
|
5
5
|
interface AppAnnouncementProps extends PConnProps {
|