@pega/react-sdk-components 0.23.18 → 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.
Files changed (32) hide show
  1. package/lib/components/helpers/authManager.d.ts.map +1 -1
  2. package/lib/components/helpers/authManager.js +1 -0
  3. package/lib/components/helpers/authManager.js.map +1 -1
  4. package/lib/components/helpers/event-utils.js +1 -1
  5. package/lib/components/helpers/event-utils.js.map +1 -1
  6. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  7. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +2 -2
  8. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  9. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  10. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +3 -49
  11. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  12. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  13. package/lib/components/infra/RootContainer/RootContainer.js +0 -50
  14. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  15. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  16. package/lib/components/infra/Stages/Stages.js +1 -2
  17. package/lib/components/infra/Stages/Stages.js.map +1 -1
  18. package/lib/components/infra/View/View.js +1 -1
  19. package/lib/components/infra/View/View.js.map +1 -1
  20. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  21. package/lib/components/template/AppShell/AppShell.js +2 -323
  22. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  23. package/lib/components/template/CaseSummary/CaseSummary.js +1 -1
  24. package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
  25. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  26. package/lib/components/template/ListView/ListView.js +5 -39
  27. package/lib/components/template/ListView/ListView.js.map +1 -1
  28. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  29. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -20
  30. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  31. package/lib/doc/KeyReleaseUpdates.md +33 -0
  32. package/package.json +1 -1
@@ -2,16 +2,8 @@ import React, { useEffect, useState } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
  import { NavContext } from '../../helpers/reactContextHelpers';
5
- // import {
6
- // Avatar,
7
- // Toaster,
8
- // Banner,
9
- // AppShell as CosmosAppShell
10
- // } from "@pega/cosmos-react-core";
11
- // import createPConnectComponent from "../../../bridge/react_pconnect";
12
- // import { buildRecentList, onRecentClickHandler } from "./Recents/utils";
13
5
  import './AppShell.css';
14
- // AppShell can emit NavBar and ViewContainer
6
+ // AppShell can emit NavBar
15
7
  import NavBar from '../../infra/NavBar';
16
8
  const useStyles = makeStyles((theme) => ({
17
9
  root: {
@@ -25,286 +17,13 @@ const useStyles = makeStyles((theme) => ({
25
17
  marginRight: theme.spacing(2),
26
18
  },
27
19
  }));
28
- /*
29
- * The wrapper handles knowing how to take in just children and mapping
30
- * to the Cosmos template. This could be a combination of things but it knows...
31
- */
32
20
  export default function AppShell(props) {
33
21
  const { pages, caseTypes, showAppName, children, getPConnect, } = props;
34
22
  const [open, setOpen] = useState(true);
35
23
  const pConn = getPConnect();
36
- // const actionsAPI = pConn.getActionsApi();
37
24
  const envInfo = PCore.getEnvironmentInfo();
38
- // const bannerRef = useRef(null);
39
- // const hasBanner = httpMessages && httpMessages.length ? httpMessages.length > 0 : false;
40
25
  const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : "";
41
26
  const classes = useStyles();
42
- // let banners = null;
43
- // banners = hasBanner && (
44
- // <Banner
45
- // ref={bannerRef}
46
- // id="appShellBanner"
47
- // variant="urgent"
48
- // heading="Error"
49
- // onDismiss={() =>
50
- // pConn.clearErrorMessages({
51
- // category: "HTTP",
52
- // context: null
53
- // })
54
- // }
55
- // messages={httpMessages}
56
- // />
57
- // );
58
- // useEffect(() => {
59
- // if (hasBanner && bannerRef.current) {
60
- // bannerRef.current.focus();
61
- // window.scrollTo(0, bannerRef.current.offsetTop);
62
- // }
63
- // }, [hasBanner]);
64
- /**
65
- *
66
- * Function to dispatch a show page action for the page links in
67
- * the left nav of the app shell
68
- *
69
- * @param {string} searchString Name of view to show
70
- */
71
- // function showSearchResults(searchString) {
72
- // if (searchString === "") {
73
- // actionsAPI.showPage("pySearchPage", "Data-Portal");
74
- // return;
75
- // }
76
- // const searchTerm = searchString.replace(/['"]+/g, "");
77
- // PCore.getDataApiUtils()
78
- // .getData(
79
- // "D_pySearch",
80
- // `{"dataViewParameters": {"SearchString": "${encodeURIComponent(
81
- // searchTerm
82
- // )}"}}`
83
- // )
84
- // .then((response) => {
85
- // if (
86
- // response.data.data !== null &&
87
- // response.data.resultCount === 1 &&
88
- // response.data.data[0].pyID === searchTerm
89
- // ) {
90
- // /* This is a match for a work item - then we will open it */
91
- // pConn
92
- // .getActionsApi()
93
- // .openWorkByHandle(
94
- // response.data.data[0].pzInsKey,
95
- // response.data.data[0].pzCategoryActionKeys
96
- // );
97
- // return;
98
- // }
99
- // // window.searchResults = {
100
- // // searchString: searchTerm,
101
- // // results: response.data
102
- // // };
103
- // actionsAPI.showPage("pySearchPage", "Data-Portal");
104
- // });
105
- // }
106
- /**
107
- *
108
- * Function to dispatch a show page action for the page links in
109
- * the left nav of the app shell
110
- *
111
- * @param {string} viewName Name of view to show
112
- * @param {string} className Pega Applies to class of the page
113
- */
114
- // function showPage(viewName, className) {
115
- // actionsAPI.showPage(viewName, className);
116
- // }
117
- /**
118
- *
119
- * Function to dispatch a create work action
120
- * @param {string} className - placeholder string of case type being created
121
- */
122
- // function createWork(className) {
123
- // actionsAPI
124
- // .createWork(className)
125
- // .catch((error) =>
126
- // // eslint-disable-next-line no-console
127
- // console.log("Error in case creation: ", error?.message)
128
- // );
129
- // }
130
- /**
131
- * Returns the Custome Component for each active case
132
- */
133
- // const VisualComponent = useCallback(
134
- // (context) => {
135
- // if (activeCases && activeCases.length > 0) {
136
- // const meta = PCore.getViewResources().fetchViewResources(
137
- // "pyCaseVisual",
138
- // getPConnect(),
139
- // PCore.getStoreValue(".caseTypeID", "caseInfo", context)
140
- // );
141
- // if (meta?.config && !meta.config.defaultVisual) {
142
- // const config = {
143
- // meta,
144
- // options: {
145
- // context,
146
- // pageReference: "caseInfo.content"
147
- // }
148
- // };
149
- // const visualConfig = PCore.createPConnect(config);
150
- // return React.createElement(createPConnectComponent(), visualConfig);
151
- // }
152
- // }
153
- // return undefined;
154
- // },
155
- // [getPConnect, activeCases]
156
- // );
157
- /**
158
- * Transforms the active cases information into the model that cosmos expect.
159
- */
160
- // function getActiveCases() {
161
- // if (activeCases) {
162
- // const activeCaseLinks = [];
163
- // activeCases.forEach((activeCase) => {
164
- // const { caseID, className, workID, active, context } = activeCase;
165
- // // activeCaseLinks.push({
166
- // // onDismiss: () => {
167
- // // PCore.getContainerUtils().closeContainerItem(
168
- // // activeCase.containerItemID
169
- // // );
170
- // // },
171
- // // key: caseID,
172
- // // name: caseID,
173
- // // onClick: () => {
174
- // // actionsAPI.openWorkByHandle(workID, className);
175
- // // },
176
- // // active,
177
- // // visual: VisualComponent(context)
178
- // // });
179
- // });
180
- // return activeCaseLinks;
181
- // }
182
- // return activeCases;
183
- // }
184
- /**
185
- * Translate Pega Data Page into the model that Cosmos expects
186
- *
187
- * Example:
188
- * pxPageViewIcon: "pi pi-home-solid"
189
- * pxURLPath: "Home"
190
- * pyClassName: "Data-Portal"
191
- * pyLabel: "Home"
192
- * pyRuleName: "pyHome"
193
- */
194
- // const links = !pages
195
- // ? []
196
- // : pages.map((page) => {
197
- // return {
198
- // name: page.pyLabel,
199
- // icon: page.pxPageViewIcon.replace("pi pi-", ""),
200
- // onClick: () => showPage(page.pyRuleName, page.pyClassName)
201
- // };
202
- // });
203
- // const userName = envInfo.getOperatorName();
204
- // const imageKey = envInfo.getOperatorImageInsKey();
205
- // const logOffAction = () => {
206
- // actionsAPI.logout().then(() => window?.top?.location?.reload());
207
- // };
208
- // const getOperator = () => {
209
- // const operatorActions = [
210
- // [{ text: "Logoff", id: "1", onClick: logOffAction }]
211
- // ];
212
- // if (imageKey) {
213
- // return {
214
- // avatar: (
215
- // <div id="AvatarWithImageKey">Avatar with image key</div>
216
- // // <Avatar
217
- // // name={userName}
218
- // // imageSrc={getPConnect().getImagePath(imageKey)}
219
- // // />
220
- // ),
221
- // actions: operatorActions,
222
- // name: userName
223
- // };
224
- // }
225
- // return {
226
- // avatar: (
227
- // <div id="Avatar">Avatar</div>
228
- // // <Avatar name={userName}>
229
- // // {userName
230
- // // .split(" ")
231
- // // .map((i) => i.charAt(0))
232
- // // .join("")
233
- // // .toUpperCase()}
234
- // // </Avatar>
235
- // ),
236
- // actions: operatorActions,
237
- // name: userName
238
- // };
239
- // };
240
- /**
241
- * Translate Case Types page into what is expected by Cosmos
242
- *
243
- * Example:
244
- * pyClassName: ""
245
- * pyFlowType: ""
246
- * pyLabel: "No case types defined"
247
- */
248
- // const cases = !caseTypes
249
- // ? []
250
- // : caseTypes.map((caseType) => {
251
- // let action = {};
252
- // // Only add actions to entries with a class name to create so in case of empty message no action is added
253
- // if (caseType.pyClassName) {
254
- // action = { onClick: () => createWork(caseType.pyClassName) };
255
- // }
256
- // return {
257
- // name: caseType.pyLabel,
258
- // ...action
259
- // };
260
- // });
261
- // const [recents, setRecents] = useState([]);
262
- // const [searchVal, setSearchVal] = useState("");
263
- // // default the icon to be empty. This will cause the image to be initially broken.
264
- // const [iconURL, setIconURL] = useState("");
265
- // useEffect(() => {
266
- // // using the default icon then fetch it from the static folder (not auth involved)
267
- // if (
268
- // !portalLogo ||
269
- // portalLogo.toLowerCase().includes("pzpega-logo-mark") ||
270
- // portalLogo.toLowerCase().includes("py-logo")
271
- // ) {
272
- // setIconURL(
273
- // `${PCore.getAssetLoader().getStaticServerUrl()}static/py-logo.svg`
274
- // );
275
- // }
276
- // // not using default icon to fetch it using the way which uses authentication
277
- // else {
278
- // PCore.getAssetLoader()
279
- // .getSvcImage(portalLogo)
280
- // .then((data) => {
281
- // setIconURL(window.URL.createObjectURL(data));
282
- // })
283
- // .catch(() => {
284
- // console.error(
285
- // `Unable to load the image for the portal logo/icon with the insName:${portalLogo}`
286
- // );
287
- // });
288
- // }
289
- // }, [portalLogo]);
290
- /**
291
- * To fetch recents and translate items into what Cosmos expects
292
- */
293
- // const fetchRecents = () => {
294
- // actionsAPI.getRecents(15).then((response) => {
295
- // const recentsitems = response.data.recents;
296
- // // setRecents(buildRecentList(recentsitems));
297
- // });
298
- // };
299
- /**
300
- * To handle on click of any recent item after the drawer is open
301
- *
302
- * @param {*} id : Recent item unique id
303
- */
304
- // const onItemClick = (id, e) => {
305
- // e.preventDefault();
306
- // // onRecentClickHandler(id, actionsAPI);
307
- // };
308
27
  // useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
309
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
310
29
  const [appName, setAppName] = useState("");
@@ -332,58 +51,18 @@ export default function AppShell(props) {
332
51
  return (React.createElement(NavContext.Provider, { value: { open, setOpen } },
333
52
  React.createElement("div", { id: "AppShell", className: classes.root },
334
53
  React.createElement(NavBar, { pConn: getPConnect(), appName: appNameToDisplay, pages: pages, caseTypes: caseTypes }),
335
- React.createElement("div", { className: classes.content }, children)))
336
- // <Toaster dismissAfter={3000}>
337
- // <CosmosAppShell
338
- // {...{
339
- // appInfo: {
340
- // imageSrc: `${iconURL}`,
341
- // appName: `${appNameToDisplay}`,
342
- // portalName
343
- // },
344
- // recents: {
345
- // items: recents,
346
- // onDrawerOpen: fetchRecents,
347
- // onItemClick
348
- // },
349
- // searchInput: {
350
- // onSearchChange: (value) => {
351
- // setSearchVal(value);
352
- // },
353
- // onSearchSubmit: (value) => {
354
- // showSearchResults(value.trim());
355
- // setSearchVal("");
356
- // },
357
- // value: searchVal
358
- // },
359
- // caseTypes: cases,
360
- // links,
361
- // cases: getActiveCases(),
362
- // operator: getOperator()
363
- // }}
364
- // main={[children]}
365
- // banners={banners}
366
- // className="app-shell"
367
- // />
368
- // </Toaster>
369
- );
54
+ React.createElement("div", { className: classes.content }, children))));
370
55
  }
371
56
  AppShell.defaultProps = {
372
57
  pages: [],
373
58
  caseTypes: [],
374
59
  children: [],
375
- // httpMessages: [],
376
- // activeCases: null
377
60
  };
378
61
  AppShell.propTypes = {
379
- // portalName: PropTypes.string/* .isRequired */,
380
- // portalLogo: PropTypes.string/* .isRequired */,
381
62
  showAppName: PropTypes.bool /* .isRequired */,
382
63
  pages: PropTypes.arrayOf(PropTypes.object),
383
64
  caseTypes: PropTypes.arrayOf(PropTypes.object),
384
65
  children: PropTypes.arrayOf(PropTypes.node),
385
66
  getPConnect: PropTypes.func.isRequired,
386
- // httpMessages: PropTypes.arrayOf(PropTypes.string),
387
- // activeCases: PropTypes.arrayOf(PropTypes.object)
388
67
  };
389
68
  //# sourceMappingURL=AppShell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../../src/components/template/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,WAAW;AACX,YAAY;AACZ,aAAa;AACb,YAAY;AACZ,+BAA+B;AAC/B,oCAAoC;AAEpC,wEAAwE;AACxE,2EAA2E;AAE3E,OAAO,gBAAgB,CAAC;AAExB,6CAA6C;AAC7C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QACJ,O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,IAAI,CAAC,UAAU;IACtC,qDAAqD;IACrD,mDAAmD;CACpD,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from '@material-ui/core/styles';\n\nimport { NavContext } from '../../helpers/reactContextHelpers';\n\n// import {\n// Avatar,\n// Toaster,\n// Banner,\n// AppShell as CosmosAppShell\n// } from \"@pega/cosmos-react-core\";\n\n// import createPConnectComponent from \"../../../bridge/react_pconnect\";\n// import { buildRecentList, onRecentClickHandler } from \"./Recents/utils\";\n\nimport './AppShell.css';\n\n// AppShell can emit NavBar and ViewContainer\nimport NavBar from '../../infra/NavBar';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: 'flex',\n },\n content: {\n flexGrow: 1,\n height: '100vh',\n overflow: 'auto',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n}));\n\ndeclare const PCore;\n\n\n/*\n * The wrapper handles knowing how to take in just children and mapping\n * to the Cosmos template. This could be a combination of things but it knows...\n */\nexport default function AppShell(props) {\n const {\n pages,\n caseTypes,\n showAppName,\n children,\n getPConnect,\n } = props;\n const [open, setOpen] = useState(true);\n\n const pConn = getPConnect();\n // const actionsAPI = pConn.getActionsApi();\n const envInfo = PCore.getEnvironmentInfo();\n\n // const bannerRef = useRef(null);\n // const hasBanner = httpMessages && httpMessages.length ? httpMessages.length > 0 : false;\n\n const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : \"\";\n\n const classes = useStyles();\n // let banners = null;\n // banners = hasBanner && (\n // <Banner\n // ref={bannerRef}\n // id=\"appShellBanner\"\n // variant=\"urgent\"\n // heading=\"Error\"\n // onDismiss={() =>\n // pConn.clearErrorMessages({\n // category: \"HTTP\",\n // context: null\n // })\n // }\n // messages={httpMessages}\n // />\n // );\n\n // useEffect(() => {\n // if (hasBanner && bannerRef.current) {\n // bannerRef.current.focus();\n // window.scrollTo(0, bannerRef.current.offsetTop);\n // }\n // }, [hasBanner]);\n\n /**\n *\n * Function to dispatch a show page action for the page links in\n * the left nav of the app shell\n *\n * @param {string} searchString Name of view to show\n */\n // function showSearchResults(searchString) {\n // if (searchString === \"\") {\n // actionsAPI.showPage(\"pySearchPage\", \"Data-Portal\");\n // return;\n // }\n // const searchTerm = searchString.replace(/['\"]+/g, \"\");\n // PCore.getDataApiUtils()\n // .getData(\n // \"D_pySearch\",\n // `{\"dataViewParameters\": {\"SearchString\": \"${encodeURIComponent(\n // searchTerm\n // )}\"}}`\n // )\n // .then((response) => {\n // if (\n // response.data.data !== null &&\n // response.data.resultCount === 1 &&\n // response.data.data[0].pyID === searchTerm\n // ) {\n // /* This is a match for a work item - then we will open it */\n // pConn\n // .getActionsApi()\n // .openWorkByHandle(\n // response.data.data[0].pzInsKey,\n // response.data.data[0].pzCategoryActionKeys\n // );\n // return;\n // }\n // // window.searchResults = {\n // // searchString: searchTerm,\n // // results: response.data\n // // };\n // actionsAPI.showPage(\"pySearchPage\", \"Data-Portal\");\n // });\n // }\n\n /**\n *\n * Function to dispatch a show page action for the page links in\n * the left nav of the app shell\n *\n * @param {string} viewName Name of view to show\n * @param {string} className Pega Applies to class of the page\n */\n // function showPage(viewName, className) {\n // actionsAPI.showPage(viewName, className);\n // }\n\n /**\n *\n * Function to dispatch a create work action\n * @param {string} className - placeholder string of case type being created\n */\n // function createWork(className) {\n // actionsAPI\n // .createWork(className)\n // .catch((error) =>\n // // eslint-disable-next-line no-console\n // console.log(\"Error in case creation: \", error?.message)\n // );\n // }\n\n /**\n * Returns the Custome Component for each active case\n */\n // const VisualComponent = useCallback(\n // (context) => {\n // if (activeCases && activeCases.length > 0) {\n // const meta = PCore.getViewResources().fetchViewResources(\n // \"pyCaseVisual\",\n // getPConnect(),\n // PCore.getStoreValue(\".caseTypeID\", \"caseInfo\", context)\n // );\n // if (meta?.config && !meta.config.defaultVisual) {\n // const config = {\n // meta,\n // options: {\n // context,\n // pageReference: \"caseInfo.content\"\n // }\n // };\n // const visualConfig = PCore.createPConnect(config);\n // return React.createElement(createPConnectComponent(), visualConfig);\n // }\n // }\n // return undefined;\n // },\n // [getPConnect, activeCases]\n // );\n\n /**\n * Transforms the active cases information into the model that cosmos expect.\n */\n // function getActiveCases() {\n // if (activeCases) {\n // const activeCaseLinks = [];\n // activeCases.forEach((activeCase) => {\n // const { caseID, className, workID, active, context } = activeCase;\n // // activeCaseLinks.push({\n // // onDismiss: () => {\n // // PCore.getContainerUtils().closeContainerItem(\n // // activeCase.containerItemID\n // // );\n // // },\n // // key: caseID,\n // // name: caseID,\n // // onClick: () => {\n // // actionsAPI.openWorkByHandle(workID, className);\n // // },\n // // active,\n // // visual: VisualComponent(context)\n // // });\n // });\n // return activeCaseLinks;\n // }\n // return activeCases;\n // }\n\n /**\n * Translate Pega Data Page into the model that Cosmos expects\n *\n * Example:\n * pxPageViewIcon: \"pi pi-home-solid\"\n * pxURLPath: \"Home\"\n * pyClassName: \"Data-Portal\"\n * pyLabel: \"Home\"\n * pyRuleName: \"pyHome\"\n */\n // const links = !pages\n // ? []\n // : pages.map((page) => {\n // return {\n // name: page.pyLabel,\n // icon: page.pxPageViewIcon.replace(\"pi pi-\", \"\"),\n // onClick: () => showPage(page.pyRuleName, page.pyClassName)\n // };\n // });\n\n // const userName = envInfo.getOperatorName();\n // const imageKey = envInfo.getOperatorImageInsKey();\n\n // const logOffAction = () => {\n // actionsAPI.logout().then(() => window?.top?.location?.reload());\n // };\n\n // const getOperator = () => {\n // const operatorActions = [\n // [{ text: \"Logoff\", id: \"1\", onClick: logOffAction }]\n // ];\n // if (imageKey) {\n // return {\n // avatar: (\n // <div id=\"AvatarWithImageKey\">Avatar with image key</div>\n // // <Avatar\n // // name={userName}\n // // imageSrc={getPConnect().getImagePath(imageKey)}\n // // />\n // ),\n // actions: operatorActions,\n // name: userName\n // };\n // }\n // return {\n // avatar: (\n // <div id=\"Avatar\">Avatar</div>\n // // <Avatar name={userName}>\n // // {userName\n // // .split(\" \")\n // // .map((i) => i.charAt(0))\n // // .join(\"\")\n // // .toUpperCase()}\n // // </Avatar>\n // ),\n // actions: operatorActions,\n // name: userName\n // };\n // };\n\n /**\n * Translate Case Types page into what is expected by Cosmos\n *\n * Example:\n * pyClassName: \"\"\n * pyFlowType: \"\"\n * pyLabel: \"No case types defined\"\n */\n // const cases = !caseTypes\n // ? []\n // : caseTypes.map((caseType) => {\n // let action = {};\n // // Only add actions to entries with a class name to create so in case of empty message no action is added\n // if (caseType.pyClassName) {\n // action = { onClick: () => createWork(caseType.pyClassName) };\n // }\n // return {\n // name: caseType.pyLabel,\n // ...action\n // };\n // });\n\n // const [recents, setRecents] = useState([]);\n\n // const [searchVal, setSearchVal] = useState(\"\");\n\n // // default the icon to be empty. This will cause the image to be initially broken.\n // const [iconURL, setIconURL] = useState(\"\");\n // useEffect(() => {\n // // using the default icon then fetch it from the static folder (not auth involved)\n // if (\n // !portalLogo ||\n // portalLogo.toLowerCase().includes(\"pzpega-logo-mark\") ||\n // portalLogo.toLowerCase().includes(\"py-logo\")\n // ) {\n // setIconURL(\n // `${PCore.getAssetLoader().getStaticServerUrl()}static/py-logo.svg`\n // );\n // }\n // // not using default icon to fetch it using the way which uses authentication\n // else {\n // PCore.getAssetLoader()\n // .getSvcImage(portalLogo)\n // .then((data) => {\n // setIconURL(window.URL.createObjectURL(data));\n // })\n // .catch(() => {\n // console.error(\n // `Unable to load the image for the portal logo/icon with the insName:${portalLogo}`\n // );\n // });\n // }\n // }, [portalLogo]);\n\n /**\n * To fetch recents and translate items into what Cosmos expects\n */\n // const fetchRecents = () => {\n // actionsAPI.getRecents(15).then((response) => {\n // const recentsitems = response.data.recents;\n // // setRecents(buildRecentList(recentsitems));\n // });\n // };\n\n /**\n * To handle on click of any recent item after the drawer is open\n *\n * @param {*} id : Recent item unique id\n */\n\n // const onItemClick = (id, e) => {\n // e.preventDefault();\n // // onRecentClickHandler(id, actionsAPI);\n // };\n\n // useState for appName and mapChildren - note these are ONLY updated once (on component mount!)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [appName, setAppName] = useState(\"\");\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [mapChildren, setMapChildren] = useState([]);\n\n // Initial setting of appName and mapChildren\n useEffect( () => {\n setAppName(PCore.getEnvironmentInfo().getApplicationName());\n\n const tempMap = pConn.getChildren().map((child, index) => {\n const theChildComp = child.getPConnect().getComponentName();\n const theKey = `.${index}`;\n return <div id={theChildComp} key={theKey} style={{border: \"solid 1px silver\", margin: \"1px\"}}>{theChildComp} will be here</div>\n });\n\n setMapChildren(tempMap)\n\n }, []);\n\n if (pConn.hasChildren()) {\n // const theChildren = pConn.getChildren();\n // const mapChildCompNames = theChildren.map((child) => { return child.getPConnect().getComponentName()});\n\n // debugging/investigation help\n // console.log(`AppShell has children: ${theChildren.length}`);\n // console.log(`--> ${mapChildCompNames.map((name) => {return name;})}`);\n }\n\n return (\n\n <NavContext.Provider value={{open, setOpen}}>\n <div id=\"AppShell\" className={classes.root}>\n <NavBar pConn={getPConnect()} appName={appNameToDisplay} pages={pages} caseTypes={caseTypes}></NavBar>\n <div className={classes.content}>\n {children}\n </div>\n </div>\n </NavContext.Provider>\n\n // <Toaster dismissAfter={3000}>\n // <CosmosAppShell\n // {...{\n // appInfo: {\n // imageSrc: `${iconURL}`,\n // appName: `${appNameToDisplay}`,\n // portalName\n // },\n // recents: {\n // items: recents,\n // onDrawerOpen: fetchRecents,\n // onItemClick\n // },\n // searchInput: {\n // onSearchChange: (value) => {\n // setSearchVal(value);\n // },\n // onSearchSubmit: (value) => {\n // showSearchResults(value.trim());\n // setSearchVal(\"\");\n // },\n // value: searchVal\n // },\n // caseTypes: cases,\n // links,\n // cases: getActiveCases(),\n // operator: getOperator()\n // }}\n // main={[children]}\n // banners={banners}\n // className=\"app-shell\"\n // />\n // </Toaster>\n );\n}\nAppShell.defaultProps = {\n pages: [],\n caseTypes: [],\n children: [],\n // httpMessages: [],\n // activeCases: null\n};\nAppShell.propTypes = {\n // portalName: PropTypes.string/* .isRequired */,\n // portalLogo: PropTypes.string/* .isRequired */,\n showAppName: PropTypes.bool/* .isRequired */,\n pages: PropTypes.arrayOf(PropTypes.object),\n caseTypes: PropTypes.arrayOf(PropTypes.object),\n children: PropTypes.arrayOf(PropTypes.node),\n getPConnect: PropTypes.func.isRequired,\n // httpMessages: PropTypes.arrayOf(PropTypes.string),\n // activeCases: PropTypes.arrayOf(PropTypes.object)\n};\n"]}
1
+ {"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../../src/components/template/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,gBAAgB,CAAC;AAExB,2BAA2B;AAC3B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;KAChB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;KAC9B;CACF,CAAC,CAAC,CAAC;AAKJ,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK;IACpC,MAAM,EACJ,KAAK,EACL,SAAS,EACT,WAAW,EACX,QAAQ,EACR,WAAW,GACZ,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvC,MAAM,KAAK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AK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC;QACzC,6BAAK,EAAE,EAAC,UAAU,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI;YACxC,oBAAC,MAAM,IAAC,KAAK,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAW;YACtG,6BAAK,SAAS,EAAE,OAAO,CAAC,OAAO,IAC5B,QAAQ,CACL,CACF,CACc,CACvB,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,YAAY,GAAG;IACtB,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,EAAE;CACb,CAAC;AACF,QAAQ,CAAC,SAAS,GAAG;IACnB,WAAW,EAAE,SAAS,CAAC,IAAI,CAAA,iBAAiB;IAC5C,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACvC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from '@material-ui/core/styles';\n\nimport { NavContext } from '../../helpers/reactContextHelpers';\nimport './AppShell.css';\n\n// AppShell can emit NavBar\nimport NavBar from '../../infra/NavBar';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: 'flex',\n },\n content: {\n flexGrow: 1,\n height: '100vh',\n overflow: 'auto',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n },\n}));\n\ndeclare const PCore;\n\n\nexport default function AppShell(props) {\n const {\n pages,\n caseTypes,\n showAppName,\n children,\n getPConnect,\n } = props;\n const [open, setOpen] = useState(true);\n\n const pConn = getPConnect();\n const envInfo = PCore.getEnvironmentInfo();\n\n const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : \"\";\n\n const classes = useStyles();\n\n // useState for appName and mapChildren - note these are ONLY updated once (on component mount!)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [appName, setAppName] = useState(\"\");\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n const [mapChildren, setMapChildren] = useState([]);\n\n // Initial setting of appName and mapChildren\n useEffect( () => {\n setAppName(PCore.getEnvironmentInfo().getApplicationName());\n\n const tempMap = pConn.getChildren().map((child, index) => {\n const theChildComp = child.getPConnect().getComponentName();\n const theKey = `.${index}`;\n return <div id={theChildComp} key={theKey} style={{border: \"solid 1px silver\", margin: \"1px\"}}>{theChildComp} will be here</div>\n });\n\n setMapChildren(tempMap)\n\n }, []);\n\n if (pConn.hasChildren()) {\n // const theChildren = pConn.getChildren();\n // const mapChildCompNames = theChildren.map((child) => { return child.getPConnect().getComponentName()});\n\n // debugging/investigation help\n // console.log(`AppShell has children: ${theChildren.length}`);\n // console.log(`--> ${mapChildCompNames.map((name) => {return name;})}`);\n }\n\n return (\n\n <NavContext.Provider value={{open, setOpen}}>\n <div id=\"AppShell\" className={classes.root}>\n <NavBar pConn={getPConnect()} appName={appNameToDisplay} pages={pages} caseTypes={caseTypes}></NavBar>\n <div className={classes.content}>\n {children}\n </div>\n </div>\n </NavContext.Provider>\n );\n}\n\nAppShell.defaultProps = {\n pages: [],\n caseTypes: [],\n children: [],\n};\nAppShell.propTypes = {\n showAppName: PropTypes.bool/* .isRequired */,\n pages: PropTypes.arrayOf(PropTypes.object),\n caseTypes: PropTypes.arrayOf(PropTypes.object),\n children: PropTypes.arrayOf(PropTypes.node),\n getPConnect: PropTypes.func.isRequired,\n};\n"]}
@@ -6,7 +6,7 @@ export default function CaseSummary(props) {
6
6
  const thePConn = getPConnect();
7
7
  const theConfigProps = thePConn.getConfigProps();
8
8
  const { status, showStatus } = theConfigProps;
9
- // from Nebula
9
+ // from Constellation DX Components
10
10
  // get the primary and secondary fields with the raw data (which has the non-resolved property values)
11
11
  // const regionsRaw = getPConnect().getRawMetadata().children;
12
12
  // const primaryFieldsRaw = regionsRaw[0].children;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../../src/components/template/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,iBAAiB,MAAM,+CAA+C,CAAC;AAE9E,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK;IACvC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;IAE9C,cAAc;IACd,sGAAsG;IACtG,8DAA8D;IAC9D,mDAAmD;IACnD,qDAAqD;IAErD,kBAAkB;IAClB,uDAAuD;IACvD,IAAI,eAAe,GAAc,EAAE,CAAC;IACpC,IAAI,iBAAiB,GAAc,EAAE,CAAC;IAEtC,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE;QAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;QAClF,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;YAC1D,eAAe,GAAG,cAAc,CAAC,QAAQ,CAAC;SAC3C;aAAM,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,kBAAkB,EAAE;YACnE,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC;SAC7C;KACF;IAED,+EAA+E;IAC/E,uDAAuD;IAEvD,+BAA+B;IAC/B,mFAAmF;IACnF,uFAAuF;IAEvF,OAAO,CACL,6BAAK,EAAE,EAAC,aAAa;QACnB,oBAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,GAAI;QACzF,oBAAC,iBAAiB,IAAC,SAAS,EAAE,iBAAiB,GAAI,CAC/C,CACP,CAAA;AACH,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACvC,CAAC","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport CaseSummaryFields from '../../designSystemExtension/CaseSummaryFields';\n\nexport default function CaseSummary(props) {\n const { getPConnect, children } = props;\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const { status, showStatus } = theConfigProps;\n\n // from Nebula\n // get the primary and secondary fields with the raw data (which has the non-resolved property values)\n // const regionsRaw = getPConnect().getRawMetadata().children;\n // const primaryFieldsRaw = regionsRaw[0].children;\n // const secondaryFieldsRaw = regionsRaw[1].children;\n\n // From other SDKs\n // may want to move these into useEffect/useState combo\n let arPrimaryFields:Array<any> = [];\n let arSecondaryFields:Array<any> = [];\n\n for (const child of children) {\n const childPConn = child.props.getPConnect();\n const childPConnData = childPConn.resolveConfigProps(childPConn.getRawMetadata());\n if (childPConnData.name.toLowerCase() === \"primary fields\") {\n arPrimaryFields = childPConnData.children;\n } else if (childPConnData.name.toLowerCase() === \"secondary fields\") {\n arSecondaryFields = childPConnData.children;\n }\n }\n\n // At this point, should hand off to another component for layout and rendering\n // of primary and secondary fields in the Case Summary\n\n // debugging/investigation help\n // console.log(`CaseSummary: arPrimaryFields: ${JSON.stringify(arPrimaryFields)}`);\n // console.log(`CaseSummary: arSecondaryFields: ${JSON.stringify(arSecondaryFields)}`);\n\n return (\n <div id=\"CaseSummary\">\n <CaseSummaryFields status={status} showStatus={showStatus} theFields={arPrimaryFields} />\n <CaseSummaryFields theFields={arSecondaryFields} />\n </div>\n )\n}\n\nCaseSummary.propTypes = {\n getPConnect: PropTypes.func.isRequired\n};\n"]}
1
+ {"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../../src/components/template/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,iBAAiB,MAAM,+CAA+C,CAAC;AAE9E,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK;IACvC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;IAE9C,mCAAmC;IACnC,sGAAsG;IACtG,8DAA8D;IAC9D,mDAAmD;IACnD,qDAAqD;IAErD,kBAAkB;IAClB,uDAAuD;IACvD,IAAI,eAAe,GAAc,EAAE,CAAC;IACpC,IAAI,iBAAiB,GAAc,EAAE,CAAC;IAEtC,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE;QAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;QAClF,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;YAC1D,eAAe,GAAG,cAAc,CAAC,QAAQ,CAAC;SAC3C;aAAM,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,kBAAkB,EAAE;YACnE,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC;SAC7C;KACF;IAED,+EAA+E;IAC/E,uDAAuD;IAEvD,+BAA+B;IAC/B,mFAAmF;IACnF,uFAAuF;IAEvF,OAAO,CACL,6BAAK,EAAE,EAAC,aAAa;QACnB,oBAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,GAAI;QACzF,oBAAC,iBAAiB,IAAC,SAAS,EAAE,iBAAiB,GAAI,CAC/C,CACP,CAAA;AACH,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACvC,CAAC","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport CaseSummaryFields from '../../designSystemExtension/CaseSummaryFields';\n\nexport default function CaseSummary(props) {\n const { getPConnect, children } = props;\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const { status, showStatus } = theConfigProps;\n\n // from Constellation DX Components\n // get the primary and secondary fields with the raw data (which has the non-resolved property values)\n // const regionsRaw = getPConnect().getRawMetadata().children;\n // const primaryFieldsRaw = regionsRaw[0].children;\n // const secondaryFieldsRaw = regionsRaw[1].children;\n\n // From other SDKs\n // may want to move these into useEffect/useState combo\n let arPrimaryFields:Array<any> = [];\n let arSecondaryFields:Array<any> = [];\n\n for (const child of children) {\n const childPConn = child.props.getPConnect();\n const childPConnData = childPConn.resolveConfigProps(childPConn.getRawMetadata());\n if (childPConnData.name.toLowerCase() === \"primary fields\") {\n arPrimaryFields = childPConnData.children;\n } else if (childPConnData.name.toLowerCase() === \"secondary fields\") {\n arSecondaryFields = childPConnData.children;\n }\n }\n\n // At this point, should hand off to another component for layout and rendering\n // of primary and secondary fields in the Case Summary\n\n // debugging/investigation help\n // console.log(`CaseSummary: arPrimaryFields: ${JSON.stringify(arPrimaryFields)}`);\n // console.log(`CaseSummary: arSecondaryFields: ${JSON.stringify(arSecondaryFields)}`);\n\n return (\n <div id=\"CaseSummary\">\n <CaseSummaryFields status={status} showStatus={showStatus} theFields={arPrimaryFields} />\n <CaseSummaryFields theFields={arSecondaryFields} />\n </div>\n )\n}\n\nCaseSummary.propTypes = {\n getPConnect: PropTypes.func.isRequired\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/components/template/ListView/ListView.tsx"],"names":[],"mappings":";AAMA,OAAO,SAAS,MAAM,YAAY,CAAC;AAkCnC,OAAO,gBAAgB,CAAC;AAsBxB,iBAAwB,QAAQ,CAAC,KAAK,KAAA,eAswCrC;kBAtwCuB,QAAQ;;;;;;eAAR,QAAQ"}
1
+ {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/components/template/ListView/ListView.tsx"],"names":[],"mappings":";AAMA,OAAO,SAAS,MAAM,YAAY,CAAC;AAkCnC,OAAO,gBAAgB,CAAC;AAiBxB,iBAAwB,QAAQ,CAAC,KAAK,KAAA,eAkuCrC;kBAluCuB,QAAQ;;;;;;eAAR,QAAQ"}
@@ -47,10 +47,6 @@ let menuColumnId = '';
47
47
  let menuColumnType = '';
48
48
  let menuColumnLabel = '';
49
49
  let sortColumnId;
50
- // let dialogContainsFilter: string = "contains";
51
- // let dialogContainsValue: string = "";
52
- // let dialogDateFilter: string = "notequal";
53
- // let dialogDateValue: string = "";
54
50
  const filterByColumns = [];
55
51
  export default function ListView(props) {
56
52
  const { getPConnect, bInForm } = props;
@@ -181,16 +177,6 @@ export default function ListView(props) {
181
177
  setRowsPerPage(+event.target.value);
182
178
  setPage(0);
183
179
  };
184
- // function getDisplayColumns(fields = []) {
185
- // let arReturn = fields.map(( field: any, colIndex) => {
186
- // let theField = field.config.value.substring(field.config.value.indexOf(" ")+1);
187
- // if (theField.indexOf(".") == 0) {
188
- // theField = theField.substring(1);
189
- // }
190
- // return theField;
191
- // });
192
- // return arReturn;
193
- // }
194
180
  const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
195
181
  function getHeaderCells(colFields, fields, presetFields) {
196
182
  const arReturn = colFields.map((field, index) => {
@@ -288,9 +274,6 @@ export default function ListView(props) {
288
274
  arCols.forEach(col => {
289
275
  myColList.push(col.id);
290
276
  });
291
- // for (const col of arCols) {
292
- // myColList.push(col.id);
293
- // }
294
277
  return myColList;
295
278
  }
296
279
  /** Will return field from a filter expression */
@@ -320,7 +303,7 @@ export default function ListView(props) {
320
303
  const relationalOp = 'AND';
321
304
  let field = getFieldFromFilter(filterExpression, isDateRange);
322
305
  selectParam = [];
323
- // Constructing the select parameters list( will be sent in dashboardFilterPayload)
306
+ // Constructing the select parameters list (will be sent in dashboardFilterPayload)
324
307
  columnList.forEach(col => {
325
308
  selectParam.push({
326
309
  field: col
@@ -352,7 +335,7 @@ export default function ListView(props) {
352
335
  // If we reach here that implies we've at least one valid filter, hence setting the flag
353
336
  validFilter = true;
354
337
  /** Below are the 2 cases for- Text & Date-Range filter types where we'll construct filter data which will be sent in the dashboardFilterPayload
355
- * In Nebula, through Repeating Structures they might be using several APIs to do it, we're doing it here
338
+ * In Constellation DX Components, through Repeating Structures they might be using several APIs to do it. We're doing it here
356
339
  */
357
340
  if (isDateRange) {
358
341
  const dateRelationalOp = filter?.AND ? 'AND' : 'OR';
@@ -428,7 +411,8 @@ export default function ListView(props) {
428
411
  });
429
412
  }
430
413
  else {
431
- // NOTE: If we ever decide to not set up all the `fieldDefs` on select, ensure that the fields corresponding to `state.groups` are set up. Needed in Client-mode grouping/pagination.
414
+ // NOTE: If we ever decide to not set up all the `fieldDefs` on select, ensure that the fields
415
+ // corresponding to `state.groups` are set up. Needed in Client-mode grouping/pagination.
432
416
  fieldDefs.forEach(field => {
433
417
  if (!listFields.find(f => f.field === field.name)) {
434
418
  listFields.push({
@@ -715,21 +699,6 @@ export default function ListView(props) {
715
699
  // move data to array and then sort
716
700
  setRows(theData);
717
701
  createSortHandler(sortColumnId);
718
- // grouping here
719
- // let reGroupData = this.addGroups(theData, this.groupByColumns$);
720
- // this.repeatList$.data = [];
721
- // this.repeatList$.data.push( ...reGroupData);
722
- // if (this.searchFilter && this.searchFilter != "") {
723
- // this.repeatList$.filter = this.searchFilter;
724
- // }
725
- // else {
726
- // this.perfFilter = performance.now().toString();
727
- // this.repeatList$.filter = this.perfFilter;
728
- // }
729
- // this.repeatList$.filter = "";
730
- // if (this.repeatList$.paginator) {
731
- // this.repeatList$.paginator.firstPage();
732
- // }
733
702
  }
734
703
  function _dialogContainsFilter(event) {
735
704
  // dialogContainsFilter = event.target.value;
@@ -956,11 +925,8 @@ export default function ListView(props) {
956
925
  React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
957
926
  React.createElement(CloseIcon, { fontSize: 'small' })) })));
958
927
  }
959
- ListView.defaultProps = {
960
- // parameters: undefined
961
- };
928
+ ListView.defaultProps = {};
962
929
  ListView.propTypes = {
963
930
  getPConnect: PropTypes.func.isRequired
964
- // parameters: PropTypes.objectOf(PropTypes.any)
965
931
  };
966
932
  //# sourceMappingURL=ListView.js.map