@pega/react-sdk-overrides 0.23.26 → 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.tsx +21 -7
- 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.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 +32 -63
- 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 +20 -9
- 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,23 +1,27 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-boolean-value */
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
6
|
-
import { Card, CardHeader, Avatar, Typography, Divider } from "@material-ui/core";
|
|
3
|
+
import { PropsWithChildren, ReactElement, useContext, useEffect, useState } from 'react';
|
|
4
|
+
import { Avatar, Card, CardHeader, Divider, Typography } from '@material-ui/core';
|
|
7
5
|
import { makeStyles } from '@material-ui/core/styles';
|
|
8
6
|
import Box from '@material-ui/core/Box';
|
|
9
7
|
import Button from '@material-ui/core/Button';
|
|
10
8
|
import Grid from '@material-ui/core/Grid';
|
|
11
9
|
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
11
|
+
import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
|
|
12
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
13
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
14
|
+
|
|
15
|
+
interface CaseViewProps extends PConnProps {
|
|
16
|
+
// If any, enter additional props that only exist on this component
|
|
17
|
+
icon: string;
|
|
18
|
+
subheader: string;
|
|
19
|
+
header: string;
|
|
20
|
+
showIconInHeader: boolean;
|
|
21
|
+
caseInfo: any;
|
|
22
|
+
}
|
|
19
23
|
|
|
20
|
-
const useStyles = makeStyles(
|
|
24
|
+
const useStyles = makeStyles(theme => ({
|
|
21
25
|
root: {
|
|
22
26
|
paddingRight: theme.spacing(1),
|
|
23
27
|
paddingLeft: theme.spacing(1),
|
|
@@ -26,55 +30,66 @@ const useStyles = makeStyles((theme) => ({
|
|
|
26
30
|
marginRight: theme.spacing(1),
|
|
27
31
|
marginLeft: theme.spacing(1),
|
|
28
32
|
marginTop: theme.spacing(1),
|
|
29
|
-
marginBottom: theme.spacing(1)
|
|
33
|
+
marginBottom: theme.spacing(1)
|
|
30
34
|
},
|
|
31
35
|
caseViewHeader: {
|
|
32
36
|
backgroundColor: theme.palette.info.light,
|
|
33
37
|
color: theme.palette.getContrastText(theme.palette.info.light),
|
|
34
|
-
borderRadius:
|
|
38
|
+
borderRadius: 'inherit'
|
|
35
39
|
},
|
|
36
40
|
caseViewIconBox: {
|
|
37
41
|
backgroundColor: theme.palette.info.dark,
|
|
38
42
|
width: theme.spacing(8),
|
|
39
43
|
height: theme.spacing(8),
|
|
40
|
-
padding: theme.spacing(1)
|
|
44
|
+
padding: theme.spacing(1)
|
|
41
45
|
},
|
|
42
46
|
caseViewIconImage: {
|
|
43
47
|
filter: 'invert(100%)'
|
|
44
48
|
}
|
|
45
49
|
}));
|
|
46
50
|
|
|
47
|
-
export default function CaseView(props) {
|
|
51
|
+
export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
|
|
52
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
53
|
+
const CaseViewActionsMenu = getComponentFromMap('CaseViewActionsMenu');
|
|
54
|
+
const VerticalTabs = getComponentFromMap('VerticalTabs');
|
|
55
|
+
const DeferLoad = getComponentFromMap('DeferLoad');
|
|
56
|
+
|
|
48
57
|
const {
|
|
49
58
|
getPConnect,
|
|
50
|
-
icon,
|
|
59
|
+
icon = '',
|
|
51
60
|
header,
|
|
52
61
|
subheader,
|
|
53
|
-
children,
|
|
54
|
-
|
|
62
|
+
children = [],
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
|
+
showIconInHeader = true,
|
|
65
|
+
caseInfo: { availableActions = [], availableProcesses = [], hasNewAttachments, caseTypeID = '', caseTypeName = '' }
|
|
55
66
|
} = props;
|
|
67
|
+
|
|
56
68
|
const currentCaseID = props.caseInfo.ID;
|
|
57
69
|
let isComponentMounted = true;
|
|
58
70
|
|
|
59
|
-
const { displayOnlyFA } = useContext(StoreContext);
|
|
71
|
+
const { displayOnlyFA } = useContext<any>(StoreContext);
|
|
60
72
|
|
|
61
73
|
const thePConn = getPConnect();
|
|
62
74
|
|
|
63
75
|
const classes = useStyles();
|
|
64
76
|
|
|
65
|
-
const editAction = availableActions.find(
|
|
77
|
+
const editAction = availableActions.find(action => action.ID === 'pyUpdateCaseDetails');
|
|
78
|
+
|
|
79
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
80
|
+
const localeCategory = 'CaseView';
|
|
81
|
+
const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();
|
|
66
82
|
|
|
67
83
|
/**
|
|
68
84
|
*
|
|
69
85
|
* @param inName the metadata <em>name</em> that will cause a region to be returned
|
|
70
86
|
*/
|
|
71
|
-
|
|
87
|
+
function getChildRegionByName(inName: string): any {
|
|
88
|
+
for (const child of children as ReactElement[]) {
|
|
89
|
+
const theMetadataType: string = (child as ReactElement).props.getPConnect().getRawMetadata().type.toLowerCase();
|
|
90
|
+
const theMetadataName: string = (child as ReactElement).props.getPConnect().getRawMetadata().name.toLowerCase();
|
|
72
91
|
|
|
73
|
-
|
|
74
|
-
const theMetadataType: string = child.props.getPConnect().getRawMetadata()['type'].toLowerCase();
|
|
75
|
-
const theMetadataName: string = child.props.getPConnect().getRawMetadata()['name'].toLowerCase();
|
|
76
|
-
|
|
77
|
-
if ((theMetadataType === "region") && (theMetadataName === inName )) {
|
|
92
|
+
if (theMetadataType === 'region' && theMetadataName === inName) {
|
|
78
93
|
return child;
|
|
79
94
|
}
|
|
80
95
|
}
|
|
@@ -82,14 +97,13 @@ export default function CaseView(props) {
|
|
|
82
97
|
return null;
|
|
83
98
|
}
|
|
84
99
|
|
|
100
|
+
const theSummaryRegion = getChildRegionByName('summary');
|
|
101
|
+
const theStagesRegion = getChildRegionByName('stages');
|
|
102
|
+
const theTodoRegion = getChildRegionByName('todo');
|
|
103
|
+
const theUtilitiesRegion = getChildRegionByName('utilities');
|
|
104
|
+
const theTabsRegion = getChildRegionByName('tabs');
|
|
85
105
|
|
|
86
|
-
const
|
|
87
|
-
const theStagesRegion = getChildRegionByName("stages");
|
|
88
|
-
const theTodoRegion = getChildRegionByName("todo");
|
|
89
|
-
const theUtilitiesRegion = getChildRegionByName("utilities");
|
|
90
|
-
const theTabsRegion = getChildRegionByName("tabs");
|
|
91
|
-
|
|
92
|
-
const svgCase = Utils.getImageSrc(icon, PCore.getAssetLoader().getStaticServerUrl());
|
|
106
|
+
const svgCase = Utils.getImageSrc(icon, Utils.getSDKStaticConentUrl());
|
|
93
107
|
|
|
94
108
|
const [activeVertTab, setActiveVertTab] = useState(0);
|
|
95
109
|
|
|
@@ -100,10 +114,10 @@ export default function CaseView(props) {
|
|
|
100
114
|
const theTabsRegionChildren = theTabsRegion.props.getPConnect().getChildren();
|
|
101
115
|
|
|
102
116
|
// vertTabInfo is sent to VerticalTabs component
|
|
103
|
-
const vertTabInfo:
|
|
117
|
+
const vertTabInfo: Object[] = [];
|
|
104
118
|
|
|
105
119
|
// deferLoadInfo is sent to DeferLoad component (currently selected entry)
|
|
106
|
-
const deferLoadInfo:
|
|
120
|
+
const deferLoadInfo: any[] = [];
|
|
107
121
|
|
|
108
122
|
if (theTabsRegionChildren) {
|
|
109
123
|
// populate vertTabInfo and deferLoadInfo
|
|
@@ -127,8 +141,6 @@ export default function CaseView(props) {
|
|
|
127
141
|
});
|
|
128
142
|
}
|
|
129
143
|
|
|
130
|
-
|
|
131
|
-
|
|
132
144
|
function handleVerticalTabClick(eventDetail: any) {
|
|
133
145
|
const theItem = parseInt(eventDetail.additionalData.itemClicked, 10);
|
|
134
146
|
|
|
@@ -138,14 +150,13 @@ export default function CaseView(props) {
|
|
|
138
150
|
}
|
|
139
151
|
}
|
|
140
152
|
|
|
141
|
-
|
|
142
153
|
// Add and Remove event listener for VerticalTabClick only at startup and teardown
|
|
143
154
|
useEffect(() => {
|
|
144
155
|
document.addEventListener('VerticalTabClick', (event: any) => {
|
|
145
156
|
handleVerticalTabClick(event.detail);
|
|
146
157
|
});
|
|
147
158
|
|
|
148
|
-
return ():void => {
|
|
159
|
+
return (): void => {
|
|
149
160
|
// inform that the component is unmounted so other code can
|
|
150
161
|
// know not to try to call useState setters (to avoid console warnings)
|
|
151
162
|
isComponentMounted = false;
|
|
@@ -153,106 +164,103 @@ export default function CaseView(props) {
|
|
|
153
164
|
document.removeEventListener('VerticalTabClick', (event: any) => {
|
|
154
165
|
handleVerticalTabClick(event.detail);
|
|
155
166
|
});
|
|
156
|
-
}
|
|
157
|
-
}, [])
|
|
167
|
+
};
|
|
168
|
+
}, []);
|
|
158
169
|
|
|
159
170
|
useEffect(() => {
|
|
160
171
|
if (hasNewAttachments) {
|
|
161
|
-
|
|
172
|
+
// @ts-ignore - Argument of type 'boolean' is not assignable to parameter of type 'object'
|
|
173
|
+
PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
|
|
162
174
|
}
|
|
163
175
|
}, [hasNewAttachments]);
|
|
164
176
|
|
|
165
177
|
function _editClick() {
|
|
166
|
-
|
|
167
178
|
const actionsAPI = thePConn.getActionsApi();
|
|
168
179
|
const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);
|
|
169
180
|
|
|
170
|
-
openLocalAction(
|
|
181
|
+
openLocalAction(editAction.ID, { ...editAction });
|
|
171
182
|
}
|
|
172
183
|
|
|
173
|
-
|
|
174
184
|
function getActionButtonsHtml(): any {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
return (
|
|
186
|
+
<Box>
|
|
187
|
+
{editAction && (
|
|
188
|
+
<Button
|
|
189
|
+
onClick={() => {
|
|
190
|
+
_editClick();
|
|
191
|
+
}}
|
|
192
|
+
>
|
|
193
|
+
{localizedVal('Edit', localeCategory)}
|
|
194
|
+
</Button>
|
|
195
|
+
)}
|
|
196
|
+
<CaseViewActionsMenu
|
|
197
|
+
getPConnect={getPConnect}
|
|
198
|
+
availableActions={availableActions}
|
|
199
|
+
availableProcesses={availableProcesses}
|
|
200
|
+
caseTypeName={caseTypeName}
|
|
201
|
+
caseTypeID={caseTypeID}
|
|
202
|
+
/>
|
|
203
|
+
</Box>
|
|
204
|
+
);
|
|
184
205
|
}
|
|
185
206
|
|
|
186
|
-
|
|
187
207
|
function getContainerContents() {
|
|
188
|
-
|
|
189
208
|
if (!displayOnlyFA) {
|
|
190
209
|
// show full portal
|
|
191
210
|
return (
|
|
192
211
|
<Grid container>
|
|
193
212
|
<Grid item xs={3}>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
<div hidden={true} id='current-caseID'>
|
|
214
|
+
{currentCaseID}
|
|
215
|
+
</div>
|
|
216
|
+
<Card className={classes.root}>
|
|
217
|
+
<CardHeader
|
|
218
|
+
className={classes.caseViewHeader}
|
|
219
|
+
title={
|
|
220
|
+
<Typography variant='h6' component='div'>
|
|
221
|
+
{PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}
|
|
222
|
+
</Typography>
|
|
223
|
+
}
|
|
224
|
+
subheader={
|
|
225
|
+
<Typography variant='body1' component='div' id='caseId'>
|
|
226
|
+
{subheader}
|
|
227
|
+
</Typography>
|
|
228
|
+
}
|
|
229
|
+
avatar={
|
|
230
|
+
<Avatar className={classes.caseViewIconBox} variant='square'>
|
|
231
|
+
<img src={svgCase} className={classes.caseViewIconImage} />
|
|
232
|
+
</Avatar>
|
|
233
|
+
}
|
|
234
|
+
/>
|
|
235
|
+
{getActionButtonsHtml()}
|
|
236
|
+
<Divider />
|
|
237
|
+
{theSummaryRegion}
|
|
238
|
+
<Divider />
|
|
239
|
+
{vertTabInfo.length > 1 && <VerticalTabs tabconfig={vertTabInfo} />}
|
|
240
|
+
</Card>
|
|
241
|
+
</Grid>
|
|
218
242
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
</Grid>
|
|
222
|
-
</Grid>
|
|
223
|
-
)
|
|
224
|
-
} else {
|
|
225
|
-
// displayOnlyFA - only show the "todo" region
|
|
226
|
-
return (
|
|
227
|
-
<Grid container>
|
|
228
|
-
<Grid item xs={12}>
|
|
243
|
+
<Grid item xs={6}>
|
|
244
|
+
{theStagesRegion}
|
|
229
245
|
{theTodoRegion}
|
|
246
|
+
{deferLoadInfo.length > 0 && <DeferLoad getPConnect={getPConnect} name={deferLoadInfo[activeVertTab].config.name} isTab />}
|
|
247
|
+
</Grid>
|
|
248
|
+
|
|
249
|
+
<Grid item xs={3}>
|
|
250
|
+
{theUtilitiesRegion}
|
|
230
251
|
</Grid>
|
|
231
252
|
</Grid>
|
|
232
|
-
)
|
|
253
|
+
);
|
|
233
254
|
}
|
|
255
|
+
// displayOnlyFA - only show the "todo" region
|
|
256
|
+
return (
|
|
257
|
+
<Grid container>
|
|
258
|
+
<Grid item xs={12}>
|
|
259
|
+
{theTodoRegion}
|
|
260
|
+
</Grid>
|
|
261
|
+
</Grid>
|
|
262
|
+
);
|
|
234
263
|
}
|
|
235
264
|
|
|
236
|
-
|
|
237
|
-
return (
|
|
238
|
-
getContainerContents()
|
|
239
|
-
);
|
|
265
|
+
return getContainerContents();
|
|
240
266
|
}
|
|
241
|
-
|
|
242
|
-
CaseView.defaultProps = {
|
|
243
|
-
icon: "",
|
|
244
|
-
children: [],
|
|
245
|
-
caseInfo: {},
|
|
246
|
-
showIconInHeader: true,
|
|
247
|
-
getPConnect: null
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
CaseView.propTypes = {
|
|
251
|
-
icon: PropTypes.string,
|
|
252
|
-
children: PropTypes.arrayOf(PropTypes.node),
|
|
253
|
-
subheader: PropTypes.string.isRequired,
|
|
254
|
-
header: PropTypes.string.isRequired,
|
|
255
|
-
showIconInHeader: PropTypes.bool,
|
|
256
|
-
caseInfo: PropTypes.objectOf(PropTypes.any),
|
|
257
|
-
getPConnect: PropTypes.func
|
|
258
|
-
};
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import Button from '@material-ui/core/Button';
|
|
4
3
|
import Menu from '@material-ui/core/Menu';
|
|
5
4
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
|
|
8
|
+
interface CaseViewActionsMenuProps extends PConnProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
availableActions: any[];
|
|
11
|
+
availableProcesses: any[];
|
|
12
|
+
caseTypeID: string;
|
|
13
|
+
caseTypeName: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
|
|
17
|
+
const { getPConnect, availableActions, availableProcesses, caseTypeID, caseTypeName } = props;
|
|
9
18
|
const thePConn = getPConnect();
|
|
10
19
|
|
|
20
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
21
|
+
const localeCategory = 'CaseView';
|
|
22
|
+
const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();
|
|
11
23
|
|
|
12
24
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
13
25
|
|
|
@@ -19,55 +31,54 @@ export default function CaseViewActionsMenu(props) {
|
|
|
19
31
|
setAnchorEl(null);
|
|
20
32
|
};
|
|
21
33
|
|
|
22
|
-
const arMenuItems:
|
|
23
|
-
|
|
34
|
+
const arMenuItems: any[] = [];
|
|
24
35
|
|
|
25
36
|
function _actionMenuActionsClick(data) {
|
|
26
|
-
|
|
27
37
|
const actionsAPI = thePConn.getActionsApi();
|
|
28
38
|
const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);
|
|
29
39
|
|
|
30
|
-
openLocalAction(
|
|
40
|
+
openLocalAction(data.ID, {
|
|
41
|
+
...data,
|
|
42
|
+
containerName: 'modal',
|
|
43
|
+
type: 'express'
|
|
44
|
+
});
|
|
31
45
|
// after doing the action, close the menu...
|
|
32
46
|
handleClose();
|
|
33
|
-
|
|
34
47
|
}
|
|
35
48
|
|
|
49
|
+
function _actionMenuProcessClick(process) {
|
|
50
|
+
const actionsAPI = thePConn.getActionsApi();
|
|
51
|
+
const openProcessAction = actionsAPI.openProcessAction.bind(actionsAPI);
|
|
52
|
+
openProcessAction(process.ID, {
|
|
53
|
+
...process
|
|
54
|
+
});
|
|
55
|
+
handleClose();
|
|
56
|
+
}
|
|
36
57
|
|
|
37
|
-
availableActions.forEach(
|
|
38
|
-
arMenuItems.push(
|
|
58
|
+
availableActions.forEach(action => {
|
|
59
|
+
arMenuItems.push(
|
|
60
|
+
<MenuItem key={action.ID} onClick={() => _actionMenuActionsClick(action)}>
|
|
61
|
+
{localizedVal(action.name, '', localeKey)}
|
|
62
|
+
</MenuItem>
|
|
63
|
+
);
|
|
39
64
|
});
|
|
40
65
|
|
|
41
|
-
availableProcesses.forEach(
|
|
42
|
-
arMenuItems.push(
|
|
66
|
+
availableProcesses.forEach(process => {
|
|
67
|
+
arMenuItems.push(
|
|
68
|
+
<MenuItem key={process.ID} onClick={() => _actionMenuProcessClick(process)}>
|
|
69
|
+
{localizedVal(process.name, '', localeKey)}
|
|
70
|
+
</MenuItem>
|
|
71
|
+
);
|
|
43
72
|
});
|
|
44
73
|
|
|
45
|
-
|
|
46
74
|
return (
|
|
47
|
-
|
|
48
|
-
<Button aria-controls=
|
|
49
|
-
Actions...
|
|
75
|
+
<>
|
|
76
|
+
<Button aria-controls='simple-menu' aria-haspopup='true' onClick={handleClick}>
|
|
77
|
+
{localizedVal('Actions...', localeCategory)}
|
|
50
78
|
</Button>
|
|
51
|
-
<Menu
|
|
52
|
-
id="simple-menu"
|
|
53
|
-
anchorEl={anchorEl}
|
|
54
|
-
keepMounted
|
|
55
|
-
open={Boolean(anchorEl)}
|
|
56
|
-
onClose={handleClose}
|
|
57
|
-
>
|
|
79
|
+
<Menu id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
|
|
58
80
|
{arMenuItems}
|
|
59
81
|
</Menu>
|
|
60
|
-
|
|
82
|
+
</>
|
|
61
83
|
);
|
|
62
84
|
}
|
|
63
|
-
|
|
64
|
-
CaseViewActionsMenu.defaultProps = {
|
|
65
|
-
availableActions: [],
|
|
66
|
-
availableProcesses: []
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
CaseViewActionsMenu.propTypes = {
|
|
70
|
-
getPConnect: PropTypes.func.isRequired,
|
|
71
|
-
availableActions: PropTypes.arrayOf(PropTypes.object),
|
|
72
|
-
availableProcesses: PropTypes.arrayOf(PropTypes.any)
|
|
73
|
-
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* eslint-disable no-unused-vars */
|
|
3
1
|
/* eslint-disable no-nested-ternary */
|
|
4
|
-
import {
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { getToDoAssignments } from '@pega/react-sdk-components/lib/components/infra/Containers/FlowContainer/helpers';
|
|
8
|
-
import ToDo from '@pega/react-sdk-components/lib/components/widget/ToDo';
|
|
9
|
-
import Details from '@pega/react-sdk-components/lib/components/template/Details/Details';
|
|
2
|
+
import { PropsWithChildren, useState } from 'react';
|
|
10
3
|
import { Button, Card, makeStyles } from '@material-ui/core';
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
import { getToDoAssignments } from '@pega/react-sdk-components/lib/components/infra/Containers/FlowContainer/helpers';
|
|
6
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
|
|
9
|
+
interface ConfirmationProps extends PConnProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
datasource: { source: any };
|
|
12
|
+
label: string;
|
|
13
|
+
showLabel: boolean;
|
|
14
|
+
showTasks: boolean;
|
|
15
|
+
}
|
|
13
16
|
|
|
14
17
|
const useStyles = makeStyles(theme => ({
|
|
15
18
|
root: {
|
|
@@ -24,28 +27,24 @@ const useStyles = makeStyles(theme => ({
|
|
|
24
27
|
}
|
|
25
28
|
}));
|
|
26
29
|
|
|
27
|
-
export default function Confirmation(props) {
|
|
30
|
+
export default function Confirmation(props: PropsWithChildren<ConfirmationProps>) {
|
|
31
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
32
|
+
const ToDo = getComponentFromMap('Todo'); // NOTE: ConstellationJS Engine uses "Todo" and not "ToDo"!!!
|
|
33
|
+
const Details = getComponentFromMap('Details');
|
|
34
|
+
|
|
28
35
|
const classes = useStyles();
|
|
29
36
|
const CONSTS = PCore.getConstants();
|
|
30
37
|
const [showConfirmView, setShowConfirmView] = useState(true);
|
|
31
|
-
const { showTasks, getPConnect
|
|
38
|
+
const { showTasks, getPConnect } = props;
|
|
32
39
|
// Get the inherited props from the parent to determine label settings
|
|
33
40
|
// Not using whatsNext at the moment, need to figure out the use of it
|
|
34
|
-
const whatsNext = datasource?.source;
|
|
35
|
-
const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';
|
|
36
|
-
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(
|
|
37
|
-
|
|
38
|
-
);
|
|
39
|
-
const rootInfo = PCore.getContainerUtils().getContainerItemData(
|
|
40
|
-
getPConnect().getTarget(),
|
|
41
|
-
activeContainerItemID
|
|
42
|
-
);
|
|
41
|
+
// const whatsNext = datasource?.source;
|
|
42
|
+
// const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';
|
|
43
|
+
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget());
|
|
44
|
+
const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID);
|
|
43
45
|
const onConfirmViewClose = () => {
|
|
44
46
|
setShowConfirmView(false);
|
|
45
|
-
PCore.getPubSubUtils().publish(
|
|
46
|
-
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,
|
|
47
|
-
rootInfo
|
|
48
|
-
);
|
|
47
|
+
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo);
|
|
49
48
|
};
|
|
50
49
|
const todoProps = { ...props, renderTodoInConfirm: true };
|
|
51
50
|
const toDoList = getToDoAssignments(getPConnect());
|
|
@@ -57,14 +56,7 @@ export default function Confirmation(props) {
|
|
|
57
56
|
{showDetails ? <Details {...detailProps} /> : undefined}
|
|
58
57
|
{showTasks ? (
|
|
59
58
|
toDoList && toDoList.length > 0 ? (
|
|
60
|
-
<ToDo
|
|
61
|
-
{...todoProps}
|
|
62
|
-
datasource={{ source: toDoList }}
|
|
63
|
-
getPConnect={getPConnect}
|
|
64
|
-
type={CONSTS.TODO}
|
|
65
|
-
headerText='Open Tasks'
|
|
66
|
-
isConfirm
|
|
67
|
-
/>
|
|
59
|
+
<ToDo {...todoProps} datasource={{ source: toDoList }} getPConnect={getPConnect} type={CONSTS.TODO} headerText='Open Tasks' isConfirm />
|
|
68
60
|
) : undefined
|
|
69
61
|
) : undefined}
|
|
70
62
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
@@ -75,27 +67,7 @@ export default function Confirmation(props) {
|
|
|
75
67
|
</Card>
|
|
76
68
|
) : toDoList && toDoList.length > 0 ? (
|
|
77
69
|
<Card className={classes.root}>
|
|
78
|
-
<ToDo
|
|
79
|
-
{...props}
|
|
80
|
-
datasource={{ source: toDoList }}
|
|
81
|
-
getPConnect={getPConnect}
|
|
82
|
-
type={CONSTS.TODO}
|
|
83
|
-
headerText='Tasks'
|
|
84
|
-
isConfirm
|
|
85
|
-
/>
|
|
70
|
+
<ToDo {...props} datasource={{ source: toDoList }} getPConnect={getPConnect} type={CONSTS.TODO} headerText='Tasks' isConfirm />
|
|
86
71
|
</Card>
|
|
87
72
|
) : null;
|
|
88
73
|
}
|
|
89
|
-
|
|
90
|
-
Confirmation.defaultProps = {
|
|
91
|
-
datasource: undefined,
|
|
92
|
-
label: '',
|
|
93
|
-
showLabel: true
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
Confirmation.propTypes = {
|
|
97
|
-
getPConnect: PropTypes.func.isRequired,
|
|
98
|
-
datasource: PropTypes.objectOf(PropTypes.any),
|
|
99
|
-
label: PropTypes.string,
|
|
100
|
-
showLabel: PropTypes.bool
|
|
101
|
-
};
|