@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,23 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Grid from '@material-ui/core/Grid';
|
|
3
|
-
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import Grid, { GridSize } from '@material-ui/core/Grid';
|
|
3
|
+
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Can't use PConnProps until getPConnect().getChildren() type is ok
|
|
10
|
-
// interface NarrowWideDetailsProps extends PConnProps {
|
|
11
|
-
// // If any, enter additional props that only exist on this component
|
|
12
|
-
// showLabel?: boolean,
|
|
13
|
-
// label: string,
|
|
14
|
-
// showHighlightedData?: boolean
|
|
15
|
-
// }
|
|
7
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
16
8
|
|
|
9
|
+
interface NarrowWideDetailsProps extends PConnProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
label: string;
|
|
13
|
+
showHighlightedData?: boolean;
|
|
14
|
+
}
|
|
17
15
|
|
|
18
16
|
const COLUMN_WIDTHS = [4, 8];
|
|
19
17
|
|
|
20
|
-
export default function NarrowWideDetails(props
|
|
18
|
+
export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
|
|
21
19
|
// Get emitted components from map (so we can get any override that may exist)
|
|
22
20
|
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
23
21
|
|
|
@@ -30,20 +28,18 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
|
|
|
30
28
|
// in a readonly (display) mode instead of a editable
|
|
31
29
|
getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
32
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
33
|
-
const children = getPConnect()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
);
|
|
31
|
+
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
32
|
+
createElement(createPConnectComponent(), {
|
|
33
|
+
...configObject,
|
|
34
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
35
|
+
key: index.toString()
|
|
36
|
+
})
|
|
37
|
+
);
|
|
42
38
|
|
|
43
39
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
44
40
|
let highlightedDataArr = [];
|
|
45
41
|
if (showHighlightedData) {
|
|
46
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
42
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
|
|
47
43
|
highlightedDataArr = highlightedData.map(field => {
|
|
48
44
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
49
45
|
|
|
@@ -53,8 +49,7 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
|
|
|
53
49
|
field.config.displayAsStatus = true;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
return getPConnect().createComponent(field,
|
|
57
|
-
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
52
|
+
return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
58
53
|
});
|
|
59
54
|
}
|
|
60
55
|
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
import './NarrowWideForm.css';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface NarrowWideFormProps {
|
|
5
|
+
interface NarrowWideFormProps extends PConnProps {
|
|
8
6
|
// If any, enter additional props that only exist on this component
|
|
9
|
-
children: Array<any>
|
|
10
7
|
}
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const {children} = props;
|
|
9
|
+
export default function NarrowWideForm(props: PropsWithChildren<NarrowWideFormProps>) {
|
|
10
|
+
const { children } = props;
|
|
15
11
|
|
|
16
12
|
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</div>
|
|
27
|
-
}
|
|
28
|
-
</React.Fragment>
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
13
|
+
<>
|
|
14
|
+
{children && (children as ReactElement[]).length === 2 && (
|
|
15
|
+
<div className='psdk-narrow-wide-column'>
|
|
16
|
+
<div className='psdk-narrow-column-column'>{children[0]}</div>
|
|
17
|
+
<div className='psdk-wide-column-column'>{children[1]}</div>
|
|
18
|
+
</div>
|
|
19
|
+
)}
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
32
22
|
}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
// import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
3
2
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
// NarrowWidePage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
7
|
-
interface NarrowWidePageProps {
|
|
5
|
+
interface NarrowWidePageProps extends PConnProps {
|
|
8
6
|
// If any, enter additional props that only exist on this component
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
icon: string
|
|
7
|
+
title: string;
|
|
8
|
+
templateCol: string;
|
|
9
|
+
icon: string;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
|
-
|
|
16
12
|
/*
|
|
17
13
|
* The wrapper handles knowing how to take in just children and mapping
|
|
18
14
|
* to the Cosmos template.
|
|
19
15
|
*/
|
|
20
|
-
export default function NarrowWidePage(props: NarrowWidePageProps) {
|
|
16
|
+
export default function NarrowWidePage(props: PropsWithChildren<NarrowWidePageProps>) {
|
|
21
17
|
// Get emitted components from map (so we can get any override that may exist)
|
|
22
18
|
const NarrowWide = getComponentFromMap('NarrowWide');
|
|
23
19
|
|
|
24
20
|
const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
|
|
25
|
-
const
|
|
21
|
+
const childrenToRender = children as ReactElement[];
|
|
26
22
|
|
|
27
23
|
return (
|
|
28
24
|
<div>
|
|
29
|
-
|
|
30
|
-
a={childArray[0]}
|
|
31
|
-
b={childArray[1]}
|
|
32
|
-
title={title}
|
|
33
|
-
cols={templateCol}
|
|
34
|
-
icon={icon?.replace("pi pi-", "")}
|
|
35
|
-
/>
|
|
25
|
+
<NarrowWide a={childrenToRender[0]} b={childrenToRender[1]} title={title} cols={templateCol} icon={icon?.replace('pi pi-', '')} />
|
|
36
26
|
</div>
|
|
37
27
|
);
|
|
38
28
|
}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Grid } from
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid } from '@material-ui/core';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
interface OneColumnProps{
|
|
6
|
+
interface OneColumnProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
8
|
-
children: Array<any>
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
|
|
12
10
|
const useStyles = makeStyles((/* theme */) => ({
|
|
13
11
|
colStyles: {
|
|
14
|
-
display:
|
|
15
|
-
gap:
|
|
16
|
-
alignContent:
|
|
17
|
-
}
|
|
12
|
+
display: 'grid',
|
|
13
|
+
gap: '1rem',
|
|
14
|
+
alignContent: 'baseline'
|
|
15
|
+
}
|
|
18
16
|
}));
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
export default function OneColumn(props: OneColumnProps) {
|
|
18
|
+
export default function OneColumn(props: PropsWithChildren<OneColumnProps>) {
|
|
22
19
|
const classes = useStyles();
|
|
23
20
|
|
|
24
|
-
const { children} = props;
|
|
21
|
+
const { children } = props;
|
|
25
22
|
|
|
26
23
|
return (
|
|
27
24
|
<Grid container spacing={2}>
|
|
28
25
|
<Grid item xs={12} className={classes.colStyles}>
|
|
29
|
-
{children.map(child => {
|
|
26
|
+
{(children as ReactElement[]).map(child => {
|
|
27
|
+
return child;
|
|
28
|
+
})}
|
|
30
29
|
</Grid>
|
|
31
30
|
</Grid>
|
|
32
|
-
)
|
|
31
|
+
);
|
|
33
32
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
interface OneColumnPageProps{
|
|
4
|
+
interface OneColumnPageProps extends PConnProps {
|
|
6
5
|
// If any, enter additional props that only exist on this component
|
|
7
|
-
children: Array<any>
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
|
|
11
8
|
/*
|
|
12
9
|
* The wrapper handles knowing how to take in just children
|
|
13
10
|
* and mapping to the TwoColumn template.
|
|
@@ -16,9 +13,5 @@ export default function OneColumnPage(props: OneColumnPageProps) {
|
|
|
16
13
|
// Get emitted components from map (so we can get any override that may exist)
|
|
17
14
|
const OneColumn = getComponentFromMap('OneColumn');
|
|
18
15
|
|
|
19
|
-
return
|
|
20
|
-
<OneColumn
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
16
|
+
return <OneColumn {...props} />;
|
|
24
17
|
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
3
|
|
|
3
|
-
interface OneColumnTabProps{
|
|
4
|
+
interface OneColumnTabProps extends PConnProps {
|
|
4
5
|
// If any, enter additional props that only exist on this component
|
|
5
|
-
children: Array<any>
|
|
6
6
|
}
|
|
7
|
-
export default function OneColumnTab(props: OneColumnTabProps) {
|
|
8
|
-
const { children} = props;
|
|
7
|
+
export default function OneColumnTab(props: PropsWithChildren<OneColumnTabProps>) {
|
|
8
|
+
const { children } = props;
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
<div id="OneColumnTab">
|
|
12
|
-
{children}
|
|
13
|
-
</div>
|
|
14
|
-
)
|
|
10
|
+
return <div id='OneColumnTab'>{children}</div>;
|
|
15
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useMemo, useState, createElement
|
|
1
|
+
import React, { useCallback, useMemo, useState, createElement } from 'react';
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
@@ -6,19 +6,18 @@ import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers
|
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import './PromotedFilters.css';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
10
|
|
|
11
11
|
// Can't use PromotedFilterProps until getContainerManager() knows about addTransientItem
|
|
12
12
|
// Currently just expects "object"
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
interface PromotedFilterProps extends PConnProps {
|
|
14
|
+
// If any, enter additional props that only exist on this component
|
|
15
|
+
viewName: string;
|
|
16
|
+
filters: any[];
|
|
17
|
+
listViewProps: any;
|
|
18
|
+
pageClass: string;
|
|
19
|
+
parameters?: object;
|
|
20
|
+
}
|
|
22
21
|
|
|
23
22
|
const localeCategory = 'SimpleTable';
|
|
24
23
|
const SUPPORTED_TYPES_IN_PROMOTED_FILTERS = [
|
|
@@ -64,10 +63,10 @@ function Filters({ filters, transientItemID, localeReference }) {
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
function isValidInput(input) {
|
|
67
|
-
return Object.values(input).findIndex(
|
|
66
|
+
return Object.values(input).findIndex(v => v) >= 0;
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
export default function PromotedFilters(props
|
|
69
|
+
export default function PromotedFilters(props: PromotedFilterProps) {
|
|
71
70
|
// Get emitted components from map (so we can get any override that may exist)
|
|
72
71
|
const ListView = getComponentFromMap('ListView');
|
|
73
72
|
|
|
@@ -77,7 +76,7 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
|
77
76
|
const [payload, setPayload] = useState({});
|
|
78
77
|
const filtersProperties = {};
|
|
79
78
|
|
|
80
|
-
filters.forEach(
|
|
79
|
+
filters.forEach(filter => {
|
|
81
80
|
filtersProperties[PCore.getAnnotationUtils().getPropertyName(filter.config.value)] = '';
|
|
82
81
|
});
|
|
83
82
|
|
|
@@ -99,7 +98,7 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
|
99
98
|
lhs: {
|
|
100
99
|
field
|
|
101
100
|
},
|
|
102
|
-
comparator:
|
|
101
|
+
comparator: 'EQ',
|
|
103
102
|
rhs: {
|
|
104
103
|
value
|
|
105
104
|
}
|
|
@@ -110,12 +109,12 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
const getFilterData = useCallback(
|
|
113
|
-
|
|
112
|
+
e => {
|
|
114
113
|
e.preventDefault(); // to prevent un-intended forms submission.
|
|
115
114
|
|
|
116
115
|
const changes = PCore.getFormUtils().getChanges(transientItemID);
|
|
117
116
|
const formValues = {};
|
|
118
|
-
Object.keys(changes).forEach(
|
|
117
|
+
Object.keys(changes).forEach(key => {
|
|
119
118
|
if (!['context_data', 'pageInstructions'].includes(key)) {
|
|
120
119
|
formValues[key] = changes[key];
|
|
121
120
|
}
|
|
@@ -143,25 +142,30 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
|
143
142
|
}, [transientItemID]);
|
|
144
143
|
|
|
145
144
|
return (
|
|
146
|
-
|
|
145
|
+
<>
|
|
147
146
|
<div>{listViewProps.title}</div>
|
|
148
|
-
<div className=
|
|
149
|
-
<Filters filters={filters} transientItemID={transientItemID} localeReference={listViewProps.localeReference}/>
|
|
147
|
+
<div className='psdk-grid-filter'>
|
|
148
|
+
<Filters filters={filters} transientItemID={transientItemID} localeReference={listViewProps.localeReference} />
|
|
150
149
|
</div>
|
|
151
150
|
<div>
|
|
152
151
|
<Button key='1' type='button' onClick={clearFilterData} data-testid='clear' variant='contained' color='primary'>
|
|
153
152
|
{localizedVal('Clear', localeCategory)}
|
|
154
153
|
</Button>
|
|
155
|
-
<Button style={{float: 'right'}} key='2' type='submit' onClick={getFilterData} data-testid='search' variant='contained' color='primary'>
|
|
154
|
+
<Button style={{ float: 'right' }} key='2' type='submit' onClick={getFilterData} data-testid='search' variant='contained' color='primary'>
|
|
156
155
|
{localizedVal('Search', localeCategory)}
|
|
157
156
|
</Button>
|
|
158
157
|
</div>
|
|
159
|
-
{initTable &&
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
{initTable && (
|
|
159
|
+
<ListView
|
|
160
|
+
{...listViewProps}
|
|
161
|
+
title=''
|
|
162
|
+
payload={payload}
|
|
163
|
+
isSearchable
|
|
164
|
+
tableDisplay={{
|
|
165
|
+
show: initTable
|
|
166
|
+
}}
|
|
167
|
+
/>
|
|
168
|
+
)}
|
|
169
|
+
</>
|
|
166
170
|
);
|
|
167
171
|
}
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
|
|
4
2
|
import { useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
8
|
|
|
9
9
|
// Can't use SimpleTableProps until getComponentConfig() and getFieldMetadata() are NOT private
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
interface SimpleTableProps extends PConnProps {
|
|
11
|
+
// If any, enter additional props that only exist on this component
|
|
12
|
+
multiRecordDisplayAs: string;
|
|
13
|
+
allowTableEdit: boolean;
|
|
14
|
+
contextClass: any;
|
|
15
|
+
label: string;
|
|
16
|
+
propertyLabel?: string;
|
|
17
|
+
displayMode?: string;
|
|
18
|
+
fieldMetadata?: any;
|
|
19
|
+
hideLabel?: boolean;
|
|
20
|
+
parameters?: any;
|
|
21
|
+
isDataObject?: boolean;
|
|
22
|
+
type?: string;
|
|
23
|
+
ruleClass?: string;
|
|
24
|
+
authorContext?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
}
|
|
17
27
|
|
|
18
|
-
export default function SimpleTable(props
|
|
28
|
+
export default function SimpleTable(props: SimpleTableProps) {
|
|
19
29
|
// Get emitted components from map (so we can get any override that may exist)
|
|
20
30
|
const ListView = getComponentFromMap('ListView');
|
|
21
31
|
const FieldGroupTemplate = getComponentFromMap('FieldGroupTemplate');
|
|
@@ -40,12 +50,14 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
|
40
50
|
|
|
41
51
|
let { contextClass } = props;
|
|
42
52
|
if (!contextClass) {
|
|
53
|
+
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
|
|
43
54
|
let listName = getPConnect().getComponentConfig().referenceList;
|
|
44
55
|
listName = PCore.getAnnotationUtils().getPropertyName(listName);
|
|
45
56
|
// was... contextClass = getPConnect().getFieldMetadata(listName)?.pageClass;
|
|
57
|
+
// @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
|
|
46
58
|
const theFieldMetadata = getPConnect().getFieldMetadata(listName);
|
|
47
59
|
if (theFieldMetadata) {
|
|
48
|
-
contextClass = theFieldMetadata
|
|
60
|
+
contextClass = theFieldMetadata.pageClass;
|
|
49
61
|
} else {
|
|
50
62
|
contextClass = undefined;
|
|
51
63
|
}
|
|
@@ -59,15 +71,11 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
|
59
71
|
const propsToUse = { label, ...getPConnect().getInheritedProps() };
|
|
60
72
|
const isDisplayModeEnabled = displayMode === 'DISPLAY_ONLY';
|
|
61
73
|
|
|
62
|
-
if (
|
|
63
|
-
fieldMetadata &&
|
|
64
|
-
fieldMetadata.type === 'Page List' &&
|
|
65
|
-
fieldMetadata.dataRetrievalType === 'refer'
|
|
66
|
-
) {
|
|
74
|
+
if (fieldMetadata && fieldMetadata.type === 'Page List' && fieldMetadata.dataRetrievalType === 'refer') {
|
|
67
75
|
const {
|
|
68
76
|
children: [{ children: rawFields }],
|
|
69
77
|
parameters: rawParams
|
|
70
|
-
} = getPConnect().getRawMetadata().config;
|
|
78
|
+
} = (getPConnect().getRawMetadata() as any).config;
|
|
71
79
|
if (isDisplayModeEnabled && hideLabel) {
|
|
72
80
|
propsToUse.label = '';
|
|
73
81
|
}
|
|
@@ -84,8 +92,8 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
|
84
92
|
);
|
|
85
93
|
|
|
86
94
|
const metaForPConnect = JSON.parse(JSON.stringify(metaForListView));
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
// @ts-ignore - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided.
|
|
96
|
+
metaForPConnect.config.parameters = rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
|
|
89
97
|
|
|
90
98
|
const { referenceListStr: referenceList } = getContext(getPConnect());
|
|
91
99
|
let requiredContextForQueryInDisplayMode = {};
|
|
@@ -100,9 +108,7 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
|
100
108
|
...requiredContextForQueryInDisplayMode
|
|
101
109
|
};
|
|
102
110
|
|
|
103
|
-
const refToPConnect = useRef(
|
|
104
|
-
PCore.createPConnect({ meta: metaForPConnect, options }).getPConnect
|
|
105
|
-
).current; // getPConnect should be created only once.
|
|
111
|
+
const refToPConnect = useRef(PCore.createPConnect({ meta: metaForPConnect, options }).getPConnect).current; // getPConnect should be created only once.
|
|
106
112
|
/* BUG-637178 : need to send context */
|
|
107
113
|
const listViewProps = {
|
|
108
114
|
...metaForListView.config,
|
|
@@ -111,15 +117,13 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
|
111
117
|
fieldName: authorContext,
|
|
112
118
|
bInForm: true
|
|
113
119
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
simpleTableManualProps.disableDragDrop = true;
|
|
122
|
-
}
|
|
123
|
-
return <SimpleTableManual {...simpleTableManualProps} />;
|
|
120
|
+
return <ListView {...listViewProps} />;
|
|
121
|
+
}
|
|
122
|
+
const simpleTableManualProps: any = { ...props, contextClass };
|
|
123
|
+
if (allowTableEdit === false) {
|
|
124
|
+
simpleTableManualProps.hideAddRow = true;
|
|
125
|
+
simpleTableManualProps.hideDeleteRow = true;
|
|
126
|
+
simpleTableManualProps.disableDragDrop = true;
|
|
124
127
|
}
|
|
128
|
+
return <SimpleTableManual {...simpleTableManualProps} />;
|
|
125
129
|
}
|