@pega/react-sdk-overrides 24.1.10 → 24.2.11
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/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 +3 -4
- 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/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 +2 -2
- 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 +79 -70
- package/lib/template/ListView/utils.ts +1 -2
- 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/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';
|
|
@@ -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 {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/* eslint-disable react/no-array-index-key */
|
|
3
3
|
/* eslint-disable no-nested-ternary */
|
|
4
4
|
import { useState, useEffect, useCallback } from 'react';
|
|
5
|
-
import { CircularProgress, IconButton, Menu, MenuItem, Button } from '@material
|
|
6
|
-
import MoreVertIcon from '@
|
|
5
|
+
import { CircularProgress, IconButton, Menu, MenuItem, Button } from '@mui/material';
|
|
6
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
7
7
|
import download from 'downloadjs';
|
|
8
8
|
|
|
9
9
|
import { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
|
|
@@ -33,7 +33,7 @@ const updateAttachmentState = (pConn, key, attachments) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export default function Attachment(props: AttachmentProps) {
|
|
36
|
-
const { value, getPConnect, label, validatemessage, allowMultiple, extensions, displayMode } = props;
|
|
36
|
+
const { value, getPConnect, label, validatemessage, allowMultiple, extensions, displayMode, helperText } = props;
|
|
37
37
|
/* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */
|
|
38
38
|
let { required, disabled } = props;
|
|
39
39
|
[required, disabled] = [required, disabled].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
|
|
@@ -155,11 +155,9 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
155
155
|
const context = pConn.getContextName();
|
|
156
156
|
// set errors to property to block submit even on errors in file upload
|
|
157
157
|
PCore.getMessageManager().addMessages({
|
|
158
|
-
// @ts-ignore
|
|
159
158
|
messages: [
|
|
160
159
|
{
|
|
161
160
|
type: 'error',
|
|
162
|
-
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
163
161
|
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
164
162
|
}
|
|
165
163
|
],
|
|
@@ -192,7 +190,6 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
192
190
|
const clearFieldErrorMessages = () => {
|
|
193
191
|
const fieldName = (pConn.getStateProps() as any).value;
|
|
194
192
|
const context = pConn.getContextName();
|
|
195
|
-
// @ts-ignore
|
|
196
193
|
PCore.getMessageManager().clearMessages({
|
|
197
194
|
type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,
|
|
198
195
|
property: fieldName,
|
|
@@ -217,9 +214,11 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
217
214
|
};
|
|
218
215
|
if (!validateMaxSize(f, maxAttachmentSize)) {
|
|
219
216
|
f.props.error = true;
|
|
217
|
+
f.inProgress = false;
|
|
220
218
|
f.props.meta = pConn.getLocalizedValue(`File is too big. Max allowed size is ${maxAttachmentSize}MB.`, '', '');
|
|
221
219
|
} else if (!validateFileExtension(f, extensions)) {
|
|
222
220
|
f.props.error = true;
|
|
221
|
+
f.inProgress = false;
|
|
223
222
|
f.props.meta = `${pConn.getLocalizedValue('File has invalid extension. Allowed extensions are:', '', '')} ${extensions.replaceAll(
|
|
224
223
|
'.',
|
|
225
224
|
''
|
|
@@ -229,11 +228,9 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
229
228
|
const fieldName = (pConn.getStateProps() as any).value;
|
|
230
229
|
const context = pConn.getContextName();
|
|
231
230
|
PCore.getMessageManager().addMessages({
|
|
232
|
-
// @ts-ignore
|
|
233
231
|
messages: [
|
|
234
232
|
{
|
|
235
233
|
type: 'error',
|
|
236
|
-
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
237
234
|
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
238
235
|
}
|
|
239
236
|
],
|
|
@@ -430,6 +427,7 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
430
427
|
aria-expanded={open ? 'true' : undefined}
|
|
431
428
|
aria-haspopup='true'
|
|
432
429
|
onClick={handleClick}
|
|
430
|
+
size='large'
|
|
433
431
|
>
|
|
434
432
|
<MoreVertIcon />
|
|
435
433
|
</IconButton>
|
|
@@ -458,7 +456,7 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
458
456
|
<div className='file-upload-container'>
|
|
459
457
|
<span className={`label ${required ? 'file-label' : ''}`}>{label}</span>
|
|
460
458
|
{((files.length === 0 && allowMultiple !== 'true') || allowMultiple === 'true') && <section>{content}</section>}
|
|
461
|
-
{validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : ''}
|
|
459
|
+
{validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : <span style={{ fontSize: '14px' }}>{helperText}</span>}
|
|
462
460
|
{files && files.length > 0 && <section>{fileDisplay}</section>}
|
|
463
461
|
</div>
|
|
464
462
|
);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
2
|
+
import { Theme } from '@mui/material/styles';
|
|
3
|
+
import withStyles from '@mui/styles/withStyles';
|
|
4
|
+
import createStyles from '@mui/styles/createStyles';
|
|
5
|
+
import Table from '@mui/material/Table';
|
|
6
|
+
import TableBody from '@mui/material/TableBody';
|
|
7
|
+
import TableCell from '@mui/material/TableCell';
|
|
8
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
9
|
+
import TableHead from '@mui/material/TableHead';
|
|
10
|
+
import TableRow from '@mui/material/TableRow';
|
|
9
11
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
10
12
|
|
|
11
13
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
@@ -145,9 +147,9 @@ export default function CaseHistory(props: CaseHistoryProps) {
|
|
|
145
147
|
const theKey = `CaseHistory-${index}`;
|
|
146
148
|
theDataRows.push(
|
|
147
149
|
<TableRow key={theKey}>
|
|
148
|
-
<StyledTableCell>{dataRow[0] ? dataRow[0] : '---'}</StyledTableCell>
|
|
149
|
-
<StyledTableCell>{dataRow[1] ? dataRow[1] : '---'}</StyledTableCell>
|
|
150
|
-
<StyledTableCell>{dataRow[2] ? dataRow[2] : '---'}</StyledTableCell>
|
|
150
|
+
<StyledTableCell>{dataRow[0] ? dataRow[0] : ('---' as any)}</StyledTableCell>
|
|
151
|
+
<StyledTableCell>{dataRow[1] ? dataRow[1] : ('---' as any)}</StyledTableCell>
|
|
152
|
+
<StyledTableCell>{dataRow[2] ? dataRow[2] : ('---' as any)}</StyledTableCell>
|
|
151
153
|
</TableRow>
|
|
152
154
|
);
|
|
153
155
|
});
|