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