@pega/react-sdk-overrides 8.8.21 → 8.23.11-debug
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 +9 -13
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -12
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +10 -15
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -10
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +3 -10
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +3 -11
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +3 -11
- package/lib/designSystemExtension/Operator/Operator.tsx +12 -16
- package/lib/designSystemExtension/Pulse/Pulse.tsx +7 -11
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -10
- package/lib/field/AutoComplete/AutoComplete.tsx +18 -37
- package/lib/field/CancelAlert/CancelAlert.tsx +4 -9
- package/lib/field/Checkbox/Checkbox.tsx +16 -39
- package/lib/field/Currency/Currency.tsx +15 -23
- package/lib/field/Currency/currency-utils.ts +5 -1
- package/lib/field/Date/Date.tsx +15 -22
- package/lib/field/DateTime/DateTime.tsx +14 -25
- package/lib/field/Decimal/Decimal.tsx +14 -25
- package/lib/field/Dropdown/Dropdown.tsx +26 -30
- package/lib/field/Email/Email.tsx +9 -17
- package/lib/field/Integer/Integer.tsx +7 -15
- package/lib/field/Percentage/Percentage.tsx +7 -15
- package/lib/field/Phone/Phone.tsx +11 -19
- package/lib/field/RadioButtons/RadioButtons.tsx +37 -25
- package/lib/field/SemanticLink/SemanticLink.tsx +25 -26
- package/lib/field/TextArea/TextArea.tsx +5 -14
- package/lib/field/TextContent/TextContent.tsx +1 -10
- package/lib/field/TextInput/TextInput.tsx +6 -15
- package/lib/field/Time/Time.tsx +27 -22
- package/lib/field/URL/URL.tsx +8 -16
- package/lib/field/UserReference/UserReference.tsx +60 -50
- package/lib/helpers/attachmentHelpers.ts +4 -4
- package/lib/helpers/auth.js +397 -741
- package/lib/helpers/authManager.js +634 -0
- package/lib/helpers/case-utils.tsx +9 -8
- package/lib/helpers/common-utils.ts +1 -1
- package/lib/helpers/config_access.js +73 -0
- package/lib/helpers/date-format-utils.ts +1 -1
- package/lib/helpers/event-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +11 -11
- package/lib/helpers/formatters/CurrencyMap.ts +5 -8
- package/lib/helpers/formatters/Date.ts +1 -1
- package/lib/helpers/formatters/common.ts +6 -2
- package/lib/helpers/formatters/index.ts +3 -3
- package/lib/helpers/simpleTableHelpers.ts +7 -7
- package/lib/helpers/state-utils.tsx +3 -0
- package/lib/helpers/template-utils.ts +6 -3
- package/lib/helpers/versionHelpers.ts +3 -0
- package/lib/infra/ActionButtons/ActionButtons.tsx +19 -9
- package/lib/infra/Assignment/Assignment.tsx +28 -21
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -15
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +58 -57
- package/lib/infra/Containers/FlowContainer/helpers.ts +3 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +19 -14
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -14
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -13
- package/lib/infra/DashboardFilter/filterUtils.tsx +1 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +20 -14
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +14 -10
- package/lib/infra/MultiStep/MultiStep.tsx +22 -22
- package/lib/infra/NavBar/NavBar.tsx +21 -14
- package/lib/infra/Reference/Reference.tsx +18 -13
- package/lib/infra/Region/Region.tsx +6 -8
- package/lib/infra/RootContainer/RootContainer.tsx +25 -16
- package/lib/infra/Stages/Stages.tsx +8 -10
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -8
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
- package/lib/infra/View/View.tsx +22 -21
- package/lib/template/AppShell/AppShell.tsx +25 -36
- package/lib/template/BannerPage/BannerPage.tsx +31 -26
- package/lib/template/CaseSummary/CaseSummary.tsx +8 -15
- package/lib/template/CaseView/CaseView.tsx +25 -24
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +19 -10
- package/lib/template/Confirmation/Confirmation.tsx +53 -27
- package/lib/template/DataReference/DataReference.tsx +52 -48
- package/lib/template/DefaultForm/DefaultForm.tsx +12 -14
- package/lib/template/Details/Details/Details.tsx +17 -16
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +16 -13
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +18 -19
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +18 -20
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +28 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +7 -11
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +17 -19
- package/lib/template/ListPage/ListPage.tsx +13 -14
- package/lib/template/ListView/ListView.tsx +186 -189
- package/lib/template/ListView/utils.ts +23 -170
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +19 -10
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +1 -16
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +18 -19
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +1 -9
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -8
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +7 -5
- package/lib/template/PromotedFilters/PromotedFilters.tsx +14 -16
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -102
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +7 -24
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -23
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +36 -34
- package/lib/template/SubTabs/SubTabs.tsx +11 -10
- package/lib/template/SubTabs/tabUtils.ts +4 -0
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +15 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +12 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +3 -17
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +25 -35
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +1 -7
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +17 -15
- package/lib/template/WssNavBar/WssNavBar.tsx +1 -18
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +21 -13
- package/lib/widget/Attachment/Attachment.tsx +16 -28
- package/lib/widget/CaseHistory/CaseHistory.tsx +10 -12
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -13
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +22 -35
- package/lib/widget/Followers/Followers.tsx +11 -10
- package/lib/widget/QuickCreate/QuickCreate.tsx +5 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +1 -11
- package/lib/widget/SummaryList/SummaryList.tsx +3 -17
- package/lib/widget/ToDo/ToDo.tsx +105 -62
- package/package.json +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +0 -121
- package/lib/designSystemExtension/RichTextEditor/index.tsx +0 -1
- package/lib/field/RichText/RichText.tsx +0 -93
- package/lib/field/RichText/index.tsx +0 -1
- package/lib/field/ScalarList/ScalarList.tsx +0 -64
- package/lib/field/ScalarList/config-ext.json +0 -8
- package/lib/field/ScalarList/index.tsx +0 -1
- package/lib/helpers/authManager.ts +0 -933
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
// import PropTypes from "prop-types";
|
|
2
3
|
import { Card, CardContent, CardHeader, Typography } from "@material-ui/core";
|
|
3
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
5
|
// import { green } from "@material-ui/core/colors";
|
|
5
6
|
|
|
6
|
-
// Followers does NOT have getPConnect. So, no need to extend from PConnProps
|
|
7
|
-
interface FollowersProps {
|
|
8
|
-
// If any, enter additional props that only exist on this component
|
|
9
|
-
children: Array<any>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
7
|
const useStyles = makeStyles((theme) => ({
|
|
14
8
|
root: {
|
|
15
9
|
paddingRight: theme.spacing(1),
|
|
@@ -25,10 +19,9 @@ const useStyles = makeStyles((theme) => ({
|
|
|
25
19
|
},
|
|
26
20
|
}));
|
|
27
21
|
|
|
28
|
-
export default function Followers(props
|
|
22
|
+
export default function Followers(/* props */) {
|
|
29
23
|
const componentName = "Followers";
|
|
30
|
-
//
|
|
31
|
-
const { children } = props;
|
|
24
|
+
// const { children } = props;
|
|
32
25
|
const classes = useStyles();
|
|
33
26
|
|
|
34
27
|
return (
|
|
@@ -40,3 +33,11 @@ export default function Followers(props: FollowersProps) {
|
|
|
40
33
|
</Card>
|
|
41
34
|
);
|
|
42
35
|
}
|
|
36
|
+
|
|
37
|
+
Followers.defaultProps = {
|
|
38
|
+
// children: []
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Followers.propTypes = {
|
|
42
|
+
// children: PropTypes.arrayOf(PropTypes.node)
|
|
43
|
+
};
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import WssQuickCreate from '@pega/react-sdk-components/lib/components/designSystemExtension/WssQuickCreate';
|
|
2
3
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
3
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
// import type { PConnProps } from '../../../types/PConnProps';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
// 2nd arg to createWork
|
|
8
|
-
// interface QuickCreateProps extends PConnProps {
|
|
9
|
-
// // If any, enter additional props that only exist on this component
|
|
10
|
-
// }
|
|
5
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
11
6
|
|
|
7
|
+
declare const PCore: typeof PCoreType;
|
|
12
8
|
|
|
13
|
-
export default function QuickCreate(props /* : QuickCreateProps */) {
|
|
14
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
15
|
-
const WssQuickCreate = getComponentFromMap('WssQuickCreate');
|
|
16
9
|
|
|
10
|
+
export default function QuickCreate(props) {
|
|
17
11
|
const { getPConnect, heading, showCaseIcons, classFilter } = props;
|
|
18
12
|
const pConn = getPConnect();
|
|
19
13
|
const createCase = (className) => {
|
|
20
14
|
pConn
|
|
21
15
|
.getActionsApi()
|
|
22
|
-
.createWork(className, {
|
|
16
|
+
.createWork(className, {})
|
|
23
17
|
.catch((error) => {
|
|
24
18
|
// eslint-disable-next-line no-console
|
|
25
19
|
console.log('Error in case creation: ', error?.message)
|
|
@@ -4,17 +4,7 @@ import './SummaryItem.css'
|
|
|
4
4
|
import { IconButton, Menu, MenuItem } from '@material-ui/core';
|
|
5
5
|
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface SummaryItemProps {
|
|
10
|
-
// If any, enter additional props that only exist on this component
|
|
11
|
-
menuIconOverride$: string,
|
|
12
|
-
menuIconOverrideAction$: any,
|
|
13
|
-
arItems$: Array<any> | any
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export default function SummaryItem(props:SummaryItemProps) {
|
|
7
|
+
export default function SummaryItem(props) {
|
|
18
8
|
let imagePath$ = "";
|
|
19
9
|
let menuIconOverride$;
|
|
20
10
|
menuIconOverride$ = props.menuIconOverride$
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import SummaryItem from '@pega/react-sdk-components/lib/components/widget/SummaryItem/index'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface SummaryListProps {
|
|
7
|
-
// If any, enter additional props that only exist on this component
|
|
8
|
-
arItems$: Array<any>,
|
|
9
|
-
menuIconOverride$?: string,
|
|
10
|
-
menuIconOverrideAction$?: any
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export default function SummaryList(props: SummaryListProps) {
|
|
15
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
16
|
-
const SummaryItem = getComponentFromMap('SummaryItem');
|
|
17
|
-
|
|
18
|
-
const { menuIconOverride$: menuOverride = ""} = props;
|
|
4
|
+
export default function SummaryList(props) {
|
|
19
5
|
return (
|
|
20
6
|
<div>
|
|
21
7
|
{props.arItems$.map(file => (
|
|
22
|
-
<SummaryItem key={file.id} menuIconOverride$={
|
|
8
|
+
<SummaryItem key={file.id} menuIconOverride$={props.menuIconOverride$} arItems$={file} menuIconOverrideAction$={props.menuIconOverrideAction$}></SummaryItem>
|
|
23
9
|
))}
|
|
24
10
|
</div>
|
|
25
11
|
);
|
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-shadow */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
3
3
|
import React, { Fragment, useState } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
4
5
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
6
|
import {
|
|
6
7
|
Box,
|
|
@@ -25,27 +26,13 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
25
26
|
import { useTheme } from '@material-ui/core/styles';
|
|
26
27
|
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
27
28
|
|
|
28
|
-
import '
|
|
29
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
29
30
|
|
|
30
|
-
import
|
|
31
|
+
import './ToDo.css';
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
// If any, enter additional props that only exist on this component
|
|
34
|
-
datasource?: any;
|
|
35
|
-
myWorkList?: any;
|
|
36
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
37
|
-
caseInfoID?: string;
|
|
38
|
-
headerText?: string;
|
|
39
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
40
|
-
itemKey?: string;
|
|
41
|
-
showTodoList?: boolean;
|
|
42
|
-
type?: string;
|
|
43
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
44
|
-
context?: string;
|
|
45
|
-
isConfirm?: boolean;
|
|
46
|
-
}
|
|
33
|
+
declare const PCore: typeof PCoreType;
|
|
47
34
|
|
|
48
|
-
const isChildCase =
|
|
35
|
+
const isChildCase = assignment => {
|
|
49
36
|
return assignment.isChild;
|
|
50
37
|
};
|
|
51
38
|
|
|
@@ -64,7 +51,7 @@ function getID(assignment: any) {
|
|
|
64
51
|
}
|
|
65
52
|
}
|
|
66
53
|
|
|
67
|
-
const useStyles = makeStyles(
|
|
54
|
+
const useStyles = makeStyles(theme => ({
|
|
68
55
|
root: {
|
|
69
56
|
marginTop: theme.spacing(1),
|
|
70
57
|
marginBottom: theme.spacing(1),
|
|
@@ -84,8 +71,8 @@ const useStyles = makeStyles((theme) => ({
|
|
|
84
71
|
}
|
|
85
72
|
}));
|
|
86
73
|
|
|
87
|
-
export default function ToDo(props
|
|
88
|
-
const {
|
|
74
|
+
export default function ToDo(props) {
|
|
75
|
+
const { datasource, getPConnect, headerText, showTodoList, myWorkList, type, isConfirm } = props;
|
|
89
76
|
|
|
90
77
|
const CONSTS = PCore.getConstants();
|
|
91
78
|
|
|
@@ -121,15 +108,15 @@ export default function ToDo(props: ToDoProps) {
|
|
|
121
108
|
}
|
|
122
109
|
}
|
|
123
110
|
|
|
124
|
-
const getAssignmentId =
|
|
111
|
+
const getAssignmentId = assignment => {
|
|
125
112
|
return type === CONSTS.TODO ? assignment.ID : assignment.id;
|
|
126
113
|
};
|
|
127
114
|
|
|
128
|
-
const getPriority =
|
|
115
|
+
const getPriority = assignment => {
|
|
129
116
|
return type === CONSTS.TODO ? assignment.urgency : assignment.priority;
|
|
130
117
|
};
|
|
131
118
|
|
|
132
|
-
const getAssignmentName =
|
|
119
|
+
const getAssignmentName = assignment => {
|
|
133
120
|
return type === CONSTS.TODO ? assignment.name : assignment.stepName;
|
|
134
121
|
};
|
|
135
122
|
|
|
@@ -164,7 +151,7 @@ export default function ToDo(props: ToDoProps) {
|
|
|
164
151
|
const sTarget = thePConn.getContainerName();
|
|
165
152
|
const sTargetContainerName = sTarget;
|
|
166
153
|
|
|
167
|
-
const options = { containerName: sTargetContainerName
|
|
154
|
+
const options = { containerName: sTargetContainerName };
|
|
168
155
|
|
|
169
156
|
if (classname === null || classname === '') {
|
|
170
157
|
classname = thePConn.getCaseInfo().getClassName();
|
|
@@ -199,26 +186,30 @@ export default function ToDo(props: ToDoProps) {
|
|
|
199
186
|
|
|
200
187
|
if ((showTodoList && type !== CONSTS.TODO) || assignment.isChild === true) {
|
|
201
188
|
/* Supress link for todo inside flow step */
|
|
202
|
-
return
|
|
189
|
+
return (
|
|
190
|
+
<Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>
|
|
191
|
+
);
|
|
203
192
|
}
|
|
204
193
|
return displayID;
|
|
205
194
|
};
|
|
206
195
|
|
|
207
|
-
const getListItemComponent =
|
|
196
|
+
const getListItemComponent = assignment => {
|
|
208
197
|
if (isDesktop) {
|
|
209
198
|
return (
|
|
210
199
|
<>
|
|
211
200
|
{localizedVal('Task in', localeCategory)}
|
|
212
201
|
{renderTaskId(type, getPConnect, showTodoList, assignment)}
|
|
213
202
|
{type === CONSTS.WORKLIST && assignment.status ? `\u2022 ` : undefined}
|
|
214
|
-
{type === CONSTS.WORKLIST && assignment.status ?
|
|
203
|
+
{type === CONSTS.WORKLIST && assignment.status ? (
|
|
204
|
+
<span className='psdk-todo-assignment-status'>{assignment.status}</span>
|
|
205
|
+
) : undefined}
|
|
215
206
|
{` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
|
|
216
207
|
</>
|
|
217
208
|
);
|
|
218
209
|
}
|
|
219
210
|
return (
|
|
220
211
|
<>
|
|
221
|
-
<Button size=
|
|
212
|
+
<Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>
|
|
222
213
|
{` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
|
|
223
214
|
</>
|
|
224
215
|
);
|
|
@@ -229,33 +220,37 @@ export default function ToDo(props: ToDoProps) {
|
|
|
229
220
|
{showTodoList && (
|
|
230
221
|
<CardHeader
|
|
231
222
|
title={
|
|
232
|
-
<Badge badgeContent={assignmentCount}
|
|
233
|
-
<Typography variant=
|
|
223
|
+
<Badge badgeContent={assignmentCount} color='primary'>
|
|
224
|
+
<Typography variant='h6'>{headerText} </Typography>
|
|
234
225
|
</Badge>
|
|
235
226
|
}
|
|
236
227
|
></CardHeader>
|
|
237
228
|
)}
|
|
238
229
|
<List>
|
|
239
|
-
{assignments.map(
|
|
240
|
-
|
|
241
|
-
<
|
|
242
|
-
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
'
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<IconButton onClick={() => clickGo(assignment)}>
|
|
254
|
-
<ArrowForwardIosOutlinedIcon />
|
|
255
|
-
</IconButton>
|
|
230
|
+
{assignments.map(assignment => (
|
|
231
|
+
<>
|
|
232
|
+
<div className='psdk-todo-avatar-header' key={getAssignmentId(assignment)}>
|
|
233
|
+
<Avatar className={classes.avatar} style={{ marginRight: '16px' }}>
|
|
234
|
+
{currentUserInitials}
|
|
235
|
+
</Avatar>
|
|
236
|
+
<div style={{ display: 'block' }}>
|
|
237
|
+
<Typography variant='h6'>{assignment?.name}</Typography>
|
|
238
|
+
{`${localizedVal('Task in', localeCategory)} ${renderTaskId(
|
|
239
|
+
type,
|
|
240
|
+
getPConnect,
|
|
241
|
+
showTodoList,
|
|
242
|
+
assignment
|
|
243
|
+
)} \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
|
|
256
244
|
</div>
|
|
257
|
-
|
|
258
|
-
|
|
245
|
+
{!isConfirm && (
|
|
246
|
+
<div style={{ marginLeft: 'auto' }}>
|
|
247
|
+
<IconButton onClick={() => clickGo(assignment)}>
|
|
248
|
+
<ArrowForwardIosOutlinedIcon />
|
|
249
|
+
</IconButton>
|
|
250
|
+
</div>
|
|
251
|
+
)}
|
|
252
|
+
</div>
|
|
253
|
+
</>
|
|
259
254
|
))}
|
|
260
255
|
</List>
|
|
261
256
|
</>
|
|
@@ -268,8 +263,8 @@ export default function ToDo(props: ToDoProps) {
|
|
|
268
263
|
{showTodoList && (
|
|
269
264
|
<CardHeader
|
|
270
265
|
title={
|
|
271
|
-
<Badge badgeContent={assignmentCount}
|
|
272
|
-
<Typography variant=
|
|
266
|
+
<Badge badgeContent={assignmentCount} color='primary'>
|
|
267
|
+
<Typography variant='h6'>{headerText} </Typography>
|
|
273
268
|
</Badge>
|
|
274
269
|
}
|
|
275
270
|
avatar={<Avatar className={classes.avatar}>{currentUserInitials}</Avatar>}
|
|
@@ -277,9 +272,17 @@ export default function ToDo(props: ToDoProps) {
|
|
|
277
272
|
)}
|
|
278
273
|
<CardContent>
|
|
279
274
|
<List>
|
|
280
|
-
{assignments.map(
|
|
281
|
-
<ListItem
|
|
282
|
-
|
|
275
|
+
{assignments.map(assignment => (
|
|
276
|
+
<ListItem
|
|
277
|
+
key={getAssignmentId(assignment)}
|
|
278
|
+
dense
|
|
279
|
+
divider
|
|
280
|
+
onClick={() => clickGo(assignment)}
|
|
281
|
+
>
|
|
282
|
+
<ListItemText
|
|
283
|
+
primary={getAssignmentName(assignment)}
|
|
284
|
+
secondary={getListItemComponent(assignment)}
|
|
285
|
+
/>
|
|
283
286
|
<ListItemSecondaryAction>
|
|
284
287
|
<IconButton onClick={() => clickGo(assignment)}>
|
|
285
288
|
<ArrowForwardIosOutlinedIcon />
|
|
@@ -292,17 +295,21 @@ export default function ToDo(props: ToDoProps) {
|
|
|
292
295
|
</Card>
|
|
293
296
|
)}
|
|
294
297
|
|
|
295
|
-
{type === CONSTS.TODO && !isConfirm &&
|
|
298
|
+
{type === CONSTS.TODO && !isConfirm && (
|
|
299
|
+
<Card className={classes.todoWrapper}>{toDoContent}</Card>
|
|
300
|
+
)}
|
|
296
301
|
{type === CONSTS.TODO && isConfirm && <Fragment>{toDoContent}</Fragment>}
|
|
297
302
|
|
|
298
303
|
{assignmentCount > 3 && (
|
|
299
|
-
<Box display=
|
|
304
|
+
<Box display='flex' justifyContent='center'>
|
|
300
305
|
{bShowMore ? (
|
|
301
|
-
<Button color=
|
|
302
|
-
{showMoreLocalizedValue ===
|
|
306
|
+
<Button color='primary' onClick={_showMore}>
|
|
307
|
+
{showMoreLocalizedValue === 'show_more' ? 'Show more': showMoreLocalizedValue}
|
|
303
308
|
</Button>
|
|
304
309
|
) : (
|
|
305
|
-
<Button onClick={_showLess}>
|
|
310
|
+
<Button onClick={_showLess}>
|
|
311
|
+
{showlessLocalizedValue === 'show_less' ? 'Show less': showlessLocalizedValue}
|
|
312
|
+
</Button>
|
|
306
313
|
)}
|
|
307
314
|
</Box>
|
|
308
315
|
)}
|
|
@@ -313,11 +320,47 @@ export default function ToDo(props: ToDoProps) {
|
|
|
313
320
|
onClose={handleSnackbarClose}
|
|
314
321
|
message={snackbarMessage}
|
|
315
322
|
action={
|
|
316
|
-
<IconButton size=
|
|
317
|
-
<CloseIcon fontSize=
|
|
323
|
+
<IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>
|
|
324
|
+
<CloseIcon fontSize='small' />
|
|
318
325
|
</IconButton>
|
|
319
326
|
}
|
|
320
327
|
/>
|
|
321
328
|
</React.Fragment>
|
|
322
329
|
);
|
|
323
330
|
}
|
|
331
|
+
|
|
332
|
+
ToDo.propTypes = {
|
|
333
|
+
datasource: PropTypes.instanceOf(Object),
|
|
334
|
+
myWorkList: PropTypes.instanceOf(Object),
|
|
335
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
336
|
+
caseInfoID: PropTypes.string,
|
|
337
|
+
// buildName: PropTypes.string,
|
|
338
|
+
getPConnect: PropTypes.func.isRequired,
|
|
339
|
+
headerText: PropTypes.string,
|
|
340
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
341
|
+
itemKey: PropTypes.string,
|
|
342
|
+
showTodoList: PropTypes.bool,
|
|
343
|
+
// target: PropTypes.string,
|
|
344
|
+
type: PropTypes.string,
|
|
345
|
+
// pageMessages: PropTypes.arrayOf(PropTypes.any),
|
|
346
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
347
|
+
context: PropTypes.string,
|
|
348
|
+
// hideActionButtons: PropTypes.bool
|
|
349
|
+
isConfirm: PropTypes.bool
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
ToDo.defaultProps = {
|
|
353
|
+
caseInfoID: '',
|
|
354
|
+
datasource: [],
|
|
355
|
+
myWorkList: {},
|
|
356
|
+
// buildName: "",
|
|
357
|
+
headerText: 'To do',
|
|
358
|
+
itemKey: '',
|
|
359
|
+
showTodoList: true,
|
|
360
|
+
// target: "",
|
|
361
|
+
type: 'worklist',
|
|
362
|
+
// pageMessages: null,
|
|
363
|
+
context: '',
|
|
364
|
+
// hideActionButtons: false
|
|
365
|
+
isConfirm: false
|
|
366
|
+
};
|
package/package.json
CHANGED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import { Editor } from '@tinymce/tinymce-react';
|
|
3
|
-
import { FormControl, FormHelperText, InputLabel, makeStyles } from '@material-ui/core';
|
|
4
|
-
import { useAfterInitialEffect, useConsolidatedRef, useUID } from '@pega/react-sdk-components/lib/hooks';
|
|
5
|
-
|
|
6
|
-
const useStyles = makeStyles((theme) => ({
|
|
7
|
-
fieldLabel: {
|
|
8
|
-
position: 'relative',
|
|
9
|
-
transform: 'translate(0, 0px) scale(1)',
|
|
10
|
-
marginBottom: '5px',
|
|
11
|
-
color: theme.palette.text.secondary
|
|
12
|
-
}
|
|
13
|
-
}));
|
|
14
|
-
|
|
15
|
-
interface RichTextEditorProps {
|
|
16
|
-
id?: string;
|
|
17
|
-
defaultValue: string;
|
|
18
|
-
label: string;
|
|
19
|
-
labelHidden: boolean;
|
|
20
|
-
info: string;
|
|
21
|
-
testId: string;
|
|
22
|
-
placeholder: string;
|
|
23
|
-
disabled: boolean;
|
|
24
|
-
required: boolean;
|
|
25
|
-
readOnly: boolean;
|
|
26
|
-
error: boolean;
|
|
27
|
-
onBlur: React.EventHandler<any>;
|
|
28
|
-
onChange: React.EventHandler<any>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorProps, ref) {
|
|
32
|
-
const classes = useStyles();
|
|
33
|
-
const uid = useUID();
|
|
34
|
-
const { id = uid, defaultValue, label, labelHidden, info, testId, placeholder, disabled, required, readOnly, error, onBlur, onChange } = props;
|
|
35
|
-
|
|
36
|
-
const editorRef: any = useConsolidatedRef(ref);
|
|
37
|
-
let richTextComponent: any = null;
|
|
38
|
-
|
|
39
|
-
useAfterInitialEffect(() => {
|
|
40
|
-
editorRef?.current.mode.set(readOnly || disabled ? 'readonly' : 'design');
|
|
41
|
-
}, [readOnly, disabled]);
|
|
42
|
-
|
|
43
|
-
const filePickerCallback = (cb) => {
|
|
44
|
-
const input = document.createElement('input');
|
|
45
|
-
input.setAttribute('type', 'file');
|
|
46
|
-
input.setAttribute('accept', 'image/*');
|
|
47
|
-
|
|
48
|
-
input.addEventListener('change', (e: any) => {
|
|
49
|
-
const file = e.target.files[0];
|
|
50
|
-
|
|
51
|
-
const reader: any = new FileReader();
|
|
52
|
-
reader.addEventListener('load', () => {
|
|
53
|
-
/*
|
|
54
|
-
Note: Now we need to register the blob in TinyMCEs image blob
|
|
55
|
-
registry. In the next release this part hopefully won't be
|
|
56
|
-
necessary, as we are looking to handle it internally.
|
|
57
|
-
*/
|
|
58
|
-
const blobId = `blobid${new Date().getTime()}`;
|
|
59
|
-
const blobCache = editorRef.current.editorUpload.blobCache;
|
|
60
|
-
const base64 = reader.result.split(',')[1];
|
|
61
|
-
const blobInfo = blobCache.create(blobId, file, base64);
|
|
62
|
-
blobCache.add(blobInfo);
|
|
63
|
-
|
|
64
|
-
/* call the callback and populate the Title field with the file name */
|
|
65
|
-
cb(blobInfo.blobUri(), { title: file.name });
|
|
66
|
-
});
|
|
67
|
-
reader.readAsDataURL(file);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
input.click();
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
if (readOnly) {
|
|
74
|
-
const value = defaultValue || '--';
|
|
75
|
-
// eslint-disable-next-line react/no-danger
|
|
76
|
-
richTextComponent = <div key={id} id={id} className="readonly-richtext-editor" dangerouslySetInnerHTML={{ __html: value }} />;
|
|
77
|
-
} else {
|
|
78
|
-
richTextComponent = (
|
|
79
|
-
<Editor
|
|
80
|
-
tinymceScriptSrc="tinymce/tinymce.min.js"
|
|
81
|
-
onInit={(_evt, editor) => {
|
|
82
|
-
editorRef.current = editor;
|
|
83
|
-
}}
|
|
84
|
-
id={id}
|
|
85
|
-
initialValue={defaultValue}
|
|
86
|
-
disabled={disabled}
|
|
87
|
-
init={{
|
|
88
|
-
placeholder,
|
|
89
|
-
menubar: false,
|
|
90
|
-
statusbar: false,
|
|
91
|
-
min_height: 130,
|
|
92
|
-
plugins: ['lists', 'advlist', 'autolink', 'image', 'link', 'autoresize'],
|
|
93
|
-
autoresize_bottom_margin: 0,
|
|
94
|
-
toolbar: disabled ? false : 'blocks | bold italic strikethrough | bullist numlist outdent indent | link image',
|
|
95
|
-
toolbar_location: 'bottom',
|
|
96
|
-
content_style: 'body { font-family:Helvetica, Arial,sans-serif; font-size:14px }',
|
|
97
|
-
branding: false,
|
|
98
|
-
paste_data_images: true,
|
|
99
|
-
file_picker_types: 'image',
|
|
100
|
-
file_picker_callback: filePickerCallback
|
|
101
|
-
}}
|
|
102
|
-
onBlur={onBlur}
|
|
103
|
-
onEditorChange={onChange}
|
|
104
|
-
/>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<FormControl data-test-id={testId} error={error} required={required}>
|
|
110
|
-
{!labelHidden && (
|
|
111
|
-
<InputLabel id="demo-simple-select-error-label" className={classes.fieldLabel}>
|
|
112
|
-
{label}
|
|
113
|
-
</InputLabel>
|
|
114
|
-
)}
|
|
115
|
-
{richTextComponent}
|
|
116
|
-
{info && <FormHelperText>{info}</FormHelperText>}
|
|
117
|
-
</FormControl>
|
|
118
|
-
);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export default RichTextEditor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './RichTextEditor';
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
3
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
-
|
|
6
|
-
interface RichTextProps extends PConnFieldProps {
|
|
7
|
-
// If any, enter additional props that only exist on TextArea here
|
|
8
|
-
additionalProps?: object;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default function RichText(props: RichTextProps) {
|
|
12
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
13
|
-
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
14
|
-
const RichTextEditor = getComponentFromMap('RichTextEditor');
|
|
15
|
-
|
|
16
|
-
const { getPConnect, value, placeholder, validatemessage, label, hideLabel, helperText, testId, displayMode, additionalProps } = props;
|
|
17
|
-
const pConn = getPConnect();
|
|
18
|
-
const editorRef: any = useRef(null);
|
|
19
|
-
|
|
20
|
-
let { readOnly, required, disabled } = props;
|
|
21
|
-
[readOnly, required, disabled] = [readOnly, required, disabled].map((prop) => prop === true || (typeof prop === 'string' && prop === 'true'));
|
|
22
|
-
|
|
23
|
-
const helperTextToDisplay = validatemessage || helperText;
|
|
24
|
-
|
|
25
|
-
if (displayMode === 'LABELS_LEFT') {
|
|
26
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
30
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant="stacked" />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let richTextComponent;
|
|
34
|
-
|
|
35
|
-
if (readOnly) {
|
|
36
|
-
// Rich Text read-only component
|
|
37
|
-
richTextComponent = (
|
|
38
|
-
<RichTextEditor
|
|
39
|
-
{...additionalProps}
|
|
40
|
-
label={label}
|
|
41
|
-
labelHidden={hideLabel}
|
|
42
|
-
defaultValue={value}
|
|
43
|
-
testId={testId}
|
|
44
|
-
info={helperTextToDisplay}
|
|
45
|
-
ref={editorRef}
|
|
46
|
-
readOnly
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
} else {
|
|
50
|
-
// Rich Text editable component
|
|
51
|
-
const actionsApi = pConn.getActionsApi();
|
|
52
|
-
let status = '';
|
|
53
|
-
if (validatemessage !== '') {
|
|
54
|
-
status = 'error';
|
|
55
|
-
}
|
|
56
|
-
const handleChange = () => {
|
|
57
|
-
if (status === 'error') {
|
|
58
|
-
const property = pConn.getStateProps().value;
|
|
59
|
-
pConn.clearErrorMessages({
|
|
60
|
-
property
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const handleBlur = () => {
|
|
66
|
-
if (editorRef.current) {
|
|
67
|
-
const editorValue = editorRef.current.getContent({ format: 'html' });
|
|
68
|
-
const property = pConn.getStateProps().value;
|
|
69
|
-
handleEvent(actionsApi, 'changeNblur', property, editorValue);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
richTextComponent = (
|
|
74
|
-
<RichTextEditor
|
|
75
|
-
{...additionalProps}
|
|
76
|
-
label={label}
|
|
77
|
-
labelHidden={hideLabel}
|
|
78
|
-
info={helperTextToDisplay}
|
|
79
|
-
defaultValue={value}
|
|
80
|
-
placeholder={placeholder}
|
|
81
|
-
disabled={disabled}
|
|
82
|
-
required={required}
|
|
83
|
-
testId={testId}
|
|
84
|
-
ref={editorRef}
|
|
85
|
-
error={status === 'error'}
|
|
86
|
-
onBlur={handleBlur}
|
|
87
|
-
onChange={handleChange}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return richTextComponent;
|
|
93
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './RichText';
|