@pega/react-sdk-overrides 8.8.21 → 8.23.11-debug
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/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +9 -13
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -12
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +10 -15
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -10
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +3 -10
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +3 -11
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +3 -11
- package/lib/designSystemExtension/Operator/Operator.tsx +12 -16
- package/lib/designSystemExtension/Pulse/Pulse.tsx +7 -11
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -10
- package/lib/field/AutoComplete/AutoComplete.tsx +18 -37
- package/lib/field/CancelAlert/CancelAlert.tsx +4 -9
- package/lib/field/Checkbox/Checkbox.tsx +16 -39
- package/lib/field/Currency/Currency.tsx +15 -23
- package/lib/field/Currency/currency-utils.ts +5 -1
- package/lib/field/Date/Date.tsx +15 -22
- package/lib/field/DateTime/DateTime.tsx +14 -25
- package/lib/field/Decimal/Decimal.tsx +14 -25
- package/lib/field/Dropdown/Dropdown.tsx +26 -30
- package/lib/field/Email/Email.tsx +9 -17
- package/lib/field/Integer/Integer.tsx +7 -15
- package/lib/field/Percentage/Percentage.tsx +7 -15
- package/lib/field/Phone/Phone.tsx +11 -19
- package/lib/field/RadioButtons/RadioButtons.tsx +37 -25
- package/lib/field/SemanticLink/SemanticLink.tsx +25 -26
- package/lib/field/TextArea/TextArea.tsx +5 -14
- package/lib/field/TextContent/TextContent.tsx +1 -10
- package/lib/field/TextInput/TextInput.tsx +6 -15
- package/lib/field/Time/Time.tsx +27 -22
- package/lib/field/URL/URL.tsx +8 -16
- package/lib/field/UserReference/UserReference.tsx +60 -50
- package/lib/helpers/attachmentHelpers.ts +4 -4
- package/lib/helpers/auth.js +397 -741
- package/lib/helpers/authManager.js +634 -0
- package/lib/helpers/case-utils.tsx +9 -8
- package/lib/helpers/common-utils.ts +1 -1
- package/lib/helpers/config_access.js +73 -0
- package/lib/helpers/date-format-utils.ts +1 -1
- package/lib/helpers/event-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +11 -11
- package/lib/helpers/formatters/CurrencyMap.ts +5 -8
- package/lib/helpers/formatters/Date.ts +1 -1
- package/lib/helpers/formatters/common.ts +6 -2
- package/lib/helpers/formatters/index.ts +3 -3
- package/lib/helpers/simpleTableHelpers.ts +7 -7
- package/lib/helpers/state-utils.tsx +3 -0
- package/lib/helpers/template-utils.ts +6 -3
- package/lib/helpers/versionHelpers.ts +3 -0
- package/lib/infra/ActionButtons/ActionButtons.tsx +19 -9
- package/lib/infra/Assignment/Assignment.tsx +28 -21
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -15
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +58 -57
- package/lib/infra/Containers/FlowContainer/helpers.ts +3 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +19 -14
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -14
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -13
- package/lib/infra/DashboardFilter/filterUtils.tsx +1 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +20 -14
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +14 -10
- package/lib/infra/MultiStep/MultiStep.tsx +22 -22
- package/lib/infra/NavBar/NavBar.tsx +21 -14
- package/lib/infra/Reference/Reference.tsx +18 -13
- package/lib/infra/Region/Region.tsx +6 -8
- package/lib/infra/RootContainer/RootContainer.tsx +25 -16
- package/lib/infra/Stages/Stages.tsx +8 -10
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -8
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
- package/lib/infra/View/View.tsx +22 -21
- package/lib/template/AppShell/AppShell.tsx +25 -36
- package/lib/template/BannerPage/BannerPage.tsx +31 -26
- package/lib/template/CaseSummary/CaseSummary.tsx +8 -15
- package/lib/template/CaseView/CaseView.tsx +25 -24
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +19 -10
- package/lib/template/Confirmation/Confirmation.tsx +53 -27
- package/lib/template/DataReference/DataReference.tsx +52 -48
- package/lib/template/DefaultForm/DefaultForm.tsx +12 -14
- package/lib/template/Details/Details/Details.tsx +17 -16
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +16 -13
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +18 -19
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +18 -20
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +28 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +7 -11
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +17 -19
- package/lib/template/ListPage/ListPage.tsx +13 -14
- package/lib/template/ListView/ListView.tsx +186 -189
- package/lib/template/ListView/utils.ts +23 -170
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +19 -10
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +1 -16
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +18 -19
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +1 -9
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -8
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +7 -5
- package/lib/template/PromotedFilters/PromotedFilters.tsx +14 -16
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -102
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +7 -24
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -23
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +36 -34
- package/lib/template/SubTabs/SubTabs.tsx +11 -10
- package/lib/template/SubTabs/tabUtils.ts +4 -0
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +15 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +12 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +3 -17
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +25 -35
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +1 -7
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +17 -15
- package/lib/template/WssNavBar/WssNavBar.tsx +1 -18
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +21 -13
- package/lib/widget/Attachment/Attachment.tsx +16 -28
- package/lib/widget/CaseHistory/CaseHistory.tsx +10 -12
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -13
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +22 -35
- package/lib/widget/Followers/Followers.tsx +11 -10
- package/lib/widget/QuickCreate/QuickCreate.tsx +5 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +1 -11
- package/lib/widget/SummaryList/SummaryList.tsx +3 -17
- package/lib/widget/ToDo/ToDo.tsx +105 -62
- package/package.json +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +0 -121
- package/lib/designSystemExtension/RichTextEditor/index.tsx +0 -1
- package/lib/field/RichText/RichText.tsx +0 -93
- package/lib/field/RichText/index.tsx +0 -1
- package/lib/field/ScalarList/ScalarList.tsx +0 -64
- package/lib/field/ScalarList/config-ext.json +0 -8
- package/lib/field/ScalarList/index.tsx +0 -1
- package/lib/helpers/authManager.ts +0 -933
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
4
5
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
6
|
import './NavBar.css';
|
|
6
7
|
import {
|
|
@@ -34,23 +35,14 @@ import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
|
34
35
|
import { useNavBar } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
35
36
|
import { logout } from '@pega/react-sdk-components/lib/components/helpers/authManager';
|
|
36
37
|
|
|
37
|
-
import
|
|
38
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
interface NavBarProps extends PConnProps {
|
|
41
|
-
// If any, enter additional props that only exist on this component
|
|
42
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
43
|
-
appName?: string,
|
|
44
|
-
pages?: Array<any>,
|
|
45
|
-
caseTypes: Array<any>,
|
|
46
|
-
pConn?: any
|
|
47
|
-
}
|
|
40
|
+
declare const PCore: typeof PCoreType;
|
|
48
41
|
|
|
49
42
|
|
|
50
43
|
const iconMap = {
|
|
51
44
|
'pi pi-headline': <HomeOutlinedIcon fontSize='large' />,
|
|
52
|
-
'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large'
|
|
53
|
-
'pi pi-home-solid': <HomeOutlinedIcon fontSize='large' />
|
|
45
|
+
'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />
|
|
54
46
|
};
|
|
55
47
|
|
|
56
48
|
const drawerWidth = 300;
|
|
@@ -106,8 +98,8 @@ const useStyles = makeStyles(theme => ({
|
|
|
106
98
|
}
|
|
107
99
|
}));
|
|
108
100
|
|
|
109
|
-
export default function NavBar(props
|
|
110
|
-
const { pConn, pages
|
|
101
|
+
export default function NavBar(props) {
|
|
102
|
+
const { pConn, pages, caseTypes } = props;
|
|
111
103
|
|
|
112
104
|
const classes = useStyles();
|
|
113
105
|
const theme = useTheme();
|
|
@@ -300,3 +292,18 @@ export default function NavBar(props: NavBarProps) {
|
|
|
300
292
|
</Drawer>
|
|
301
293
|
);
|
|
302
294
|
}
|
|
295
|
+
|
|
296
|
+
NavBar.defaultProps = {
|
|
297
|
+
pConn: null,
|
|
298
|
+
appName: '',
|
|
299
|
+
pages: [],
|
|
300
|
+
caseTypes: []
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
NavBar.propTypes = {
|
|
304
|
+
pConn: PropTypes.object,
|
|
305
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
306
|
+
appName: PropTypes.string,
|
|
307
|
+
pages: PropTypes.arrayOf(PropTypes.object),
|
|
308
|
+
caseTypes: PropTypes.arrayOf(PropTypes.object)
|
|
309
|
+
};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface ReferenceProps extends PConnProps {
|
|
6
|
-
// If any, enter additional props that only exist on this component
|
|
7
|
-
visibility?: boolean,
|
|
8
|
-
context?: string,
|
|
9
|
-
readOnly?: boolean,
|
|
10
|
-
displayMode?: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export default function Reference(props: ReferenceProps) {
|
|
15
|
-
const { visibility = true, context = '', getPConnect, readOnly = false, displayMode = '' } = props;
|
|
4
|
+
export default function Reference(props) {
|
|
5
|
+
const { visibility, context, getPConnect, readOnly, displayMode } = props;
|
|
16
6
|
|
|
17
7
|
const pConnect = getPConnect();
|
|
18
8
|
const referenceConfig = { ...pConnect.getComponentConfig() } || {};
|
|
@@ -51,3 +41,18 @@ export default function Reference(props: ReferenceProps) {
|
|
|
51
41
|
}
|
|
52
42
|
return null;
|
|
53
43
|
}
|
|
44
|
+
|
|
45
|
+
Reference.defaultProps = {
|
|
46
|
+
visibility: true,
|
|
47
|
+
context: null,
|
|
48
|
+
readOnly: false,
|
|
49
|
+
displayMode: null
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
Reference.propTypes = {
|
|
53
|
+
getPConnect: PropTypes.func.isRequired,
|
|
54
|
+
visibility: PropTypes.bool,
|
|
55
|
+
context: PropTypes.string,
|
|
56
|
+
readOnly: PropTypes.bool,
|
|
57
|
+
displayMode: PropTypes.string
|
|
58
|
+
};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
interface RegionProps {
|
|
5
|
-
// If any, enter additional props that only exist on this component
|
|
6
|
-
children: Array<any>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export default function Region(props: RegionProps) {
|
|
4
|
+
export default function Region(props) {
|
|
11
5
|
const { children } = props;
|
|
12
6
|
|
|
13
7
|
return <React.Fragment>
|
|
@@ -17,3 +11,7 @@ export default function Region(props: RegionProps) {
|
|
|
17
11
|
</>
|
|
18
12
|
</React.Fragment>;
|
|
19
13
|
}
|
|
14
|
+
|
|
15
|
+
Region.propTypes = {
|
|
16
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired
|
|
17
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useRef, useState, useEffect, useContext, createElement } from "react";
|
|
2
2
|
// import { Banner, ModalManager } from "@pega/cosmos-react-core";
|
|
3
|
+
import PropTypes, { object } from "prop-types";
|
|
3
4
|
import isEqual from 'lodash.isequal';
|
|
4
5
|
// import ReAuthMessageModal from "../ReAuthenticationModal";
|
|
5
6
|
import { Box, CircularProgress } from "@material-ui/core";
|
|
@@ -8,18 +9,6 @@ import { LazyMap as LazyComponentMap } from "@pega/react-sdk-components/lib/comp
|
|
|
8
9
|
import StoreContext from "@pega/react-sdk-components/lib/bridge/Context/StoreContext";
|
|
9
10
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
10
11
|
|
|
11
|
-
// import type { PConnProps } from '../../../types/PConnProps';
|
|
12
|
-
|
|
13
|
-
// Can't use RootContainerProps until getChildren() typedef is fixes to not return an array of 'never'
|
|
14
|
-
// interface RootContainerProps extends PConnProps {
|
|
15
|
-
// // If any, enter additional props that only exist on this component
|
|
16
|
-
// renderingMode?: string,
|
|
17
|
-
// routingInfo: { type: string, accessedOrder: Array<any>, items: any },
|
|
18
|
-
// children: Array<any>,
|
|
19
|
-
// skeleton: any,
|
|
20
|
-
// httpMessages: Array<any>
|
|
21
|
-
// }
|
|
22
|
-
|
|
23
12
|
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
|
|
24
13
|
declare const PCore: any;
|
|
25
14
|
|
|
@@ -59,13 +48,13 @@ function getItemView(routingInfo, renderingMode) {
|
|
|
59
48
|
return viewConfigs;
|
|
60
49
|
}
|
|
61
50
|
|
|
62
|
-
|
|
51
|
+
const RootContainer = (props) => {
|
|
63
52
|
const {
|
|
64
53
|
getPConnect,
|
|
65
|
-
renderingMode
|
|
66
|
-
children
|
|
54
|
+
renderingMode,
|
|
55
|
+
children,
|
|
67
56
|
skeleton,
|
|
68
|
-
httpMessages
|
|
57
|
+
httpMessages,
|
|
69
58
|
routingInfo
|
|
70
59
|
} = props;
|
|
71
60
|
|
|
@@ -275,3 +264,23 @@ export default function RootContainer(props /* : RootContainerProps */) {
|
|
|
275
264
|
);
|
|
276
265
|
}
|
|
277
266
|
};
|
|
267
|
+
|
|
268
|
+
RootContainer.defaultProps = {
|
|
269
|
+
getPConnect: null,
|
|
270
|
+
renderingMode: null,
|
|
271
|
+
children: null,
|
|
272
|
+
routingInfo: object
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
RootContainer.propTypes = {
|
|
276
|
+
getPConnect: PropTypes.func,
|
|
277
|
+
renderingMode: PropTypes.string,
|
|
278
|
+
routingInfo: PropTypes.shape({
|
|
279
|
+
type: PropTypes.string,
|
|
280
|
+
accessedOrder: PropTypes.array,
|
|
281
|
+
items: PropTypes.object
|
|
282
|
+
}),
|
|
283
|
+
children: PropTypes.arrayOf(PropTypes.oneOfType( [PropTypes.object, PropTypes.string ]))
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export default RootContainer;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import { Breadcrumbs, Card, Typography } from "@material-ui/core";
|
|
3
4
|
import DoubleArrowIcon from '@material-ui/icons/DoubleArrow';
|
|
4
5
|
import DoneIcon from '@material-ui/icons/Done';
|
|
5
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface StagesProps extends PConnProps {
|
|
10
|
-
// If any, enter additional props that only exist on this component
|
|
11
|
-
stages: Array<any>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
7
|
|
|
15
8
|
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
|
|
16
9
|
declare const PCore: any;
|
|
@@ -64,7 +57,7 @@ function getFilteredStages(stages) {
|
|
|
64
57
|
|
|
65
58
|
/* TODO - this component should be refactored and not exposed as top level DX Component -
|
|
66
59
|
the stages should be created as part of the CaseView */
|
|
67
|
-
export default function Stages(props
|
|
60
|
+
export default function Stages(props) {
|
|
68
61
|
const classes = useStyles();
|
|
69
62
|
|
|
70
63
|
const { getPConnect, stages } = props;
|
|
@@ -73,7 +66,7 @@ export default function Stages(props: StagesProps) {
|
|
|
73
66
|
|
|
74
67
|
|
|
75
68
|
const filteredStages = getFilteredStages(stages);
|
|
76
|
-
const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID
|
|
69
|
+
const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID);
|
|
77
70
|
const stagesObj = filteredStages.map((stage, index, arr) => {
|
|
78
71
|
const theID = stage.ID || stage.id;
|
|
79
72
|
return {
|
|
@@ -123,3 +116,8 @@ export default function Stages(props: StagesProps) {
|
|
|
123
116
|
</Card>
|
|
124
117
|
)
|
|
125
118
|
}
|
|
119
|
+
|
|
120
|
+
Stages.propTypes = {
|
|
121
|
+
getPConnect: PropTypes.func.isRequired,
|
|
122
|
+
stages: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
123
|
+
};
|
|
@@ -5,13 +5,6 @@ import {
|
|
|
5
5
|
Divider,
|
|
6
6
|
} from '@material-ui/core';
|
|
7
7
|
|
|
8
|
-
// LeftAlignVerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
|
|
9
|
-
|
|
10
|
-
interface LeftAlignVerticalTabsProps {
|
|
11
|
-
// If any, enter additional props that only exist on this component
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
8
|
// LeftAlignVerticalTab is a specialized Tab that has styles to make it
|
|
16
9
|
// left aligned and full width of the container Tabs
|
|
17
10
|
|
|
@@ -29,6 +22,6 @@ const LeftAlignVerticalTabs: any = withStyles((/* theme */) => ({
|
|
|
29
22
|
display: 'block',
|
|
30
23
|
textAlign: 'left',
|
|
31
24
|
},
|
|
32
|
-
}))((props
|
|
25
|
+
}))((props) => <div><Tab {...props} /><Divider /></div>);
|
|
33
26
|
|
|
34
27
|
export default LeftAlignVerticalTabs;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import { makeStyles } from '@material-ui/core/styles'
|
|
3
4
|
|
|
4
5
|
import Tabs from '@material-ui/core/Tabs';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
// VerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
|
|
8
|
-
interface VerticalTabsProps {
|
|
9
|
-
// If any, enter additional props that only exist on this component
|
|
10
|
-
tabconfig: Array<any>
|
|
11
|
-
}
|
|
6
|
+
import LeftAlignVerticalTab from '@pega/react-sdk-components/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs';
|
|
12
7
|
|
|
13
8
|
|
|
14
9
|
// The MuiTabs-indicator class is in a span whose parent is div (under the Tabs root component)
|
|
@@ -36,12 +31,9 @@ const createCustomEvent = (eventName: string, additionalData: {[key: string]: st
|
|
|
36
31
|
};
|
|
37
32
|
|
|
38
33
|
|
|
39
|
-
export default function VerticalTabs(props
|
|
40
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
41
|
-
const LeftAlignVerticalTab = getComponentFromMap("LeftAlignVerticalTabs");
|
|
42
|
-
|
|
34
|
+
export default function VerticalTabs(props) {
|
|
43
35
|
// Get a React warning when we use tabConfig as mixed case. So all lowercase tabconfig
|
|
44
|
-
const { tabconfig
|
|
36
|
+
const { tabconfig } = props;
|
|
45
37
|
const classes = useStyles();
|
|
46
38
|
const [value, setValue] = useState(0);
|
|
47
39
|
|
|
@@ -73,3 +65,11 @@ export default function VerticalTabs(props: VerticalTabsProps) {
|
|
|
73
65
|
</div>
|
|
74
66
|
)
|
|
75
67
|
}
|
|
68
|
+
|
|
69
|
+
VerticalTabs.defaultProps = {
|
|
70
|
+
tabconfig: []
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
VerticalTabs.propTypes = {
|
|
74
|
+
tabconfig: PropTypes.arrayOf(PropTypes.object)
|
|
75
|
+
};
|
package/lib/infra/View/View.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
// import { FieldGroup } from "@pega/cosmos-react-core";
|
|
3
4
|
// import { LazyMap as LazyComponentMap } from "../../components_map";
|
|
4
5
|
|
|
@@ -9,24 +10,6 @@ import { getAllFields } from '@pega/react-sdk-components/lib/components/helpers/
|
|
|
9
10
|
// Need to import any templates that we might render
|
|
10
11
|
|
|
11
12
|
import './View.css';
|
|
12
|
-
|
|
13
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
interface ViewProps extends PConnProps {
|
|
17
|
-
// If any, enter additional props that only exist on this component
|
|
18
|
-
children: Array<any>,
|
|
19
|
-
template?: string,
|
|
20
|
-
label?: string,
|
|
21
|
-
showLabel: boolean,
|
|
22
|
-
mode?: string,
|
|
23
|
-
title?: string,
|
|
24
|
-
visibility?: boolean,
|
|
25
|
-
name?: string,
|
|
26
|
-
bInForm?: boolean
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
13
|
//
|
|
31
14
|
// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
32
15
|
// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
|
|
@@ -45,14 +28,14 @@ const NO_HEADER_TEMPLATES = [
|
|
|
45
28
|
'Confirmation'
|
|
46
29
|
];
|
|
47
30
|
|
|
48
|
-
export default function View(props
|
|
31
|
+
export default function View(props) {
|
|
49
32
|
const { children, template, getPConnect, mode, visibility, name: pageName } = props;
|
|
50
|
-
let { label
|
|
33
|
+
let { label, showLabel = false } = props;
|
|
51
34
|
|
|
52
35
|
// Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
|
|
53
36
|
// Putting this logic here instead of copy/paste in every Form template index.js
|
|
54
37
|
|
|
55
|
-
const inheritedProps
|
|
38
|
+
const inheritedProps = getPConnect().getInheritedProps();
|
|
56
39
|
label = inheritedProps.label || label;
|
|
57
40
|
showLabel = inheritedProps.showLabel || showLabel;
|
|
58
41
|
|
|
@@ -129,6 +112,24 @@ export default function View(props: ViewProps) {
|
|
|
129
112
|
return null;
|
|
130
113
|
}
|
|
131
114
|
|
|
115
|
+
View.defaultProps = {
|
|
116
|
+
label: undefined,
|
|
117
|
+
showLabel: undefined,
|
|
118
|
+
mode: undefined
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
View.propTypes = {
|
|
122
|
+
children: PropTypes.oneOfType([
|
|
123
|
+
PropTypes.arrayOf(PropTypes.node),
|
|
124
|
+
PropTypes.array
|
|
125
|
+
]) /* array might be empty */,
|
|
126
|
+
template: PropTypes.string /* .isRequired */,
|
|
127
|
+
getPConnect: PropTypes.func.isRequired,
|
|
128
|
+
label: PropTypes.string,
|
|
129
|
+
showLabel: PropTypes.bool,
|
|
130
|
+
mode: PropTypes.string,
|
|
131
|
+
title: PropTypes.string
|
|
132
|
+
};
|
|
132
133
|
|
|
133
134
|
// Adapted from Constellation DX Component to add in additional props for some templates
|
|
134
135
|
View.additionalProps = (state, getPConnect) => {
|
|
@@ -1,32 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
4
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
4
5
|
import Avatar from '@material-ui/core/Avatar';
|
|
5
6
|
import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
6
7
|
import './AppShell.css';
|
|
7
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
|
-
|
|
9
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
|
-
|
|
11
|
-
interface AppShellProps extends PConnProps {
|
|
12
|
-
// If any, enter additional props that only exist on this component
|
|
13
|
-
showAppName: boolean,
|
|
14
|
-
pages: Array<{
|
|
15
|
-
pxPageViewIcon: string,
|
|
16
|
-
pyClassName: string,
|
|
17
|
-
pyLabel: string,
|
|
18
|
-
pyRuleName: string,
|
|
19
|
-
pyURLContent: string,
|
|
20
|
-
|
|
21
|
-
}>,
|
|
22
|
-
caseTypes?:Array<object>,
|
|
23
|
-
children?: Array<any>,
|
|
24
|
-
portalTemplate: string,
|
|
25
|
-
portalName: string,
|
|
26
|
-
portalLogo : string,
|
|
27
|
-
navDisplayOptions: { alignment: string, position: string }
|
|
28
|
-
}
|
|
29
8
|
|
|
9
|
+
// AppShell can emit NavBar or WssNavBar
|
|
10
|
+
import NavBar from '@pega/react-sdk-components/lib/components/infra/NavBar';
|
|
11
|
+
import WssNavBar from '@pega/react-sdk-components/lib/components/template/WssNavBar';
|
|
30
12
|
|
|
31
13
|
const useStyles = makeStyles(theme => ({
|
|
32
14
|
root: {
|
|
@@ -51,23 +33,18 @@ const useStyles = makeStyles(theme => ({
|
|
|
51
33
|
declare const PCore: any;
|
|
52
34
|
|
|
53
35
|
|
|
54
|
-
export default function AppShell(props
|
|
55
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
56
|
-
const NavBar = getComponentFromMap("NavBar");
|
|
57
|
-
const WssNavBar = getComponentFromMap("WssNavBar");
|
|
58
|
-
|
|
36
|
+
export default function AppShell(props) {
|
|
59
37
|
const {
|
|
60
|
-
pages
|
|
61
|
-
caseTypes
|
|
38
|
+
pages,
|
|
39
|
+
caseTypes,
|
|
62
40
|
showAppName,
|
|
63
|
-
children
|
|
41
|
+
children,
|
|
64
42
|
getPConnect,
|
|
65
43
|
portalTemplate,
|
|
66
44
|
portalName,
|
|
67
45
|
portalLogo,
|
|
68
46
|
navDisplayOptions
|
|
69
47
|
} = props;
|
|
70
|
-
|
|
71
48
|
const [open, setOpen] = useState(true);
|
|
72
49
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
73
50
|
const [activeTab, setActiveTab] = useState(!pages ? null : pages[0]?.pyRuleName);
|
|
@@ -77,13 +54,13 @@ export default function AppShell(props:AppShellProps) {
|
|
|
77
54
|
const userName = envInfo.getOperatorName();
|
|
78
55
|
const currentUserInitials = Utils.getInitials(userName);
|
|
79
56
|
const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
|
|
80
|
-
const portalClass = pConn.getValue('.classID'
|
|
57
|
+
const portalClass = pConn.getValue('.classID');
|
|
81
58
|
const envPortalName = envInfo.getPortalName();
|
|
82
59
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
83
60
|
|
|
84
61
|
const classes = useStyles();
|
|
85
62
|
const actionsAPI = pConn.getActionsApi();
|
|
86
|
-
const localeReference = pConn.getValue('.pyLocaleReference'
|
|
63
|
+
const localeReference = pConn.getValue('.pyLocaleReference');
|
|
87
64
|
const [imageBlobUrl, setImageBlobUrl] = useState(null);
|
|
88
65
|
// useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
|
|
89
66
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
@@ -95,7 +72,7 @@ export default function AppShell(props:AppShellProps) {
|
|
|
95
72
|
useEffect(() => {
|
|
96
73
|
setAppName(PCore.getEnvironmentInfo().getApplicationName());
|
|
97
74
|
|
|
98
|
-
const tempMap
|
|
75
|
+
const tempMap = pConn.getChildren().map((child, index) => {
|
|
99
76
|
const theChildComp = child.getPConnect().getComponentName();
|
|
100
77
|
const theKey = `.${index}`;
|
|
101
78
|
return (
|
|
@@ -210,7 +187,7 @@ export default function AppShell(props:AppShellProps) {
|
|
|
210
187
|
'',
|
|
211
188
|
`${portalClass}!PORTAL!${envPortalName}`.toUpperCase()
|
|
212
189
|
),
|
|
213
|
-
onClick: links[0] &&
|
|
190
|
+
onClick: links[0] && links[0].onClick ? links[0].onClick : undefined
|
|
214
191
|
}}
|
|
215
192
|
navLinks={links.filter((link, index) => {
|
|
216
193
|
return index !== 0;
|
|
@@ -228,7 +205,6 @@ export default function AppShell(props:AppShellProps) {
|
|
|
228
205
|
<NavContext.Provider value={{ open, setOpen }}>
|
|
229
206
|
<div id='AppShell' className={classes.root}>
|
|
230
207
|
<NavBar
|
|
231
|
-
getPConnect={getPConnect}
|
|
232
208
|
pConn={getPConnect()}
|
|
233
209
|
appName={localizedVal(
|
|
234
210
|
appNameToDisplay,
|
|
@@ -243,3 +219,16 @@ export default function AppShell(props:AppShellProps) {
|
|
|
243
219
|
</NavContext.Provider>
|
|
244
220
|
);
|
|
245
221
|
}
|
|
222
|
+
|
|
223
|
+
AppShell.defaultProps = {
|
|
224
|
+
pages: [],
|
|
225
|
+
caseTypes: [],
|
|
226
|
+
children: []
|
|
227
|
+
};
|
|
228
|
+
AppShell.propTypes = {
|
|
229
|
+
showAppName: PropTypes.bool /* .isRequired */,
|
|
230
|
+
pages: PropTypes.arrayOf(PropTypes.object),
|
|
231
|
+
caseTypes: PropTypes.arrayOf(PropTypes.object),
|
|
232
|
+
children: PropTypes.arrayOf(PropTypes.node),
|
|
233
|
+
getPConnect: PropTypes.func.isRequired
|
|
234
|
+
};
|
|
@@ -1,37 +1,21 @@
|
|
|
1
1
|
import { useMemo, Children } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Banner from '@pega/react-sdk-components/lib/components/designSystemExtension/Banner';
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
|
|
5
|
-
// BannerPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
|
-
|
|
7
|
-
interface BannerPageProps {
|
|
8
|
-
// If any, enter additional props that only exist on this component
|
|
9
|
-
children: Array<any>,
|
|
10
|
-
layout?: string,
|
|
11
|
-
heading?: string,
|
|
12
|
-
message?: string,
|
|
13
|
-
imageTheme?: string,
|
|
14
|
-
backgroundImage?: string,
|
|
15
|
-
backgroundColor?: string,
|
|
16
|
-
tintImage?: boolean
|
|
17
|
-
}
|
|
18
5
|
|
|
19
6
|
/*
|
|
20
7
|
* BannerPage template.
|
|
21
8
|
*/
|
|
22
|
-
export default function BannerPage(props
|
|
23
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
24
|
-
const Banner = getComponentFromMap('Banner');
|
|
25
|
-
|
|
9
|
+
export default function BannerPage(props) {
|
|
26
10
|
const {
|
|
27
11
|
children,
|
|
28
|
-
layout
|
|
29
|
-
heading
|
|
30
|
-
message
|
|
31
|
-
imageTheme
|
|
32
|
-
backgroundImage
|
|
33
|
-
backgroundColor
|
|
34
|
-
tintImage
|
|
12
|
+
layout,
|
|
13
|
+
heading,
|
|
14
|
+
message,
|
|
15
|
+
imageTheme,
|
|
16
|
+
backgroundImage,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
tintImage
|
|
35
19
|
} = props;
|
|
36
20
|
|
|
37
21
|
const childArray = useMemo(() => {
|
|
@@ -54,3 +38,24 @@ export default function BannerPage(props: BannerPageProps) {
|
|
|
54
38
|
/>
|
|
55
39
|
);
|
|
56
40
|
}
|
|
41
|
+
|
|
42
|
+
BannerPage.propTypes = {
|
|
43
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
44
|
+
layout: PropTypes.string,
|
|
45
|
+
heading: PropTypes.string,
|
|
46
|
+
message: PropTypes.string,
|
|
47
|
+
imageTheme: PropTypes.string,
|
|
48
|
+
backgroundImage: PropTypes.string,
|
|
49
|
+
backgroundColor: PropTypes.string,
|
|
50
|
+
tintImage: PropTypes.bool
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
BannerPage.defaultProps = {
|
|
54
|
+
layout: 'two-column',
|
|
55
|
+
heading: '',
|
|
56
|
+
message: '',
|
|
57
|
+
imageTheme: 'light',
|
|
58
|
+
backgroundImage: '',
|
|
59
|
+
backgroundColor: '',
|
|
60
|
+
tintImage: false
|
|
61
|
+
};
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
interface CaseSummaryProps extends PConnProps {
|
|
7
|
-
// If any, enter additional props that only exist on this component
|
|
8
|
-
children: Array<any>
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export default function CaseSummary(props: CaseSummaryProps) {
|
|
13
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
14
|
-
const CaseSummaryFields = getComponentFromMap('CaseSummaryFields');
|
|
4
|
+
import CaseSummaryFields from '@pega/react-sdk-components/lib/components/designSystemExtension/CaseSummaryFields';
|
|
15
5
|
|
|
6
|
+
export default function CaseSummary(props) {
|
|
16
7
|
const { getPConnect, children } = props;
|
|
17
8
|
const thePConn = getPConnect();
|
|
18
9
|
const theConfigProps = thePConn.getConfigProps();
|
|
19
|
-
|
|
20
|
-
const status = theConfigProps["status"];
|
|
21
|
-
const showStatus = theConfigProps["showStatus"];
|
|
10
|
+
const { status, showStatus } = theConfigProps;
|
|
22
11
|
|
|
23
12
|
// from Constellation DX Components
|
|
24
13
|
// get the primary and secondary fields with the raw data (which has the non-resolved property values)
|
|
@@ -55,3 +44,7 @@ export default function CaseSummary(props: CaseSummaryProps) {
|
|
|
55
44
|
</div>
|
|
56
45
|
)
|
|
57
46
|
}
|
|
47
|
+
|
|
48
|
+
CaseSummary.propTypes = {
|
|
49
|
+
getPConnect: PropTypes.func.isRequired
|
|
50
|
+
};
|