@pega/react-sdk-components 0.23.17 → 0.23.19
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/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +20 -3
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +1 -2
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +23 -40
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.js +5 -5
- package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +5 -5
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/Currency.d.ts.map +1 -1
- package/lib/components/field/Currency/Currency.js +21 -6
- package/lib/components/field/Currency/Currency.js.map +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts +11 -0
- package/lib/components/field/Currency/currency-utils.d.ts.map +1 -0
- package/lib/components/field/Currency/currency-utils.js +60 -0
- package/lib/components/field/Currency/currency-utils.js.map +1 -0
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +17 -6
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +16 -7
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +5 -5
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +5 -5
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Email/Email.js +5 -5
- package/lib/components/field/Email/Email.js.map +1 -1
- package/lib/components/field/Integer/Integer.d.ts.map +1 -1
- package/lib/components/field/Integer/Integer.js +5 -5
- package/lib/components/field/Integer/Integer.js.map +1 -1
- package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
- package/lib/components/field/Percentage/Percentage.js +5 -5
- package/lib/components/field/Percentage/Percentage.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +5 -5
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +5 -5
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.js +5 -1
- package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/field/TextArea/TextArea.js +5 -5
- package/lib/components/field/TextArea/TextArea.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +5 -5
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +5 -5
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +5 -5
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/helpers/authManager.d.ts.map +1 -1
- package/lib/components/helpers/authManager.js +1 -0
- package/lib/components/helpers/authManager.js.map +1 -1
- package/lib/components/helpers/date-format-utils.d.ts +13 -0
- package/lib/components/helpers/date-format-utils.d.ts.map +1 -0
- package/lib/components/helpers/date-format-utils.js +59 -0
- package/lib/components/helpers/date-format-utils.js.map +1 -0
- package/lib/components/helpers/event-utils.js +1 -1
- package/lib/components/helpers/event-utils.js.map +1 -1
- package/lib/components/helpers/formatters/Currency.js +11 -5
- package/lib/components/helpers/formatters/Currency.js.map +1 -1
- package/lib/components/helpers/formatters/common.d.ts.map +1 -1
- package/lib/components/helpers/formatters/common.js +6 -1
- package/lib/components/helpers/formatters/common.js.map +1 -1
- package/lib/components/helpers/formatters/index.d.ts.map +1 -1
- package/lib/components/helpers/formatters/index.js +4 -0
- package/lib/components/helpers/formatters/index.js.map +1 -1
- package/lib/components/helpers/template-utils.d.ts +14 -0
- package/lib/components/helpers/template-utils.d.ts.map +1 -0
- package/lib/components/helpers/template-utils.js +65 -0
- package/lib/components/helpers/template-utils.js.map +1 -0
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +53 -54
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +3 -49
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.css +4 -18
- package/lib/components/infra/NavBar/NavBar.d.ts +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +57 -121
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +0 -50
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +1 -2
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +13 -4
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +2 -323
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.js +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +2 -3
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js +6 -1
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/Details/Details/Details.d.ts +2 -0
- package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
- package/lib/components/template/Details/Details/Details.js +35 -18
- package/lib/components/template/Details/Details/Details.js.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +12 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +43 -27
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +12 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +43 -25
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.d.ts +91 -0
- package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -0
- package/lib/components/template/ListView/DefaultViewMeta.js +208 -0
- package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -0
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +147 -83
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/ListView/hooks.d.ts +2 -0
- package/lib/components/template/ListView/hooks.d.ts.map +1 -0
- package/lib/components/template/ListView/hooks.js +73 -0
- package/lib/components/template/ListView/hooks.js.map +1 -0
- package/lib/components/template/ListView/utils.d.ts +63 -0
- package/lib/components/template/ListView/utils.d.ts.map +1 -0
- package/lib/components/template/ListView/utils.js +537 -0
- package/lib/components/template/ListView/utils.js.map +1 -0
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +12 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +45 -29
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -20
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +12 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +45 -29
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.css +7 -0
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +25 -2
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +33 -0
- package/package.json +1 -1
- package/lib/components/template/utils.d.ts +0 -3
- package/lib/components/template/utils.d.ts.map +0 -1
- package/lib/components/template/utils.js +0 -22
- package/lib/components/template/utils.js.map +0 -1
|
@@ -34,7 +34,7 @@ mat-horizontal-stepper {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.psdk-sub-step-current {
|
|
37
|
-
padding-left: 0.625rem;
|
|
37
|
+
padding-left: 0.625rem;
|
|
38
38
|
font-weight: bold;
|
|
39
39
|
color: rgba(0,0,0,.87);
|
|
40
40
|
}
|
|
@@ -53,7 +53,7 @@ mat-horizontal-stepper {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.psdk-sub-step-list {
|
|
56
|
-
list-style: none;
|
|
56
|
+
list-style: none;
|
|
57
57
|
padding-bottom: 0.625rem;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -219,35 +219,21 @@ mat-horizontal-stepper {
|
|
|
219
219
|
.psdk-horizontal-step-label {
|
|
220
220
|
color: rgba(0,0,0,.54);
|
|
221
221
|
display: inline-block;
|
|
222
|
-
white-space: nowrap;
|
|
223
|
-
overflow: hidden;
|
|
224
|
-
text-overflow: ellipsis;
|
|
225
222
|
min-width: 50px;
|
|
226
223
|
vertical-align: middle;
|
|
227
224
|
font-size: 14px;
|
|
228
225
|
font-weight: 500;
|
|
229
|
-
|
|
230
|
-
overflow: hidden;
|
|
226
|
+
white-space: initial;
|
|
231
227
|
}
|
|
232
228
|
|
|
233
229
|
.psdk-horizontal-step-label-selected {
|
|
234
230
|
color: rgba(0,0,0,.87);
|
|
235
231
|
display: inline-block;
|
|
236
|
-
white-space: nowrap;
|
|
237
|
-
overflow: hidden;
|
|
238
|
-
text-overflow: ellipsis;
|
|
239
232
|
min-width: 50px;
|
|
240
233
|
vertical-align: middle;
|
|
241
234
|
font-size: 14px;
|
|
242
235
|
font-weight: 500;
|
|
243
|
-
|
|
244
|
-
overflow: hidden;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.psdk-horizontal-step-text-label {
|
|
248
|
-
text-overflow: ellipsis;
|
|
249
|
-
overflow: hidden;
|
|
250
|
-
display: block;
|
|
236
|
+
white-space: initial;
|
|
251
237
|
}
|
|
252
238
|
|
|
253
239
|
.psdk-horizontal-step-line {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/NavBar/NavBar.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/NavBar/NavBar.tsx"],"names":[],"mappings":";AAGA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,cAAc,CAAC;AA4FtB,iBAAwB,MAAM,CAAC,KAAK,KAAA,eA8LnC;kBA9LuB,MAAM;;;;;;;;;;;;;;eAAN,MAAM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useEffect, useState } from
|
|
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
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { Utils } from '../../helpers/utils';
|
|
6
6
|
import './NavBar.css';
|
|
7
7
|
import { Drawer, List, ListItem, ListItemIcon, ListItemText, ListItemSecondaryAction, Collapse, Divider, IconButton, Menu, MenuItem, Typography } from '@material-ui/core';
|
|
@@ -17,117 +17,99 @@ import WorkOutlineIcon from '@material-ui/icons/WorkOutline';
|
|
|
17
17
|
import ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';
|
|
18
18
|
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
|
19
19
|
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
20
|
-
import { useNavBar } from
|
|
20
|
+
import { useNavBar } from '../../helpers/reactContextHelpers';
|
|
21
21
|
import { logout } from '../../helpers/authManager';
|
|
22
22
|
const iconMap = {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
'pi pi-headline': React.createElement(HomeOutlinedIcon, { fontSize: 'large' }),
|
|
24
|
+
'pi pi-flag-solid': React.createElement(FlagOutlinedIcon, { fontSize: 'large' })
|
|
25
25
|
};
|
|
26
26
|
const drawerWidth = 300;
|
|
27
|
-
const useStyles = makeStyles(
|
|
27
|
+
const useStyles = makeStyles(theme => ({
|
|
28
28
|
drawerPaper: {
|
|
29
29
|
position: 'relative',
|
|
30
30
|
whiteSpace: 'nowrap',
|
|
31
31
|
width: drawerWidth,
|
|
32
32
|
transition: theme.transitions.create('width', {
|
|
33
33
|
easing: theme.transitions.easing.sharp,
|
|
34
|
-
duration: theme.transitions.duration.enteringScreen
|
|
34
|
+
duration: theme.transitions.duration.enteringScreen
|
|
35
35
|
}),
|
|
36
|
-
height:
|
|
36
|
+
height: '100vh'
|
|
37
37
|
},
|
|
38
38
|
drawerPaperClose: {
|
|
39
39
|
overflowX: 'hidden',
|
|
40
40
|
transition: theme.transitions.create('width', {
|
|
41
41
|
easing: theme.transitions.easing.sharp,
|
|
42
|
-
duration: theme.transitions.duration.leavingScreen
|
|
42
|
+
duration: theme.transitions.duration.leavingScreen
|
|
43
43
|
}),
|
|
44
44
|
width: theme.spacing(7),
|
|
45
45
|
[theme.breakpoints.up('md')]: {
|
|
46
|
-
width: theme.spacing(9)
|
|
46
|
+
width: theme.spacing(9)
|
|
47
47
|
},
|
|
48
|
-
height:
|
|
48
|
+
height: '100vh'
|
|
49
49
|
},
|
|
50
50
|
nested: {
|
|
51
|
-
paddingLeft: theme.spacing(4)
|
|
51
|
+
paddingLeft: theme.spacing(4)
|
|
52
52
|
},
|
|
53
53
|
appListItem: {
|
|
54
54
|
backgroundColor: theme.palette.primary.light,
|
|
55
|
-
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
55
|
+
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
56
56
|
},
|
|
57
57
|
appListLogo: {
|
|
58
58
|
marginRight: theme.spacing(2),
|
|
59
|
-
width:
|
|
59
|
+
width: '3.6rem'
|
|
60
60
|
},
|
|
61
61
|
appListIcon: {
|
|
62
|
-
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
62
|
+
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
63
63
|
},
|
|
64
64
|
appListDiv: {
|
|
65
65
|
backgroundColor: theme.palette.primary.light,
|
|
66
66
|
color: theme.palette.getContrastText(theme.palette.primary.light),
|
|
67
67
|
paddingTop: theme.spacing(2),
|
|
68
68
|
paddingBottom: theme.spacing(2),
|
|
69
|
-
display:
|
|
70
|
-
alignItems:
|
|
71
|
-
justifyContent:
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center'
|
|
72
|
+
},
|
|
73
|
+
applicationLabel: {
|
|
74
|
+
whiteSpace: 'initial'
|
|
72
75
|
}
|
|
73
76
|
}));
|
|
74
77
|
export default function NavBar(props) {
|
|
75
78
|
const { pConn, pages, caseTypes } = props;
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const
|
|
79
|
+
const classes = useStyles();
|
|
80
|
+
const theme = useTheme();
|
|
81
|
+
const isDesktop = useMediaQuery(theme.breakpoints.up('md'));
|
|
82
|
+
const { open, setOpen } = useNavBar();
|
|
80
83
|
const [navPages, setNavPages] = useState(JSON.parse(JSON.stringify(pages)));
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
82
|
-
const [portalLogoImage, setPortalLogoImage] = useState(Utils.getIconPath(PCore.getAssetLoader().getStaticServerUrl()).concat("pzpega-logo-mark.svg"));
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
84
|
-
const [portalOperator, setPortalOperator] = useState(PCore.getEnvironmentInfo().getOperatorName());
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
86
|
-
const [portalOperatorInitials, setPortalOperatorInitials] = useState(Utils.getInitials(portalOperator));
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
88
|
-
const [portalApp, setPortalApp] = useState(PCore.getEnvironmentInfo().getApplicationLabel());
|
|
89
84
|
const [bShowCaseTypes, setBShowCaseTypes] = useState(true);
|
|
90
85
|
const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false);
|
|
91
|
-
const { open, setOpen } = useNavBar();
|
|
92
86
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
const
|
|
87
|
+
const portalLogoImage = Utils.getIconPath(PCore.getAssetLoader().getStaticServerUrl()).concat('pzpega-logo-mark.svg');
|
|
88
|
+
const portalOperator = PCore.getEnvironmentInfo().getOperatorName();
|
|
89
|
+
const portalApp = PCore.getEnvironmentInfo().getApplicationLabel();
|
|
96
90
|
useEffect(() => {
|
|
97
91
|
setNavPages(JSON.parse(JSON.stringify(pages)));
|
|
98
92
|
}, [pages]);
|
|
99
|
-
// const caseTypesMap = caseTypes.map((caseType, index) => {
|
|
100
|
-
// const theKey = `caseType.${index}`;
|
|
101
|
-
// return <li key={theKey}>{caseType.pyLabel}</li>;
|
|
102
|
-
// });
|
|
103
|
-
// const pagesMap = pages.map((page, index) => {
|
|
104
|
-
// const theKey = `page.${index}`;
|
|
105
|
-
// return <li key={theKey}>{page.pyLabel}</li>;
|
|
106
|
-
// });
|
|
107
93
|
function navPanelButtonClick(oPageData) {
|
|
108
94
|
const { pyClassName, pyRuleName } = oPageData;
|
|
109
|
-
pConn
|
|
95
|
+
pConn
|
|
96
|
+
.getActionsApi()
|
|
97
|
+
.showPage(pyRuleName, pyClassName)
|
|
98
|
+
.then(() => {
|
|
110
99
|
// eslint-disable-next-line no-console
|
|
111
100
|
console.log(`showPage completed`);
|
|
112
101
|
});
|
|
113
102
|
}
|
|
114
|
-
// function navPanelCreateButtonClick() {
|
|
115
|
-
// if (navExpandCollapse.indexOf("plus") > 0) {
|
|
116
|
-
// setNavExpandCollapse(Utils.getImageSrc("times", PCore.getAssetLoader().getStaticServerUrl()));
|
|
117
|
-
// setBShowCaseTypes(true);
|
|
118
|
-
// }
|
|
119
|
-
// else {
|
|
120
|
-
// setNavExpandCollapse(Utils.getImageSrc("plus", PCore.getAssetLoader().getStaticServerUrl()));
|
|
121
|
-
// setBShowCaseTypes(false);
|
|
122
|
-
// }
|
|
123
|
-
// }
|
|
124
103
|
function navPanelCreateCaseType(sCaseType, sFlowType) {
|
|
125
104
|
setOpen(false);
|
|
126
105
|
const actionInfo = {
|
|
127
|
-
containerName:
|
|
128
|
-
flowType: sFlowType ||
|
|
106
|
+
containerName: 'primary',
|
|
107
|
+
flowType: sFlowType || 'pyStartCase'
|
|
129
108
|
};
|
|
130
|
-
pConn
|
|
109
|
+
pConn
|
|
110
|
+
.getActionsApi()
|
|
111
|
+
.createWork(sCaseType, actionInfo)
|
|
112
|
+
.then(() => {
|
|
131
113
|
// eslint-disable-next-line no-console
|
|
132
114
|
console.log(`createWork completed`);
|
|
133
115
|
});
|
|
@@ -140,46 +122,6 @@ export default function NavBar(props) {
|
|
|
140
122
|
else
|
|
141
123
|
setAnchorEl(null);
|
|
142
124
|
}
|
|
143
|
-
function navPanelLogoutClick() {
|
|
144
|
-
try {
|
|
145
|
-
// eslint-disable-next-line no-console
|
|
146
|
-
console.log(`--> navPanelLogoutClick clicked`);
|
|
147
|
-
// Commenting out until revokeToken API is available
|
|
148
|
-
// pConn.getActionsApi().logout().then(() => {
|
|
149
|
-
// // eslint-disable-next-line no-console
|
|
150
|
-
// console.log(`logout completed`);
|
|
151
|
-
// },
|
|
152
|
-
// error => {
|
|
153
|
-
// // eslint-disable-next-line no-console
|
|
154
|
-
// console.error(`onRejected function called: ${error.message}`);
|
|
155
|
-
// })
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
// eslint-disable-next-line no-console
|
|
159
|
-
console.log(`--> Attempt to call logout api failed: ${err}`);
|
|
160
|
-
}
|
|
161
|
-
finally {
|
|
162
|
-
// authLogout();
|
|
163
|
-
logout();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
// const theCaseTypeButtons = caseTypes.map((caseType) => <div style={{display: "flex"}}>
|
|
167
|
-
// <button className="btn btn-link text-white"
|
|
168
|
-
// onClick={() => { navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}}>{caseType.pyLabel}</button></div>
|
|
169
|
-
// );
|
|
170
|
-
// const theOperatorButtons = <button className="btn btn-link text-white" style={{marginLeft: "-0.05rem"}} onClick={navPanelLogoutClick}>Logoff</button>;
|
|
171
|
-
// return <div id="NavBar" style={{border: "solid 1px silver", margin: "1px"}} >
|
|
172
|
-
// NavBar for <strong>{appName}</strong>
|
|
173
|
-
// <br></br>
|
|
174
|
-
// caseTypes:
|
|
175
|
-
// <ul>
|
|
176
|
-
// {caseTypesMap}
|
|
177
|
-
// </ul>
|
|
178
|
-
// Pages:
|
|
179
|
-
// <ul>
|
|
180
|
-
// {pagesMap}
|
|
181
|
-
// </ul>
|
|
182
|
-
// </div>;
|
|
183
125
|
const handleDrawerOpen = () => {
|
|
184
126
|
setOpen(!open);
|
|
185
127
|
};
|
|
@@ -191,39 +133,33 @@ export default function NavBar(props) {
|
|
|
191
133
|
else
|
|
192
134
|
setBShowCaseTypes(!bShowCaseTypes);
|
|
193
135
|
};
|
|
194
|
-
// const handlePopoverOpen = (event) => {
|
|
195
|
-
// setAnchorEl(event.currentTarget);
|
|
196
|
-
// };
|
|
197
|
-
// const handlePopoverClose = () => {
|
|
198
|
-
// setAnchorEl(null);
|
|
199
|
-
// };
|
|
200
136
|
useEffect(() => {
|
|
201
137
|
if (!isDesktop)
|
|
202
138
|
setOpen(false);
|
|
203
139
|
else
|
|
204
140
|
setOpen(true);
|
|
205
141
|
}, [isDesktop]);
|
|
206
|
-
return (React.createElement(Drawer, { variant:
|
|
207
|
-
paper: clsx(classes.drawerPaper, !open && classes.drawerPaperClose)
|
|
142
|
+
return (React.createElement(Drawer, { variant: 'permanent', classes: {
|
|
143
|
+
paper: clsx(classes.drawerPaper, !open && classes.drawerPaperClose)
|
|
208
144
|
}, open: open && isDesktop },
|
|
209
145
|
open ? (React.createElement(List, { className: classes.appListItem },
|
|
210
146
|
React.createElement(ListItem, { onClick: handleDrawerOpen },
|
|
211
147
|
React.createElement(ListItemIcon, null,
|
|
212
148
|
React.createElement("img", { src: portalLogoImage, className: classes.appListLogo })),
|
|
213
|
-
React.createElement(ListItemText, { primary: React.createElement(Typography, { variant:
|
|
149
|
+
React.createElement(ListItemText, { primary: React.createElement(Typography, { variant: 'h6', className: classes.applicationLabel }, portalApp) }),
|
|
214
150
|
React.createElement(ListItemSecondaryAction, null,
|
|
215
|
-
React.createElement(IconButton, { edge:
|
|
151
|
+
React.createElement(IconButton, { edge: 'end', onClick: handleDrawerOpen },
|
|
216
152
|
React.createElement(ChevronLeftIcon, { className: classes.appListIcon })))))) : (React.createElement("div", { className: classes.appListDiv, onClick: handleDrawerOpen },
|
|
217
|
-
React.createElement(ChevronRightIcon, { className: classes.appListIcon, id:
|
|
153
|
+
React.createElement(ChevronRightIcon, { className: classes.appListIcon, id: 'chevron-right-icon', fontSize: 'large' }))),
|
|
218
154
|
React.createElement(List, null,
|
|
219
155
|
React.createElement(ListItem, { button: true, onClick: handleCaseItemClick },
|
|
220
|
-
React.createElement(ListItemIcon, null, bShowCaseTypes && open ? React.createElement(ClearOutlinedIcon, { fontSize:
|
|
221
|
-
React.createElement(ListItemText, { primary:
|
|
156
|
+
React.createElement(ListItemIcon, null, bShowCaseTypes && open ? (React.createElement(ClearOutlinedIcon, { fontSize: 'large' })) : (React.createElement(AddIcon, { fontSize: 'large' }))),
|
|
157
|
+
React.createElement(ListItemText, { primary: 'Create' }),
|
|
222
158
|
bShowCaseTypes ? React.createElement(ExpandLess, null) : React.createElement(ExpandMore, null))),
|
|
223
|
-
React.createElement(Collapse, { in: bShowCaseTypes && open, timeout:
|
|
224
|
-
React.createElement(List, { component:
|
|
159
|
+
React.createElement(Collapse, { in: bShowCaseTypes && open, timeout: 'auto', unmountOnExit: true, className: 'scrollable' },
|
|
160
|
+
React.createElement(List, { component: 'div', disablePadding: true }, caseTypes.map(caseType => (React.createElement(ListItem, { button: true, className: classes.nested, onClick: () => navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType), key: caseType.pyLabel },
|
|
225
161
|
React.createElement(ListItemIcon, null,
|
|
226
|
-
React.createElement(WorkOutlineIcon, { fontSize:
|
|
162
|
+
React.createElement(WorkOutlineIcon, { fontSize: 'large' })),
|
|
227
163
|
React.createElement(ListItemText, { primary: caseType.pyLabel })))))),
|
|
228
164
|
React.createElement(List, null, navPages.map(page => (React.createElement(ListItem, { button: true, onClick: () => navPanelButtonClick(page), key: page.pyLabel },
|
|
229
165
|
React.createElement(ListItemIcon, null, iconMap[page.pxPageViewIcon]),
|
|
@@ -233,28 +169,28 @@ export default function NavBar(props) {
|
|
|
233
169
|
React.createElement(React.Fragment, null,
|
|
234
170
|
React.createElement(ListItem, { onClick: navPanelOperatorButtonClick },
|
|
235
171
|
React.createElement(ListItemIcon, null,
|
|
236
|
-
React.createElement(PersonOutlineIcon, { fontSize:
|
|
172
|
+
React.createElement(PersonOutlineIcon, { fontSize: 'large' })),
|
|
237
173
|
React.createElement(ListItemText, { primary: portalOperator }),
|
|
238
174
|
open && (React.createElement(ListItemSecondaryAction, null,
|
|
239
|
-
React.createElement(IconButton, { edge:
|
|
175
|
+
React.createElement(IconButton, { edge: 'end', onClick: navPanelOperatorButtonClick },
|
|
240
176
|
React.createElement(ChevronRightIcon, null))))),
|
|
241
177
|
React.createElement(Menu, { anchorEl: anchorEl, keepMounted: bShowOperatorButtons, open: bShowOperatorButtons, onClick: navPanelOperatorButtonClick, anchorOrigin: {
|
|
242
178
|
vertical: 'top',
|
|
243
|
-
horizontal: 'right'
|
|
179
|
+
horizontal: 'right'
|
|
244
180
|
}, transformOrigin: {
|
|
245
181
|
vertical: 'top',
|
|
246
|
-
horizontal: 'left'
|
|
182
|
+
horizontal: 'left'
|
|
247
183
|
} },
|
|
248
|
-
React.createElement(MenuItem, { onClick:
|
|
184
|
+
React.createElement(MenuItem, { onClick: logout },
|
|
249
185
|
React.createElement(ListItemIcon, null,
|
|
250
|
-
React.createElement(ArrowBackIcon, { fontSize:
|
|
251
|
-
React.createElement(Typography, { variant:
|
|
186
|
+
React.createElement(ArrowBackIcon, { fontSize: 'large' })),
|
|
187
|
+
React.createElement(Typography, { variant: 'inherit' }, "Logout")))))));
|
|
252
188
|
}
|
|
253
189
|
NavBar.defaultProps = {
|
|
254
190
|
pConn: null,
|
|
255
|
-
appName:
|
|
191
|
+
appName: '',
|
|
256
192
|
pages: [],
|
|
257
|
-
caseTypes: []
|
|
193
|
+
caseTypes: []
|
|
258
194
|
};
|
|
259
195
|
NavBar.propTypes = {
|
|
260
196
|
pConn: PropTypes.object,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavBar.js","sourceRoot":"","sources":["../../../../src/components/infra/NavBar/NavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,cAAc,CAAC;AAEtB,OAAO,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,QAAQ,EACR,OAAO,EACP,UA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oBAAC,YAAY;4BACX,oBAAC,aAAa,IAAC,QAAQ,EAAC,OAAO,GAAG,CACrB;wBACf,oBAAC,UAAU,IAAC,OAAO,EAAC,SAAS,aAAoB,CACxC,CACN,CACN,CACE,CACA,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,YAAY,GAAG;IACpB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;CACd,CAAC;AAEF,MAAM,CAAC,SAAS,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,sDAAsD;IACtD,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;CAC/C,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\nimport clsx from 'clsx';\nimport PropTypes from \"prop-types\";\nimport { Utils } from '../../helpers/utils';\n\nimport './NavBar.css';\n\nimport {\n Drawer,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n ListItemSecondaryAction,\n Collapse,\n Divider,\n IconButton,\n Menu,\n MenuItem,\n Typography\n} from '@material-ui/core';\n\nimport PersonOutlineIcon from '@material-ui/icons/PersonOutlineOutlined';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FlagOutlinedIcon from '@material-ui/icons/FlagOutlined';\nimport HomeOutlinedIcon from '@material-ui/icons/HomeOutlined';\nimport ExpandLess from '@material-ui/icons/ExpandLess';\nimport ExpandMore from '@material-ui/icons/ExpandMore';\nimport AddIcon from '@material-ui/icons/Add';\nimport WorkOutlineIcon from '@material-ui/icons/WorkOutline';\nimport ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';\nimport ArrowBackIcon from '@material-ui/icons/ArrowBack';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport { useNavBar } from \"../../helpers/reactContextHelpers\";\nimport { logout } from '../../helpers/authManager';\n\ndeclare const PCore;\n\nconst iconMap = {\n \"pi pi-headline\" : <HomeOutlinedIcon fontSize=\"large\"/>,\n \"pi pi-flag-solid\": <FlagOutlinedIcon fontSize=\"large\"/>\n}\n\nconst drawerWidth = 300;\n\nconst useStyles = makeStyles((theme) => ({\n drawerPaper: {\n position: 'relative',\n whiteSpace: 'nowrap',\n width: drawerWidth,\n transition: theme.transitions.create('width', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n height: \"100vh\"\n },\n drawerPaperClose: {\n overflowX: 'hidden',\n transition: theme.transitions.create('width', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n width: theme.spacing(7),\n [theme.breakpoints.up('md')]: {\n width: theme.spacing(9),\n },\n height: \"100vh\"\n },\n nested: {\n paddingLeft: theme.spacing(4),\n },\n appListItem: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light),\n },\n appListLogo: {\n marginRight: theme.spacing(2),\n width: \"3.6rem\",\n },\n appListIcon: {\n color: theme.palette.getContrastText(theme.palette.primary.light),\n },\n appListDiv: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light),\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\"\n }\n}));\n\nexport default function NavBar(props) {\n const {\n pConn,\n pages,\n caseTypes\n } = props;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [navIcon, setNavIcon] = useState((PCore.getAssetLoader().getStaticServerUrl()).concat(\"pzpega-logo-mark.svg\"));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [navExpandCollapse, setNavExpandCollapse] = useState(Utils.getImageSrc(\"plus\", PCore.getAssetLoader().getStaticServerUrl()));\n const [navPages, setNavPages] = useState(JSON.parse(JSON.stringify(pages)));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [portalLogoImage, setPortalLogoImage] = useState(Utils.getIconPath(PCore.getAssetLoader().getStaticServerUrl()).concat(\"pzpega-logo-mark.svg\"));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [portalOperator, setPortalOperator] = useState(PCore.getEnvironmentInfo().getOperatorName());\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [portalOperatorInitials, setPortalOperatorInitials] = useState(Utils.getInitials(portalOperator));\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [portalApp, setPortalApp] = useState(PCore.getEnvironmentInfo().getApplicationLabel());\n const [bShowCaseTypes, setBShowCaseTypes] = useState(true);\n const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false)\n const {open, setOpen} = useNavBar();\n const [anchorEl, setAnchorEl] = useState(null);\n\n const classes = useStyles();\n const theme = useTheme();\n const isDesktop = useMediaQuery(theme.breakpoints.up('md'));\n\n useEffect( () => {\n setNavPages(JSON.parse(JSON.stringify(pages)));\n },\n [pages]);\n\n // const caseTypesMap = caseTypes.map((caseType, index) => {\n // const theKey = `caseType.${index}`;\n // return <li key={theKey}>{caseType.pyLabel}</li>;\n // });\n\n // const pagesMap = pages.map((page, index) => {\n // const theKey = `page.${index}`;\n // return <li key={theKey}>{page.pyLabel}</li>;\n // });\n\n function navPanelButtonClick(oPageData: any) {\n const {\n pyClassName,\n pyRuleName\n } = oPageData;\n\n pConn.getActionsApi().showPage(pyRuleName, pyClassName).then(() => {\n // eslint-disable-next-line no-console\n console.log(`showPage completed`);\n });\n }\n\n // function navPanelCreateButtonClick() {\n // if (navExpandCollapse.indexOf(\"plus\") > 0) {\n // setNavExpandCollapse(Utils.getImageSrc(\"times\", PCore.getAssetLoader().getStaticServerUrl()));\n // setBShowCaseTypes(true);\n // }\n // else {\n // setNavExpandCollapse(Utils.getImageSrc(\"plus\", PCore.getAssetLoader().getStaticServerUrl()));\n // setBShowCaseTypes(false);\n // }\n // }\n\n function navPanelCreateCaseType(sCaseType: string, sFlowType: string) {\n setOpen(false);\n const actionInfo = {\n containerName: \"primary\",\n flowType: sFlowType || \"pyStartCase\"\n };\n\n pConn.getActionsApi().createWork(sCaseType, actionInfo).then(() => {\n // eslint-disable-next-line no-console\n console.log(`createWork completed`);\n });\n\n }\n\n // Toggle showing the Operator buttons\n function navPanelOperatorButtonClick(evt) {\n setBShowOperatorButtons(!bShowOperatorButtons);\n if (!bShowOperatorButtons) setAnchorEl(evt.currentTarget);\n else setAnchorEl(null);\n }\n\n function navPanelLogoutClick() {\n\n try {\n // eslint-disable-next-line no-console\n console.log(`--> navPanelLogoutClick clicked`);\n // Commenting out until revokeToken API is available\n // pConn.getActionsApi().logout().then(() => {\n // // eslint-disable-next-line no-console\n // console.log(`logout completed`);\n // },\n // error => {\n // // eslint-disable-next-line no-console\n // console.error(`onRejected function called: ${error.message}`);\n // })\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log(`--> Attempt to call logout api failed: ${err}`);\n }\n finally {\n // authLogout();\n logout();\n }\n }\n\n // const theCaseTypeButtons = caseTypes.map((caseType) => <div style={{display: \"flex\"}}>\n // <button className=\"btn btn-link text-white\"\n // onClick={() => { navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}}>{caseType.pyLabel}</button></div>\n // );\n\n // const theOperatorButtons = <button className=\"btn btn-link text-white\" style={{marginLeft: \"-0.05rem\"}} onClick={navPanelLogoutClick}>Logoff</button>;\n\n\n // return <div id=\"NavBar\" style={{border: \"solid 1px silver\", margin: \"1px\"}} >\n // NavBar for <strong>{appName}</strong>\n // <br></br>\n // caseTypes:\n // <ul>\n // {caseTypesMap}\n // </ul>\n // Pages:\n // <ul>\n // {pagesMap}\n // </ul>\n // </div>;\n\n\n const handleDrawerOpen = () => {\n setOpen(!open);\n };\n\n const handleCaseItemClick = () => {\n if (!open) {\n setOpen(true);\n setBShowCaseTypes(true);\n } else setBShowCaseTypes(!bShowCaseTypes);\n }\n\n// const handlePopoverOpen = (event) => {\n// setAnchorEl(event.currentTarget);\n// };\n\n // const handlePopoverClose = () => {\n // setAnchorEl(null);\n // };\n\n\n useEffect(() => {\n if (!isDesktop) setOpen(false);\n else setOpen(true);\n }, [isDesktop])\n\n\n return (\n <Drawer\n variant=\"permanent\"\n classes={{\n paper: clsx(classes.drawerPaper, !open && classes.drawerPaperClose),\n }}\n open={open && isDesktop}\n >\n {\n open ? (\n <List className={classes.appListItem}>\n <ListItem onClick={handleDrawerOpen}>\n <ListItemIcon>\n <img src={portalLogoImage} className={classes.appListLogo}/>\n </ListItemIcon>\n <ListItemText\n primary={<Typography variant=\"h6\">{portalApp}</Typography>}\n />\n <ListItemSecondaryAction>\n <IconButton edge=\"end\" onClick={handleDrawerOpen}>\n <ChevronLeftIcon className={classes.appListIcon} />\n </IconButton>\n </ListItemSecondaryAction>\n </ListItem>\n </List>\n ) : (\n <div className={classes.appListDiv} onClick={handleDrawerOpen} >\n <ChevronRightIcon className={classes.appListIcon} id=\"chevron-right-icon\" fontSize=\"large\" />\n </div>\n )\n }\n <List>\n <ListItem button onClick={handleCaseItemClick}>\n <ListItemIcon>\n {\n bShowCaseTypes && open ? <ClearOutlinedIcon fontSize=\"large\" /> : <AddIcon fontSize=\"large\" />\n }\n </ListItemIcon>\n <ListItemText primary=\"Create\" />\n {bShowCaseTypes ? <ExpandLess /> : <ExpandMore />}\n </ListItem>\n </List>\n <Collapse in={bShowCaseTypes && open} timeout=\"auto\" unmountOnExit className='scrollable'>\n <List component=\"div\" disablePadding>\n {\n caseTypes.map(caseType => (\n <ListItem\n button\n className={classes.nested}\n onClick={() => navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}\n key={caseType.pyLabel}\n >\n <ListItemIcon>\n <WorkOutlineIcon fontSize=\"large\" />\n </ListItemIcon>\n <ListItemText primary={caseType.pyLabel} />\n </ListItem>\n ))\n }\n </List>\n </Collapse>\n <List>\n {\n navPages.map(page => (\n <ListItem\n button\n onClick={() => navPanelButtonClick(page)}\n key={page.pyLabel}\n >\n <ListItemIcon>\n {iconMap[page.pxPageViewIcon]}\n </ListItemIcon>\n <ListItemText primary={page.pyLabel} />\n </ListItem>\n ))\n }\n </List>\n <Divider />\n <List className='marginTopAuto'>\n <>\n <ListItem onClick={navPanelOperatorButtonClick}>\n <ListItemIcon>\n <PersonOutlineIcon fontSize=\"large\" />\n </ListItemIcon>\n <ListItemText primary={portalOperator} />\n {\n open && (\n <ListItemSecondaryAction>\n <IconButton edge=\"end\" onClick={navPanelOperatorButtonClick}>\n <ChevronRightIcon/>\n </IconButton>\n </ListItemSecondaryAction>\n )\n }\n\n </ListItem>\n <Menu\n anchorEl={anchorEl}\n keepMounted={bShowOperatorButtons}\n open={bShowOperatorButtons}\n onClick={navPanelOperatorButtonClick}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n >\n <MenuItem onClick={navPanelLogoutClick}>\n <ListItemIcon>\n <ArrowBackIcon fontSize=\"large\" />\n </ListItemIcon>\n <Typography variant=\"inherit\">Logout</Typography>\n </MenuItem>\n </Menu>\n </>\n </List>\n </Drawer>\n );\n}\n\nNavBar.defaultProps = {\n pConn: null,\n appName: \"\",\n pages: [],\n caseTypes: [],\n};\n\nNavBar.propTypes = {\n pConn: PropTypes.object,\n // eslint-disable-next-line react/no-unused-prop-types\n appName: PropTypes.string,\n pages: PropTypes.arrayOf(PropTypes.object),\n caseTypes: PropTypes.arrayOf(PropTypes.object)\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NavBar.js","sourceRoot":"","sources":["../../../../src/components/infra/NavBar/NavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MA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B;oBAED,oBAAC,QAAQ,IAAC,OAAO,EAAE,MAAM;wBACvB,oBAAC,YAAY;4BACX,oBAAC,aAAa,IAAC,QAAQ,EAAC,OAAO,GAAG,CACrB;wBACf,oBAAC,UAAU,IAAC,OAAO,EAAC,SAAS,aAAoB,CACxC,CACN,CACN,CACE,CACA,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,YAAY,GAAG;IACpB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;CACd,CAAC;AAEF,MAAM,CAAC,SAAS,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,sDAAsD;IACtD,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;CAC/C,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport { Utils } from '../../helpers/utils';\nimport './NavBar.css';\nimport {\n Drawer,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n ListItemSecondaryAction,\n Collapse,\n Divider,\n IconButton,\n Menu,\n MenuItem,\n Typography\n} from '@material-ui/core';\n\nimport PersonOutlineIcon from '@material-ui/icons/PersonOutlineOutlined';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FlagOutlinedIcon from '@material-ui/icons/FlagOutlined';\nimport HomeOutlinedIcon from '@material-ui/icons/HomeOutlined';\nimport ExpandLess from '@material-ui/icons/ExpandLess';\nimport ExpandMore from '@material-ui/icons/ExpandMore';\nimport AddIcon from '@material-ui/icons/Add';\nimport WorkOutlineIcon from '@material-ui/icons/WorkOutline';\nimport ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';\nimport ArrowBackIcon from '@material-ui/icons/ArrowBack';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport { useNavBar } from '../../helpers/reactContextHelpers';\nimport { logout } from '../../helpers/authManager';\n\ndeclare const PCore;\n\nconst iconMap = {\n 'pi pi-headline': <HomeOutlinedIcon fontSize='large' />,\n 'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />\n};\n\nconst drawerWidth = 300;\n\nconst useStyles = makeStyles(theme => ({\n drawerPaper: {\n position: 'relative',\n whiteSpace: 'nowrap',\n width: drawerWidth,\n transition: theme.transitions.create('width', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen\n }),\n height: '100vh'\n },\n drawerPaperClose: {\n overflowX: 'hidden',\n transition: theme.transitions.create('width', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen\n }),\n width: theme.spacing(7),\n [theme.breakpoints.up('md')]: {\n width: theme.spacing(9)\n },\n height: '100vh'\n },\n nested: {\n paddingLeft: theme.spacing(4)\n },\n appListItem: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light)\n },\n appListLogo: {\n marginRight: theme.spacing(2),\n width: '3.6rem'\n },\n appListIcon: {\n color: theme.palette.getContrastText(theme.palette.primary.light)\n },\n appListDiv: {\n backgroundColor: theme.palette.primary.light,\n color: theme.palette.getContrastText(theme.palette.primary.light),\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(2),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n },\n applicationLabel: {\n whiteSpace: 'initial'\n }\n}));\n\nexport default function NavBar(props) {\n const { pConn, pages, caseTypes } = props;\n\n const classes = useStyles();\n const theme = useTheme();\n const isDesktop = useMediaQuery(theme.breakpoints.up('md'));\n\n const { open, setOpen } = useNavBar();\n const [navPages, setNavPages] = useState(JSON.parse(JSON.stringify(pages)));\n const [bShowCaseTypes, setBShowCaseTypes] = useState(true);\n const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false);\n const [anchorEl, setAnchorEl] = useState(null);\n\n const portalLogoImage = Utils.getIconPath(PCore.getAssetLoader().getStaticServerUrl()).concat(\n 'pzpega-logo-mark.svg'\n );\n const portalOperator = PCore.getEnvironmentInfo().getOperatorName();\n const portalApp = PCore.getEnvironmentInfo().getApplicationLabel();\n\n useEffect(() => {\n setNavPages(JSON.parse(JSON.stringify(pages)));\n }, [pages]);\n\n function navPanelButtonClick(oPageData: any) {\n const { pyClassName, pyRuleName } = oPageData;\n\n pConn\n .getActionsApi()\n .showPage(pyRuleName, pyClassName)\n .then(() => {\n // eslint-disable-next-line no-console\n console.log(`showPage completed`);\n });\n }\n\n function navPanelCreateCaseType(sCaseType: string, sFlowType: string) {\n setOpen(false);\n const actionInfo = {\n containerName: 'primary',\n flowType: sFlowType || 'pyStartCase'\n };\n\n pConn\n .getActionsApi()\n .createWork(sCaseType, actionInfo)\n .then(() => {\n // eslint-disable-next-line no-console\n console.log(`createWork completed`);\n });\n }\n\n // Toggle showing the Operator buttons\n function navPanelOperatorButtonClick(evt) {\n setBShowOperatorButtons(!bShowOperatorButtons);\n if (!bShowOperatorButtons) setAnchorEl(evt.currentTarget);\n else setAnchorEl(null);\n }\n\n const handleDrawerOpen = () => {\n setOpen(!open);\n };\n\n const handleCaseItemClick = () => {\n if (!open) {\n setOpen(true);\n setBShowCaseTypes(true);\n } else setBShowCaseTypes(!bShowCaseTypes);\n };\n\n useEffect(() => {\n if (!isDesktop) setOpen(false);\n else setOpen(true);\n }, [isDesktop]);\n\n return (\n <Drawer\n variant='permanent'\n classes={{\n paper: clsx(classes.drawerPaper, !open && classes.drawerPaperClose)\n }}\n open={open && isDesktop}\n >\n {open ? (\n <List className={classes.appListItem}>\n <ListItem onClick={handleDrawerOpen}>\n <ListItemIcon>\n <img src={portalLogoImage} className={classes.appListLogo} />\n </ListItemIcon>\n <ListItemText\n primary={\n <Typography variant='h6' className={classes.applicationLabel}>\n {portalApp}\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n <IconButton edge='end' onClick={handleDrawerOpen}>\n <ChevronLeftIcon className={classes.appListIcon} />\n </IconButton>\n </ListItemSecondaryAction>\n </ListItem>\n </List>\n ) : (\n <div className={classes.appListDiv} onClick={handleDrawerOpen}>\n <ChevronRightIcon\n className={classes.appListIcon}\n id='chevron-right-icon'\n fontSize='large'\n />\n </div>\n )}\n <List>\n <ListItem button onClick={handleCaseItemClick}>\n <ListItemIcon>\n {bShowCaseTypes && open ? (\n <ClearOutlinedIcon fontSize='large' />\n ) : (\n <AddIcon fontSize='large' />\n )}\n </ListItemIcon>\n <ListItemText primary='Create' />\n {bShowCaseTypes ? <ExpandLess /> : <ExpandMore />}\n </ListItem>\n </List>\n <Collapse in={bShowCaseTypes && open} timeout='auto' unmountOnExit className='scrollable'>\n <List component='div' disablePadding>\n {caseTypes.map(caseType => (\n <ListItem\n button\n className={classes.nested}\n onClick={() => navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}\n key={caseType.pyLabel}\n >\n <ListItemIcon>\n <WorkOutlineIcon fontSize='large' />\n </ListItemIcon>\n <ListItemText primary={caseType.pyLabel} />\n </ListItem>\n ))}\n </List>\n </Collapse>\n <List>\n {navPages.map(page => (\n <ListItem button onClick={() => navPanelButtonClick(page)} key={page.pyLabel}>\n <ListItemIcon>{iconMap[page.pxPageViewIcon]}</ListItemIcon>\n <ListItemText primary={page.pyLabel} />\n </ListItem>\n ))}\n </List>\n <Divider />\n <List className='marginTopAuto'>\n <>\n <ListItem onClick={navPanelOperatorButtonClick}>\n <ListItemIcon>\n <PersonOutlineIcon fontSize='large' />\n </ListItemIcon>\n <ListItemText primary={portalOperator} />\n {open && (\n <ListItemSecondaryAction>\n <IconButton edge='end' onClick={navPanelOperatorButtonClick}>\n <ChevronRightIcon />\n </IconButton>\n </ListItemSecondaryAction>\n )}\n </ListItem>\n <Menu\n anchorEl={anchorEl}\n keepMounted={bShowOperatorButtons}\n open={bShowOperatorButtons}\n onClick={navPanelOperatorButtonClick}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left'\n }}\n >\n <MenuItem onClick={logout}>\n <ListItemIcon>\n <ArrowBackIcon fontSize='large' />\n </ListItemIcon>\n <Typography variant='inherit'>Logout</Typography>\n </MenuItem>\n </Menu>\n </>\n </List>\n </Drawer>\n );\n}\n\nNavBar.defaultProps = {\n pConn: null,\n appName: '',\n pages: [],\n caseTypes: []\n};\n\nNavBar.propTypes = {\n pConn: PropTypes.object,\n // eslint-disable-next-line react/no-unused-prop-types\n appName: PropTypes.string,\n pages: PropTypes.arrayOf(PropTypes.object),\n caseTypes: PropTypes.arrayOf(PropTypes.object)\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/RootContainer/RootContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,SAAqB,MAAM,YAAY,CAAC;AA8C/C,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RootContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/RootContainer/RootContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,SAAqB,MAAM,YAAY,CAAC;AA8C/C,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;CAuNlB,CAAC;AAoBF,eAAe,aAAa,CAAC"}
|
|
@@ -44,8 +44,6 @@ const RootContainer = (props) => {
|
|
|
44
44
|
if (isMashup) {
|
|
45
45
|
options["context"] = "root";
|
|
46
46
|
}
|
|
47
|
-
// Used for embedded mode
|
|
48
|
-
// let newPConn: any;
|
|
49
47
|
const [componentName, setComponentName] = useState("");
|
|
50
48
|
useEffect(() => {
|
|
51
49
|
// debugging/investigation help
|
|
@@ -53,7 +51,6 @@ const RootContainer = (props) => {
|
|
|
53
51
|
}, [componentName]);
|
|
54
52
|
// debugging/investigation help
|
|
55
53
|
// console.log(`RootContainer props.routingInfo: ${JSON.stringify(routingInfo)}`);
|
|
56
|
-
// const bannerRef = useRef(null);
|
|
57
54
|
let hasBanner = false;
|
|
58
55
|
let banners = null;
|
|
59
56
|
const messages = httpMessages
|
|
@@ -63,21 +60,6 @@ const RootContainer = (props) => {
|
|
|
63
60
|
banners = hasBanner && (React.createElement("div", null,
|
|
64
61
|
"RootContainer: trying to emit Banner with ",
|
|
65
62
|
messages));
|
|
66
|
-
// && (
|
|
67
|
-
// <Banner
|
|
68
|
-
// ref={bannerRef}
|
|
69
|
-
// id="appShellBanner"
|
|
70
|
-
// variant="urgent"
|
|
71
|
-
// heading="Error"
|
|
72
|
-
// onDismiss={() =>
|
|
73
|
-
// pConn.clearErrorMessages({
|
|
74
|
-
// category: "HTTP",
|
|
75
|
-
// context: "root"
|
|
76
|
-
// })
|
|
77
|
-
// }
|
|
78
|
-
// messages={messages}
|
|
79
|
-
// />
|
|
80
|
-
// );
|
|
81
63
|
const MemoizedModalViewContainer = useMemo(() => {
|
|
82
64
|
return createElement(createPConnectComponent(), PCore.createPConnect({
|
|
83
65
|
meta: {
|
|
@@ -132,7 +114,6 @@ const RootContainer = (props) => {
|
|
|
132
114
|
}
|
|
133
115
|
return noPortalContent;
|
|
134
116
|
}
|
|
135
|
-
// const rootViewRef: any = useRef(null);
|
|
136
117
|
let rootView;
|
|
137
118
|
let rootViewConfig = null;
|
|
138
119
|
useEffect(() => {
|
|
@@ -140,7 +121,6 @@ const RootContainer = (props) => {
|
|
|
140
121
|
const items = Object.keys(containers).filter((item) => item.includes("root"));
|
|
141
122
|
PCore.getContainerUtils().getContainerAPI().addContainerItems(items);
|
|
142
123
|
}, [routingInfo]);
|
|
143
|
-
// const { store } = useConstellationContext();
|
|
144
124
|
const items = getItemView(routingInfo, renderingMode);
|
|
145
125
|
if (items.length > 0) {
|
|
146
126
|
rootViewConfig = {
|
|
@@ -168,13 +148,6 @@ const RootContainer = (props) => {
|
|
|
168
148
|
if (!isEqual(currentRootConfig, prevRootConfig)) {
|
|
169
149
|
rootView = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig));
|
|
170
150
|
}
|
|
171
|
-
// interior was
|
|
172
|
-
// <ModalManager>
|
|
173
|
-
// {rootViewRef.current}
|
|
174
|
-
// {MemoisedModalViewContainer}
|
|
175
|
-
// {MemoizedPreviewViewContainer}
|
|
176
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
177
|
-
// </ModalManager> */}
|
|
178
151
|
// debugging/investigation help
|
|
179
152
|
// console.log(`rootView.props.getPConnect().getComponentName(): ${rootView.props.getPConnect().getComponentName()}`);
|
|
180
153
|
return (React.createElement("div", { id: "ModalManager" },
|
|
@@ -188,10 +161,7 @@ const RootContainer = (props) => {
|
|
|
188
161
|
console.log(`RootContainer rendering in noPortal mode`);
|
|
189
162
|
const theChildren = pConn.getChildren();
|
|
190
163
|
if (theChildren && (theChildren.length === 1)) {
|
|
191
|
-
// this.createdPConnect = theChildren[0];
|
|
192
|
-
// this.createdPConnect = null;
|
|
193
164
|
const localPConn = theChildren[0].getPConnect();
|
|
194
|
-
// newPConn = pConn;
|
|
195
165
|
const localCompName = localPConn.getComponentName();
|
|
196
166
|
if (componentName !== localCompName) {
|
|
197
167
|
setComponentName(localCompName);
|
|
@@ -201,39 +171,19 @@ const RootContainer = (props) => {
|
|
|
201
171
|
return noPortalContent;
|
|
202
172
|
}
|
|
203
173
|
else if (children && children.length > 0) {
|
|
204
|
-
// interior was
|
|
205
|
-
// <ModalManager>
|
|
206
|
-
// {httpMessages ? <div id="root-container">{banners}</div> : ""}
|
|
207
|
-
// {children}
|
|
208
|
-
// {MemoizedModalViewContainer}
|
|
209
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
210
|
-
// {MemoizedPreviewViewContainer}
|
|
211
|
-
// </ModalManager>
|
|
212
174
|
return (React.createElement(React.Fragment, null,
|
|
213
175
|
React.createElement("div", null, "RootContainer: Has children. Trying to show ModalManager with children, etc."),
|
|
214
176
|
children,
|
|
215
177
|
MemoizedModalViewContainer));
|
|
216
178
|
}
|
|
217
179
|
else if (skeleton) {
|
|
218
|
-
// TODO: need to update once skeletons are available
|
|
219
180
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
220
181
|
const LoadingComponent = LazyComponentMap[skeleton];
|
|
221
|
-
// interior was
|
|
222
|
-
// <ModalManager>
|
|
223
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
224
|
-
// <LoadingComponent />
|
|
225
|
-
// </ModalManager>
|
|
226
182
|
return (React.createElement("div", { id: "root-container" },
|
|
227
183
|
React.createElement(Box, { textAlign: "center" },
|
|
228
184
|
React.createElement(CircularProgress, null))));
|
|
229
185
|
}
|
|
230
186
|
else {
|
|
231
|
-
// interior was
|
|
232
|
-
// <ModalManager>
|
|
233
|
-
// {MemoisedModalViewContainer}
|
|
234
|
-
// {MemoizedPreviewViewContainer}
|
|
235
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
236
|
-
// </ModalManager>
|
|
237
187
|
return (React.createElement("div", { id: "root-container" },
|
|
238
188
|
React.createElement("div", null, "RootContainer: Should be ModalManager, etc.")));
|
|
239
189
|
}
|