@pega/react-sdk-overrides 0.23.6

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.
Files changed (220) hide show
  1. package/lib/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.css +19 -0
  2. package/lib/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.tsx +156 -0
  3. package/lib/designSystemExtensions/CaseSummaryFields/index.tsx +1 -0
  4. package/lib/designSystemExtensions/DetailsFields/DetailsFields.tsx +154 -0
  5. package/lib/designSystemExtensions/DetailsFields/index.tsx +1 -0
  6. package/lib/designSystemExtensions/FieldGroup/FieldGroup.tsx +113 -0
  7. package/lib/designSystemExtensions/FieldGroup/index.tsx +1 -0
  8. package/lib/designSystemExtensions/FieldGroupList/FieldGroupList.tsx +53 -0
  9. package/lib/designSystemExtensions/FieldGroupList/index.tsx +1 -0
  10. package/lib/designSystemExtensions/FieldValueList/FieldValueList.tsx +106 -0
  11. package/lib/designSystemExtensions/FieldValueList/index.tsx +1 -0
  12. package/lib/designSystemExtensions/Operator/Operator.tsx +195 -0
  13. package/lib/designSystemExtensions/Operator/index.tsx +1 -0
  14. package/lib/designSystemExtensions/Pulse/Pulse.tsx +31 -0
  15. package/lib/designSystemExtensions/Pulse/index.tsx +1 -0
  16. package/lib/forms/AutoComplete/AutoComplete.tsx +183 -0
  17. package/lib/forms/AutoComplete/index.tsx +1 -0
  18. package/lib/forms/CancelAlert/CancelAlert.css +24 -0
  19. package/lib/forms/CancelAlert/CancelAlert.tsx +126 -0
  20. package/lib/forms/CancelAlert/index.tsx +1 -0
  21. package/lib/forms/Checkbox/Checkbox.tsx +68 -0
  22. package/lib/forms/Checkbox/index.tsx +1 -0
  23. package/lib/forms/Currency/Currency.tsx +89 -0
  24. package/lib/forms/Currency/index.tsx +1 -0
  25. package/lib/forms/Date/Date.tsx +79 -0
  26. package/lib/forms/Date/index.tsx +1 -0
  27. package/lib/forms/DateTime/DateTime.tsx +75 -0
  28. package/lib/forms/DateTime/index.tsx +1 -0
  29. package/lib/forms/Decimal/Decimal.tsx +51 -0
  30. package/lib/forms/Decimal/index.tsx +1 -0
  31. package/lib/forms/Dropdown/Dropdown.tsx +82 -0
  32. package/lib/forms/Dropdown/index.tsx +1 -0
  33. package/lib/forms/Email/Email.tsx +68 -0
  34. package/lib/forms/Email/index.tsx +1 -0
  35. package/lib/forms/Integer/Integer.tsx +77 -0
  36. package/lib/forms/Integer/index.tsx +1 -0
  37. package/lib/forms/Percentage/Percentage.tsx +82 -0
  38. package/lib/forms/Percentage/index.tsx +1 -0
  39. package/lib/forms/Phone/Phone.tsx +90 -0
  40. package/lib/forms/Phone/index.tsx +1 -0
  41. package/lib/forms/RadioButtons/RadioButtons.tsx +73 -0
  42. package/lib/forms/RadioButtons/index.tsx +1 -0
  43. package/lib/forms/SemanticLink/SemanticLink.tsx +69 -0
  44. package/lib/forms/SemanticLink/index.tsx +1 -0
  45. package/lib/forms/SemanticLink/utils.ts +51 -0
  46. package/lib/forms/TextArea/TextArea.tsx +66 -0
  47. package/lib/forms/TextArea/index.tsx +1 -0
  48. package/lib/forms/TextContent/TextContent.tsx +40 -0
  49. package/lib/forms/TextContent/index.tsx +1 -0
  50. package/lib/forms/TextInput/TextInput.tsx +61 -0
  51. package/lib/forms/TextInput/index.tsx +1 -0
  52. package/lib/forms/Time/Time.tsx +71 -0
  53. package/lib/forms/Time/index.tsx +1 -0
  54. package/lib/forms/URL/URL.tsx +53 -0
  55. package/lib/forms/URL/index.tsx +1 -0
  56. package/lib/forms/UserReference/UserReference.tsx +197 -0
  57. package/lib/forms/UserReference/UserReferenceUtils.ts +13 -0
  58. package/lib/forms/UserReference/index.tsx +1 -0
  59. package/lib/helpers/auth.js +483 -0
  60. package/lib/helpers/authManager.js +630 -0
  61. package/lib/helpers/config_access.js +268 -0
  62. package/lib/helpers/data_page.ts +24 -0
  63. package/lib/helpers/event-utils.js +20 -0
  64. package/lib/helpers/field-group-utils.js +61 -0
  65. package/lib/helpers/formatters/Boolean.js +38 -0
  66. package/lib/helpers/formatters/Currency.js +74 -0
  67. package/lib/helpers/formatters/CurrencyMap.js +908 -0
  68. package/lib/helpers/formatters/Date.js +77 -0
  69. package/lib/helpers/formatters/common.js +10 -0
  70. package/lib/helpers/formatters/index.js +120 -0
  71. package/lib/helpers/utils.ts +334 -0
  72. package/lib/helpers/versionHelpers.ts +50 -0
  73. package/lib/infra/ActionButtons/ActionButtons.tsx +70 -0
  74. package/lib/infra/ActionButtons/index.tsx +1 -0
  75. package/lib/infra/Assignment/Assignment.tsx +301 -0
  76. package/lib/infra/Assignment/index.tsx +1 -0
  77. package/lib/infra/AssignmentCard/AssignmentCard.tsx +47 -0
  78. package/lib/infra/AssignmentCard/index.tsx +1 -0
  79. package/lib/infra/Attachment/Attachment.css +18 -0
  80. package/lib/infra/Attachment/Attachment.tsx +404 -0
  81. package/lib/infra/Attachment/AttachmentUtils.js +71 -0
  82. package/lib/infra/Attachment/index.tsx +1 -0
  83. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +511 -0
  84. package/lib/infra/Containers/FlowContainer/helpers.js +147 -0
  85. package/lib/infra/Containers/FlowContainer/index.tsx +1 -0
  86. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +320 -0
  87. package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -0
  88. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +216 -0
  89. package/lib/infra/Containers/ViewContainer/index.tsx +1 -0
  90. package/lib/infra/DashboardFilter/DashboardFilter.tsx +180 -0
  91. package/lib/infra/DashboardFilter/filterUtils.tsx +188 -0
  92. package/lib/infra/DashboardFilter/index.tsx +1 -0
  93. package/lib/infra/DeferLoad/DeferLoad.tsx +175 -0
  94. package/lib/infra/DeferLoad/index.tsx +1 -0
  95. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +103 -0
  96. package/lib/infra/ErrorBoundary/index.tsx +1 -0
  97. package/lib/infra/MultiStep/MultiStep.css +261 -0
  98. package/lib/infra/MultiStep/MultiStep.tsx +225 -0
  99. package/lib/infra/MultiStep/index.tsx +1 -0
  100. package/lib/infra/NavBar/NavBar.css +170 -0
  101. package/lib/infra/NavBar/NavBar.tsx +393 -0
  102. package/lib/infra/NavBar/index.tsx +1 -0
  103. package/lib/infra/Reference/Reference.tsx +58 -0
  104. package/lib/infra/Reference/index.tsx +1 -0
  105. package/lib/infra/Region/Region.tsx +17 -0
  106. package/lib/infra/Region/index.tsx +1 -0
  107. package/lib/infra/RootContainer/RootContainer.tsx +336 -0
  108. package/lib/infra/RootContainer/index.tsx +1 -0
  109. package/lib/infra/Stages/Stages.tsx +120 -0
  110. package/lib/infra/Stages/index.tsx +1 -0
  111. package/lib/infra/ToDo/ToDo.css +87 -0
  112. package/lib/infra/ToDo/ToDo.tsx +285 -0
  113. package/lib/infra/ToDo/index.tsx +1 -0
  114. package/lib/infra/VerticalTabs/LeftAlignVerticalTab.tsx +27 -0
  115. package/lib/infra/VerticalTabs/VerticalTabs.tsx +75 -0
  116. package/lib/infra/VerticalTabs/index.tsx +1 -0
  117. package/lib/infra/View/View.css +8 -0
  118. package/lib/infra/View/View.tsx +175 -0
  119. package/lib/infra/View/index.tsx +1 -0
  120. package/lib/templates/AppShell/AppShell.css +40 -0
  121. package/lib/templates/AppShell/AppShell.tsx +439 -0
  122. package/lib/templates/AppShell/index.tsx +1 -0
  123. package/lib/templates/CaseSummary/CaseSummary.tsx +50 -0
  124. package/lib/templates/CaseSummary/index.tsx +1 -0
  125. package/lib/templates/CaseView/CaseView.tsx +261 -0
  126. package/lib/templates/CaseView/CaseViewActionsMenu.tsx +73 -0
  127. package/lib/templates/CaseView/index.tsx +1 -0
  128. package/lib/templates/DataReference/DataReference.tsx +290 -0
  129. package/lib/templates/DataReference/index.tsx +1 -0
  130. package/lib/templates/DefaultForm/DefaultForm.css +25 -0
  131. package/lib/templates/DefaultForm/DefaultForm.tsx +52 -0
  132. package/lib/templates/DefaultForm/index.tsx +1 -0
  133. package/lib/templates/Details/Details/Details.tsx +35 -0
  134. package/lib/templates/Details/Details/index.tsx +1 -0
  135. package/lib/templates/Details/DetailsSubTabs/DetailsSubTabs.tsx +65 -0
  136. package/lib/templates/Details/DetailsSubTabs/index.tsx +1 -0
  137. package/lib/templates/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +45 -0
  138. package/lib/templates/Details/DetailsThreeColumn/index.tsx +1 -0
  139. package/lib/templates/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +43 -0
  140. package/lib/templates/Details/DetailsTwoColumn/index.tsx +1 -0
  141. package/lib/templates/FieldGroupTemplate/FieldGroupTemplate.tsx +94 -0
  142. package/lib/templates/FieldGroupTemplate/index.tsx +1 -0
  143. package/lib/templates/InlineDashboard/InlineDashboard.tsx +72 -0
  144. package/lib/templates/InlineDashboard/index.tsx +1 -0
  145. package/lib/templates/InlineDashboardPage/InlineDashboardPage.tsx +41 -0
  146. package/lib/templates/InlineDashboardPage/index.tsx +1 -0
  147. package/lib/templates/ListPage/ListPage.tsx +20 -0
  148. package/lib/templates/ListPage/index.tsx +1 -0
  149. package/lib/templates/ListView/ListView.css +10 -0
  150. package/lib/templates/ListView/ListView.tsx +1230 -0
  151. package/lib/templates/ListView/index.tsx +1 -0
  152. package/lib/templates/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +42 -0
  153. package/lib/templates/MultiReferenceReadOnly/index.tsx +1 -0
  154. package/lib/templates/NarrowWide/NarrowWide/NarrowWide.css +21 -0
  155. package/lib/templates/NarrowWide/NarrowWide/NarrowWide.tsx +35 -0
  156. package/lib/templates/NarrowWide/NarrowWide/index.tsx +1 -0
  157. package/lib/templates/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +53 -0
  158. package/lib/templates/NarrowWide/NarrowWideDetails/index.tsx +1 -0
  159. package/lib/templates/NarrowWide/NarrowWideForm/NarrowWideForm.css +21 -0
  160. package/lib/templates/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +24 -0
  161. package/lib/templates/NarrowWide/NarrowWideForm/index.tsx +1 -0
  162. package/lib/templates/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +38 -0
  163. package/lib/templates/NarrowWide/NarrowWidePage/index.tsx +1 -0
  164. package/lib/templates/OneColumn/OneColumn/OneColumn.tsx +32 -0
  165. package/lib/templates/OneColumn/OneColumn/index.tsx +1 -0
  166. package/lib/templates/OneColumn/OneColumnPage/OneColumnPage.tsx +24 -0
  167. package/lib/templates/OneColumn/OneColumnPage/index.tsx +1 -0
  168. package/lib/templates/OneColumn/OneColumnTab/OneColumnTab.tsx +17 -0
  169. package/lib/templates/OneColumn/OneColumnTab/index.tsx +1 -0
  170. package/lib/templates/PromotedFilters/PromotedFilters.css +7 -0
  171. package/lib/templates/PromotedFilters/PromotedFilters.tsx +160 -0
  172. package/lib/templates/PromotedFilters/index.tsx +1 -0
  173. package/lib/templates/SimpleTable/SimpleTable/SimpleTable.tsx +28 -0
  174. package/lib/templates/SimpleTable/SimpleTable/index.tsx +1 -0
  175. package/lib/templates/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +719 -0
  176. package/lib/templates/SimpleTable/SimpleTableManual/index.tsx +1 -0
  177. package/lib/templates/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +129 -0
  178. package/lib/templates/SimpleTable/SimpleTableSelect/index.tsx +1 -0
  179. package/lib/templates/SimpleTable/helpers.ts +360 -0
  180. package/lib/templates/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +66 -0
  181. package/lib/templates/SingleReferenceReadOnly/index.tsx +1 -0
  182. package/lib/templates/SubTabs/SubTabs.tsx +65 -0
  183. package/lib/templates/SubTabs/index.tsx +1 -0
  184. package/lib/templates/SubTabs/tabUtils.ts +73 -0
  185. package/lib/templates/TwoColumn/TwoColumn/TwoColumn.css +13 -0
  186. package/lib/templates/TwoColumn/TwoColumn/TwoColumn.tsx +58 -0
  187. package/lib/templates/TwoColumn/TwoColumn/index.tsx +1 -0
  188. package/lib/templates/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +25 -0
  189. package/lib/templates/TwoColumn/TwoColumnPage/index.tsx +1 -0
  190. package/lib/templates/TwoColumn/TwoColumnTab/TwoColumnTab.css +12 -0
  191. package/lib/templates/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +55 -0
  192. package/lib/templates/TwoColumn/TwoColumnTab/index.tsx +1 -0
  193. package/lib/templates/WideNarrow/WideNarrow/WideNarrow.css +21 -0
  194. package/lib/templates/WideNarrow/WideNarrow/WideNarrow.tsx +35 -0
  195. package/lib/templates/WideNarrow/WideNarrow/index.tsx +1 -0
  196. package/lib/templates/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +54 -0
  197. package/lib/templates/WideNarrow/WideNarrowDetails/index.tsx +1 -0
  198. package/lib/templates/WideNarrow/WideNarrowForm/WideNarrowForm.css +21 -0
  199. package/lib/templates/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +24 -0
  200. package/lib/templates/WideNarrow/WideNarrowForm/index.tsx +1 -0
  201. package/lib/templates/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +38 -0
  202. package/lib/templates/WideNarrow/WideNarrowPage/index.tsx +1 -0
  203. package/lib/templates/utils.ts +23 -0
  204. package/lib/widgets/AppAnnouncement/AppAnnouncement.tsx +67 -0
  205. package/lib/widgets/AppAnnouncement/index.tsx +1 -0
  206. package/lib/widgets/CaseHistory/CaseHistory.tsx +169 -0
  207. package/lib/widgets/CaseHistory/index.tsx +1 -0
  208. package/lib/widgets/FileUtility/ActionButtonsForFileUtil.css +27 -0
  209. package/lib/widgets/FileUtility/ActionButtonsForFileUtil.tsx +22 -0
  210. package/lib/widgets/FileUtility/FileUtility.css +117 -0
  211. package/lib/widgets/FileUtility/FileUtility.tsx +567 -0
  212. package/lib/widgets/FileUtility/index.tsx +0 -0
  213. package/lib/widgets/Followers/Followers.tsx +43 -0
  214. package/lib/widgets/Followers/index.tsx +1 -0
  215. package/lib/widgets/SummaryItem/SummaryItem.css +78 -0
  216. package/lib/widgets/SummaryItem/SummaryItem.tsx +80 -0
  217. package/lib/widgets/SummaryItem/index.tsx +1 -0
  218. package/lib/widgets/SummaryList/SummaryList.tsx +12 -0
  219. package/lib/widgets/SummaryList/index.tsx +1 -0
  220. package/package.json +14 -0
@@ -0,0 +1,393 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
3
+ import clsx from 'clsx';
4
+ import PropTypes from "prop-types";
5
+ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
6
+
7
+ import './NavBar.css';
8
+
9
+ import {
10
+ Drawer,
11
+ List,
12
+ ListItem,
13
+ ListItemIcon,
14
+ ListItemText,
15
+ ListItemSecondaryAction,
16
+ Collapse,
17
+ Divider,
18
+ IconButton,
19
+ Menu,
20
+ MenuItem,
21
+ Typography
22
+ } from '@material-ui/core';
23
+
24
+ import PersonOutlineIcon from '@material-ui/icons/PersonOutlineOutlined';
25
+ import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
26
+ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
27
+ import FlagOutlinedIcon from '@material-ui/icons/FlagOutlined';
28
+ import HomeOutlinedIcon from '@material-ui/icons/HomeOutlined';
29
+ import ExpandLess from '@material-ui/icons/ExpandLess';
30
+ import ExpandMore from '@material-ui/icons/ExpandMore';
31
+ import AddIcon from '@material-ui/icons/Add';
32
+ import WorkOutlineIcon from '@material-ui/icons/WorkOutline';
33
+ import ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';
34
+ import ArrowBackIcon from '@material-ui/icons/ArrowBack';
35
+ import useMediaQuery from '@material-ui/core/useMediaQuery';
36
+
37
+ import { useNavBar } from "@pega/react-sdk-components/lib/components/templates/AppShell/AppShell";
38
+ import { logout } from '@pega/react-sdk-components/lib/components/helpers/authManager';
39
+
40
+ declare const PCore;
41
+
42
+ const iconMap = {
43
+ "pi pi-headline" : <HomeOutlinedIcon fontSize="large"/>,
44
+ "pi pi-flag-solid": <FlagOutlinedIcon fontSize="large"/>
45
+ }
46
+
47
+ const drawerWidth = 300;
48
+
49
+ const useStyles = makeStyles((theme) => ({
50
+ drawerPaper: {
51
+ position: 'relative',
52
+ whiteSpace: 'nowrap',
53
+ width: drawerWidth,
54
+ transition: theme.transitions.create('width', {
55
+ easing: theme.transitions.easing.sharp,
56
+ duration: theme.transitions.duration.enteringScreen,
57
+ }),
58
+ height: "100vh"
59
+ },
60
+ drawerPaperClose: {
61
+ overflowX: 'hidden',
62
+ transition: theme.transitions.create('width', {
63
+ easing: theme.transitions.easing.sharp,
64
+ duration: theme.transitions.duration.leavingScreen,
65
+ }),
66
+ width: theme.spacing(7),
67
+ [theme.breakpoints.up('md')]: {
68
+ width: theme.spacing(9),
69
+ },
70
+ height: "100vh"
71
+ },
72
+ nested: {
73
+ paddingLeft: theme.spacing(4),
74
+ },
75
+ appListItem: {
76
+ backgroundColor: theme.palette.primary.light,
77
+ color: theme.palette.getContrastText(theme.palette.primary.light),
78
+ },
79
+ appListLogo: {
80
+ marginRight: theme.spacing(2),
81
+ width: "3.6rem",
82
+ },
83
+ appListIcon: {
84
+ color: theme.palette.getContrastText(theme.palette.primary.light),
85
+ },
86
+ appListDiv: {
87
+ backgroundColor: theme.palette.primary.light,
88
+ color: theme.palette.getContrastText(theme.palette.primary.light),
89
+ paddingTop: theme.spacing(2),
90
+ paddingBottom: theme.spacing(2),
91
+ display: "flex",
92
+ alignItems: "center",
93
+ justifyContent: "center"
94
+ }
95
+ }));
96
+
97
+ export default function NavBar(props) {
98
+ const {
99
+ pConn,
100
+ pages,
101
+ caseTypes
102
+ } = props;
103
+
104
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
105
+ const [navIcon, setNavIcon] = useState((PCore.getAssetLoader().getStaticServerUrl()).concat("pzpega-logo-mark.svg"));
106
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
107
+ const [navExpandCollapse, setNavExpandCollapse] = useState(Utils.getImageSrc("plus", PCore.getAssetLoader().getStaticServerUrl()));
108
+ const [navPages, setNavPages] = useState(JSON.parse(JSON.stringify(pages)));
109
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
110
+ const [portalLogoImage, setPortalLogoImage] = useState(Utils.getIconPath(PCore.getAssetLoader().getStaticServerUrl()).concat("pzpega-logo-mark.svg"));
111
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
112
+ const [portalOperator, setPortalOperator] = useState(PCore.getEnvironmentInfo().getOperatorName());
113
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
114
+ const [portalOperatorInitials, setPortalOperatorInitials] = useState(Utils.getInitials(portalOperator));
115
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
116
+ const [portalApp, setPortalApp] = useState(PCore.getEnvironmentInfo().getApplicationLabel());
117
+ const [bShowCaseTypes, setBShowCaseTypes] = useState(true);
118
+ const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false)
119
+ const {open, setOpen} = useNavBar();
120
+ const [anchorEl, setAnchorEl] = useState(null);
121
+
122
+ const classes = useStyles();
123
+ const theme = useTheme();
124
+ const isDesktop = useMediaQuery(theme.breakpoints.up('md'));
125
+
126
+ useEffect( () => {
127
+ setNavPages(JSON.parse(JSON.stringify(pages)));
128
+ },
129
+ [pages]);
130
+
131
+ // const caseTypesMap = caseTypes.map((caseType, index) => {
132
+ // const theKey = `caseType.${index}`;
133
+ // return <li key={theKey}>{caseType.pyLabel}</li>;
134
+ // });
135
+
136
+ // const pagesMap = pages.map((page, index) => {
137
+ // const theKey = `page.${index}`;
138
+ // return <li key={theKey}>{page.pyLabel}</li>;
139
+ // });
140
+
141
+ function navPanelButtonClick(oPageData: any) {
142
+ const {
143
+ pyClassName,
144
+ pyRuleName
145
+ } = oPageData;
146
+
147
+ pConn.getActionsApi().showPage(pyRuleName, pyClassName).then(() => {
148
+ // eslint-disable-next-line no-console
149
+ console.log(`showPage completed`);
150
+ });
151
+ }
152
+
153
+ // function navPanelCreateButtonClick() {
154
+ // if (navExpandCollapse.indexOf("plus") > 0) {
155
+ // setNavExpandCollapse(Utils.getImageSrc("times", PCore.getAssetLoader().getStaticServerUrl()));
156
+ // setBShowCaseTypes(true);
157
+ // }
158
+ // else {
159
+ // setNavExpandCollapse(Utils.getImageSrc("plus", PCore.getAssetLoader().getStaticServerUrl()));
160
+ // setBShowCaseTypes(false);
161
+ // }
162
+ // }
163
+
164
+ function navPanelCreateCaseType(sCaseType: string, sFlowType: string) {
165
+ setOpen(false);
166
+ const actionInfo = {
167
+ containerName: "primary",
168
+ flowType: sFlowType || "pyStartCase"
169
+ };
170
+
171
+ pConn.getActionsApi().createWork(sCaseType, actionInfo).then(() => {
172
+ // eslint-disable-next-line no-console
173
+ console.log(`createWork completed`);
174
+ });
175
+
176
+ }
177
+
178
+ // Toggle showing the Operator buttons
179
+ function navPanelOperatorButtonClick(evt) {
180
+ setBShowOperatorButtons(!bShowOperatorButtons);
181
+ if (!bShowOperatorButtons) setAnchorEl(evt.currentTarget);
182
+ else setAnchorEl(null);
183
+ }
184
+
185
+ function navPanelLogoutClick() {
186
+
187
+ try {
188
+ // eslint-disable-next-line no-console
189
+ console.log(`--> navPanelLogoutClick clicked`);
190
+ // Commenting out until revokeToken API is available
191
+ // pConn.getActionsApi().logout().then(() => {
192
+ // // eslint-disable-next-line no-console
193
+ // console.log(`logout completed`);
194
+ // },
195
+ // error => {
196
+ // // eslint-disable-next-line no-console
197
+ // console.error(`onRejected function called: ${error.message}`);
198
+ // })
199
+ } catch (err) {
200
+ // eslint-disable-next-line no-console
201
+ console.log(`--> Attempt to call logout api failed: ${err}`);
202
+ }
203
+ finally {
204
+ // authLogout();
205
+ logout();
206
+ }
207
+ }
208
+
209
+ // const theCaseTypeButtons = caseTypes.map((caseType) => <div style={{display: "flex"}}>
210
+ // <button className="btn btn-link text-white"
211
+ // onClick={() => { navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}}>{caseType.pyLabel}</button></div>
212
+ // );
213
+
214
+ // const theOperatorButtons = <button className="btn btn-link text-white" style={{marginLeft: "-0.05rem"}} onClick={navPanelLogoutClick}>Logoff</button>;
215
+
216
+
217
+ // return <div id="NavBar" style={{border: "solid 1px silver", margin: "1px"}} >
218
+ // NavBar for <strong>{appName}</strong>
219
+ // <br></br>
220
+ // caseTypes:
221
+ // <ul>
222
+ // {caseTypesMap}
223
+ // </ul>
224
+ // Pages:
225
+ // <ul>
226
+ // {pagesMap}
227
+ // </ul>
228
+ // </div>;
229
+
230
+
231
+ const handleDrawerOpen = () => {
232
+ setOpen(!open);
233
+ };
234
+
235
+ const handleCaseItemClick = () => {
236
+ if (!open) {
237
+ setOpen(true);
238
+ setBShowCaseTypes(true);
239
+ } else setBShowCaseTypes(!bShowCaseTypes);
240
+ }
241
+
242
+ // const handlePopoverOpen = (event) => {
243
+ // setAnchorEl(event.currentTarget);
244
+ // };
245
+
246
+ // const handlePopoverClose = () => {
247
+ // setAnchorEl(null);
248
+ // };
249
+
250
+
251
+ useEffect(() => {
252
+ if (!isDesktop) setOpen(false);
253
+ else setOpen(true);
254
+ }, [isDesktop])
255
+
256
+
257
+ return (
258
+ <Drawer
259
+ variant="permanent"
260
+ classes={{
261
+ paper: clsx(classes.drawerPaper, !open && classes.drawerPaperClose),
262
+ }}
263
+ open={open && isDesktop}
264
+ >
265
+ {
266
+ open ? (
267
+ <List className={classes.appListItem}>
268
+ <ListItem onClick={handleDrawerOpen}>
269
+ <ListItemIcon>
270
+ <img src={portalLogoImage} className={classes.appListLogo}/>
271
+ </ListItemIcon>
272
+ <ListItemText
273
+ primary={<Typography variant="h6">{portalApp}</Typography>}
274
+ />
275
+ <ListItemSecondaryAction>
276
+ <IconButton edge="end" onClick={handleDrawerOpen}>
277
+ <ChevronLeftIcon className={classes.appListIcon} />
278
+ </IconButton>
279
+ </ListItemSecondaryAction>
280
+ </ListItem>
281
+ </List>
282
+ ) : (
283
+ <div className={classes.appListDiv} onClick={handleDrawerOpen} >
284
+ <ChevronRightIcon className={classes.appListIcon} id="chevron-right-icon" fontSize="large" />
285
+ </div>
286
+ )
287
+ }
288
+ <List>
289
+ <ListItem button onClick={handleCaseItemClick}>
290
+ <ListItemIcon>
291
+ {
292
+ bShowCaseTypes && open ? <ClearOutlinedIcon fontSize="large" /> : <AddIcon fontSize="large" />
293
+ }
294
+ </ListItemIcon>
295
+ <ListItemText primary="Create" />
296
+ {bShowCaseTypes ? <ExpandLess /> : <ExpandMore />}
297
+ </ListItem>
298
+ </List>
299
+ <Collapse in={bShowCaseTypes && open} timeout="auto" unmountOnExit className='scrollable'>
300
+ <List component="div" disablePadding>
301
+ {
302
+ caseTypes.map(caseType => (
303
+ <ListItem
304
+ button
305
+ className={classes.nested}
306
+ onClick={() => navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}
307
+ key={caseType.pyLabel}
308
+ >
309
+ <ListItemIcon>
310
+ <WorkOutlineIcon fontSize="large" />
311
+ </ListItemIcon>
312
+ <ListItemText primary={caseType.pyLabel} />
313
+ </ListItem>
314
+ ))
315
+ }
316
+ </List>
317
+ </Collapse>
318
+ <List>
319
+ {
320
+ navPages.map(page => (
321
+ <ListItem
322
+ button
323
+ onClick={() => navPanelButtonClick(page)}
324
+ key={page.pyLabel}
325
+ >
326
+ <ListItemIcon>
327
+ {iconMap[page.pxPageViewIcon]}
328
+ </ListItemIcon>
329
+ <ListItemText primary={page.pyLabel} />
330
+ </ListItem>
331
+ ))
332
+ }
333
+ </List>
334
+ <Divider />
335
+ <List className='marginTopAuto'>
336
+ <>
337
+ <ListItem onClick={navPanelOperatorButtonClick}>
338
+ <ListItemIcon>
339
+ <PersonOutlineIcon fontSize="large" />
340
+ </ListItemIcon>
341
+ <ListItemText primary={portalOperator} />
342
+ {
343
+ open && (
344
+ <ListItemSecondaryAction>
345
+ <IconButton edge="end" onClick={navPanelOperatorButtonClick}>
346
+ <ChevronRightIcon/>
347
+ </IconButton>
348
+ </ListItemSecondaryAction>
349
+ )
350
+ }
351
+
352
+ </ListItem>
353
+ <Menu
354
+ anchorEl={anchorEl}
355
+ keepMounted={bShowOperatorButtons}
356
+ open={bShowOperatorButtons}
357
+ onClick={navPanelOperatorButtonClick}
358
+ anchorOrigin={{
359
+ vertical: 'top',
360
+ horizontal: 'right',
361
+ }}
362
+ transformOrigin={{
363
+ vertical: 'top',
364
+ horizontal: 'left',
365
+ }}
366
+ >
367
+ <MenuItem onClick={navPanelLogoutClick}>
368
+ <ListItemIcon>
369
+ <ArrowBackIcon fontSize="large" />
370
+ </ListItemIcon>
371
+ <Typography variant="inherit">Logout</Typography>
372
+ </MenuItem>
373
+ </Menu>
374
+ </>
375
+ </List>
376
+ </Drawer>
377
+ );
378
+ }
379
+
380
+ NavBar.defaultProps = {
381
+ pConn: null,
382
+ appName: "",
383
+ pages: [],
384
+ caseTypes: [],
385
+ };
386
+
387
+ NavBar.propTypes = {
388
+ pConn: PropTypes.object,
389
+ // eslint-disable-next-line react/no-unused-prop-types
390
+ appName: PropTypes.string,
391
+ pages: PropTypes.arrayOf(PropTypes.object),
392
+ caseTypes: PropTypes.arrayOf(PropTypes.object)
393
+ };
@@ -0,0 +1 @@
1
+ export { default } from './NavBar';
@@ -0,0 +1,58 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+
4
+ export default function Reference(props) {
5
+ const { visibility, context, getPConnect, readOnly, displayMode } = props;
6
+
7
+ const pConnect = getPConnect();
8
+ const referenceConfig = { ...pConnect.getComponentConfig() } || {};
9
+
10
+ delete referenceConfig?.name;
11
+ delete referenceConfig?.type;
12
+ delete referenceConfig?.visibility;
13
+
14
+ const viewMetadata = pConnect.getReferencedView();
15
+
16
+ if (!viewMetadata) {
17
+ // console.log("View not found ", pConnect.getComponentConfig());
18
+ return null;
19
+ }
20
+
21
+ const viewObject = {
22
+ ...viewMetadata,
23
+ config: {
24
+ ...viewMetadata.config,
25
+ ...referenceConfig
26
+ }
27
+ };
28
+
29
+ const viewComponent = pConnect.createComponent(viewObject, null, null, {
30
+ pageReference: context
31
+ });
32
+
33
+ viewComponent.props.getPConnect().setInheritedConfig({
34
+ ...referenceConfig,
35
+ readOnly,
36
+ displayMode
37
+ });
38
+
39
+ if (visibility !== false) {
40
+ return <React.Fragment>{viewComponent}</React.Fragment>;
41
+ }
42
+ return null;
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
+ };
@@ -0,0 +1 @@
1
+ export { default } from './Reference';
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+
4
+ export default function Region(props) {
5
+ const { children } = props;
6
+
7
+ return <React.Fragment>
8
+ <>
9
+ {/* <div>Region</div> */}
10
+ {children}
11
+ </>
12
+ </React.Fragment>;
13
+ }
14
+
15
+ Region.propTypes = {
16
+ children: PropTypes.arrayOf(PropTypes.node).isRequired
17
+ };
@@ -0,0 +1 @@
1
+ export { default } from './Region';