@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,14 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { GridSize } from '@material-ui/core/Grid';
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import Grid, { GridSize } from '@material-ui/core/Grid';
|
|
3
|
+
|
|
5
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
6
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
7
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
|
|
9
|
+
interface WideNarrowDetailsProps extends PConnProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
showHighlightedData?: boolean;
|
|
14
|
+
}
|
|
7
15
|
|
|
8
16
|
const COLUMN_WIDTHS = [8, 4];
|
|
9
17
|
|
|
10
|
-
export default function WideNarrowDetails(props) {
|
|
11
|
-
|
|
18
|
+
export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
19
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
21
|
+
|
|
22
|
+
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
12
23
|
|
|
13
24
|
// Get the inherited props from the parent to determine label settings
|
|
14
25
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
@@ -17,20 +28,23 @@ export default function WideNarrowDetails(props) {
|
|
|
17
28
|
// in a readonly (display) mode instead of a editable
|
|
18
29
|
getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
19
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
20
|
-
const children = getPConnect()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
const children = (getPConnect().getChildren() as any[])?.map((configObject, index) => {
|
|
32
|
+
let theConfigObject: object = configObject;
|
|
33
|
+
if (!theConfigObject) {
|
|
34
|
+
theConfigObject = {};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return createElement(createPConnectComponent(), {
|
|
38
|
+
...theConfigObject,
|
|
39
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
40
|
+
key: index.toString()
|
|
41
|
+
});
|
|
42
|
+
});
|
|
29
43
|
|
|
30
44
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
31
45
|
let highlightedDataArr = [];
|
|
32
46
|
if (showHighlightedData) {
|
|
33
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
47
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
|
|
34
48
|
highlightedDataArr = highlightedData.map(field => {
|
|
35
49
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
36
50
|
|
|
@@ -40,12 +54,17 @@ export default function WideNarrowDetails(props) {
|
|
|
40
54
|
field.config.displayAsStatus = true;
|
|
41
55
|
}
|
|
42
56
|
|
|
43
|
-
return getPConnect().createComponent(field);
|
|
57
|
+
return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
44
58
|
});
|
|
45
59
|
}
|
|
46
60
|
|
|
61
|
+
let theName = '';
|
|
62
|
+
if (propsToUse?.showLabel && propsToUse.label) {
|
|
63
|
+
theName = propsToUse.label;
|
|
64
|
+
}
|
|
65
|
+
|
|
47
66
|
return (
|
|
48
|
-
<FieldGroup name={
|
|
67
|
+
<FieldGroup name={theName}>
|
|
49
68
|
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
50
69
|
<Grid container spacing={1} style={{ padding: '0 0 1em' }}>
|
|
51
70
|
{highlightedDataArr.map((child, i) => (
|
|
@@ -56,7 +75,7 @@ export default function WideNarrowDetails(props) {
|
|
|
56
75
|
</Grid>
|
|
57
76
|
)}
|
|
58
77
|
<Grid container spacing={1}>
|
|
59
|
-
{children
|
|
78
|
+
{children?.map((child, i) => (
|
|
60
79
|
<Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`r-${i + 1}`}>
|
|
61
80
|
{child}
|
|
62
81
|
</Grid>
|
|
@@ -65,16 +84,3 @@ export default function WideNarrowDetails(props) {
|
|
|
65
84
|
</FieldGroup>
|
|
66
85
|
);
|
|
67
86
|
}
|
|
68
|
-
|
|
69
|
-
WideNarrowDetails.defaultProps = {
|
|
70
|
-
label: undefined,
|
|
71
|
-
showLabel: true,
|
|
72
|
-
showHighlightedData: false
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
WideNarrowDetails.propTypes = {
|
|
76
|
-
showLabel: PropTypes.bool,
|
|
77
|
-
label: PropTypes.string,
|
|
78
|
-
getPConnect: PropTypes.func.isRequired,
|
|
79
|
-
showHighlightedData: PropTypes.bool
|
|
80
|
-
};
|
|
@@ -1,24 +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 './WideNarrowForm.css';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interface WideNarrowFormProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function WideNarrowForm(props: PropsWithChildren<WideNarrowFormProps>) {
|
|
10
|
+
const { children } = props;
|
|
7
11
|
|
|
8
12
|
return (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{children[
|
|
13
|
+
<>
|
|
14
|
+
{children && (children as ReactElement[]).length === 2 && (
|
|
15
|
+
<div className='psdk-wide-narrow-column'>
|
|
16
|
+
<div className='psdk-wide-column-column'>{children[0]}</div>
|
|
17
|
+
<div className='psdk-narrow-column-column'>{children[1]}</div>
|
|
14
18
|
</div>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</div>
|
|
19
|
-
}
|
|
20
|
-
</React.Fragment>
|
|
21
|
-
|
|
22
|
-
)
|
|
23
|
-
|
|
19
|
+
)}
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
24
22
|
}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Children, PropsWithChildren } from 'react';
|
|
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';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
interface WideNarrowPageProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
title: string;
|
|
8
|
+
templateCol?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
/*
|
|
8
13
|
* The wrapper handles knowing how to take in just children and mapping
|
|
9
14
|
* to the Cosmos template.
|
|
10
15
|
*/
|
|
11
|
-
export default function WideNarrowPage(props) {
|
|
12
|
-
|
|
16
|
+
export default function WideNarrowPage(props: PropsWithChildren<WideNarrowPageProps>) {
|
|
17
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
18
|
+
const WideNarrow = getComponentFromMap('WideNarrow');
|
|
19
|
+
|
|
20
|
+
const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
|
|
13
21
|
const childArray = Children.toArray(children);
|
|
14
22
|
|
|
15
23
|
return (
|
|
16
24
|
<div>
|
|
17
|
-
|
|
18
|
-
a={childArray[0]}
|
|
19
|
-
b={childArray[1]}
|
|
20
|
-
title={title}
|
|
21
|
-
cols={templateCol}
|
|
22
|
-
icon={icon?.replace("pi pi-", "")}
|
|
23
|
-
/>
|
|
25
|
+
<WideNarrow a={childArray[0]} b={childArray[1]} title={title} cols={templateCol} icon={icon?.replace('pi pi-', '')} />
|
|
24
26
|
</div>
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
|
-
|
|
28
|
-
WideNarrowPage.propTypes = {
|
|
29
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
30
|
-
title: PropTypes.string.isRequired,
|
|
31
|
-
templateCol: PropTypes.string,
|
|
32
|
-
icon: PropTypes.string
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
WideNarrowPage.defaultProps = {
|
|
36
|
-
templateCol: "1fr 1fr",
|
|
37
|
-
icon: ""
|
|
38
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './WideNarrowPage';
|
|
1
|
+
export { default } from './WideNarrowPage';
|
|
@@ -4,13 +4,27 @@ import AppBar from '@material-ui/core/AppBar';
|
|
|
4
4
|
import Box from '@material-ui/core/Box';
|
|
5
5
|
import Toolbar from '@material-ui/core/Toolbar';
|
|
6
6
|
import Container from '@material-ui/core/Container';
|
|
7
|
-
import { IconButton, Menu, MenuItem, Typography } from '@material-ui/core';
|
|
8
|
-
import { Button } from '@material-ui/core';
|
|
7
|
+
import { IconButton, Menu, MenuItem, Typography, Button } from '@material-ui/core';
|
|
9
8
|
import Avatar from '@material-ui/core/Avatar';
|
|
10
9
|
import MenuIcon from '@material-ui/icons/Menu';
|
|
11
|
-
import { logout } from '@pega/
|
|
10
|
+
import { logout } from '@pega/auth/lib/sdk-auth-manager';
|
|
11
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
12
|
import './WssNavBar.css';
|
|
13
13
|
|
|
14
|
+
interface WssNavBarProps extends PConnProps {
|
|
15
|
+
// If any, enter additional props that only exist on this component
|
|
16
|
+
appInfo: any;
|
|
17
|
+
navLinks: any[];
|
|
18
|
+
operator: { currentUserInitials: string };
|
|
19
|
+
navDisplayOptions: { alignment: string; position: string };
|
|
20
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
21
|
+
portalName: string;
|
|
22
|
+
imageSrc: string;
|
|
23
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
24
|
+
fullImageSrc: string;
|
|
25
|
+
appName: any;
|
|
26
|
+
}
|
|
27
|
+
|
|
14
28
|
const useStyles = makeStyles(theme => ({
|
|
15
29
|
root: {
|
|
16
30
|
display: 'flex'
|
|
@@ -32,9 +46,9 @@ const useStyles = makeStyles(theme => ({
|
|
|
32
46
|
}
|
|
33
47
|
}));
|
|
34
48
|
|
|
35
|
-
export default function WssNavBar(props) {
|
|
49
|
+
export default function WssNavBar(props: WssNavBarProps) {
|
|
36
50
|
const { appInfo, navLinks, operator, navDisplayOptions } = props;
|
|
37
|
-
const { alignment } = navDisplayOptions;
|
|
51
|
+
const { alignment, position } = navDisplayOptions;
|
|
38
52
|
const classes = useStyles();
|
|
39
53
|
|
|
40
54
|
const [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);
|
|
@@ -55,12 +69,22 @@ export default function WssNavBar(props) {
|
|
|
55
69
|
setAnchorElUser(null);
|
|
56
70
|
};
|
|
57
71
|
|
|
72
|
+
const navLinksContent = (
|
|
73
|
+
<Box id='nav-links' sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }} style={{ justifyContent: alignment }}>
|
|
74
|
+
{navLinks.map(link => (
|
|
75
|
+
<Button className='link-style' key={link.text} onClick={link.onClick}>
|
|
76
|
+
{link.text}
|
|
77
|
+
</Button>
|
|
78
|
+
))}
|
|
79
|
+
</Box>
|
|
80
|
+
);
|
|
81
|
+
|
|
58
82
|
return (
|
|
59
83
|
<div id='NavBar' className='nav-bar'>
|
|
60
84
|
<AppBar position='static' color='primary'>
|
|
61
85
|
<Container maxWidth='xl'>
|
|
62
|
-
<Toolbar disableGutters>
|
|
63
|
-
<Button style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>
|
|
86
|
+
<Toolbar disableGutters style={{ justifyContent: 'space-between' }}>
|
|
87
|
+
<Button id='appName' style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>
|
|
64
88
|
<img src={appInfo.imageSrc} className={classes.appListLogo} />
|
|
65
89
|
<span className={classes.appName}>{appInfo.appName}</span>
|
|
66
90
|
</Button>
|
|
@@ -98,16 +122,7 @@ export default function WssNavBar(props) {
|
|
|
98
122
|
</Menu>
|
|
99
123
|
</Box>
|
|
100
124
|
|
|
101
|
-
|
|
102
|
-
sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }}
|
|
103
|
-
style={{ justifyContent: alignment }}
|
|
104
|
-
>
|
|
105
|
-
{navLinks.map(link => (
|
|
106
|
-
<Button className='link-style' key={link.text} onClick={link.onClick}>
|
|
107
|
-
{link.text}
|
|
108
|
-
</Button>
|
|
109
|
-
))}
|
|
110
|
-
</Box>
|
|
125
|
+
{position === 'inline' && <>{navLinksContent}</>}
|
|
111
126
|
|
|
112
127
|
<Box sx={{ flexGrow: 0 }}>
|
|
113
128
|
<IconButton onClick={handleOpenUserMenu}>
|
|
@@ -134,6 +149,7 @@ export default function WssNavBar(props) {
|
|
|
134
149
|
</Menu>
|
|
135
150
|
</Box>
|
|
136
151
|
</Toolbar>
|
|
152
|
+
{position === 'below' && <>{navLinksContent}</>}
|
|
137
153
|
</Container>
|
|
138
154
|
</AppBar>
|
|
139
155
|
</div>
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from "@material-ui/core";
|
|
1
|
+
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@material-ui/core';
|
|
4
2
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
interface AppAnnouncementProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
header?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
datasource?: any;
|
|
10
|
+
whatsnewlink?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const useStyles = makeStyles(theme => ({
|
|
7
14
|
root: {
|
|
8
15
|
marginTop: theme.spacing(1),
|
|
9
16
|
marginBottom: theme.spacing(1),
|
|
10
|
-
borderLeft:
|
|
17
|
+
borderLeft: '6px solid',
|
|
11
18
|
borderLeftColor: theme.palette.primary.light
|
|
12
|
-
}
|
|
19
|
+
}
|
|
13
20
|
}));
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
const { header, description, datasource, whatsnewlink } = props;
|
|
22
|
+
export default function AppAnnouncement(props: AppAnnouncementProps) {
|
|
23
|
+
const { header = '', description = '', datasource = [], whatsnewlink = '' } = props;
|
|
17
24
|
let details = [];
|
|
18
25
|
if (datasource && datasource.source) {
|
|
19
|
-
details = datasource.source.map(
|
|
26
|
+
details = datasource.source.map(item => {
|
|
20
27
|
return item.name;
|
|
21
28
|
});
|
|
22
29
|
}
|
|
@@ -25,43 +32,29 @@ const AppAnnouncement = (props) => {
|
|
|
25
32
|
|
|
26
33
|
const handleClick = () => {
|
|
27
34
|
window.open(whatsnewlink);
|
|
28
|
-
}
|
|
35
|
+
};
|
|
29
36
|
|
|
30
37
|
return (
|
|
31
|
-
<Card title=
|
|
32
|
-
<CardHeader title={<Typography variant=
|
|
38
|
+
<Card title='AppAnnouncement' className={classes.root}>
|
|
39
|
+
<CardHeader title={<Typography variant='h6'>{header}</Typography>} />
|
|
33
40
|
<CardContent>
|
|
34
|
-
<Typography variant=
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
<Typography variant='body1' gutterBottom>
|
|
42
|
+
{description}
|
|
43
|
+
</Typography>
|
|
44
|
+
{details.map((itm, idx) => {
|
|
45
|
+
const theKey = `AppAnn-item-${idx}`;
|
|
46
|
+
return (
|
|
47
|
+
<Typography key={theKey} variant='body2'>
|
|
48
|
+
- {itm}
|
|
49
|
+
</Typography>
|
|
50
|
+
);
|
|
51
|
+
})}
|
|
43
52
|
</CardContent>
|
|
44
53
|
<CardActions>
|
|
45
|
-
<Button color=
|
|
54
|
+
<Button color='primary' onClick={handleClick} size='small'>
|
|
55
|
+
See what's new
|
|
56
|
+
</Button>
|
|
46
57
|
</CardActions>
|
|
47
58
|
</Card>
|
|
48
59
|
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
AppAnnouncement.propTypes = {
|
|
52
|
-
header: PropTypes.string,
|
|
53
|
-
description: PropTypes.string,
|
|
54
|
-
datasource: PropTypes.instanceOf(Object),
|
|
55
|
-
whatsnewlink: PropTypes.string,
|
|
56
|
-
// image: PropTypes.string
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
AppAnnouncement.defaultProps = {
|
|
60
|
-
header: "",
|
|
61
|
-
description: "",
|
|
62
|
-
// image: "",
|
|
63
|
-
datasource: [],
|
|
64
|
-
whatsnewlink: ""
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default AppAnnouncement;
|
|
60
|
+
}
|
|
@@ -4,7 +4,15 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.file-div {
|
|
7
|
-
border: 1px dashed
|
|
7
|
+
border: 1px dashed var(--app-neutral-dark-color);
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding: 0.5rem;
|
|
10
|
+
text-align: center;
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.file-div-error {
|
|
15
|
+
border: 1px dashed var(--app-error-color);
|
|
8
16
|
width: 100%;
|
|
9
17
|
padding: 0.5rem;
|
|
10
18
|
text-align: center;
|
|
@@ -17,9 +25,72 @@
|
|
|
17
25
|
left: 47%;
|
|
18
26
|
}
|
|
19
27
|
|
|
20
|
-
file-label::after {
|
|
28
|
+
.file-label::after {
|
|
21
29
|
display: inline;
|
|
22
|
-
content:
|
|
30
|
+
content: ' *';
|
|
23
31
|
vertical-align: top;
|
|
24
|
-
color:
|
|
32
|
+
color: var(--app-neutral-dark-color);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.file-error {
|
|
36
|
+
color: var(--app-error-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.psdk-utility-card {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: row;
|
|
42
|
+
padding: 0.25rem 0rem 0.25rem 0.25rem;
|
|
43
|
+
margin-bottom: 0.5rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.psdk-utility-card-icon {
|
|
47
|
+
flex-grow: 1;
|
|
48
|
+
max-width: 2.813rem;
|
|
49
|
+
align-content: center;
|
|
50
|
+
display: flex;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.psdk-utility-card-svg-icon {
|
|
54
|
+
width: 2.5rem;
|
|
55
|
+
display: inline-block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.psdk-utility-card-main {
|
|
59
|
+
flex-grow: 2;
|
|
60
|
+
margin-left: 5px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.psdk-utility-card-main-primary-label {
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
text-overflow: ellipsis;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
white-space: normal;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.psdk-utility-card-action-svg-icon {
|
|
71
|
+
width: 1.4rem;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.psdk-utility-card {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
border: 0.0625rem solid rgb(207, 207, 207);
|
|
79
|
+
border-radius: calc(0.25rem);
|
|
80
|
+
min-height: 3rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.psdk-utility-button {
|
|
84
|
+
background: none;
|
|
85
|
+
border: none;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.psdk-utility-action {
|
|
90
|
+
flex-grow: 1;
|
|
91
|
+
text-align: right;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.file-disabled {
|
|
95
|
+
opacity: 0.4;
|
|
25
96
|
}
|