@pega/react-sdk-overrides 24.1.10 → 24.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/designSystemExtension/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 +5 -5
- 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 +3 -3
- package/lib/field/Checkbox/Checkbox.tsx +4 -4
- package/lib/field/Currency/Currency.tsx +2 -2
- package/lib/field/Date/Date.tsx +23 -42
- package/lib/field/DateTime/DateTime.tsx +29 -34
- package/lib/field/Decimal/Decimal.tsx +2 -2
- package/lib/field/Dropdown/Dropdown.tsx +3 -3
- 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 +3 -3
- package/lib/field/Phone/Phone.tsx +6 -5
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +3 -3
- package/lib/field/RichText/RichText.tsx +1 -1
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/ScalarList/ScalarList.tsx +2 -2
- 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 +27 -20
- package/lib/field/URL/URL.tsx +26 -7
- package/lib/field/UserReference/UserReference.tsx +2 -2
- package/lib/helpers/field-group-utils.ts +2 -2
- package/lib/helpers/simpleTableHelpers.ts +1 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
- package/lib/infra/Assignment/Assignment.tsx +10 -6
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +11 -10
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +7 -4
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/lib/infra/DashboardFilter/filterUtils.tsx +2 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +3 -3
- package/lib/infra/MultiStep/MultiStep.tsx +14 -8
- 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 +55 -5
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/CaseView/CaseView.tsx +5 -5
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +7 -7
- package/lib/template/Confirmation/Confirmation.tsx +2 -1
- 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 -3
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
- package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/template/ListView/ListView.tsx +69 -61
- package/lib/template/ListView/utils.ts +1 -1
- 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 -1
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +42 -30
- 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.tsx +5 -2
- package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +4 -3
- package/lib/widget/Followers/Followers.tsx +2 -2
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/lib/widget/SummaryItem/SummaryItem.tsx +3 -2
- package/lib/widget/ToDo/ToDo.tsx +91 -21
- package/package.json +1 -1
|
@@ -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';
|
|
@@ -217,9 +217,11 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
217
217
|
};
|
|
218
218
|
if (!validateMaxSize(f, maxAttachmentSize)) {
|
|
219
219
|
f.props.error = true;
|
|
220
|
+
f.inProgress = false;
|
|
220
221
|
f.props.meta = pConn.getLocalizedValue(`File is too big. Max allowed size is ${maxAttachmentSize}MB.`, '', '');
|
|
221
222
|
} else if (!validateFileExtension(f, extensions)) {
|
|
222
223
|
f.props.error = true;
|
|
224
|
+
f.inProgress = false;
|
|
223
225
|
f.props.meta = `${pConn.getLocalizedValue('File has invalid extension. Allowed extensions are:', '', '')} ${extensions.replaceAll(
|
|
224
226
|
'.',
|
|
225
227
|
''
|
|
@@ -430,6 +432,7 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
430
432
|
aria-expanded={open ? 'true' : undefined}
|
|
431
433
|
aria-haspopup='true'
|
|
432
434
|
onClick={handleClick}
|
|
435
|
+
size='large'
|
|
433
436
|
>
|
|
434
437
|
<MoreVertIcon />
|
|
435
438
|
</IconButton>
|
|
@@ -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
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import TextField from '@material
|
|
2
|
+
import TextField from '@mui/material/TextField';
|
|
3
3
|
|
|
4
4
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
5
|
|
|
@@ -7,8 +7,8 @@ import download from 'downloadjs';
|
|
|
7
7
|
// import SummaryList from '../../SummaryList';
|
|
8
8
|
// import ActionButtonsForFileUtil from '../ActionButtonsForFileUtil';
|
|
9
9
|
import './FileUtility.css';
|
|
10
|
-
import { IconButton, Menu, MenuItem, Button, CircularProgress } from '@material
|
|
11
|
-
import MoreVertIcon from '@
|
|
10
|
+
import { IconButton, Menu, MenuItem, Button, CircularProgress } from '@mui/material';
|
|
11
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
12
12
|
|
|
13
13
|
import { validateMaxSize } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
|
|
14
14
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -508,6 +508,7 @@ export default function FileUtility(props: FileUtilityProps) {
|
|
|
508
508
|
aria-expanded={open ? 'true' : undefined}
|
|
509
509
|
aria-haspopup='true'
|
|
510
510
|
onClick={handleClick}
|
|
511
|
+
size='large'
|
|
511
512
|
>
|
|
512
513
|
<MoreVertIcon />
|
|
513
514
|
</IconButton>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { Card, CardContent, CardHeader, Typography } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Card, CardContent, CardHeader, Typography } 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 FollowersProps extends PConnProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import { IconButton, Menu, MenuItem } from '@material
|
|
3
|
-
import MoreVertIcon from '@
|
|
2
|
+
import { IconButton, Menu, MenuItem } from '@mui/material';
|
|
3
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
4
4
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
5
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
|
|
@@ -69,6 +69,7 @@ export default function SummaryItem(props: SummaryItemProps) {
|
|
|
69
69
|
aria-expanded={open ? 'true' : undefined}
|
|
70
70
|
aria-haspopup='true'
|
|
71
71
|
onClick={handleClick}
|
|
72
|
+
size='large'
|
|
72
73
|
>
|
|
73
74
|
<MoreVertIcon />
|
|
74
75
|
</IconButton>
|
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
Box,
|
|
5
5
|
Button,
|
|
@@ -13,19 +13,53 @@ import {
|
|
|
13
13
|
ListItem,
|
|
14
14
|
ListItemText,
|
|
15
15
|
ListItemSecondaryAction
|
|
16
|
-
} from '@material
|
|
17
|
-
import Snackbar from '@material
|
|
18
|
-
import IconButton from '@material
|
|
19
|
-
import CloseIcon from '@
|
|
20
|
-
import ArrowForwardIosOutlinedIcon from '@
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
16
|
+
} from '@mui/material';
|
|
17
|
+
import Snackbar from '@mui/material/Snackbar';
|
|
18
|
+
import IconButton from '@mui/material/IconButton';
|
|
19
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
20
|
+
import ArrowForwardIosOutlinedIcon from '@mui/icons-material/ArrowForwardIosOutlined';
|
|
21
|
+
import { useTheme } from '@mui/material/styles';
|
|
22
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
23
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
23
24
|
|
|
24
25
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
25
26
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
26
27
|
|
|
27
28
|
import './ToDo.css';
|
|
28
29
|
|
|
30
|
+
const fetchMyWorkList = (datapage, fields, numberOfRecords, includeTotalCount, context) => {
|
|
31
|
+
return PCore.getDataPageUtils()
|
|
32
|
+
.getDataAsync(
|
|
33
|
+
datapage,
|
|
34
|
+
context,
|
|
35
|
+
{},
|
|
36
|
+
{
|
|
37
|
+
pageNumber: 1,
|
|
38
|
+
pageSize: numberOfRecords
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
select: Object.keys(fields).map(key => ({ field: PCore.getAnnotationUtils().getPropertyName(fields[key]) }))
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
invalidateCache: true,
|
|
45
|
+
additionalApiParams: {
|
|
46
|
+
includeTotalCount
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
.then(response => {
|
|
51
|
+
return {
|
|
52
|
+
...response,
|
|
53
|
+
data: (Array.isArray(response?.data) ? response.data : []).map(row =>
|
|
54
|
+
Object.keys(fields).reduce((obj, key) => {
|
|
55
|
+
obj[key] = row[PCore.getAnnotationUtils().getPropertyName(fields[key])];
|
|
56
|
+
return obj;
|
|
57
|
+
}, {})
|
|
58
|
+
)
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
29
63
|
interface ToDoProps extends PConnProps {
|
|
30
64
|
// If any, enter additional props that only exist on this component
|
|
31
65
|
datasource?: any;
|
|
@@ -37,7 +71,7 @@ interface ToDoProps extends PConnProps {
|
|
|
37
71
|
itemKey?: string;
|
|
38
72
|
showTodoList?: boolean;
|
|
39
73
|
type?: string;
|
|
40
|
-
|
|
74
|
+
|
|
41
75
|
context?: string;
|
|
42
76
|
isConfirm?: boolean;
|
|
43
77
|
}
|
|
@@ -81,12 +115,20 @@ const useStyles = makeStyles(theme => ({
|
|
|
81
115
|
}));
|
|
82
116
|
|
|
83
117
|
export default function ToDo(props: ToDoProps) {
|
|
84
|
-
const {
|
|
118
|
+
const {
|
|
119
|
+
getPConnect,
|
|
120
|
+
context,
|
|
121
|
+
datasource = [],
|
|
122
|
+
headerText = 'To do',
|
|
123
|
+
showTodoList = true,
|
|
124
|
+
myWorkList = {},
|
|
125
|
+
type = 'worklist',
|
|
126
|
+
isConfirm = false
|
|
127
|
+
} = props;
|
|
85
128
|
|
|
86
129
|
const CONSTS = PCore.getConstants();
|
|
87
130
|
|
|
88
131
|
const bLogging = true;
|
|
89
|
-
let assignmentCount = 0;
|
|
90
132
|
const currentUser = PCore.getEnvironmentInfo().getOperatorName();
|
|
91
133
|
const currentUserInitials = Utils.getInitials(currentUser);
|
|
92
134
|
const assignmentsSource = datasource?.source || myWorkList?.source;
|
|
@@ -106,17 +148,36 @@ export default function ToDo(props: ToDoProps) {
|
|
|
106
148
|
const showlessLocalizedValue = localizedVal('show_less', 'CosmosFields');
|
|
107
149
|
const showMoreLocalizedValue = localizedVal('show_more', 'CosmosFields');
|
|
108
150
|
const canPerform = assignments?.[0]?.canPerform === 'true' || assignments?.[0]?.canPerform === true;
|
|
109
|
-
|
|
151
|
+
const [count, setCount] = useState(0);
|
|
152
|
+
|
|
153
|
+
const {
|
|
154
|
+
WORK_BASKET: { MY_WORK_LIST }
|
|
155
|
+
} = PCore.getConstants();
|
|
110
156
|
|
|
111
157
|
function initAssignments(): any[] {
|
|
112
158
|
if (assignmentsSource) {
|
|
113
|
-
assignmentCount = assignmentsSource.length;
|
|
114
159
|
return topThreeAssignments(assignmentsSource);
|
|
115
160
|
}
|
|
116
161
|
// turn off todolist
|
|
117
162
|
return [];
|
|
118
163
|
}
|
|
119
164
|
|
|
165
|
+
const deferLoadWorklistItems = useCallback(
|
|
166
|
+
responseData => {
|
|
167
|
+
setCount(responseData.totalCount);
|
|
168
|
+
setAssignments(responseData.data);
|
|
169
|
+
},
|
|
170
|
+
[MY_WORK_LIST]
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
if (Object.keys(myWorkList).length && myWorkList.datapage) {
|
|
175
|
+
fetchMyWorkList(myWorkList.datapage, getPConnect().getComponentConfig()?.myWorkList.fields, 3, true, context).then(responseData => {
|
|
176
|
+
deferLoadWorklistItems(responseData);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}, []);
|
|
180
|
+
|
|
120
181
|
const getAssignmentId = assignment => {
|
|
121
182
|
return type === CONSTS.TODO ? assignment.ID : assignment.id;
|
|
122
183
|
};
|
|
@@ -137,7 +198,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
137
198
|
setShowSnackbar(true);
|
|
138
199
|
}
|
|
139
200
|
|
|
140
|
-
function handleSnackbarClose(event: React.SyntheticEvent |
|
|
201
|
+
function handleSnackbarClose(event: React.SyntheticEvent<any> | Event, reason?: string) {
|
|
141
202
|
if (reason === 'clickaway') {
|
|
142
203
|
return;
|
|
143
204
|
}
|
|
@@ -146,12 +207,18 @@ export default function ToDo(props: ToDoProps) {
|
|
|
146
207
|
|
|
147
208
|
function _showMore() {
|
|
148
209
|
setBShowMore(false);
|
|
149
|
-
|
|
210
|
+
if (type === CONSTS.WORKLIST && count && count > assignments.length && !assignmentsSource) {
|
|
211
|
+
fetchMyWorkList(myWorkList.datapage, getPConnect().getComponentConfig()?.myWorkList.fields, count, false, context).then(response => {
|
|
212
|
+
setAssignments(response.data);
|
|
213
|
+
});
|
|
214
|
+
} else {
|
|
215
|
+
setAssignments(assignmentsSource);
|
|
216
|
+
}
|
|
150
217
|
}
|
|
151
218
|
|
|
152
219
|
function _showLess() {
|
|
153
220
|
setBShowMore(true);
|
|
154
|
-
setAssignments(
|
|
221
|
+
setAssignments(assignments => assignments.slice(0, 3));
|
|
155
222
|
}
|
|
156
223
|
|
|
157
224
|
function clickGo(assignment) {
|
|
@@ -223,12 +290,15 @@ export default function ToDo(props: ToDoProps) {
|
|
|
223
290
|
);
|
|
224
291
|
};
|
|
225
292
|
|
|
293
|
+
// eslint-disable-next-line no-nested-ternary
|
|
294
|
+
const getCount = () => (assignmentsSource ? assignmentsSource.length : type === CONSTS.WORKLIST ? count : 0);
|
|
295
|
+
|
|
226
296
|
const toDoContent = (
|
|
227
297
|
<>
|
|
228
298
|
{showTodoList && (
|
|
229
299
|
<CardHeader
|
|
230
300
|
title={
|
|
231
|
-
<Badge badgeContent={
|
|
301
|
+
<Badge badgeContent={getCount()} overlap='rectangular' color='primary'>
|
|
232
302
|
<Typography variant='h6'>{headerText} </Typography>
|
|
233
303
|
</Badge>
|
|
234
304
|
}
|
|
@@ -249,7 +319,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
249
319
|
</div>
|
|
250
320
|
{(!isConfirm || canPerform) && (
|
|
251
321
|
<div style={{ marginLeft: 'auto' }}>
|
|
252
|
-
<IconButton id='go-btn' onClick={() => clickGo(assignment)}>
|
|
322
|
+
<IconButton id='go-btn' onClick={() => clickGo(assignment)} size='large'>
|
|
253
323
|
<ArrowForwardIosOutlinedIcon />
|
|
254
324
|
</IconButton>
|
|
255
325
|
</div>
|
|
@@ -267,7 +337,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
267
337
|
{showTodoList && (
|
|
268
338
|
<CardHeader
|
|
269
339
|
title={
|
|
270
|
-
<Badge badgeContent={
|
|
340
|
+
<Badge badgeContent={getCount()} overlap='rectangular' color='primary'>
|
|
271
341
|
<Typography variant='h6'>{headerText} </Typography>
|
|
272
342
|
</Badge>
|
|
273
343
|
}
|
|
@@ -280,7 +350,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
280
350
|
<ListItem key={getAssignmentId(assignment)} dense divider onClick={() => clickGo(assignment)}>
|
|
281
351
|
<ListItemText primary={getAssignmentName(assignment)} secondary={getListItemComponent(assignment)} />
|
|
282
352
|
<ListItemSecondaryAction>
|
|
283
|
-
<IconButton onClick={() => clickGo(assignment)}>
|
|
353
|
+
<IconButton onClick={() => clickGo(assignment)} size='large'>
|
|
284
354
|
<ArrowForwardIosOutlinedIcon />
|
|
285
355
|
</IconButton>
|
|
286
356
|
</ListItemSecondaryAction>
|
|
@@ -294,7 +364,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
294
364
|
{type === CONSTS.TODO && !isConfirm && <Card className={classes.todoWrapper}>{toDoContent}</Card>}
|
|
295
365
|
{type === CONSTS.TODO && isConfirm && <>{toDoContent}</>}
|
|
296
366
|
|
|
297
|
-
{
|
|
367
|
+
{getCount() > 3 && (
|
|
298
368
|
<Box display='flex' justifyContent='center'>
|
|
299
369
|
{bShowMore ? (
|
|
300
370
|
<Button color='primary' onClick={_showMore}>
|
package/package.json
CHANGED