@pega/react-sdk-overrides 23.1.10 → 23.1.12
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 +6 -14
- package/lib/designSystemExtension/Banner/Banner.tsx +14 -11
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +27 -22
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +14 -20
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +44 -19
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +21 -32
- package/lib/designSystemExtension/Operator/Operator.tsx +94 -82
- package/lib/designSystemExtension/Pulse/Pulse.tsx +14 -16
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +6 -5
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +14 -14
- package/lib/field/AutoComplete/AutoComplete.tsx +24 -26
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +98 -84
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +120 -63
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +25 -50
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +9 -16
- package/lib/field/Date/Date.tsx +15 -11
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +9 -9
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +33 -44
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +122 -31
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +11 -10
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +39 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +8 -7
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/MultiSelect/Multiselect.tsx +244 -0
- package/lib/field/MultiSelect/index.tsx +1 -0
- package/lib/field/MultiSelect/utils.ts +230 -0
- package/lib/field/Percentage/Percentage.tsx +46 -41
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +13 -12
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +8 -7
- package/lib/field/ScalarList/ScalarList.tsx +3 -13
- package/lib/field/ScalarList/config-ext.json +1 -2
- package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -11
- package/lib/field/TextArea/TextArea.tsx +7 -6
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +4 -6
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +9 -7
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +11 -11
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +9 -8
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +18 -16
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/attachmentHelpers.ts +13 -8
- package/lib/helpers/case-utils.tsx +4 -8
- package/lib/helpers/common-utils.ts +5 -1
- package/lib/helpers/data_page.ts +3 -7
- package/lib/helpers/date-format-utils.ts +3 -3
- package/lib/helpers/event-utils.ts +3 -3
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Boolean.ts +9 -26
- package/lib/helpers/formatters/Currency.ts +15 -21
- package/lib/helpers/formatters/CurrencyMap.ts +505 -501
- package/lib/helpers/formatters/Date.ts +20 -26
- package/lib/helpers/formatters/common.ts +1 -2
- package/lib/helpers/formatters/index.ts +26 -19
- package/lib/helpers/instructions-utils.ts +38 -0
- package/lib/helpers/reactContextHelpers.ts +2 -2
- package/lib/helpers/simpleTableHelpers.ts +59 -83
- package/lib/helpers/state-utils.tsx +5 -9
- package/lib/helpers/template-utils.ts +3 -6
- package/lib/helpers/utils.ts +5 -5
- package/lib/helpers/versionHelpers.ts +1 -4
- package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -79
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
- package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
- 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 +36 -46
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +176 -212
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +19 -31
- package/lib/infra/Reference/Reference.tsx +16 -18
- package/lib/infra/Region/Region.tsx +4 -6
- package/lib/infra/RootContainer/RootContainer.tsx +75 -111
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +32 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
- package/lib/infra/View/View.tsx +17 -21
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +39 -74
- package/lib/template/BannerPage/BannerPage.tsx +12 -14
- package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +34 -63
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
- package/lib/template/Confirmation/Confirmation.tsx +12 -17
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +95 -121
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +13 -16
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/Details/Details/Details.tsx +19 -22
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
- 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 +15 -14
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
- package/lib/template/ListPage/ListPage.tsx +5 -10
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/DefaultViewMeta.ts +1 -3
- package/lib/template/ListView/ListView.tsx +185 -175
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/hooks.ts +24 -26
- package/lib/template/ListView/utils.ts +51 -87
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
- 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 +14 -24
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -121
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
- package/lib/template/SubTabs/SubTabs.tsx +22 -40
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -5
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
- 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 +22 -34
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
- 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 +13 -21
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
- 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 +18 -21
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +60 -1
- package/lib/widget/Attachment/Attachment.tsx +378 -405
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +23 -20
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +7 -10
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +52 -53
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -834
- package/lib/helpers/authManager.ts +0 -933
- package/lib/helpers/config_access.js +0 -186
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
|
-
|
|
4
2
|
import Button from '@material-ui/core/Button';
|
|
5
|
-
import { Grid, Divider } from
|
|
3
|
+
import { Grid, Divider } from '@material-ui/core';
|
|
6
4
|
|
|
7
5
|
// ActionButtons does NOT have getPConnect. So, no need to extend from PConnProps
|
|
8
6
|
interface ActionButtonsProps {
|
|
9
7
|
// If any, enter additional props that only exist on this component
|
|
10
|
-
arMainButtons?:
|
|
11
|
-
arSecondaryButtons?:
|
|
12
|
-
onButtonPress: any
|
|
8
|
+
arMainButtons?: any[];
|
|
9
|
+
arSecondaryButtons?: any[];
|
|
10
|
+
onButtonPress: any;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
|
|
16
13
|
const useStyles = makeStyles((/* theme */) => ({
|
|
17
14
|
button: {
|
|
18
|
-
padding:
|
|
15
|
+
padding: '0px 5px'
|
|
19
16
|
},
|
|
20
17
|
divider: {
|
|
21
|
-
marginTop:
|
|
22
|
-
marginBottom:
|
|
18
|
+
marginTop: '10px',
|
|
19
|
+
marginBottom: '10px'
|
|
23
20
|
}
|
|
24
21
|
}));
|
|
25
22
|
|
|
26
|
-
|
|
27
23
|
export default function ActionButtons(props: ActionButtonsProps) {
|
|
28
24
|
const { arMainButtons = [], arSecondaryButtons = [], onButtonPress } = props;
|
|
29
25
|
const classes = useStyles();
|
|
@@ -31,35 +27,48 @@ export default function ActionButtons(props: ActionButtonsProps) {
|
|
|
31
27
|
const localeCategory = 'Assignment';
|
|
32
28
|
|
|
33
29
|
function _onButtonPress(sAction: string, sButtonType: string) {
|
|
34
|
-
|
|
35
30
|
onButtonPress(sAction, sButtonType);
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
return (
|
|
39
|
-
|
|
40
|
-
<Divider className={classes.divider}/>
|
|
41
|
-
<Grid container spacing={4} justifyContent=
|
|
34
|
+
<>
|
|
35
|
+
<Divider className={classes.divider} />
|
|
36
|
+
<Grid container spacing={4} justifyContent='space-between'>
|
|
42
37
|
<Grid item>
|
|
43
38
|
<Grid container spacing={1}>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
{arSecondaryButtons.map(sButton => (
|
|
40
|
+
<Grid item key={sButton.name}>
|
|
41
|
+
<Button
|
|
42
|
+
variant='contained'
|
|
43
|
+
color='secondary'
|
|
44
|
+
onClick={() => {
|
|
45
|
+
_onButtonPress(sButton.jsAction, 'secondary');
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{localizedVal(sButton.name, localeCategory)}
|
|
49
|
+
</Button>
|
|
50
|
+
</Grid>
|
|
51
|
+
))}
|
|
49
52
|
</Grid>
|
|
50
53
|
</Grid>
|
|
51
54
|
<Grid item>
|
|
52
55
|
<Grid container spacing={1}>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
{arMainButtons.map(mButton => (
|
|
57
|
+
<Grid item key={mButton.name}>
|
|
58
|
+
<Button
|
|
59
|
+
variant='contained'
|
|
60
|
+
color='primary'
|
|
61
|
+
onClick={() => {
|
|
62
|
+
_onButtonPress(mButton.jsAction, 'primary');
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
{localizedVal(mButton.name, localeCategory)}
|
|
66
|
+
</Button>
|
|
67
|
+
</Grid>
|
|
68
|
+
))}
|
|
58
69
|
</Grid>
|
|
59
70
|
</Grid>
|
|
60
71
|
</Grid>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
65
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './ActionButtons';
|
|
1
|
+
export { default } from './ActionButtons';
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { PropsWithChildren, useEffect, useState } from 'react';
|
|
2
2
|
import Snackbar from '@material-ui/core/Snackbar';
|
|
3
3
|
import IconButton from '@material-ui/core/IconButton';
|
|
4
4
|
import CloseIcon from '@material-ui/icons/Close';
|
|
5
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
// getCaseInfo().isAssignmentInCreateStage()
|
|
11
|
-
// getCaseInfo().isLocalAction()
|
|
12
|
-
// interface AssignmentProps extends PConnProps {
|
|
13
|
-
// // If any, enter additional props that only exist on this component
|
|
14
|
-
// children: Array<any>,
|
|
15
|
-
// itemKey: string,
|
|
16
|
-
// isInModal: boolean,
|
|
17
|
-
// banners: Array<any>
|
|
18
|
-
// // eslint-disable-next-line react/no-unused-prop-types
|
|
19
|
-
// actionButtons: Array<any>,
|
|
20
|
-
// }
|
|
8
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
21
9
|
|
|
10
|
+
interface AssignmentProps extends PConnProps {
|
|
11
|
+
// If any, enter additional props that only exist on this component
|
|
12
|
+
itemKey: string;
|
|
13
|
+
isInModal: boolean;
|
|
14
|
+
banners: any[];
|
|
15
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
16
|
+
actionButtons: any[];
|
|
17
|
+
}
|
|
22
18
|
|
|
23
|
-
export default function Assignment(props
|
|
19
|
+
export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
24
20
|
// Get emitted components from map (so we can get any override that may exist)
|
|
25
|
-
const AssignmentCard = getComponentFromMap(
|
|
26
|
-
const MultiStep = getComponentFromMap(
|
|
21
|
+
const AssignmentCard = getComponentFromMap('AssignmentCard');
|
|
22
|
+
const MultiStep = getComponentFromMap('MultiStep');
|
|
27
23
|
|
|
28
24
|
const { getPConnect, children, itemKey = '', isInModal = false, banners = [] } = props;
|
|
29
25
|
const thePConn = getPConnect();
|
|
@@ -31,8 +27,8 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
31
27
|
const [bHasNavigation, setHasNavigation] = useState(false);
|
|
32
28
|
const [actionButtons, setActionButtons] = useState([]);
|
|
33
29
|
const [bIsVertical, setIsVertical] = useState(false);
|
|
34
|
-
const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState<
|
|
35
|
-
const [arNavigationSteps, setArNavigationSteps] = useState<
|
|
30
|
+
const [arCurrentStepIndicies, setArCurrentStepIndicies] = useState<any[]>([]);
|
|
31
|
+
const [arNavigationSteps, setArNavigationSteps] = useState<any[]>([]);
|
|
36
32
|
|
|
37
33
|
const actionsAPI = thePConn.getActionsApi();
|
|
38
34
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
@@ -50,18 +46,14 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
50
46
|
const [showSnackbar, setShowSnackbar] = useState(false);
|
|
51
47
|
const [snackbarMessage, setSnackbarMessage] = useState('');
|
|
52
48
|
|
|
53
|
-
function findCurrentIndicies(
|
|
54
|
-
arStepperSteps: Array<any>,
|
|
55
|
-
arIndicies: Array<number>,
|
|
56
|
-
depth: number
|
|
57
|
-
): Array<number> {
|
|
49
|
+
function findCurrentIndicies(arStepperSteps: any[], arIndicies: number[], depth: number): number[] {
|
|
58
50
|
let count = 0;
|
|
59
51
|
arStepperSteps.forEach(step => {
|
|
60
52
|
if (step.visited_status === 'current') {
|
|
61
53
|
arIndicies[depth] = count;
|
|
62
54
|
|
|
63
55
|
// add in
|
|
64
|
-
step
|
|
56
|
+
step.step_status = '';
|
|
65
57
|
} else if (step.visited_status === 'success') {
|
|
66
58
|
count += 1;
|
|
67
59
|
step.step_status = 'completed';
|
|
@@ -78,16 +70,29 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
78
70
|
return arIndicies;
|
|
79
71
|
}
|
|
80
72
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
function getStepsInfo(steps, formedSteps: any = []) {
|
|
74
|
+
steps.forEach(step => {
|
|
75
|
+
if (step.name) {
|
|
76
|
+
step.name = PCore.getLocaleUtils().getLocaleValue(step.name, undefined, localeReference);
|
|
77
|
+
}
|
|
78
|
+
if (step.steps) {
|
|
79
|
+
formedSteps = getStepsInfo(step.steps, formedSteps);
|
|
80
|
+
} else {
|
|
81
|
+
formedSteps.push(step);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
return formedSteps;
|
|
85
|
+
}
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (children) {
|
|
89
|
+
const firstChild = Array.isArray(children) ? children[0] : children;
|
|
90
|
+
const oWorkItem = firstChild.props.getPConnect();
|
|
86
91
|
const oWorkData = oWorkItem.getDataObject();
|
|
87
|
-
const oData = thePConn.getDataObject('');
|
|
92
|
+
const oData: any = thePConn.getDataObject(''); // 1st arg empty string until typedefs allow it to be optional
|
|
88
93
|
|
|
89
94
|
if (oWorkData?.caseInfo && oWorkData.caseInfo.assignments !== null) {
|
|
90
|
-
const oCaseInfo = oData
|
|
95
|
+
const oCaseInfo = oData.caseInfo;
|
|
91
96
|
|
|
92
97
|
if (oCaseInfo && oCaseInfo.actionButtons) {
|
|
93
98
|
setActionButtons(oCaseInfo.actionButtons);
|
|
@@ -97,28 +102,23 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
97
102
|
setHasNavigation(true);
|
|
98
103
|
|
|
99
104
|
if (
|
|
100
|
-
oCaseInfo.navigation.template &&
|
|
101
|
-
oCaseInfo
|
|
105
|
+
(oCaseInfo.navigation.template && oCaseInfo.navigation.template.toLowerCase() === 'standard') ||
|
|
106
|
+
oCaseInfo?.navigation?.steps?.length === 1
|
|
102
107
|
) {
|
|
103
108
|
setHasNavigation(false);
|
|
104
|
-
} else if (
|
|
105
|
-
oCaseInfo.navigation.template &&
|
|
106
|
-
oCaseInfo.navigation.template.toLowerCase() === 'vertical'
|
|
107
|
-
) {
|
|
109
|
+
} else if (oCaseInfo.navigation.template && oCaseInfo.navigation.template.toLowerCase() === 'vertical') {
|
|
108
110
|
setIsVertical(true);
|
|
109
111
|
} else {
|
|
110
112
|
setIsVertical(false);
|
|
111
113
|
}
|
|
112
|
-
|
|
113
|
-
steps
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
setArCurrentStepIndicies(
|
|
120
|
-
findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0)
|
|
121
|
-
);
|
|
114
|
+
|
|
115
|
+
if (oCaseInfo?.navigation?.steps) {
|
|
116
|
+
const steps = JSON.parse(JSON.stringify(oCaseInfo?.navigation?.steps));
|
|
117
|
+
const formedSteps = getStepsInfo(steps);
|
|
118
|
+
setArNavigationSteps(formedSteps);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
setArCurrentStepIndicies(findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0));
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -141,10 +141,7 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
141
141
|
|
|
142
142
|
function onSaveActionSuccess(data) {
|
|
143
143
|
actionsAPI.cancelAssignment(itemKey).then(() => {
|
|
144
|
-
PCore.getPubSubUtils().publish(
|
|
145
|
-
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED,
|
|
146
|
-
data
|
|
147
|
-
);
|
|
144
|
+
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED, data);
|
|
148
145
|
});
|
|
149
146
|
}
|
|
150
147
|
|
|
@@ -170,9 +167,7 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
170
167
|
|
|
171
168
|
savePromise
|
|
172
169
|
.then(() => {
|
|
173
|
-
const caseType = thePConn
|
|
174
|
-
.getCaseInfo()
|
|
175
|
-
.c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
|
|
170
|
+
const caseType = thePConn.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
|
|
176
171
|
onSaveActionSuccess({ caseType, caseID, assignmentID });
|
|
177
172
|
})
|
|
178
173
|
.catch(() => {
|
|
@@ -186,11 +181,12 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
186
181
|
// check if create stage (modal)
|
|
187
182
|
const { PUB_SUB_EVENTS } = PCore.getConstants();
|
|
188
183
|
const { publish } = PCore.getPubSubUtils();
|
|
184
|
+
// @ts-ignore - Property 'isAssignmentInCreateStage' is private and only accessible within class 'CaseInfo'
|
|
189
185
|
const isAssignmentInCreateStage = thePConn.getCaseInfo().isAssignmentInCreateStage();
|
|
190
186
|
const isLocalAction =
|
|
187
|
+
// @ts-ignore - Property 'isLocalAction' is private and only accessible within class 'CaseInfo'.
|
|
191
188
|
thePConn.getCaseInfo().isLocalAction() ||
|
|
192
|
-
(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION &&
|
|
193
|
-
getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION, ''));// 2nd arg empty string until typedefs allow it to be optional
|
|
189
|
+
(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION && getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION));
|
|
194
190
|
if (isAssignmentInCreateStage && isInModal && !isLocalAction) {
|
|
195
191
|
const cancelPromise = cancelCreateStageAssignment(itemKey);
|
|
196
192
|
|
|
@@ -239,11 +235,50 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
239
235
|
}
|
|
240
236
|
}
|
|
241
237
|
|
|
238
|
+
function getRefreshProps(refreshConditions) {
|
|
239
|
+
// refreshConditions cuurently supports only "Changes" event
|
|
240
|
+
if (!refreshConditions) {
|
|
241
|
+
return [];
|
|
242
|
+
}
|
|
243
|
+
return refreshConditions.filter(item => item.event && item.event === 'Changes').map(item => [item.field, item.field?.substring(1)]) || [];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// expected format of refreshConditions : [{field: ".Name", event: "Changes"}]
|
|
247
|
+
// @ts-ignore - Property 'getActionRefreshConditions' is private and only accessible within class 'CaseInfo'
|
|
248
|
+
const refreshConditions = thePConn.getCaseInfo()?.getActionRefreshConditions();
|
|
249
|
+
const context = thePConn.getContextName();
|
|
250
|
+
const pageReference = thePConn.getPageReference();
|
|
251
|
+
|
|
252
|
+
// refresh api de-registration
|
|
253
|
+
PCore.getRefreshManager().deRegisterForRefresh(context);
|
|
254
|
+
|
|
255
|
+
// refresh api registration
|
|
256
|
+
const refreshProps = getRefreshProps(refreshConditions);
|
|
257
|
+
const caseKey = thePConn.getCaseInfo().getKey();
|
|
258
|
+
const refreshOptions = {
|
|
259
|
+
autoDetectRefresh: true,
|
|
260
|
+
preserveClientChanges: false
|
|
261
|
+
};
|
|
262
|
+
if (refreshProps.length > 0) {
|
|
263
|
+
refreshProps.forEach(prop => {
|
|
264
|
+
PCore.getRefreshManager().registerForRefresh(
|
|
265
|
+
'PROP_CHANGE',
|
|
266
|
+
thePConn.getActionsApi().refreshCaseView.bind(thePConn.getActionsApi(), caseKey, null, pageReference, {
|
|
267
|
+
...refreshOptions,
|
|
268
|
+
refreshFor: prop[0]
|
|
269
|
+
}),
|
|
270
|
+
`${pageReference}.${prop[1]}`,
|
|
271
|
+
`${context}/${pageReference}`,
|
|
272
|
+
context
|
|
273
|
+
);
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
242
277
|
return (
|
|
243
278
|
<div id='Assignment'>
|
|
244
279
|
{banners}
|
|
245
280
|
{bHasNavigation ? (
|
|
246
|
-
|
|
281
|
+
<>
|
|
247
282
|
<MultiStep
|
|
248
283
|
getPConnect={getPConnect}
|
|
249
284
|
itemKey={itemKey}
|
|
@@ -261,25 +296,15 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
261
296
|
onClose={handleSnackbarClose}
|
|
262
297
|
message={snackbarMessage}
|
|
263
298
|
action={
|
|
264
|
-
<IconButton
|
|
265
|
-
size='small'
|
|
266
|
-
aria-label='close'
|
|
267
|
-
color='inherit'
|
|
268
|
-
onClick={handleSnackbarClose}
|
|
269
|
-
>
|
|
299
|
+
<IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>
|
|
270
300
|
<CloseIcon fontSize='small' />
|
|
271
301
|
</IconButton>
|
|
272
302
|
}
|
|
273
303
|
/>
|
|
274
|
-
|
|
304
|
+
</>
|
|
275
305
|
) : (
|
|
276
|
-
|
|
277
|
-
<AssignmentCard
|
|
278
|
-
getPConnect={getPConnect}
|
|
279
|
-
itemKey={itemKey}
|
|
280
|
-
actionButtons={actionButtons}
|
|
281
|
-
onButtonPress={buttonPress}
|
|
282
|
-
>
|
|
306
|
+
<>
|
|
307
|
+
<AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
|
|
283
308
|
{children}
|
|
284
309
|
</AssignmentCard>
|
|
285
310
|
<Snackbar
|
|
@@ -288,17 +313,12 @@ export default function Assignment(props /* : AssignmentProps */) {
|
|
|
288
313
|
onClose={handleSnackbarClose}
|
|
289
314
|
message={snackbarMessage}
|
|
290
315
|
action={
|
|
291
|
-
<IconButton
|
|
292
|
-
size='small'
|
|
293
|
-
aria-label='close'
|
|
294
|
-
color='inherit'
|
|
295
|
-
onClick={handleSnackbarClose}
|
|
296
|
-
>
|
|
316
|
+
<IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>
|
|
297
317
|
<CloseIcon fontSize='small' />
|
|
298
318
|
</IconButton>
|
|
299
319
|
}
|
|
300
320
|
/>
|
|
301
|
-
|
|
321
|
+
</>
|
|
302
322
|
)}
|
|
303
323
|
</div>
|
|
304
324
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Assignment';
|
|
1
|
+
export { default } from './Assignment';
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
5
|
|
|
5
6
|
interface AssignmentCardProps extends PConnProps {
|
|
6
7
|
// If any, enter additional props that only exist on this component
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onButtonPress: any,
|
|
10
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
11
|
-
itemKey?: string
|
|
8
|
+
actionButtons: any;
|
|
9
|
+
onButtonPress: any;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
export default function AssignmentCard(props: AssignmentCardProps) {
|
|
12
|
+
export default function AssignmentCard(props: PropsWithChildren<AssignmentCardProps>) {
|
|
16
13
|
// Get emitted components from map (so we can get any override that may exist)
|
|
17
|
-
const ActionButtons = getComponentFromMap(
|
|
14
|
+
const ActionButtons = getComponentFromMap('ActionButtons');
|
|
18
15
|
|
|
19
|
-
const { children, actionButtons, onButtonPress} = props;
|
|
16
|
+
const { children, actionButtons, onButtonPress } = props;
|
|
20
17
|
|
|
21
18
|
const [arMainButtons, setArMainButtons] = useState([]);
|
|
22
19
|
const [arSecondaryButtons, setArSecondaryButtons] = useState([]);
|
|
23
20
|
|
|
24
|
-
useEffect(
|
|
21
|
+
useEffect(() => {
|
|
25
22
|
if (actionButtons) {
|
|
26
23
|
setArMainButtons(actionButtons.main);
|
|
27
24
|
setArSecondaryButtons(actionButtons.secondary);
|
|
@@ -35,9 +32,9 @@ export default function AssignmentCard(props: AssignmentCardProps) {
|
|
|
35
32
|
return (
|
|
36
33
|
<>
|
|
37
34
|
{children}
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
}
|
|
35
|
+
{arMainButtons && arSecondaryButtons && (
|
|
36
|
+
<ActionButtons arMainButtons={arMainButtons} arSecondaryButtons={arSecondaryButtons} onButtonPress={buttonPress} />
|
|
37
|
+
)}
|
|
41
38
|
</>
|
|
42
|
-
)
|
|
39
|
+
);
|
|
43
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './AssignmentCard';
|
|
1
|
+
export { default } from './AssignmentCard';
|