@pega/react-sdk-overrides 0.23.25 → 0.23.27
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/LICENSE +201 -0
- package/README.md +17 -0
- package/SECURITY.md +10 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +39 -0
- package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/lib/designSystemExtension/Banner/Banner.css +4 -0
- package/lib/designSystemExtension/Banner/Banner.tsx +33 -16
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +13 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
- package/lib/designSystemExtension/Operator/Operator.tsx +106 -87
- package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
- package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +6 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
- package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +21 -15
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +29 -19
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +27 -38
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +10 -18
- package/lib/field/Date/Date.tsx +33 -15
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +22 -11
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +64 -17
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +154 -18
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +16 -7
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +37 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +15 -6
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/Percentage/Percentage.tsx +14 -6
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +17 -7
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +55 -24
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +96 -0
- package/lib/field/RichText/index.tsx +1 -0
- package/lib/field/ScalarList/ScalarList.tsx +63 -0
- package/lib/field/ScalarList/config-ext.json +7 -0
- package/lib/field/ScalarList/index.tsx +1 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -10
- package/lib/field/TextArea/TextArea.tsx +15 -5
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +9 -2
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +41 -10
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +21 -18
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +23 -6
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +52 -58
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +16 -11
- package/lib/helpers/case-utils.tsx +99 -0
- package/lib/helpers/common-utils.ts +8 -0
- package/lib/helpers/data_page.ts +3 -6
- package/lib/helpers/date-format-utils.ts +29 -19
- package/lib/helpers/{event-utils.js → event-utils.ts} +4 -4
- package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +9 -10
- package/lib/helpers/formatters/Boolean.ts +21 -0
- package/lib/helpers/formatters/{Currency.js → Currency.ts} +22 -27
- package/lib/helpers/formatters/CurrencyMap.ts +915 -0
- package/lib/helpers/formatters/{Date.js → Date.ts} +20 -26
- package/lib/helpers/formatters/{common.js → common.ts} +3 -4
- package/lib/helpers/formatters/{index.js → index.ts} +22 -22
- package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +2 -2
- package/lib/helpers/simpleTableHelpers.ts +65 -85
- package/lib/helpers/state-utils.tsx +43 -0
- package/lib/helpers/template-utils.ts +4 -8
- package/lib/helpers/utils.ts +16 -8
- package/lib/helpers/versionHelpers.ts +1 -5
- package/lib/infra/ActionButtons/ActionButtons.tsx +46 -42
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -84
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +98 -232
- package/lib/infra/Containers/FlowContainer/helpers.ts +138 -0
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +66 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +105 -70
- package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
- package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
- package/lib/infra/Containers/SimpleView/helper.ts +125 -0
- package/lib/infra/Containers/SimpleView/index.tsx +1 -0
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +49 -64
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +26 -51
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -40
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -31
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +25 -38
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +180 -216
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +28 -43
- package/lib/infra/Reference/Reference.tsx +16 -22
- package/lib/infra/Region/Region.tsx +9 -9
- package/lib/infra/RootContainer/RootContainer.tsx +82 -125
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +38 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
- package/lib/infra/View/View.tsx +34 -65
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +51 -69
- package/lib/template/BannerPage/BannerPage.tsx +26 -33
- package/lib/template/CaseSummary/CaseSummary.tsx +23 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +122 -114
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +46 -35
- package/lib/template/Confirmation/Confirmation.tsx +25 -53
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +112 -140
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +26 -20
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/DefaultForm/utils/index.ts +33 -0
- package/lib/template/Details/Details/Details.tsx +24 -28
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
- package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/lib/template/Details/DynamicTabs/config.json +36 -0
- package/lib/template/Details/DynamicTabs/index.tsx +1 -0
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -34
- package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
- package/lib/template/ListPage/ListPage.tsx +12 -16
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +1 -3
- package/lib/template/ListView/ListView.tsx +245 -306
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/{hooks.js → hooks.ts} +24 -24
- package/lib/template/ListView/{utils.js → utils.ts} +202 -91
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -30
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
- package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +17 -19
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +44 -34
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +115 -14
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +171 -100
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +34 -40
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
- package/lib/template/SubTabs/SubTabs.tsx +26 -45
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -7
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
- package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +29 -27
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
- package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +16 -18
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
- package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +33 -17
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +75 -4
- package/lib/widget/Attachment/Attachment.tsx +370 -388
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +324 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +27 -25
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +24 -16
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +62 -54
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +15 -4
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +80 -116
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -483
- package/lib/helpers/authManager.js +0 -631
- package/lib/helpers/config_access.js +0 -268
- package/lib/helpers/formatters/Boolean.js +0 -38
- package/lib/helpers/formatters/CurrencyMap.js +0 -908
- package/lib/infra/Containers/FlowContainer/helpers.js +0 -147
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren, useState } from 'react';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import KeyboardArrowRightIcon from '@material-ui/icons/KeyboardArrowRight';
|
|
5
|
+
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
|
|
6
|
+
|
|
7
|
+
// FieldGroupProps is one of the few components that does NOT have getPConnect.
|
|
8
|
+
// So, no need to extend PConnProps
|
|
9
|
+
interface FieldGroupProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
name?: string;
|
|
12
|
+
collapsible?: boolean;
|
|
13
|
+
instructions?: string;
|
|
14
|
+
}
|
|
4
15
|
|
|
5
16
|
const useStyles = makeStyles(theme => ({
|
|
6
17
|
root: {
|
|
@@ -16,12 +27,22 @@ const useStyles = makeStyles(theme => ({
|
|
|
16
27
|
},
|
|
17
28
|
fullWidth: {
|
|
18
29
|
width: '100%'
|
|
30
|
+
},
|
|
31
|
+
fieldGroupHeader: {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
gap: '5px',
|
|
35
|
+
cursor: collapsible => (collapsible ? 'pointer' : 'auto')
|
|
36
|
+
},
|
|
37
|
+
instructionText: {
|
|
38
|
+
padding: '5px 0'
|
|
19
39
|
}
|
|
20
40
|
}));
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
const { children, name } = props;
|
|
24
|
-
const classes = useStyles();
|
|
42
|
+
export default function FieldGroup(props: PropsWithChildren<FieldGroupProps>) {
|
|
43
|
+
const { children, name, collapsible = false, instructions } = props;
|
|
44
|
+
const classes = useStyles(collapsible);
|
|
45
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
25
46
|
|
|
26
47
|
const descAndChildren = (
|
|
27
48
|
<Grid container>
|
|
@@ -29,20 +50,31 @@ const FieldGroup = props => {
|
|
|
29
50
|
</Grid>
|
|
30
51
|
);
|
|
31
52
|
|
|
53
|
+
const headerClickHandler = () => {
|
|
54
|
+
setCollapsed(current => !current);
|
|
55
|
+
};
|
|
56
|
+
|
|
32
57
|
return (
|
|
33
|
-
<
|
|
34
|
-
<Grid
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
<Grid container spacing={4} justifyContent='space-between'>
|
|
59
|
+
<Grid item style={{ width: '100%' }}>
|
|
60
|
+
{name && (
|
|
61
|
+
<div className={classes.fieldMargin}>
|
|
62
|
+
{collapsible ? (
|
|
63
|
+
<span id='field-group-header' className={classes.fieldGroupHeader} onClick={headerClickHandler}>
|
|
64
|
+
{collapsed ? <KeyboardArrowRightIcon /> : <KeyboardArrowDownIcon />}
|
|
65
|
+
<b>{name}</b>
|
|
66
|
+
</span>
|
|
67
|
+
) : (
|
|
68
|
+
<b>{name}</b>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
{instructions && instructions !== 'none' && (
|
|
73
|
+
// eslint-disable-next-line react/no-danger
|
|
74
|
+
<div key='instructions' className={classes.instructionText} dangerouslySetInnerHTML={{ __html: instructions }} />
|
|
75
|
+
)}
|
|
76
|
+
{!collapsed && descAndChildren}
|
|
43
77
|
</Grid>
|
|
44
|
-
</
|
|
78
|
+
</Grid>
|
|
45
79
|
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default FieldGroup;
|
|
80
|
+
}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import Grid from '@material-ui/core/Grid';
|
|
4
2
|
import Divider from '@material-ui/core/Divider';
|
|
5
3
|
import Link from '@material-ui/core/Link';
|
|
6
4
|
|
|
7
5
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
// FieldGroupList is one of the few components that does NOT have getPConnect.
|
|
8
|
+
// So, no need to extend PConnProps
|
|
9
|
+
interface FieldGroupListProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
items: any[] | any;
|
|
12
|
+
onDelete: any;
|
|
13
|
+
onAdd: any;
|
|
14
|
+
}
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
export default function FieldGroupList(props: FieldGroupListProps) {
|
|
12
17
|
let menuIconOverride$ = 'trash';
|
|
13
18
|
if (menuIconOverride$) {
|
|
14
|
-
menuIconOverride$ = Utils.getImageSrc(
|
|
15
|
-
menuIconOverride$,
|
|
16
|
-
PCore.getAssetLoader().getStaticServerUrl()
|
|
17
|
-
);
|
|
19
|
+
menuIconOverride$ = Utils.getImageSrc(menuIconOverride$, Utils.getSDKStaticConentUrl());
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
return (
|
|
@@ -30,11 +32,12 @@ const FieldGroupList = props => {
|
|
|
30
32
|
style={{ float: 'right' }}
|
|
31
33
|
className='psdk-utility-button'
|
|
32
34
|
id={`delete-row-${item.id}`}
|
|
35
|
+
aria-label='Delete Row'
|
|
33
36
|
onClick={() => {
|
|
34
37
|
props.onDelete(item.id);
|
|
35
38
|
}}
|
|
36
39
|
>
|
|
37
|
-
<img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$}
|
|
40
|
+
<img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$} />
|
|
38
41
|
</button>
|
|
39
42
|
)}
|
|
40
43
|
{item.children}
|
|
@@ -52,6 +55,4 @@ const FieldGroupList = props => {
|
|
|
52
55
|
</Grid>
|
|
53
56
|
</Grid>
|
|
54
57
|
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default FieldGroupList;
|
|
58
|
+
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import Grid from '@material-ui/core/Grid';
|
|
4
2
|
import Typography from '@material-ui/core/Typography';
|
|
5
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
4
|
|
|
5
|
+
// FieldValueList is one of the few components that does NOT have getPConnect.
|
|
6
|
+
// So, no need to extend PConnProps
|
|
7
|
+
interface FieldValueListProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
name?: string;
|
|
10
|
+
value: any;
|
|
11
|
+
variant?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
const useStyles = makeStyles(theme => ({
|
|
8
15
|
root: {
|
|
9
16
|
marginRight: theme.spacing(1),
|
|
@@ -37,17 +44,13 @@ function formatItemValue(value) {
|
|
|
37
44
|
return formattedVal;
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
export default function FieldValueList(props: FieldValueListProps) {
|
|
41
48
|
const { name, value, variant = 'inline' } = props;
|
|
42
49
|
const classes = useStyles();
|
|
43
50
|
|
|
44
51
|
function getGridItemLabel() {
|
|
45
52
|
return (
|
|
46
|
-
<Grid
|
|
47
|
-
item
|
|
48
|
-
xs={variant === 'stacked' ? 12 : 6}
|
|
49
|
-
className={variant === 'stacked' ? classes.noPaddingBottom : ''}
|
|
50
|
-
>
|
|
53
|
+
<Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
|
|
51
54
|
<Typography variant='body2' component='span' className={`${classes.fieldLabel}`}>
|
|
52
55
|
{name}
|
|
53
56
|
</Typography>
|
|
@@ -59,16 +62,8 @@ const FieldValueList = props => {
|
|
|
59
62
|
const formattedValue = formatItemValue(value);
|
|
60
63
|
|
|
61
64
|
return (
|
|
62
|
-
<Grid
|
|
63
|
-
|
|
64
|
-
xs={variant === 'stacked' ? 12 : 6}
|
|
65
|
-
className={variant === 'stacked' ? classes.noPaddingTop : ''}
|
|
66
|
-
>
|
|
67
|
-
<Typography
|
|
68
|
-
variant={variant === 'stacked' ? 'h6' : 'body2'}
|
|
69
|
-
component='span'
|
|
70
|
-
className={classes.fieldValue}
|
|
71
|
-
>
|
|
65
|
+
<Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
|
|
66
|
+
<Typography variant={variant === 'stacked' ? 'h6' : 'body2'} component='span' className={classes.fieldValue}>
|
|
72
67
|
{formattedValue}
|
|
73
68
|
</Typography>
|
|
74
69
|
</Grid>
|
|
@@ -76,13 +71,9 @@ const FieldValueList = props => {
|
|
|
76
71
|
}
|
|
77
72
|
|
|
78
73
|
return (
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</Grid>
|
|
84
|
-
</React.Fragment>
|
|
74
|
+
<Grid container spacing={4} justifyContent='space-between'>
|
|
75
|
+
{getGridItemLabel()}
|
|
76
|
+
{getGridItemValue()}
|
|
77
|
+
</Grid>
|
|
85
78
|
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export default FieldValueList;
|
|
79
|
+
}
|
|
@@ -1,127 +1,143 @@
|
|
|
1
|
-
import React, {useState} from
|
|
2
|
-
import PropTypes from "prop-types";
|
|
1
|
+
import React, { useState } from 'react';
|
|
3
2
|
import TextField from '@material-ui/core/TextField';
|
|
4
3
|
import Popover from '@material-ui/core/Popover';
|
|
5
4
|
import Grid from '@material-ui/core/Grid';
|
|
6
5
|
import Typography from '@material-ui/core/Typography';
|
|
7
|
-
|
|
8
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
9
7
|
|
|
10
8
|
import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
9
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
|
+
|
|
11
|
+
// Operator is one of the few components that does NOT have getPConnect.
|
|
12
|
+
// So, no need to extend PConnProps
|
|
13
|
+
interface OperatorProps extends PConnProps {
|
|
14
|
+
// If any, enter additional props that only exist on this component
|
|
15
|
+
label: string;
|
|
16
|
+
createDateTime: string;
|
|
17
|
+
createLabel: string;
|
|
18
|
+
createOperator: { userName: string; userId: string };
|
|
19
|
+
updateDateTime: string;
|
|
20
|
+
updateLabel: string;
|
|
21
|
+
updateOperator: { userName: string; userId: string };
|
|
22
|
+
}
|
|
11
23
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const useStyles = makeStyles((theme) => ({
|
|
24
|
+
const useStyles = makeStyles(theme => ({
|
|
15
25
|
root: {
|
|
16
26
|
padding: theme.spacing(1),
|
|
17
|
-
margin: theme.spacing(1)
|
|
27
|
+
margin: theme.spacing(1)
|
|
18
28
|
},
|
|
19
29
|
popover: {
|
|
20
30
|
padding: theme.spacing(1),
|
|
21
|
-
margin: theme.spacing(1)
|
|
31
|
+
margin: theme.spacing(1)
|
|
22
32
|
}
|
|
23
33
|
}));
|
|
24
34
|
|
|
25
|
-
export default function Operator(props) {
|
|
35
|
+
export default function Operator(props: OperatorProps) {
|
|
26
36
|
// const componentName = "Operator";
|
|
27
|
-
const { caseOpConfig } = props;
|
|
28
37
|
const classes = useStyles();
|
|
29
38
|
|
|
30
|
-
const fieldLabel =
|
|
31
|
-
let caseOpLabel =
|
|
32
|
-
let caseOpName =
|
|
33
|
-
let caseOpId =
|
|
34
|
-
let caseTime =
|
|
35
|
-
|
|
36
|
-
if (fieldLabel ===
|
|
37
|
-
caseOpLabel =
|
|
38
|
-
caseOpName =
|
|
39
|
-
caseTime =
|
|
40
|
-
caseOpId =
|
|
41
|
-
} else if (fieldLabel ===
|
|
42
|
-
caseOpLabel =
|
|
43
|
-
caseOpName =
|
|
44
|
-
caseTime =
|
|
45
|
-
caseOpId =
|
|
39
|
+
const fieldLabel = props.label.toLowerCase();
|
|
40
|
+
let caseOpLabel = '---';
|
|
41
|
+
let caseOpName = '---';
|
|
42
|
+
let caseOpId = '';
|
|
43
|
+
let caseTime = '';
|
|
44
|
+
|
|
45
|
+
if (fieldLabel === 'create operator') {
|
|
46
|
+
caseOpLabel = props.createLabel;
|
|
47
|
+
caseOpName = props.createOperator.userName;
|
|
48
|
+
caseTime = props.createDateTime;
|
|
49
|
+
caseOpId = props.createOperator.userId;
|
|
50
|
+
} else if (fieldLabel === 'update operator') {
|
|
51
|
+
caseOpLabel = props.updateLabel;
|
|
52
|
+
caseOpName = props.updateOperator.userName;
|
|
53
|
+
caseTime = props.updateDateTime;
|
|
54
|
+
caseOpId = props.updateOperator.userId;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
// Popover-related
|
|
49
58
|
const [popoverAnchorEl, setPopoverAnchorEl] = useState(null);
|
|
50
|
-
const [popoverFields, setPopoverFields] = useState<
|
|
59
|
+
const [popoverFields, setPopoverFields] = useState<any[]>([]);
|
|
51
60
|
|
|
52
61
|
const popoverOpen = Boolean(popoverAnchorEl);
|
|
53
62
|
const popoverId = popoverOpen ? 'operator-details-popover' : undefined;
|
|
54
63
|
|
|
55
|
-
const handlePopoverClose = (
|
|
64
|
+
const handlePopoverClose = () => {
|
|
56
65
|
setPopoverAnchorEl(null);
|
|
57
|
-
}
|
|
66
|
+
};
|
|
58
67
|
|
|
59
68
|
function showOperatorDetails(event) {
|
|
60
|
-
|
|
61
69
|
const operatorPreviewPromise = PCore.getUserApi().getOperatorDetails(caseOpId);
|
|
70
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
71
|
+
const localeCategory = 'Operator';
|
|
62
72
|
|
|
63
|
-
operatorPreviewPromise.then((res) => {
|
|
64
|
-
const fillerString =
|
|
73
|
+
operatorPreviewPromise.then((res: any) => {
|
|
74
|
+
const fillerString = '---';
|
|
65
75
|
let fields: any = [];
|
|
66
|
-
if (
|
|
67
|
-
res.data &&
|
|
68
|
-
res.data.pyOperatorInfo &&
|
|
69
|
-
res.data.pyOperatorInfo.pyUserName
|
|
70
|
-
) {
|
|
76
|
+
if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
|
|
71
77
|
fields = [
|
|
72
78
|
{
|
|
73
|
-
id:
|
|
74
|
-
name:
|
|
79
|
+
id: 'pyPosition',
|
|
80
|
+
name: localizedVal('Position', localeCategory),
|
|
75
81
|
value: res.data.pyOperatorInfo.pyPosition ? res.data.pyOperatorInfo.pyPosition : fillerString
|
|
76
82
|
},
|
|
77
83
|
{
|
|
78
|
-
id:
|
|
79
|
-
name:
|
|
84
|
+
id: 'pyOrganization',
|
|
85
|
+
name: localizedVal('Organization', localeCategory),
|
|
80
86
|
value: res.data.pyOperatorInfo.pyOrganization ? res.data.pyOperatorInfo.pyOrganization : fillerString
|
|
81
87
|
},
|
|
82
88
|
{
|
|
83
|
-
id:
|
|
84
|
-
name:
|
|
89
|
+
id: 'ReportToUserName',
|
|
90
|
+
name: localizedVal('Reports to', localeCategory),
|
|
85
91
|
value: res.data.pyOperatorInfo.pyReportToUserName ? res.data.pyOperatorInfo.pyReportToUserName : fillerString
|
|
86
92
|
},
|
|
87
93
|
{
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
90
|
-
value: res.data.pyOperatorInfo.pyTelephone ?
|
|
94
|
+
id: 'pyTelephone',
|
|
95
|
+
name: localizedVal('Telephone', localeCategory),
|
|
96
|
+
value: res.data.pyOperatorInfo.pyTelephone ? (
|
|
97
|
+
<a href={`tel:${res.data.pyOperatorInfo.pyTelephone}`}>{res.data.pyOperatorInfo.pyTelephone}</a>
|
|
98
|
+
) : (
|
|
99
|
+
fillerString
|
|
100
|
+
)
|
|
91
101
|
},
|
|
92
102
|
{
|
|
93
|
-
id:
|
|
94
|
-
name:
|
|
95
|
-
value: res.data.pyOperatorInfo.pyEmailAddress ?
|
|
103
|
+
id: 'pyEmailAddress',
|
|
104
|
+
name: localizedVal('Email address', localeCategory),
|
|
105
|
+
value: res.data.pyOperatorInfo.pyEmailAddress ? (
|
|
106
|
+
<a href={`mailto:${res.data.pyOperatorInfo.pyEmailAddress}`}>{res.data.pyOperatorInfo.pyEmailAddress}</a>
|
|
107
|
+
) : (
|
|
108
|
+
fillerString
|
|
109
|
+
)
|
|
96
110
|
}
|
|
97
111
|
];
|
|
98
112
|
} else {
|
|
99
113
|
// eslint-disable-next-line no-console
|
|
100
|
-
console.log(
|
|
114
|
+
console.log(
|
|
115
|
+
`Operator: PCore.getUserApi().getOperatorDetails(${caseOpId}); returned empty res.data.pyOperatorInfo.pyUserName - adding default`
|
|
116
|
+
);
|
|
101
117
|
fields = [
|
|
102
118
|
{
|
|
103
|
-
id:
|
|
104
|
-
name:
|
|
119
|
+
id: 'pyPosition',
|
|
120
|
+
name: localizedVal('Position', localeCategory),
|
|
105
121
|
value: fillerString
|
|
106
122
|
},
|
|
107
123
|
{
|
|
108
|
-
id:
|
|
109
|
-
name:
|
|
124
|
+
id: 'pyOrganization',
|
|
125
|
+
name: localizedVal('Organization', localeCategory),
|
|
110
126
|
value: fillerString
|
|
111
127
|
},
|
|
112
128
|
{
|
|
113
|
-
id:
|
|
114
|
-
name:
|
|
129
|
+
id: 'ReportToUserName',
|
|
130
|
+
name: localizedVal('Reports to', localeCategory),
|
|
115
131
|
value: fillerString
|
|
116
132
|
},
|
|
117
133
|
{
|
|
118
|
-
id:
|
|
119
|
-
name:
|
|
134
|
+
id: 'pyTelephone',
|
|
135
|
+
name: localizedVal('Telephone', localeCategory),
|
|
120
136
|
value: fillerString
|
|
121
137
|
},
|
|
122
138
|
{
|
|
123
|
-
id:
|
|
124
|
-
name:
|
|
139
|
+
id: 'pyEmailAddress',
|
|
140
|
+
name: localizedVal('Email address', localeCategory),
|
|
125
141
|
value: fillerString
|
|
126
142
|
}
|
|
127
143
|
];
|
|
@@ -143,23 +159,33 @@ export default function Operator(props) {
|
|
|
143
159
|
}
|
|
144
160
|
|
|
145
161
|
// There are fields, so build the grid.
|
|
146
|
-
return
|
|
147
|
-
<Grid
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
162
|
+
return (
|
|
163
|
+
<Grid container className={classes.popover} spacing={1}>
|
|
164
|
+
<Grid item xs={12}>
|
|
165
|
+
<Typography variant='h6'>{caseOpName}</Typography>
|
|
166
|
+
</Grid>
|
|
167
|
+
{popoverFields.map(field => {
|
|
168
|
+
return (
|
|
169
|
+
<React.Fragment key={field.id}>
|
|
170
|
+
<Grid container item xs={12} spacing={1}>
|
|
171
|
+
<Grid item xs={6}>
|
|
172
|
+
<Typography variant='caption'>{field.name}</Typography>
|
|
173
|
+
</Grid>
|
|
174
|
+
<Grid item xs={6}>
|
|
175
|
+
<Typography variant='subtitle2'>{field.value}</Typography>
|
|
176
|
+
</Grid>
|
|
177
|
+
</Grid>
|
|
178
|
+
</React.Fragment>
|
|
179
|
+
);
|
|
180
|
+
})}
|
|
181
|
+
</Grid>
|
|
182
|
+
);
|
|
158
183
|
}
|
|
159
184
|
|
|
160
185
|
// End of popover-related
|
|
161
186
|
|
|
162
|
-
return
|
|
187
|
+
return (
|
|
188
|
+
<>
|
|
163
189
|
<TextField
|
|
164
190
|
defaultValue={caseOpName}
|
|
165
191
|
label={caseOpLabel}
|
|
@@ -167,30 +193,23 @@ export default function Operator(props) {
|
|
|
167
193
|
InputProps={{
|
|
168
194
|
readOnly: true,
|
|
169
195
|
disableUnderline: true,
|
|
170
|
-
inputProps: {style: {cursor: 'pointer'}}
|
|
196
|
+
inputProps: { style: { cursor: 'pointer' } }
|
|
171
197
|
}}
|
|
172
198
|
/>
|
|
173
199
|
<br />
|
|
174
|
-
{Utils.generateDateTime(caseTime,
|
|
200
|
+
{Utils.generateDateTime(caseTime, 'DateTime-Since')}
|
|
175
201
|
|
|
176
202
|
<Popover
|
|
177
203
|
id={popoverId}
|
|
178
204
|
open={popoverOpen}
|
|
179
205
|
anchorEl={popoverAnchorEl}
|
|
180
206
|
onClose={handlePopoverClose}
|
|
181
|
-
anchorOrigin={{ vertical: 'bottom', horizontal: 'center'}}
|
|
182
|
-
transformOrigin={{ vertical: 'top', horizontal: 'center'}}
|
|
183
|
-
PaperProps={{ style: {maxWidth: '45ch'}}}
|
|
207
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
|
208
|
+
transformOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
209
|
+
PaperProps={{ style: { maxWidth: '45ch' } }}
|
|
184
210
|
>
|
|
185
211
|
{getPopoverGrid()}
|
|
186
212
|
</Popover>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
Operator.defaultProps = {
|
|
213
|
+
</>
|
|
214
|
+
);
|
|
192
215
|
}
|
|
193
|
-
|
|
194
|
-
Operator.propTypes = {
|
|
195
|
-
caseOpConfig: PropTypes.object.isRequired,
|
|
196
|
-
};
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Card, CardContent, CardHeader, Typography } from "@material-ui/core";
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Card, CardContent, CardHeader, Typography } from '@material-ui/core';
|
|
4
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
// Pulse is one of the few components that does NOT have getPConnect.
|
|
6
|
+
// So, no need to extend PConnProps
|
|
7
|
+
interface PulseProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const useStyles = makeStyles(theme => ({
|
|
7
12
|
root: {
|
|
8
13
|
marginTop: theme.spacing(1),
|
|
9
14
|
marginBottom: theme.spacing(1),
|
|
10
|
-
borderLeft:
|
|
15
|
+
borderLeft: '6px solid',
|
|
11
16
|
borderLeftColor: theme.palette.primary.light
|
|
12
|
-
}
|
|
17
|
+
}
|
|
13
18
|
}));
|
|
14
19
|
|
|
15
|
-
export default function Pulse(
|
|
16
|
-
//
|
|
20
|
+
export default function Pulse(props: PropsWithChildren<PulseProps>) {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
+
const { children } = props;
|
|
17
23
|
const classes = useStyles();
|
|
18
24
|
|
|
19
25
|
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
<Card className={classes.root}>
|
|
27
|
+
<CardHeader title={<Typography variant='h6'>Pulse</Typography>} />
|
|
28
|
+
<CardContent>
|
|
29
|
+
<Typography>Pulse</Typography>
|
|
30
|
+
</CardContent>
|
|
31
|
+
</Card>
|
|
32
|
+
);
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
// Pulse.propTypes = {
|
|
30
|
-
// children: PropTypes.arrayOf(PropTypes.node).isRequired
|
|
31
|
-
// };
|