@pega/react-sdk-overrides 0.23.19 → 0.23.21
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/Banner/Banner.css +35 -0
- package/lib/designSystemExtension/Banner/Banner.tsx +33 -0
- package/lib/designSystemExtension/Banner/index.tsx +1 -0
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +1 -2
- package/lib/field/DateTime/DateTime.tsx +6 -7
- package/lib/helpers/template-utils.ts +7 -7
- package/lib/infra/Assignment/Assignment.tsx +126 -109
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +120 -136
- package/lib/infra/View/View.tsx +2 -1
- package/lib/template/AppShell/AppShell.tsx +159 -27
- package/lib/template/BannerPage/BannerPage.tsx +61 -0
- package/lib/template/BannerPage/index.tsx +1 -0
- package/lib/template/Confirmation/Confirmation.tsx +101 -0
- package/lib/template/Confirmation/config-ext.json +12 -0
- package/lib/template/Confirmation/index.tsx +1 -0
- package/lib/template/WssNavBar/WssNavBar.css +5 -0
- package/lib/template/WssNavBar/WssNavBar.tsx +141 -0
- package/lib/template/WssNavBar/index.tsx +1 -0
- package/lib/widget/Attachment/Attachment.tsx +9 -10
- package/lib/widget/ToDo/ToDo.css +10 -4
- package/lib/widget/ToDo/ToDo.tsx +125 -52
- package/package.json +1 -1
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable no-shadow */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-shadow */
|
|
3
|
+
import React, { Fragment, useState } from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
4
6
|
import {
|
|
@@ -28,7 +30,7 @@ import './ToDo.css';
|
|
|
28
30
|
|
|
29
31
|
declare const PCore: any;
|
|
30
32
|
|
|
31
|
-
const isChildCase =
|
|
33
|
+
const isChildCase = assignment => {
|
|
32
34
|
return assignment.isChild;
|
|
33
35
|
};
|
|
34
36
|
|
|
@@ -58,11 +60,17 @@ const useStyles = makeStyles(theme => ({
|
|
|
58
60
|
avatar: {
|
|
59
61
|
backgroundColor: theme.palette.primary.light,
|
|
60
62
|
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
63
|
+
},
|
|
64
|
+
todoWrapper: {
|
|
65
|
+
borderLeft: '6px solid',
|
|
66
|
+
borderLeftColor: theme.palette.primary.light,
|
|
67
|
+
padding: theme.spacing(1),
|
|
68
|
+
margin: theme.spacing(1)
|
|
61
69
|
}
|
|
62
70
|
}));
|
|
63
71
|
|
|
64
72
|
export default function ToDo(props) {
|
|
65
|
-
const { datasource, getPConnect, headerText, showTodoList, myWorkList, type } = props;
|
|
73
|
+
const { datasource, getPConnect, headerText, showTodoList, myWorkList, type, isConfirm } = props;
|
|
66
74
|
|
|
67
75
|
const CONSTS = PCore.getConstants();
|
|
68
76
|
|
|
@@ -167,14 +175,28 @@ export default function ToDo(props) {
|
|
|
167
175
|
});
|
|
168
176
|
}
|
|
169
177
|
|
|
178
|
+
const renderTaskId = (type, getPConnect, showTodoList, assignment) => {
|
|
179
|
+
const displayID = getID(assignment);
|
|
180
|
+
|
|
181
|
+
if ((showTodoList && type !== CONSTS.TODO) || assignment.isChild === true) {
|
|
182
|
+
/* Supress link for todo inside flow step */
|
|
183
|
+
return (
|
|
184
|
+
<Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return displayID;
|
|
188
|
+
};
|
|
189
|
+
|
|
170
190
|
const getListItemComponent = assignment => {
|
|
171
191
|
if (isDesktop) {
|
|
172
192
|
return (
|
|
173
193
|
<>
|
|
174
194
|
Task in
|
|
175
|
-
|
|
176
|
-
{
|
|
177
|
-
|
|
195
|
+
{renderTaskId(type, getPConnect, showTodoList, assignment)}
|
|
196
|
+
{type === CONSTS.WORKLIST && assignment.status ? `\u2022 ` : undefined}
|
|
197
|
+
{type === CONSTS.WORKLIST && assignment.status ? (
|
|
198
|
+
<span className='psdk-todo-assignment-status'>{assignment.status}</span>
|
|
199
|
+
) : undefined}
|
|
178
200
|
{` \u2022 Urgency ${getPriority(assignment)}`}
|
|
179
201
|
</>
|
|
180
202
|
);
|
|
@@ -187,53 +209,102 @@ export default function ToDo(props) {
|
|
|
187
209
|
);
|
|
188
210
|
};
|
|
189
211
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
const toDoContent = (
|
|
213
|
+
<>
|
|
214
|
+
{showTodoList && (
|
|
215
|
+
<CardHeader
|
|
216
|
+
title={
|
|
217
|
+
<Badge badgeContent={assignmentCount} color='primary'>
|
|
218
|
+
<Typography variant='h6'>{headerText} </Typography>
|
|
219
|
+
</Badge>
|
|
220
|
+
}
|
|
221
|
+
></CardHeader>
|
|
222
|
+
)}
|
|
223
|
+
<List>
|
|
224
|
+
{assignments.map(assignment => (
|
|
225
|
+
<>
|
|
226
|
+
<div className='psdk-todo-avatar-header'>
|
|
227
|
+
<Avatar className={classes.avatar} style={{ marginRight: '16px' }}>
|
|
228
|
+
{currentUserInitials}
|
|
229
|
+
</Avatar>
|
|
230
|
+
<div style={{ display: 'block' }}>
|
|
231
|
+
<Typography variant='h6'>{assignment?.name}</Typography>
|
|
232
|
+
{`Task in ${renderTaskId(
|
|
233
|
+
type,
|
|
234
|
+
getPConnect,
|
|
235
|
+
showTodoList,
|
|
236
|
+
assignment
|
|
237
|
+
)} \u2022 Urgency ${getPriority(assignment)}`}
|
|
238
|
+
</div>
|
|
239
|
+
{!isConfirm && (
|
|
240
|
+
<div style={{ marginLeft: 'auto' }}>
|
|
217
241
|
<IconButton onClick={() => clickGo(assignment)}>
|
|
218
242
|
<ArrowForwardIosOutlinedIcon />
|
|
219
243
|
</IconButton>
|
|
220
|
-
</
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
244
|
+
</div>
|
|
245
|
+
)}
|
|
246
|
+
</div>
|
|
247
|
+
</>
|
|
248
|
+
))}
|
|
249
|
+
</List>
|
|
250
|
+
</>
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
return (
|
|
254
|
+
<React.Fragment>
|
|
255
|
+
{type === CONSTS.WORKLIST && (
|
|
256
|
+
<Card className={classes.root}>
|
|
257
|
+
{showTodoList && (
|
|
258
|
+
<CardHeader
|
|
259
|
+
title={
|
|
260
|
+
<Badge badgeContent={assignmentCount} color='primary'>
|
|
261
|
+
<Typography variant='h6'>{headerText} </Typography>
|
|
262
|
+
</Badge>
|
|
263
|
+
}
|
|
264
|
+
avatar={<Avatar className={classes.avatar}>{currentUserInitials}</Avatar>}
|
|
265
|
+
></CardHeader>
|
|
266
|
+
)}
|
|
267
|
+
<CardContent>
|
|
268
|
+
<List>
|
|
269
|
+
{assignments.map(assignment => (
|
|
270
|
+
<ListItem
|
|
271
|
+
key={getAssignmentId(assignment)}
|
|
272
|
+
dense
|
|
273
|
+
divider
|
|
274
|
+
onClick={() => clickGo(assignment)}
|
|
275
|
+
>
|
|
276
|
+
<ListItemText
|
|
277
|
+
primary={getAssignmentName(assignment)}
|
|
278
|
+
secondary={getListItemComponent(assignment)}
|
|
279
|
+
/>
|
|
280
|
+
<ListItemSecondaryAction>
|
|
281
|
+
<IconButton onClick={() => clickGo(assignment)}>
|
|
282
|
+
<ArrowForwardIosOutlinedIcon />
|
|
283
|
+
</IconButton>
|
|
284
|
+
</ListItemSecondaryAction>
|
|
285
|
+
</ListItem>
|
|
286
|
+
))}
|
|
287
|
+
</List>
|
|
288
|
+
</CardContent>
|
|
289
|
+
</Card>
|
|
290
|
+
)}
|
|
291
|
+
|
|
292
|
+
{type === CONSTS.TODO && !isConfirm && (
|
|
293
|
+
<Card className={classes.todoWrapper}>{toDoContent}</Card>
|
|
294
|
+
)}
|
|
295
|
+
{type === CONSTS.TODO && isConfirm && <Fragment>{toDoContent}</Fragment>}
|
|
296
|
+
|
|
297
|
+
{assignmentCount > 3 && (
|
|
298
|
+
<Box display='flex' justifyContent='center'>
|
|
299
|
+
{bShowMore ? (
|
|
300
|
+
<Button color='primary' onClick={_showMore}>
|
|
301
|
+
Show more
|
|
302
|
+
</Button>
|
|
303
|
+
) : (
|
|
304
|
+
<Button onClick={_showLess}>Show less</Button>
|
|
305
|
+
)}
|
|
306
|
+
</Box>
|
|
307
|
+
)}
|
|
237
308
|
|
|
238
309
|
<Snackbar
|
|
239
310
|
open={showSnackbar}
|
|
@@ -265,8 +336,9 @@ ToDo.propTypes = {
|
|
|
265
336
|
type: PropTypes.string,
|
|
266
337
|
// pageMessages: PropTypes.arrayOf(PropTypes.any),
|
|
267
338
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
268
|
-
context: PropTypes.string
|
|
339
|
+
context: PropTypes.string,
|
|
269
340
|
// hideActionButtons: PropTypes.bool
|
|
341
|
+
isConfirm: PropTypes.bool
|
|
270
342
|
};
|
|
271
343
|
|
|
272
344
|
ToDo.defaultProps = {
|
|
@@ -280,6 +352,7 @@ ToDo.defaultProps = {
|
|
|
280
352
|
// target: "",
|
|
281
353
|
type: 'worklist',
|
|
282
354
|
// pageMessages: null,
|
|
283
|
-
context: ''
|
|
355
|
+
context: '',
|
|
284
356
|
// hideActionButtons: false
|
|
357
|
+
isConfirm: false
|
|
285
358
|
};
|
package/package.json
CHANGED