@pega/react-sdk-overrides 0.23.18 → 0.23.20
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 +120 -137
- 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 +3 -2
- package/lib/template/AppShell/AppShell.tsx +2 -343
- package/lib/template/CaseSummary/CaseSummary.tsx +1 -1
- package/lib/template/Confirmation/Confirmation.tsx +83 -0
- package/lib/template/Confirmation/config-ext.json +12 -0
- package/lib/template/Confirmation/index.tsx +1 -0
- package/lib/template/ListView/ListView.tsx +4 -47
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +3 -24
- package/lib/widget/ToDo/ToDo.css +10 -4
- package/lib/widget/ToDo/ToDo.tsx +104 -41
- package/package.json +1 -1
|
@@ -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
|
@@ -25,7 +25,8 @@ const NO_HEADER_TEMPLATES = [
|
|
|
25
25
|
'DetailsTwoColumn',
|
|
26
26
|
'DetailsThreeColumn',
|
|
27
27
|
'NarrowWideDetails',
|
|
28
|
-
'WideNarrowDetails'
|
|
28
|
+
'WideNarrowDetails',
|
|
29
|
+
'Confirmation'
|
|
29
30
|
];
|
|
30
31
|
|
|
31
32
|
export default function View(props) {
|
|
@@ -150,7 +151,7 @@ View.propTypes = {
|
|
|
150
151
|
title: PropTypes.string
|
|
151
152
|
};
|
|
152
153
|
|
|
153
|
-
// Adapted from
|
|
154
|
+
// Adapted from Constellation DX Component to add in additional props for some templates
|
|
154
155
|
View.additionalProps = (state, getPConnect) => {
|
|
155
156
|
const thePConn = getPConnect();
|
|
156
157
|
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;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable no-unused-vars */
|
|
3
|
+
/* eslint-disable no-nested-ternary */
|
|
4
|
+
import { Fragment, useState } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { getToDoAssignments } from '@pega/react-sdk-components/lib/components/infra/Containers/FlowContainer/helpers';
|
|
8
|
+
import ToDo from '@pega/react-sdk-components/lib/components/widget/ToDo';
|
|
9
|
+
import Details from '@pega/react-sdk-components/lib/components/template/Details/Details';
|
|
10
|
+
import { Button } from '@material-ui/core';
|
|
11
|
+
|
|
12
|
+
declare const PCore;
|
|
13
|
+
|
|
14
|
+
export default function Confirmation(props) {
|
|
15
|
+
const CONSTS = PCore.getConstants();
|
|
16
|
+
const [showConfirmView, setShowConfirmView] = useState(true);
|
|
17
|
+
const { showTasks, getPConnect, datasource } = props;
|
|
18
|
+
// Get the inherited props from the parent to determine label settings
|
|
19
|
+
// Not using whatsNext at the moment, need to figure out the use of it
|
|
20
|
+
const whatsNext = datasource?.source;
|
|
21
|
+
const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';
|
|
22
|
+
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(
|
|
23
|
+
getPConnect().getTarget()
|
|
24
|
+
);
|
|
25
|
+
const rootInfo = PCore.getContainerUtils().getContainerItemData(
|
|
26
|
+
getPConnect().getTarget(),
|
|
27
|
+
activeContainerItemID
|
|
28
|
+
);
|
|
29
|
+
const onConfirmViewClose = () => {
|
|
30
|
+
setShowConfirmView(false);
|
|
31
|
+
PCore.getPubSubUtils().publish(
|
|
32
|
+
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,
|
|
33
|
+
rootInfo
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
const todoProps = { ...props, renderTodoInConfirm: true };
|
|
37
|
+
const toDoList = getToDoAssignments(getPConnect());
|
|
38
|
+
const detailProps = { ...props, showLabel: false };
|
|
39
|
+
const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;
|
|
40
|
+
return showConfirmView ? (
|
|
41
|
+
<Fragment>
|
|
42
|
+
<h2>{props.showLabel ? props.label : ''}</h2>
|
|
43
|
+
{showDetails ? <Details {...detailProps} /> : undefined}
|
|
44
|
+
{showTasks ? (
|
|
45
|
+
toDoList && toDoList.length > 0 ? (
|
|
46
|
+
<ToDo
|
|
47
|
+
{...todoProps}
|
|
48
|
+
datasource={{ source: toDoList }}
|
|
49
|
+
getPConnect={getPConnect}
|
|
50
|
+
type={CONSTS.TODO}
|
|
51
|
+
headerText='Open Tasks'
|
|
52
|
+
/>
|
|
53
|
+
) : undefined
|
|
54
|
+
) : undefined}
|
|
55
|
+
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
56
|
+
<Button variant='contained' color='primary' onClick={onConfirmViewClose}>
|
|
57
|
+
Done
|
|
58
|
+
</Button>
|
|
59
|
+
</div>
|
|
60
|
+
</Fragment>
|
|
61
|
+
) : toDoList && toDoList.length > 0 ? (
|
|
62
|
+
<ToDo
|
|
63
|
+
{...props}
|
|
64
|
+
datasource={{ source: toDoList }}
|
|
65
|
+
getPConnect={getPConnect}
|
|
66
|
+
type={CONSTS.TODO}
|
|
67
|
+
headerText='Tasks'
|
|
68
|
+
/>
|
|
69
|
+
) : null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Confirmation.defaultProps = {
|
|
73
|
+
datasource: undefined,
|
|
74
|
+
label: '',
|
|
75
|
+
showLabel: true
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
Confirmation.propTypes = {
|
|
79
|
+
getPConnect: PropTypes.func.isRequired,
|
|
80
|
+
datasource: PropTypes.objectOf(PropTypes.any),
|
|
81
|
+
label: PropTypes.string,
|
|
82
|
+
showLabel: PropTypes.bool
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Confirmation';
|