@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,21 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createElement } from 'react';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
|
+
|
|
3
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
4
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// showLabel: boolean,
|
|
13
|
-
// label: string,
|
|
14
|
-
// showHighlightedData: boolean
|
|
15
|
-
// }
|
|
16
|
-
|
|
8
|
+
interface DetailsTwoColumnProps extends PConnProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
showLabel: boolean;
|
|
11
|
+
label: string;
|
|
12
|
+
showHighlightedData: boolean;
|
|
13
|
+
}
|
|
17
14
|
|
|
18
|
-
export default function DetailsTwoColumn(props
|
|
15
|
+
export default function DetailsTwoColumn(props: DetailsTwoColumnProps) {
|
|
19
16
|
// Get emitted components from map (so we can get any override that may exist)
|
|
20
17
|
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
21
18
|
|
|
@@ -28,20 +25,18 @@ export default function DetailsTwoColumn(props /* : DetailsTwoColumnProps */) {
|
|
|
28
25
|
// in a readonly (display) mode instead of a editable
|
|
29
26
|
getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
30
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
31
|
-
const children = getPConnect()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
);
|
|
28
|
+
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
|
+
createElement(createPConnectComponent(), {
|
|
30
|
+
...configObject,
|
|
31
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
32
|
+
key: index.toString()
|
|
33
|
+
})
|
|
34
|
+
);
|
|
40
35
|
|
|
41
36
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
42
37
|
let highlightedDataArr = [];
|
|
43
38
|
if (showHighlightedData) {
|
|
44
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
39
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
|
|
45
40
|
highlightedDataArr = highlightedData.map(field => {
|
|
46
41
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
47
42
|
|
|
@@ -51,8 +46,7 @@ export default function DetailsTwoColumn(props /* : DetailsTwoColumnProps */) {
|
|
|
51
46
|
field.config.displayAsStatus = true;
|
|
52
47
|
}
|
|
53
48
|
|
|
54
|
-
return getPConnect().createComponent(field,
|
|
55
|
-
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
49
|
+
return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
56
50
|
});
|
|
57
51
|
}
|
|
58
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './DetailsTwoColumn';
|
|
1
|
+
export { default } from './DetailsTwoColumn';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React, { Children,
|
|
1
|
+
import React, { Children, useMemo, useState } from 'react';
|
|
2
2
|
import { makeStyles, Tab, Tabs } from '@material-ui/core';
|
|
3
3
|
import { TabContext, TabPanel } from '@material-ui/lab';
|
|
4
|
+
|
|
4
5
|
import { buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
5
|
-
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
7
|
|
|
7
8
|
const useStyles = makeStyles(() => ({
|
|
8
9
|
tab: {
|
|
@@ -10,24 +11,24 @@ const useStyles = makeStyles(() => ({
|
|
|
10
11
|
}
|
|
11
12
|
}));
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// }
|
|
14
|
+
interface DynamicTabsProps extends PConnProps {
|
|
15
|
+
// If any, enter additional props that only exist on this component
|
|
16
|
+
showLabel: boolean;
|
|
17
|
+
label: string;
|
|
18
|
+
referenceList?: any[];
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
function DynamicTabs(props
|
|
21
|
+
function DynamicTabs(props: DynamicTabsProps) {
|
|
22
22
|
const classes = useStyles();
|
|
23
23
|
const { referenceList, showLabel, label, getPConnect } = props;
|
|
24
24
|
const pConnect = getPConnect();
|
|
25
25
|
// Get the inherited props from the parent to determine label settings
|
|
26
26
|
const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() };
|
|
27
27
|
const defaultTabIndex = 0;
|
|
28
|
+
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
|
|
28
29
|
const { tablabel } = pConnect.getComponentConfig();
|
|
29
30
|
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
30
|
-
const referenceListData = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
31
|
+
const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
31
32
|
const memoisedTabViews = useMemo(() => {
|
|
32
33
|
pConnect.setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
33
34
|
pConnect.setInheritedProp('readOnly', true);
|
|
@@ -57,16 +58,16 @@ function DynamicTabs(props /*: DynamicTabsProps */) {
|
|
|
57
58
|
|
|
58
59
|
return (
|
|
59
60
|
<>
|
|
60
|
-
{propsToUse.label && <h3 id=
|
|
61
|
+
{propsToUse.label && <h3 id='dynamic-tabs-title'>{propsToUse.label}</h3>}
|
|
61
62
|
<TabContext value={panelShown.toString()}>
|
|
62
|
-
<Tabs onChange={handleTabClick} value={panelShown} variant=
|
|
63
|
+
<Tabs onChange={handleTabClick} value={panelShown} variant='scrollable' scrollButtons='auto' indicatorColor='primary' id='dynamic-tabs'>
|
|
63
64
|
{tabItems.map((tab: any) => (
|
|
64
65
|
<Tab key={tab.id} label={tab.name} value={tab.id} className={classes.tab} />
|
|
65
66
|
))}
|
|
66
67
|
</Tabs>
|
|
67
68
|
|
|
68
69
|
{tabItems.map((tab: any) => (
|
|
69
|
-
<TabPanel key={tab.id} value={tab.id.toString()} tabIndex={+tab.id} id=
|
|
70
|
+
<TabPanel key={tab.id} value={tab.id.toString()} tabIndex={+tab.id} id='dynamic-tabpanel'>
|
|
70
71
|
<div>{memoisedTabViews[parseInt(tab.id, 10)] || 'No content exists'}</div>
|
|
71
72
|
</TabPanel>
|
|
72
73
|
))}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
3
4
|
import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
4
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
-
|
|
6
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
|
|
8
8
|
interface FieldGroupTemplateProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
10
|
-
referenceList?:
|
|
11
|
-
contextClass: string
|
|
12
|
-
renderMode?: string
|
|
13
|
-
heading?: string
|
|
14
|
-
lookForChildInConfig?: boolean
|
|
15
|
-
displayMode?: string
|
|
16
|
-
fieldHeader?: string
|
|
17
|
-
allowTableEdit: boolean
|
|
10
|
+
referenceList?: any[];
|
|
11
|
+
contextClass: string;
|
|
12
|
+
renderMode?: string;
|
|
13
|
+
heading?: string;
|
|
14
|
+
lookForChildInConfig?: boolean;
|
|
15
|
+
displayMode?: string;
|
|
16
|
+
fieldHeader?: string;
|
|
17
|
+
allowTableEdit: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
22
21
|
// Get emitted components from map (so we can get any override that may exist)
|
|
23
22
|
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
@@ -52,7 +51,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
52
51
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
53
52
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
54
53
|
} else {
|
|
55
|
-
pConn.getListActions().insert({}, referenceList.length
|
|
54
|
+
pConn.getListActions().insert({}, referenceList.length);
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
57
|
|
|
@@ -64,7 +63,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
64
63
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
65
64
|
pConn.getListActions().deleteEntry(index, pageReference);
|
|
66
65
|
} else {
|
|
67
|
-
pConn.getListActions().deleteEntry(index
|
|
66
|
+
pConn.getListActions().deleteEntry(index);
|
|
68
67
|
}
|
|
69
68
|
};
|
|
70
69
|
if (referenceList.length === 0 && allowAddEdit !== false) {
|
|
@@ -74,10 +73,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
74
73
|
const MemoisedChildren = useMemo(() => {
|
|
75
74
|
return referenceList.map((item, index) => ({
|
|
76
75
|
id: index,
|
|
77
|
-
name:
|
|
78
|
-
fieldHeader === 'propertyRef'
|
|
79
|
-
? getDynamicHeaderProp(item, index)
|
|
80
|
-
: `${HEADING} ${index + 1}`,
|
|
76
|
+
name: fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`,
|
|
81
77
|
children: buildView(pConn, index, lookForChildInConfig)
|
|
82
78
|
}));
|
|
83
79
|
}, [referenceList?.length]);
|
|
@@ -96,10 +92,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
96
92
|
return referenceList.map((item, index) => {
|
|
97
93
|
const key = item[heading] || `field-group-row-${index}`;
|
|
98
94
|
return (
|
|
99
|
-
<FieldGroup
|
|
100
|
-
key={key}
|
|
101
|
-
name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}
|
|
102
|
-
>
|
|
95
|
+
<FieldGroup key={key} name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}>
|
|
103
96
|
{buildView(pConn, index, lookForChildInConfig)}
|
|
104
97
|
</FieldGroup>
|
|
105
98
|
);
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { Grid, Typography } from '@material-ui/core';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
-
import
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
|
-
// InlineDashboard does NOT have getPConnect. So, no need to extend from PConnProps
|
|
7
6
|
interface InlineDashboardProps extends PConnProps {
|
|
8
7
|
// If any, enter additional props that only exist on this component
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
filterPosition?: string
|
|
8
|
+
title: string;
|
|
9
|
+
filterPosition?: string;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
|
|
15
12
|
const useStyles = makeStyles((/* theme */) => ({
|
|
16
13
|
headerStyles: {
|
|
17
14
|
fontWeight: 500,
|
|
@@ -39,10 +36,11 @@ const useStyles = makeStyles((/* theme */) => ({
|
|
|
39
36
|
}
|
|
40
37
|
}));
|
|
41
38
|
|
|
42
|
-
export default function InlineDashboard(props: InlineDashboardProps) {
|
|
39
|
+
export default function InlineDashboard(props: PropsWithChildren<InlineDashboardProps>) {
|
|
43
40
|
const classes = useStyles();
|
|
44
41
|
|
|
45
42
|
const { children, title, filterPosition } = props;
|
|
43
|
+
const childrenToRender = children as ReactElement[];
|
|
46
44
|
|
|
47
45
|
const direction = filterPosition === 'inline-start' ? 'row-reverse' : 'row';
|
|
48
46
|
return (
|
|
@@ -54,20 +52,20 @@ export default function InlineDashboard(props: InlineDashboardProps) {
|
|
|
54
52
|
{filterPosition === 'block-start' && (
|
|
55
53
|
<Grid container spacing={2} direction='column-reverse' className={classes.containerStyles}>
|
|
56
54
|
<Grid item xs={12} className={classes.colStyles}>
|
|
57
|
-
{
|
|
55
|
+
{childrenToRender[0]}
|
|
58
56
|
</Grid>
|
|
59
|
-
<Grid item xs={12} className={classes.filterContainerStyles}>
|
|
60
|
-
{
|
|
57
|
+
<Grid id='filters' item xs={12} className={classes.filterContainerStyles}>
|
|
58
|
+
{childrenToRender[1]}
|
|
61
59
|
</Grid>
|
|
62
60
|
</Grid>
|
|
63
61
|
)}
|
|
64
62
|
{filterPosition !== 'block-start' && (
|
|
65
63
|
<Grid container spacing={2} direction={direction} className={classes.containerStyles}>
|
|
66
64
|
<Grid item xs={9}>
|
|
67
|
-
{
|
|
65
|
+
{childrenToRender[0]}
|
|
68
66
|
</Grid>
|
|
69
|
-
<Grid item xs={3} className={classes.inlineStyles}>
|
|
70
|
-
{
|
|
67
|
+
<Grid id='filters' item xs={3} className={classes.inlineStyles}>
|
|
68
|
+
{childrenToRender[1]}
|
|
71
69
|
</Grid>
|
|
72
70
|
</Grid>
|
|
73
71
|
)}
|
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useMemo, Children, useEffect, useState } from 'react';
|
|
1
|
+
import { useMemo, Children, useEffect, useState, PropsWithChildren } from 'react';
|
|
3
2
|
|
|
4
3
|
import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
|
|
5
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
-
|
|
7
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
-
|
|
5
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
6
|
|
|
10
7
|
interface InlineDashboardPageProps extends PConnProps {
|
|
11
8
|
// If any, enter additional props that only exist on this component
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
filterPosition?: string
|
|
9
|
+
title: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
filterPosition?: string;
|
|
16
12
|
}
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
export default function InlineDashboardPage(props: InlineDashboardPageProps) {
|
|
14
|
+
export default function InlineDashboardPage(props: PropsWithChildren<InlineDashboardPageProps>) {
|
|
20
15
|
// Get emitted components from map (so we can get any override that may exist)
|
|
21
|
-
const InlineDashboard = getComponentFromMap(
|
|
16
|
+
const InlineDashboard = getComponentFromMap('InlineDashboard');
|
|
22
17
|
|
|
23
|
-
// eslint-disable-next-line
|
|
24
|
-
const { children, getPConnect, icon = '', filterPosition = 'block-start'
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
const { children, getPConnect, icon = '', filterPosition = 'block-start' } = props;
|
|
25
20
|
const [filterComponents, setFilterComponents] = useState([]);
|
|
26
21
|
const childArray = useMemo(() => {
|
|
27
22
|
return Children.toArray(children);
|
|
28
23
|
}, [children]);
|
|
29
24
|
|
|
30
|
-
const allFilters = getPConnect().getRawMetadata()
|
|
25
|
+
const allFilters = (getPConnect().getRawMetadata() as any).children[1];
|
|
31
26
|
|
|
32
27
|
useEffect(() => {
|
|
33
28
|
setFilterComponents(buildFilterComponents(getPConnect, allFilters));
|
|
34
29
|
}, []);
|
|
35
30
|
|
|
36
|
-
const inlineProps = props;
|
|
31
|
+
const inlineProps = { ...props };
|
|
32
|
+
inlineProps.children = [];
|
|
37
33
|
// Region layout views
|
|
38
34
|
inlineProps.children[0] = childArray[0];
|
|
39
35
|
// filter items
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
|
-
|
|
4
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
3
|
|
|
6
4
|
interface ListPageProps extends PConnProps {
|
|
7
5
|
// If any, enter additional props that only exist on this component
|
|
8
|
-
parameters: object
|
|
6
|
+
parameters: object;
|
|
9
7
|
}
|
|
10
8
|
|
|
11
|
-
|
|
12
9
|
export default function ListPage(props: ListPageProps) {
|
|
13
10
|
// Get emitted components from map (so we can get any override that may exist)
|
|
14
11
|
const ListView = getComponentFromMap('ListView');
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
<ListView {...listViewProps}></ListView>
|
|
20
|
-
)
|
|
13
|
+
// special case for ListView - add in a prop
|
|
14
|
+
const listViewProps = { ...props, bInForm: false };
|
|
15
|
+
return <ListView {...listViewProps} />;
|
|
21
16
|
}
|
|
@@ -34,10 +34,8 @@ const getDefaultConfig = (fieldMeta, classID, show) => {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
|
|
38
37
|
export default function getDefaultViewMeta(fieldMeta, classID, showField) {
|
|
39
|
-
const { type, name, displayAs, fieldID, isUserReference, associationID, datasource, label, fieldType } =
|
|
40
|
-
fieldMeta;
|
|
38
|
+
const { type, name, displayAs, fieldID, isUserReference, associationID, datasource, label, fieldType } = fieldMeta;
|
|
41
39
|
const mapperKey = type && displayAs ? type.concat(':').concat(displayAs) : type;
|
|
42
40
|
const defaultConfig = getDefaultConfig(fieldMeta, classID, showField);
|
|
43
41
|
let viewMeta;
|