@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 +1 @@
|
|
|
1
|
-
export { default } from './Attachment';
|
|
1
|
+
export { default } from './Attachment';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from "prop-types";
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
2
|
import { withStyles, Theme, createStyles } from '@material-ui/core/styles';
|
|
4
3
|
import Table from '@material-ui/core/Table';
|
|
5
4
|
import TableBody from '@material-ui/core/TableBody';
|
|
@@ -8,68 +7,81 @@ import TableContainer from '@material-ui/core/TableContainer';
|
|
|
8
7
|
import TableHead from '@material-ui/core/TableHead';
|
|
9
8
|
import TableRow from '@material-ui/core/TableRow';
|
|
10
9
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
11
|
-
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
12
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
14
13
|
|
|
14
|
+
interface CaseHistoryProps extends PConnProps {
|
|
15
|
+
// If any, enter additional props that only exist on this component
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
const StyledTableCell = withStyles((theme: Theme) =>
|
|
17
19
|
createStyles({
|
|
18
20
|
head: {
|
|
19
|
-
borderWidth:
|
|
20
|
-
borderStyle:
|
|
21
|
-
borderColor:
|
|
21
|
+
borderWidth: '1px',
|
|
22
|
+
borderStyle: 'solid',
|
|
23
|
+
borderColor: 'silver',
|
|
22
24
|
backgroundColor: theme.palette.text.disabled,
|
|
23
|
-
color: theme.palette.getContrastText(theme.palette.text.disabled)
|
|
25
|
+
color: theme.palette.getContrastText(theme.palette.text.disabled)
|
|
24
26
|
},
|
|
25
27
|
body: {
|
|
26
|
-
borderWidth:
|
|
27
|
-
borderStyle:
|
|
28
|
-
borderColor:
|
|
28
|
+
borderWidth: '1px',
|
|
29
|
+
borderStyle: 'solid',
|
|
30
|
+
borderColor: 'silver'
|
|
29
31
|
// fontSize: 14,
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
+
}
|
|
33
|
+
})
|
|
32
34
|
)(TableCell);
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
export default function CaseHistory(props) {
|
|
36
|
+
export default function CaseHistory(props: CaseHistoryProps) {
|
|
36
37
|
const { getPConnect } = props;
|
|
37
38
|
const thePConn = getPConnect();
|
|
38
39
|
// let waitingForData = true;
|
|
39
40
|
|
|
40
41
|
const displayedColumns = [
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
{
|
|
43
|
+
label: thePConn.getLocalizedValue('Date', '', ''),
|
|
44
|
+
type: 'DateTime',
|
|
45
|
+
fieldName: 'pxTimeCreated'
|
|
46
|
+
}, // 2nd and 3rd args empty string until typedef marked correctly
|
|
47
|
+
{
|
|
48
|
+
label: thePConn.getLocalizedValue('Description', '', ''),
|
|
49
|
+
type: 'TextInput',
|
|
50
|
+
fieldName: 'pyMessageKey'
|
|
51
|
+
}, // 2nd and 3rd args empty string until typedef marked correctly
|
|
52
|
+
{
|
|
53
|
+
label: thePConn.getLocalizedValue('Performed by', '', ''),
|
|
54
|
+
type: 'TextInput',
|
|
55
|
+
fieldName: 'pyPerformer'
|
|
56
|
+
} // 2nd and 3rd args empty string until typedef marked correctly
|
|
57
|
+
];
|
|
45
58
|
|
|
46
59
|
const rowData: any = useRef([]);
|
|
47
|
-
// eslint-disable-next-line
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48
61
|
const [waitingForData, setWaitingForData] = useState<boolean>(true);
|
|
49
62
|
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const dataViewName = "D_pyWorkHistory";
|
|
63
|
+
const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
|
|
64
|
+
const dataViewName = 'D_pyWorkHistory';
|
|
53
65
|
const context = thePConn.getContextName();
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const theRowData: Array<Object> = [];
|
|
67
|
+
function computeRowData(rows: Object[]): void {
|
|
68
|
+
const theRowData: Object[] = [];
|
|
58
69
|
|
|
59
70
|
rows.forEach((row: any, rowIndex: number) => {
|
|
60
71
|
// Now, for each property in the index of row properties (displayedColumns), add an object
|
|
61
72
|
// to a new array of values
|
|
62
73
|
const rowDisplayValues: any = [];
|
|
63
74
|
|
|
64
|
-
displayedColumns.forEach((column:
|
|
65
|
-
const theType = column
|
|
66
|
-
const theFieldName = column
|
|
67
|
-
const theValue =
|
|
75
|
+
displayedColumns.forEach((column: any, rowValIndex) => {
|
|
76
|
+
const theType = column.type;
|
|
77
|
+
const theFieldName = column.fieldName;
|
|
78
|
+
const theValue =
|
|
79
|
+
theType === 'Date' || theType === 'DateTime' ? Utils.generateDateTime(row[theFieldName], 'DateTime-Short') : row[theFieldName];
|
|
68
80
|
rowDisplayValues[rowValIndex] = theValue;
|
|
69
81
|
});
|
|
70
82
|
|
|
71
83
|
theRowData[rowIndex] = rowDisplayValues;
|
|
72
|
-
})
|
|
84
|
+
});
|
|
73
85
|
|
|
74
86
|
if (!isDeepEqual(theRowData, rowData.current)) {
|
|
75
87
|
// Only update rowData.current when it actually changes (to prevent infinite loop)
|
|
@@ -78,18 +90,17 @@ export default function CaseHistory(props) {
|
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
// Get the case history data when component mounted/initialized
|
|
81
|
-
useEffect(
|
|
82
|
-
|
|
93
|
+
useEffect(() => {
|
|
83
94
|
let bCallSetWaitingForData = true;
|
|
84
95
|
|
|
85
96
|
const historyData = PCore.getDataApiUtils().getData(
|
|
86
|
-
dataViewName,
|
|
97
|
+
dataViewName,
|
|
98
|
+
{ dataViewParameters: [{ CaseInstanceKey: caseID }] } as any,
|
|
87
99
|
context
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
historyData.then( (historyJSON: Object) => {
|
|
100
|
+
) as Promise<any>;
|
|
91
101
|
|
|
92
|
-
|
|
102
|
+
historyData.then((historyJSON: any) => {
|
|
103
|
+
const tableDataResults = historyJSON.data.data;
|
|
93
104
|
|
|
94
105
|
// compute the rowData using the tableDataResults
|
|
95
106
|
computeRowData(tableDataResults);
|
|
@@ -99,7 +110,6 @@ export default function CaseHistory(props) {
|
|
|
99
110
|
if (bCallSetWaitingForData) {
|
|
100
111
|
setWaitingForData(false);
|
|
101
112
|
}
|
|
102
|
-
|
|
103
113
|
});
|
|
104
114
|
|
|
105
115
|
return () => {
|
|
@@ -110,38 +120,36 @@ export default function CaseHistory(props) {
|
|
|
110
120
|
// So, if this cleanup code gets run before the promise .then is called,
|
|
111
121
|
// we can avoid calling the useState setter which would otherwise show a warning
|
|
112
122
|
bCallSetWaitingForData = false;
|
|
113
|
-
}
|
|
114
|
-
|
|
123
|
+
};
|
|
115
124
|
}, []);
|
|
116
125
|
|
|
117
|
-
|
|
118
126
|
function getTableHeader() {
|
|
119
|
-
const theRowKey =
|
|
127
|
+
const theRowKey = 'CaseHistory.TableHeader';
|
|
120
128
|
|
|
121
|
-
const theHeaderCells:
|
|
129
|
+
const theHeaderCells: any[] = displayedColumns.map((headerCol, index) => {
|
|
122
130
|
const theCellKey = `${theRowKey}.${index}`;
|
|
123
|
-
return <StyledTableCell key={theCellKey}>{headerCol.label}</StyledTableCell
|
|
124
|
-
})
|
|
131
|
+
return <StyledTableCell key={theCellKey}>{headerCol.label}</StyledTableCell>;
|
|
132
|
+
});
|
|
125
133
|
|
|
126
134
|
return <TableRow key={theRowKey}>{theHeaderCells}</TableRow>;
|
|
127
135
|
}
|
|
128
136
|
|
|
129
|
-
|
|
130
137
|
function getTableData() {
|
|
131
|
-
const theDataRows:
|
|
138
|
+
const theDataRows: any[] = [];
|
|
132
139
|
|
|
133
140
|
// Note: using rowData.current since we're using useRef as a mutatable
|
|
134
141
|
// value that's only updated when it changes.
|
|
135
142
|
if (rowData.current.length > 0) {
|
|
136
|
-
rowData.current.forEach((dataRow:
|
|
143
|
+
rowData.current.forEach((dataRow: Object[], index) => {
|
|
137
144
|
// using dataRow[0]-dataRow[1] as the array key since it's a unique value
|
|
138
145
|
const theKey = `CaseHistory-${index}`;
|
|
139
|
-
theDataRows.push(
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
theDataRows.push(
|
|
147
|
+
<TableRow key={theKey}>
|
|
148
|
+
<StyledTableCell>{dataRow[0] ? dataRow[0] : '---'}</StyledTableCell>
|
|
149
|
+
<StyledTableCell>{dataRow[1] ? dataRow[1] : '---'}</StyledTableCell>
|
|
150
|
+
<StyledTableCell>{dataRow[2] ? dataRow[2] : '---'}</StyledTableCell>
|
|
151
|
+
</TableRow>
|
|
152
|
+
);
|
|
145
153
|
});
|
|
146
154
|
}
|
|
147
155
|
|
|
@@ -149,21 +157,13 @@ export default function CaseHistory(props) {
|
|
|
149
157
|
}
|
|
150
158
|
|
|
151
159
|
return (
|
|
152
|
-
<div id=
|
|
160
|
+
<div id='CaseHistory'>
|
|
153
161
|
<TableContainer>
|
|
154
162
|
<Table>
|
|
155
|
-
<TableHead>
|
|
156
|
-
|
|
157
|
-
</TableHead>
|
|
158
|
-
<TableBody>
|
|
159
|
-
{getTableData()}
|
|
160
|
-
</TableBody>
|
|
163
|
+
<TableHead>{getTableHeader()}</TableHead>
|
|
164
|
+
<TableBody>{getTableData()}</TableBody>
|
|
161
165
|
</Table>
|
|
162
166
|
</TableContainer>
|
|
163
167
|
</div>
|
|
164
|
-
)
|
|
168
|
+
);
|
|
165
169
|
}
|
|
166
|
-
|
|
167
|
-
CaseHistory.propTypes = {
|
|
168
|
-
getPConnect: PropTypes.func.isRequired
|
|
169
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './CaseHistory';
|
|
1
|
+
export { default } from './CaseHistory';
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Button } from '@material-ui/core';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
import './ActionButtonsForFileUtil.css';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface ActionButtonsForFileUtilProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
arMainButtons: any[];
|
|
8
|
+
arSecondaryButtons: any[];
|
|
9
|
+
primaryAction: any;
|
|
10
|
+
secondaryAction: any;
|
|
11
|
+
}
|
|
6
12
|
|
|
13
|
+
export default function ActionButtonsForFileUtil(props: ActionButtonsForFileUtilProps) {
|
|
7
14
|
return (
|
|
8
|
-
<div className=
|
|
9
|
-
<div className=
|
|
15
|
+
<div className='psdk-actions'>
|
|
16
|
+
<div className='psdk-action-buttons'>
|
|
10
17
|
{props.arSecondaryButtons.map(file => (
|
|
11
|
-
<Button className=
|
|
18
|
+
<Button className='secondary-button' key={file.actionID} onClick={props.secondaryAction}>
|
|
19
|
+
{file.name}
|
|
20
|
+
</Button>
|
|
12
21
|
))}
|
|
13
22
|
</div>
|
|
14
|
-
<div className=
|
|
23
|
+
<div className='psdk-action-buttons'>
|
|
15
24
|
{props.arMainButtons.map(file => (
|
|
16
|
-
<Button className=
|
|
25
|
+
<Button className='primary-button' key={file.actionID} onClick={props.primaryAction}>
|
|
26
|
+
{file.name}
|
|
27
|
+
</Button>
|
|
17
28
|
))}
|
|
18
29
|
</div>
|
|
19
30
|
</div>
|
|
20
|
-
)
|
|
21
|
-
|
|
31
|
+
);
|
|
22
32
|
}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
height: 100%;
|
|
42
42
|
width: 100%;
|
|
43
|
-
background-color: rgba(100,100,100, 0.4);
|
|
43
|
+
background-color: rgba(100, 100, 100, 0.4);
|
|
44
44
|
position: fixed;
|
|
45
45
|
z-index: 999;
|
|
46
46
|
top: 0px;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
border: 1px dashed;
|
|
63
63
|
width: 100%;
|
|
64
64
|
padding: 0.3rem;
|
|
65
|
-
text-align: center
|
|
65
|
+
text-align: center;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.psdk-modal-links-row {
|