@pega/react-sdk-overrides 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.
- package/lib/helpers/authManager.js +1 -0
- package/lib/helpers/event-utils.js +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +2 -3
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +0 -44
- package/lib/infra/RootContainer/RootContainer.tsx +2 -54
- package/lib/infra/Stages/Stages.tsx +1 -2
- package/lib/infra/View/View.tsx +1 -1
- package/lib/template/AppShell/AppShell.tsx +2 -343
- package/lib/template/CaseSummary/CaseSummary.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +4 -47
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +3 -24
- package/package.json +1 -1
|
@@ -286,8 +286,7 @@ export default function FlowContainer(props) {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
|
|
289
|
-
// From WC
|
|
290
|
-
|
|
289
|
+
// From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...
|
|
291
290
|
useEffect(() => {
|
|
292
291
|
const localPConn = arNewChildren[0].getPConnect();
|
|
293
292
|
|
|
@@ -388,7 +387,7 @@ export default function FlowContainer(props) {
|
|
|
388
387
|
theNewChildren.push(configObject);
|
|
389
388
|
setArNewChildren(theNewChildren);
|
|
390
389
|
|
|
391
|
-
// JEA - adapted from
|
|
390
|
+
// JEA - adapted from Constellation DX Components FlowContainer since we want to render children that are React components
|
|
392
391
|
const root = createElement(createPConnectComponent(), configObject);
|
|
393
392
|
setArNewChildrenAsReact([root]);
|
|
394
393
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Adapted from nebula ErrorBoundary (remove Cosmos dependencies)
|
|
2
|
-
|
|
3
1
|
import React from "react";
|
|
4
2
|
import PropTypes from "prop-types";
|
|
5
3
|
|
|
@@ -16,18 +14,6 @@ function ErrorBoundary(props) {
|
|
|
16
14
|
if (!getPConnect) {
|
|
17
15
|
return (
|
|
18
16
|
theErrorDiv
|
|
19
|
-
// <Flex
|
|
20
|
-
// container={{
|
|
21
|
-
// alignItems: "center",
|
|
22
|
-
// justify: "center",
|
|
23
|
-
// itemGap: 1
|
|
24
|
-
// }}
|
|
25
|
-
// >
|
|
26
|
-
// <Text status="error">
|
|
27
|
-
// <Icon name="warn-solid" />
|
|
28
|
-
// </Text>
|
|
29
|
-
// <Text data-testid="errorText">{ERROR_TEXT}</Text>
|
|
30
|
-
// </Flex>
|
|
31
17
|
);
|
|
32
18
|
}
|
|
33
19
|
|
|
@@ -43,12 +29,6 @@ function ErrorBoundary(props) {
|
|
|
43
29
|
if (pConn.getConfigProps().type === "page") {
|
|
44
30
|
return (
|
|
45
31
|
theErrorDiv
|
|
46
|
-
// <Banner
|
|
47
|
-
// data-testid="errorBanner"
|
|
48
|
-
// variant="urgent"
|
|
49
|
-
// heading="Error"
|
|
50
|
-
// messages={[ERROR_TEXT]}
|
|
51
|
-
// />
|
|
52
32
|
);
|
|
53
33
|
}
|
|
54
34
|
|
|
@@ -64,30 +44,6 @@ function ErrorBoundary(props) {
|
|
|
64
44
|
|
|
65
45
|
return (
|
|
66
46
|
theErrorDiv
|
|
67
|
-
// <Card>
|
|
68
|
-
// <CardHeader>
|
|
69
|
-
// <Text variant="h3">
|
|
70
|
-
// {pConn.getConfigProps().label || pConn.getComponentName()}
|
|
71
|
-
// </Text>
|
|
72
|
-
// </CardHeader>
|
|
73
|
-
// <CardContent
|
|
74
|
-
// direction="row"
|
|
75
|
-
// style={{ minHeight: "5rem", justifyContent: "center" }}
|
|
76
|
-
// >
|
|
77
|
-
// <Flex
|
|
78
|
-
// container={{
|
|
79
|
-
// alignItems: "center",
|
|
80
|
-
// justify: "center",
|
|
81
|
-
// itemGap: 1
|
|
82
|
-
// }}
|
|
83
|
-
// >
|
|
84
|
-
// <Text status="error">
|
|
85
|
-
// <Icon name="warn-solid" />
|
|
86
|
-
// </Text>
|
|
87
|
-
// <Text>{ERROR_TEXT}</Text>
|
|
88
|
-
// </Flex>
|
|
89
|
-
// </CardContent>
|
|
90
|
-
// </Card>
|
|
91
47
|
);
|
|
92
48
|
}
|
|
93
49
|
ErrorBoundary.propTypes = {
|
|
@@ -66,8 +66,6 @@ const RootContainer = (props) => {
|
|
|
66
66
|
options["context"] = "root";
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
// Used for embedded mode
|
|
70
|
-
// let newPConn: any;
|
|
71
69
|
const [componentName, setComponentName] = useState("");
|
|
72
70
|
|
|
73
71
|
useEffect( () => {
|
|
@@ -78,7 +76,6 @@ const RootContainer = (props) => {
|
|
|
78
76
|
// debugging/investigation help
|
|
79
77
|
// console.log(`RootContainer props.routingInfo: ${JSON.stringify(routingInfo)}`);
|
|
80
78
|
|
|
81
|
-
// const bannerRef = useRef(null);
|
|
82
79
|
let hasBanner = false;
|
|
83
80
|
let banners: any = null;
|
|
84
81
|
const messages = httpMessages
|
|
@@ -87,21 +84,6 @@ const RootContainer = (props) => {
|
|
|
87
84
|
|
|
88
85
|
hasBanner = messages && messages.length > 0;
|
|
89
86
|
banners = hasBanner && (<div>RootContainer: trying to emit Banner with {messages}</div>);
|
|
90
|
-
// && (
|
|
91
|
-
// <Banner
|
|
92
|
-
// ref={bannerRef}
|
|
93
|
-
// id="appShellBanner"
|
|
94
|
-
// variant="urgent"
|
|
95
|
-
// heading="Error"
|
|
96
|
-
// onDismiss={() =>
|
|
97
|
-
// pConn.clearErrorMessages({
|
|
98
|
-
// category: "HTTP",
|
|
99
|
-
// context: "root"
|
|
100
|
-
// })
|
|
101
|
-
// }
|
|
102
|
-
// messages={messages}
|
|
103
|
-
// />
|
|
104
|
-
// );
|
|
105
87
|
|
|
106
88
|
const MemoizedModalViewContainer = useMemo(() => {
|
|
107
89
|
return createElement(
|
|
@@ -175,7 +157,6 @@ const RootContainer = (props) => {
|
|
|
175
157
|
}
|
|
176
158
|
|
|
177
159
|
|
|
178
|
-
// const rootViewRef: any = useRef(null);
|
|
179
160
|
let rootView : any;
|
|
180
161
|
let rootViewConfig: any = null;
|
|
181
162
|
|
|
@@ -187,7 +168,6 @@ const RootContainer = (props) => {
|
|
|
187
168
|
PCore.getContainerUtils().getContainerAPI().addContainerItems(items);
|
|
188
169
|
}, [routingInfo]);
|
|
189
170
|
|
|
190
|
-
// const { store } = useConstellationContext();
|
|
191
171
|
const items: any = getItemView(routingInfo, renderingMode);
|
|
192
172
|
|
|
193
173
|
if (items.length > 0) {
|
|
@@ -225,14 +205,6 @@ const RootContainer = (props) => {
|
|
|
225
205
|
);
|
|
226
206
|
}
|
|
227
207
|
|
|
228
|
-
// interior was
|
|
229
|
-
// <ModalManager>
|
|
230
|
-
// {rootViewRef.current}
|
|
231
|
-
// {MemoisedModalViewContainer}
|
|
232
|
-
// {MemoizedPreviewViewContainer}
|
|
233
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
234
|
-
// </ModalManager> */}
|
|
235
|
-
|
|
236
208
|
// debugging/investigation help
|
|
237
209
|
// console.log(`rootView.props.getPConnect().getComponentName(): ${rootView.props.getPConnect().getComponentName()}`);
|
|
238
210
|
|
|
@@ -252,10 +224,7 @@ const RootContainer = (props) => {
|
|
|
252
224
|
|
|
253
225
|
const theChildren = pConn.getChildren();
|
|
254
226
|
if (theChildren && (theChildren.length === 1)) {
|
|
255
|
-
// this.createdPConnect = theChildren[0];
|
|
256
|
-
// this.createdPConnect = null;
|
|
257
227
|
const localPConn = theChildren[0].getPConnect();
|
|
258
|
-
// newPConn = pConn;
|
|
259
228
|
const localCompName = localPConn.getComponentName()
|
|
260
229
|
if (componentName !== localCompName) {
|
|
261
230
|
setComponentName(localCompName);
|
|
@@ -267,15 +236,6 @@ const RootContainer = (props) => {
|
|
|
267
236
|
return noPortalContent;
|
|
268
237
|
}
|
|
269
238
|
else if (children && children.length > 0) {
|
|
270
|
-
// interior was
|
|
271
|
-
// <ModalManager>
|
|
272
|
-
// {httpMessages ? <div id="root-container">{banners}</div> : ""}
|
|
273
|
-
// {children}
|
|
274
|
-
// {MemoizedModalViewContainer}
|
|
275
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
276
|
-
// {MemoizedPreviewViewContainer}
|
|
277
|
-
// </ModalManager>
|
|
278
|
-
|
|
279
239
|
return (
|
|
280
240
|
<React.Fragment>
|
|
281
241
|
<div>RootContainer: Has children. Trying to show ModalManager with children, etc.</div>
|
|
@@ -285,14 +245,8 @@ const RootContainer = (props) => {
|
|
|
285
245
|
|
|
286
246
|
);
|
|
287
247
|
} else if (skeleton) {
|
|
288
|
-
//
|
|
289
|
-
|
|
290
|
-
const LoadingComponent = LazyComponentMap[skeleton];
|
|
291
|
-
// interior was
|
|
292
|
-
// <ModalManager>
|
|
293
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
294
|
-
// <LoadingComponent />
|
|
295
|
-
// </ModalManager>
|
|
248
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
249
|
+
const LoadingComponent = LazyComponentMap[skeleton];
|
|
296
250
|
|
|
297
251
|
return (
|
|
298
252
|
<div id="root-container">
|
|
@@ -301,12 +255,6 @@ const RootContainer = (props) => {
|
|
|
301
255
|
</div>
|
|
302
256
|
);
|
|
303
257
|
} else {
|
|
304
|
-
// interior was
|
|
305
|
-
// <ModalManager>
|
|
306
|
-
// {MemoisedModalViewContainer}
|
|
307
|
-
// {MemoizedPreviewViewContainer}
|
|
308
|
-
// <ReAuthMessageModal openModal={false} key="reauthMessageModel" />
|
|
309
|
-
// </ModalManager>
|
|
310
258
|
return (
|
|
311
259
|
<div id="root-container">
|
|
312
260
|
<div>RootContainer: Should be ModalManager, etc.</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
// import { Stages as CosmosStages } from "@pega/cosmos-react-work";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { Breadcrumbs, Card, Typography } from "@material-ui/core";
|
|
5
4
|
import DoubleArrowIcon from '@material-ui/icons/DoubleArrow';
|
|
@@ -54,7 +53,7 @@ function getFilteredStages(stages) {
|
|
|
54
53
|
);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
/* TODO - this component should be refactored and not exposed as top level
|
|
56
|
+
/* TODO - this component should be refactored and not exposed as top level DX Component -
|
|
58
57
|
the stages should be created as part of the CaseView */
|
|
59
58
|
export default function Stages(props) {
|
|
60
59
|
const classes = useStyles();
|
package/lib/infra/View/View.tsx
CHANGED
|
@@ -150,7 +150,7 @@ View.propTypes = {
|
|
|
150
150
|
title: PropTypes.string
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
// Adapted from
|
|
153
|
+
// Adapted from Constellation DX Component to add in additional props for some templates
|
|
154
154
|
View.additionalProps = (state, getPConnect) => {
|
|
155
155
|
const thePConn = getPConnect();
|
|
156
156
|
const { template } = thePConn.getConfigProps();
|
|
@@ -3,20 +3,9 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
4
|
|
|
5
5
|
import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
6
|
-
|
|
7
|
-
// import {
|
|
8
|
-
// Avatar,
|
|
9
|
-
// Toaster,
|
|
10
|
-
// Banner,
|
|
11
|
-
// AppShell as CosmosAppShell
|
|
12
|
-
// } from "@pega/cosmos-react-core";
|
|
13
|
-
|
|
14
|
-
// import createPConnectComponent from "../../../bridge/react_pconnect";
|
|
15
|
-
// import { buildRecentList, onRecentClickHandler } from "./Recents/utils";
|
|
16
|
-
|
|
17
6
|
import './AppShell.css';
|
|
18
7
|
|
|
19
|
-
// AppShell can emit NavBar
|
|
8
|
+
// AppShell can emit NavBar
|
|
20
9
|
import NavBar from '@pega/react-sdk-components/lib/components/infra/NavBar';
|
|
21
10
|
|
|
22
11
|
const useStyles = makeStyles((theme) => ({
|
|
@@ -35,10 +24,6 @@ const useStyles = makeStyles((theme) => ({
|
|
|
35
24
|
declare const PCore;
|
|
36
25
|
|
|
37
26
|
|
|
38
|
-
/*
|
|
39
|
-
* The wrapper handles knowing how to take in just children and mapping
|
|
40
|
-
* to the Cosmos template. This could be a combination of things but it knows...
|
|
41
|
-
*/
|
|
42
27
|
export default function AppShell(props) {
|
|
43
28
|
const {
|
|
44
29
|
pages,
|
|
@@ -50,298 +35,11 @@ export default function AppShell(props) {
|
|
|
50
35
|
const [open, setOpen] = useState(true);
|
|
51
36
|
|
|
52
37
|
const pConn = getPConnect();
|
|
53
|
-
// const actionsAPI = pConn.getActionsApi();
|
|
54
38
|
const envInfo = PCore.getEnvironmentInfo();
|
|
55
39
|
|
|
56
|
-
// const bannerRef = useRef(null);
|
|
57
|
-
// const hasBanner = httpMessages && httpMessages.length ? httpMessages.length > 0 : false;
|
|
58
|
-
|
|
59
40
|
const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : "";
|
|
60
41
|
|
|
61
42
|
const classes = useStyles();
|
|
62
|
-
// let banners = null;
|
|
63
|
-
// banners = hasBanner && (
|
|
64
|
-
// <Banner
|
|
65
|
-
// ref={bannerRef}
|
|
66
|
-
// id="appShellBanner"
|
|
67
|
-
// variant="urgent"
|
|
68
|
-
// heading="Error"
|
|
69
|
-
// onDismiss={() =>
|
|
70
|
-
// pConn.clearErrorMessages({
|
|
71
|
-
// category: "HTTP",
|
|
72
|
-
// context: null
|
|
73
|
-
// })
|
|
74
|
-
// }
|
|
75
|
-
// messages={httpMessages}
|
|
76
|
-
// />
|
|
77
|
-
// );
|
|
78
|
-
|
|
79
|
-
// useEffect(() => {
|
|
80
|
-
// if (hasBanner && bannerRef.current) {
|
|
81
|
-
// bannerRef.current.focus();
|
|
82
|
-
// window.scrollTo(0, bannerRef.current.offsetTop);
|
|
83
|
-
// }
|
|
84
|
-
// }, [hasBanner]);
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* Function to dispatch a show page action for the page links in
|
|
89
|
-
* the left nav of the app shell
|
|
90
|
-
*
|
|
91
|
-
* @param {string} searchString Name of view to show
|
|
92
|
-
*/
|
|
93
|
-
// function showSearchResults(searchString) {
|
|
94
|
-
// if (searchString === "") {
|
|
95
|
-
// actionsAPI.showPage("pySearchPage", "Data-Portal");
|
|
96
|
-
// return;
|
|
97
|
-
// }
|
|
98
|
-
// const searchTerm = searchString.replace(/['"]+/g, "");
|
|
99
|
-
// PCore.getDataApiUtils()
|
|
100
|
-
// .getData(
|
|
101
|
-
// "D_pySearch",
|
|
102
|
-
// `{"dataViewParameters": {"SearchString": "${encodeURIComponent(
|
|
103
|
-
// searchTerm
|
|
104
|
-
// )}"}}`
|
|
105
|
-
// )
|
|
106
|
-
// .then((response) => {
|
|
107
|
-
// if (
|
|
108
|
-
// response.data.data !== null &&
|
|
109
|
-
// response.data.resultCount === 1 &&
|
|
110
|
-
// response.data.data[0].pyID === searchTerm
|
|
111
|
-
// ) {
|
|
112
|
-
// /* This is a match for a work item - then we will open it */
|
|
113
|
-
// pConn
|
|
114
|
-
// .getActionsApi()
|
|
115
|
-
// .openWorkByHandle(
|
|
116
|
-
// response.data.data[0].pzInsKey,
|
|
117
|
-
// response.data.data[0].pzCategoryActionKeys
|
|
118
|
-
// );
|
|
119
|
-
// return;
|
|
120
|
-
// }
|
|
121
|
-
// // window.searchResults = {
|
|
122
|
-
// // searchString: searchTerm,
|
|
123
|
-
// // results: response.data
|
|
124
|
-
// // };
|
|
125
|
-
// actionsAPI.showPage("pySearchPage", "Data-Portal");
|
|
126
|
-
// });
|
|
127
|
-
// }
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* Function to dispatch a show page action for the page links in
|
|
132
|
-
* the left nav of the app shell
|
|
133
|
-
*
|
|
134
|
-
* @param {string} viewName Name of view to show
|
|
135
|
-
* @param {string} className Pega Applies to class of the page
|
|
136
|
-
*/
|
|
137
|
-
// function showPage(viewName, className) {
|
|
138
|
-
// actionsAPI.showPage(viewName, className);
|
|
139
|
-
// }
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* Function to dispatch a create work action
|
|
144
|
-
* @param {string} className - placeholder string of case type being created
|
|
145
|
-
*/
|
|
146
|
-
// function createWork(className) {
|
|
147
|
-
// actionsAPI
|
|
148
|
-
// .createWork(className)
|
|
149
|
-
// .catch((error) =>
|
|
150
|
-
// // eslint-disable-next-line no-console
|
|
151
|
-
// console.log("Error in case creation: ", error?.message)
|
|
152
|
-
// );
|
|
153
|
-
// }
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Returns the Custome Component for each active case
|
|
157
|
-
*/
|
|
158
|
-
// const VisualComponent = useCallback(
|
|
159
|
-
// (context) => {
|
|
160
|
-
// if (activeCases && activeCases.length > 0) {
|
|
161
|
-
// const meta = PCore.getViewResources().fetchViewResources(
|
|
162
|
-
// "pyCaseVisual",
|
|
163
|
-
// getPConnect(),
|
|
164
|
-
// PCore.getStoreValue(".caseTypeID", "caseInfo", context)
|
|
165
|
-
// );
|
|
166
|
-
// if (meta?.config && !meta.config.defaultVisual) {
|
|
167
|
-
// const config = {
|
|
168
|
-
// meta,
|
|
169
|
-
// options: {
|
|
170
|
-
// context,
|
|
171
|
-
// pageReference: "caseInfo.content"
|
|
172
|
-
// }
|
|
173
|
-
// };
|
|
174
|
-
// const visualConfig = PCore.createPConnect(config);
|
|
175
|
-
// return React.createElement(createPConnectComponent(), visualConfig);
|
|
176
|
-
// }
|
|
177
|
-
// }
|
|
178
|
-
// return undefined;
|
|
179
|
-
// },
|
|
180
|
-
// [getPConnect, activeCases]
|
|
181
|
-
// );
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Transforms the active cases information into the model that cosmos expect.
|
|
185
|
-
*/
|
|
186
|
-
// function getActiveCases() {
|
|
187
|
-
// if (activeCases) {
|
|
188
|
-
// const activeCaseLinks = [];
|
|
189
|
-
// activeCases.forEach((activeCase) => {
|
|
190
|
-
// const { caseID, className, workID, active, context } = activeCase;
|
|
191
|
-
// // activeCaseLinks.push({
|
|
192
|
-
// // onDismiss: () => {
|
|
193
|
-
// // PCore.getContainerUtils().closeContainerItem(
|
|
194
|
-
// // activeCase.containerItemID
|
|
195
|
-
// // );
|
|
196
|
-
// // },
|
|
197
|
-
// // key: caseID,
|
|
198
|
-
// // name: caseID,
|
|
199
|
-
// // onClick: () => {
|
|
200
|
-
// // actionsAPI.openWorkByHandle(workID, className);
|
|
201
|
-
// // },
|
|
202
|
-
// // active,
|
|
203
|
-
// // visual: VisualComponent(context)
|
|
204
|
-
// // });
|
|
205
|
-
// });
|
|
206
|
-
// return activeCaseLinks;
|
|
207
|
-
// }
|
|
208
|
-
// return activeCases;
|
|
209
|
-
// }
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Translate Pega Data Page into the model that Cosmos expects
|
|
213
|
-
*
|
|
214
|
-
* Example:
|
|
215
|
-
* pxPageViewIcon: "pi pi-home-solid"
|
|
216
|
-
* pxURLPath: "Home"
|
|
217
|
-
* pyClassName: "Data-Portal"
|
|
218
|
-
* pyLabel: "Home"
|
|
219
|
-
* pyRuleName: "pyHome"
|
|
220
|
-
*/
|
|
221
|
-
// const links = !pages
|
|
222
|
-
// ? []
|
|
223
|
-
// : pages.map((page) => {
|
|
224
|
-
// return {
|
|
225
|
-
// name: page.pyLabel,
|
|
226
|
-
// icon: page.pxPageViewIcon.replace("pi pi-", ""),
|
|
227
|
-
// onClick: () => showPage(page.pyRuleName, page.pyClassName)
|
|
228
|
-
// };
|
|
229
|
-
// });
|
|
230
|
-
|
|
231
|
-
// const userName = envInfo.getOperatorName();
|
|
232
|
-
// const imageKey = envInfo.getOperatorImageInsKey();
|
|
233
|
-
|
|
234
|
-
// const logOffAction = () => {
|
|
235
|
-
// actionsAPI.logout().then(() => window?.top?.location?.reload());
|
|
236
|
-
// };
|
|
237
|
-
|
|
238
|
-
// const getOperator = () => {
|
|
239
|
-
// const operatorActions = [
|
|
240
|
-
// [{ text: "Logoff", id: "1", onClick: logOffAction }]
|
|
241
|
-
// ];
|
|
242
|
-
// if (imageKey) {
|
|
243
|
-
// return {
|
|
244
|
-
// avatar: (
|
|
245
|
-
// <div id="AvatarWithImageKey">Avatar with image key</div>
|
|
246
|
-
// // <Avatar
|
|
247
|
-
// // name={userName}
|
|
248
|
-
// // imageSrc={getPConnect().getImagePath(imageKey)}
|
|
249
|
-
// // />
|
|
250
|
-
// ),
|
|
251
|
-
// actions: operatorActions,
|
|
252
|
-
// name: userName
|
|
253
|
-
// };
|
|
254
|
-
// }
|
|
255
|
-
// return {
|
|
256
|
-
// avatar: (
|
|
257
|
-
// <div id="Avatar">Avatar</div>
|
|
258
|
-
// // <Avatar name={userName}>
|
|
259
|
-
// // {userName
|
|
260
|
-
// // .split(" ")
|
|
261
|
-
// // .map((i) => i.charAt(0))
|
|
262
|
-
// // .join("")
|
|
263
|
-
// // .toUpperCase()}
|
|
264
|
-
// // </Avatar>
|
|
265
|
-
// ),
|
|
266
|
-
// actions: operatorActions,
|
|
267
|
-
// name: userName
|
|
268
|
-
// };
|
|
269
|
-
// };
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Translate Case Types page into what is expected by Cosmos
|
|
273
|
-
*
|
|
274
|
-
* Example:
|
|
275
|
-
* pyClassName: ""
|
|
276
|
-
* pyFlowType: ""
|
|
277
|
-
* pyLabel: "No case types defined"
|
|
278
|
-
*/
|
|
279
|
-
// const cases = !caseTypes
|
|
280
|
-
// ? []
|
|
281
|
-
// : caseTypes.map((caseType) => {
|
|
282
|
-
// let action = {};
|
|
283
|
-
// // Only add actions to entries with a class name to create so in case of empty message no action is added
|
|
284
|
-
// if (caseType.pyClassName) {
|
|
285
|
-
// action = { onClick: () => createWork(caseType.pyClassName) };
|
|
286
|
-
// }
|
|
287
|
-
// return {
|
|
288
|
-
// name: caseType.pyLabel,
|
|
289
|
-
// ...action
|
|
290
|
-
// };
|
|
291
|
-
// });
|
|
292
|
-
|
|
293
|
-
// const [recents, setRecents] = useState([]);
|
|
294
|
-
|
|
295
|
-
// const [searchVal, setSearchVal] = useState("");
|
|
296
|
-
|
|
297
|
-
// // default the icon to be empty. This will cause the image to be initially broken.
|
|
298
|
-
// const [iconURL, setIconURL] = useState("");
|
|
299
|
-
// useEffect(() => {
|
|
300
|
-
// // using the default icon then fetch it from the static folder (not auth involved)
|
|
301
|
-
// if (
|
|
302
|
-
// !portalLogo ||
|
|
303
|
-
// portalLogo.toLowerCase().includes("pzpega-logo-mark") ||
|
|
304
|
-
// portalLogo.toLowerCase().includes("py-logo")
|
|
305
|
-
// ) {
|
|
306
|
-
// setIconURL(
|
|
307
|
-
// `${PCore.getAssetLoader().getStaticServerUrl()}static/py-logo.svg`
|
|
308
|
-
// );
|
|
309
|
-
// }
|
|
310
|
-
// // not using default icon to fetch it using the way which uses authentication
|
|
311
|
-
// else {
|
|
312
|
-
// PCore.getAssetLoader()
|
|
313
|
-
// .getSvcImage(portalLogo)
|
|
314
|
-
// .then((data) => {
|
|
315
|
-
// setIconURL(window.URL.createObjectURL(data));
|
|
316
|
-
// })
|
|
317
|
-
// .catch(() => {
|
|
318
|
-
// console.error(
|
|
319
|
-
// `Unable to load the image for the portal logo/icon with the insName:${portalLogo}`
|
|
320
|
-
// );
|
|
321
|
-
// });
|
|
322
|
-
// }
|
|
323
|
-
// }, [portalLogo]);
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* To fetch recents and translate items into what Cosmos expects
|
|
327
|
-
*/
|
|
328
|
-
// const fetchRecents = () => {
|
|
329
|
-
// actionsAPI.getRecents(15).then((response) => {
|
|
330
|
-
// const recentsitems = response.data.recents;
|
|
331
|
-
// // setRecents(buildRecentList(recentsitems));
|
|
332
|
-
// });
|
|
333
|
-
// };
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* To handle on click of any recent item after the drawer is open
|
|
337
|
-
*
|
|
338
|
-
* @param {*} id : Recent item unique id
|
|
339
|
-
*/
|
|
340
|
-
|
|
341
|
-
// const onItemClick = (id, e) => {
|
|
342
|
-
// e.preventDefault();
|
|
343
|
-
// // onRecentClickHandler(id, actionsAPI);
|
|
344
|
-
// };
|
|
345
43
|
|
|
346
44
|
// useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
|
|
347
45
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
@@ -382,57 +80,18 @@ export default function AppShell(props) {
|
|
|
382
80
|
</div>
|
|
383
81
|
</div>
|
|
384
82
|
</NavContext.Provider>
|
|
385
|
-
|
|
386
|
-
// <Toaster dismissAfter={3000}>
|
|
387
|
-
// <CosmosAppShell
|
|
388
|
-
// {...{
|
|
389
|
-
// appInfo: {
|
|
390
|
-
// imageSrc: `${iconURL}`,
|
|
391
|
-
// appName: `${appNameToDisplay}`,
|
|
392
|
-
// portalName
|
|
393
|
-
// },
|
|
394
|
-
// recents: {
|
|
395
|
-
// items: recents,
|
|
396
|
-
// onDrawerOpen: fetchRecents,
|
|
397
|
-
// onItemClick
|
|
398
|
-
// },
|
|
399
|
-
// searchInput: {
|
|
400
|
-
// onSearchChange: (value) => {
|
|
401
|
-
// setSearchVal(value);
|
|
402
|
-
// },
|
|
403
|
-
// onSearchSubmit: (value) => {
|
|
404
|
-
// showSearchResults(value.trim());
|
|
405
|
-
// setSearchVal("");
|
|
406
|
-
// },
|
|
407
|
-
// value: searchVal
|
|
408
|
-
// },
|
|
409
|
-
// caseTypes: cases,
|
|
410
|
-
// links,
|
|
411
|
-
// cases: getActiveCases(),
|
|
412
|
-
// operator: getOperator()
|
|
413
|
-
// }}
|
|
414
|
-
// main={[children]}
|
|
415
|
-
// banners={banners}
|
|
416
|
-
// className="app-shell"
|
|
417
|
-
// />
|
|
418
|
-
// </Toaster>
|
|
419
83
|
);
|
|
420
84
|
}
|
|
85
|
+
|
|
421
86
|
AppShell.defaultProps = {
|
|
422
87
|
pages: [],
|
|
423
88
|
caseTypes: [],
|
|
424
89
|
children: [],
|
|
425
|
-
// httpMessages: [],
|
|
426
|
-
// activeCases: null
|
|
427
90
|
};
|
|
428
91
|
AppShell.propTypes = {
|
|
429
|
-
// portalName: PropTypes.string/* .isRequired */,
|
|
430
|
-
// portalLogo: PropTypes.string/* .isRequired */,
|
|
431
92
|
showAppName: PropTypes.bool/* .isRequired */,
|
|
432
93
|
pages: PropTypes.arrayOf(PropTypes.object),
|
|
433
94
|
caseTypes: PropTypes.arrayOf(PropTypes.object),
|
|
434
95
|
children: PropTypes.arrayOf(PropTypes.node),
|
|
435
96
|
getPConnect: PropTypes.func.isRequired,
|
|
436
|
-
// httpMessages: PropTypes.arrayOf(PropTypes.string),
|
|
437
|
-
// activeCases: PropTypes.arrayOf(PropTypes.object)
|
|
438
97
|
};
|
|
@@ -9,7 +9,7 @@ export default function CaseSummary(props) {
|
|
|
9
9
|
const theConfigProps = thePConn.getConfigProps();
|
|
10
10
|
const { status, showStatus } = theConfigProps;
|
|
11
11
|
|
|
12
|
-
// from
|
|
12
|
+
// from Constellation DX Components
|
|
13
13
|
// get the primary and secondary fields with the raw data (which has the non-resolved property values)
|
|
14
14
|
// const regionsRaw = getPConnect().getRawMetadata().children;
|
|
15
15
|
// const primaryFieldsRaw = regionsRaw[0].children;
|
|
@@ -53,11 +53,6 @@ let menuColumnLabel = '';
|
|
|
53
53
|
|
|
54
54
|
let sortColumnId: any;
|
|
55
55
|
|
|
56
|
-
// let dialogContainsFilter: string = "contains";
|
|
57
|
-
// let dialogContainsValue: string = "";
|
|
58
|
-
// let dialogDateFilter: string = "notequal";
|
|
59
|
-
// let dialogDateValue: string = "";
|
|
60
|
-
|
|
61
56
|
const filterByColumns: Array<any> = [];
|
|
62
57
|
|
|
63
58
|
export default function ListView(props) {
|
|
@@ -217,19 +212,6 @@ export default function ListView(props) {
|
|
|
217
212
|
setPage(0);
|
|
218
213
|
};
|
|
219
214
|
|
|
220
|
-
// function getDisplayColumns(fields = []) {
|
|
221
|
-
// let arReturn = fields.map(( field: any, colIndex) => {
|
|
222
|
-
// let theField = field.config.value.substring(field.config.value.indexOf(" ")+1);
|
|
223
|
-
// if (theField.indexOf(".") == 0) {
|
|
224
|
-
// theField = theField.substring(1);
|
|
225
|
-
// }
|
|
226
|
-
|
|
227
|
-
// return theField;
|
|
228
|
-
// });
|
|
229
|
-
// return arReturn;
|
|
230
|
-
|
|
231
|
-
// }
|
|
232
|
-
|
|
233
215
|
const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
|
|
234
216
|
function getHeaderCells(colFields, fields, presetFields) {
|
|
235
217
|
const arReturn = colFields.map((field: any, index) => {
|
|
@@ -345,10 +327,6 @@ export default function ListView(props) {
|
|
|
345
327
|
myColList.push(col.id);
|
|
346
328
|
});
|
|
347
329
|
|
|
348
|
-
// for (const col of arCols) {
|
|
349
|
-
// myColList.push(col.id);
|
|
350
|
-
// }
|
|
351
|
-
|
|
352
330
|
return myColList;
|
|
353
331
|
}
|
|
354
332
|
|
|
@@ -381,7 +359,7 @@ export default function ListView(props) {
|
|
|
381
359
|
|
|
382
360
|
let field = getFieldFromFilter(filterExpression, isDateRange);
|
|
383
361
|
selectParam = [];
|
|
384
|
-
// Constructing the select parameters list(
|
|
362
|
+
// Constructing the select parameters list (will be sent in dashboardFilterPayload)
|
|
385
363
|
columnList.forEach(col => {
|
|
386
364
|
selectParam.push({
|
|
387
365
|
field: col
|
|
@@ -417,7 +395,7 @@ export default function ListView(props) {
|
|
|
417
395
|
// If we reach here that implies we've at least one valid filter, hence setting the flag
|
|
418
396
|
validFilter = true;
|
|
419
397
|
/** Below are the 2 cases for- Text & Date-Range filter types where we'll construct filter data which will be sent in the dashboardFilterPayload
|
|
420
|
-
* In
|
|
398
|
+
* In Constellation DX Components, through Repeating Structures they might be using several APIs to do it. We're doing it here
|
|
421
399
|
*/
|
|
422
400
|
if (isDateRange) {
|
|
423
401
|
const dateRelationalOp = filter?.AND ? 'AND' : 'OR';
|
|
@@ -518,7 +496,8 @@ export default function ListView(props) {
|
|
|
518
496
|
field: field.name
|
|
519
497
|
});
|
|
520
498
|
} else {
|
|
521
|
-
// NOTE: If we ever decide to not set up all the `fieldDefs` on select, ensure that the fields
|
|
499
|
+
// NOTE: If we ever decide to not set up all the `fieldDefs` on select, ensure that the fields
|
|
500
|
+
// corresponding to `state.groups` are set up. Needed in Client-mode grouping/pagination.
|
|
522
501
|
fieldDefs.forEach(field => {
|
|
523
502
|
if (!listFields.find(f => f.field === field.name)) {
|
|
524
503
|
listFields.push({
|
|
@@ -868,26 +847,6 @@ export default function ListView(props) {
|
|
|
868
847
|
// move data to array and then sort
|
|
869
848
|
setRows(theData);
|
|
870
849
|
createSortHandler(sortColumnId);
|
|
871
|
-
|
|
872
|
-
// grouping here
|
|
873
|
-
|
|
874
|
-
// let reGroupData = this.addGroups(theData, this.groupByColumns$);
|
|
875
|
-
|
|
876
|
-
// this.repeatList$.data = [];
|
|
877
|
-
// this.repeatList$.data.push( ...reGroupData);
|
|
878
|
-
|
|
879
|
-
// if (this.searchFilter && this.searchFilter != "") {
|
|
880
|
-
// this.repeatList$.filter = this.searchFilter;
|
|
881
|
-
// }
|
|
882
|
-
// else {
|
|
883
|
-
// this.perfFilter = performance.now().toString();
|
|
884
|
-
// this.repeatList$.filter = this.perfFilter;
|
|
885
|
-
// }
|
|
886
|
-
// this.repeatList$.filter = "";
|
|
887
|
-
|
|
888
|
-
// if (this.repeatList$.paginator) {
|
|
889
|
-
// this.repeatList$.paginator.firstPage();
|
|
890
|
-
// }
|
|
891
850
|
}
|
|
892
851
|
|
|
893
852
|
function _dialogContainsFilter(event) {
|
|
@@ -1349,10 +1308,8 @@ export default function ListView(props) {
|
|
|
1349
1308
|
}
|
|
1350
1309
|
|
|
1351
1310
|
ListView.defaultProps = {
|
|
1352
|
-
// parameters: undefined
|
|
1353
1311
|
};
|
|
1354
1312
|
|
|
1355
1313
|
ListView.propTypes = {
|
|
1356
1314
|
getPConnect: PropTypes.func.isRequired
|
|
1357
|
-
// parameters: PropTypes.objectOf(PropTypes.any)
|
|
1358
1315
|
};
|
|
@@ -147,14 +147,12 @@ export default function SimpleTableManual(props) {
|
|
|
147
147
|
}
|
|
148
148
|
}, [referenceList.length]);
|
|
149
149
|
|
|
150
|
-
// Nebula has other handling for isReadOnlyMode but has Cosmos-specific code
|
|
151
|
-
// so ignoring that for now...
|
|
152
150
|
// fieldDefs will be an array where each entry will have a "name" which will be the
|
|
153
151
|
// "resolved" property name (that we can use as the colId) though it's not really
|
|
154
152
|
// resolved. The buildFieldsForTable helper just removes the "@P " (which is what
|
|
155
|
-
//
|
|
153
|
+
// Constellation DX Components do). It will also have the "label", and "meta" contains the original,
|
|
156
154
|
// unchanged config info. For now, much of the info here is carried over from
|
|
157
|
-
//
|
|
155
|
+
// Constellation DX Components.
|
|
158
156
|
const fieldDefs = buildFieldsForTable(rawFields, resolvedFields, showDeleteButton);
|
|
159
157
|
|
|
160
158
|
const displayedColumns = fieldDefs.map(field => {
|
|
@@ -164,18 +162,6 @@ export default function SimpleTableManual(props) {
|
|
|
164
162
|
// console.log(`SimpleTable displayedColumns:`);
|
|
165
163
|
// console.log(displayedColumns);
|
|
166
164
|
|
|
167
|
-
// And now we can process the resolvedFields to add in the "name"
|
|
168
|
-
// from from the fieldDefs. This "name" is the value that
|
|
169
|
-
// we'll share to connect things together in the table.
|
|
170
|
-
|
|
171
|
-
// const processedFields = resolvedFields.map((field, i) => {
|
|
172
|
-
// field.config['name'] = displayedColumns[i]; // .config["value"].replace(/ ./g,"_"); // replace space dot with underscore
|
|
173
|
-
// return field;
|
|
174
|
-
// });
|
|
175
|
-
|
|
176
|
-
// console.log("SimpleTable processedFields:");
|
|
177
|
-
// console.log(processedFields);
|
|
178
|
-
|
|
179
165
|
// return the value that should be shown as the contents for the given row data
|
|
180
166
|
// of the given row field
|
|
181
167
|
function getRowValue(inRowData: Object, inColKey: string): any {
|
|
@@ -226,25 +212,18 @@ export default function SimpleTableManual(props) {
|
|
|
226
212
|
}
|
|
227
213
|
}
|
|
228
214
|
|
|
215
|
+
// May be useful for debugging or understanding how it works.
|
|
229
216
|
// These are the data structures referred to in the html file.
|
|
230
217
|
// These are the relationships that make the table work
|
|
231
218
|
// displayedColumns: key/value pairs where key is order of column and
|
|
232
219
|
// value is the property shown in that column. Ex: 1: "FirstName"
|
|
233
|
-
// processedFields: key/value pairs where each key is order of column
|
|
234
|
-
// and each value is an object of more detailed information about that
|
|
235
|
-
// column.
|
|
236
220
|
// rowData: array of each row's key/value pairs. Inside each row,
|
|
237
221
|
// each key is an entry in displayedColumns: ex: "FirstName": "Charles"
|
|
238
222
|
// Ex: { 1: {config: {label: "First Name", readOnly: true: name: "FirstName"}}, type: "TextInput" }
|
|
239
223
|
// The "type" indicates the type of component that should be used for editing (when editing is enabled)
|
|
240
224
|
//
|
|
241
|
-
// Note that the "property" shown in the column ("FirstName" in the above examples) is what
|
|
242
|
-
// ties the 3 data structures together.
|
|
243
|
-
|
|
244
225
|
// console.log("SimpleTable displayedColumns:");
|
|
245
226
|
// console.log(displayedColumns);
|
|
246
|
-
// console.log("SimpleTable processedFields:");
|
|
247
|
-
// console.log(processedFields);
|
|
248
227
|
// console.log(`SimpleTable rowData (${rowData.length} row(s)):`);
|
|
249
228
|
// console.log(JSON.stringify(rowData));
|
|
250
229
|
|
package/package.json
CHANGED