@pega/react-sdk-overrides 0.23.8 → 0.23.10
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/designSystemExtensions/FieldGroupList/FieldGroupList.tsx +19 -15
- package/lib/forms/AutoComplete/AutoComplete.tsx +8 -2
- package/lib/forms/AutoComplete/config-ext.json +11 -0
- package/lib/forms/Checkbox/config-ext.json +10 -0
- package/lib/forms/Currency/config-ext.json +10 -0
- package/lib/forms/Date/config-ext.json +10 -0
- package/lib/helpers/reactContextHelpers.js +10 -0
- package/lib/infra/Assignment/Assignment.tsx +6 -4
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +1 -1
- package/lib/infra/NavBar/NavBar.tsx +1 -1
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +1 -1
- package/lib/templates/AppShell/AppShell.tsx +3 -4
- package/lib/templates/AppShell/index.tsx +1 -1
- package/lib/templates/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/lib/templates/FieldGroupTemplate/FieldGroupTemplate.tsx +18 -6
- package/lib/{infra → widgets}/Attachment/Attachment.css +0 -0
- package/lib/{infra → widgets}/Attachment/Attachment.tsx +0 -0
- package/lib/{infra → widgets}/Attachment/AttachmentUtils.js +0 -0
- package/lib/{infra → widgets}/Attachment/index.tsx +0 -0
- package/lib/widgets/FileUtility/FileUtility/FileUtility.tsx +1 -1
- package/package.json +1 -1
|
@@ -24,26 +24,30 @@ const FieldGroupList = props => {
|
|
|
24
24
|
{props.items.map(item => (
|
|
25
25
|
<Grid item style={{ width: '100%' }}>
|
|
26
26
|
<b>{item.name}</b>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
{props.onDelete && (
|
|
28
|
+
<button
|
|
29
|
+
type='button'
|
|
30
|
+
style={{ float: 'right' }}
|
|
31
|
+
className='psdk-utility-button'
|
|
32
|
+
id={`delete-row-${item.id}`}
|
|
33
|
+
onClick={() => {
|
|
34
|
+
props.onDelete(item.id);
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$}></img>
|
|
38
|
+
</button>
|
|
39
|
+
)}
|
|
38
40
|
{item.children}
|
|
39
41
|
<br />
|
|
40
|
-
<Divider />
|
|
42
|
+
{props.onAdd && <Divider />}
|
|
41
43
|
<br />
|
|
42
44
|
</Grid>
|
|
43
45
|
))}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
{props.onAdd && (
|
|
47
|
+
<Link onClick={props.onAdd} style={{ cursor: 'pointer' }}>
|
|
48
|
+
+Add
|
|
49
|
+
</Link>
|
|
50
|
+
)}
|
|
47
51
|
</Grid>
|
|
48
52
|
</Grid>
|
|
49
53
|
</Grid>
|
|
@@ -5,6 +5,7 @@ import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
|
5
5
|
import TextInput from '@pega/react-sdk-components/lib/components/forms/TextInput';
|
|
6
6
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
7
7
|
import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
|
|
8
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
9
|
|
|
9
10
|
interface IOption {
|
|
10
11
|
key: string;
|
|
@@ -42,7 +43,6 @@ export default function AutoComplete(props) {
|
|
|
42
43
|
placeholder,
|
|
43
44
|
value = '',
|
|
44
45
|
validatemessage,
|
|
45
|
-
onChange,
|
|
46
46
|
readOnly,
|
|
47
47
|
testId,
|
|
48
48
|
displayMode,
|
|
@@ -60,6 +60,11 @@ export default function AutoComplete(props) {
|
|
|
60
60
|
let selectedValue: any = '';
|
|
61
61
|
const helperTextToDisplay = validatemessage || helperText;
|
|
62
62
|
|
|
63
|
+
const thePConn = getPConnect();
|
|
64
|
+
const actionsApi = thePConn.getActionsApi();
|
|
65
|
+
const propName = thePConn.getStateProps().value;
|
|
66
|
+
|
|
67
|
+
|
|
63
68
|
if (!isDeepEqual(datasource, theDatasource)) {
|
|
64
69
|
// inbound datasource is different, so update theDatasource (to trigger useEffect)
|
|
65
70
|
setDatasource(datasource);
|
|
@@ -137,7 +142,8 @@ export default function AutoComplete(props) {
|
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
const handleChange = (event: object, newValue) => {
|
|
140
|
-
|
|
145
|
+
const val = newValue ? newValue.key : '' ;
|
|
146
|
+
handleEvent(actionsApi, 'changeNblur', propName, val);
|
|
141
147
|
};
|
|
142
148
|
|
|
143
149
|
const handleInputValue = (event, newInputValue) => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
// This file contains a shared access point for any React contexts that may need to be
|
|
4
|
+
// defined/used across various components.
|
|
5
|
+
|
|
6
|
+
// For example, the AppShell wants to use a NavContext that interacts with
|
|
7
|
+
// that context's consumption in the NavBar to handle clicks for opening/closing
|
|
8
|
+
// aspects of the NavBar
|
|
9
|
+
export const NavContext = createContext({open: false, setOpen: f => f});
|
|
10
|
+
export const useNavBar = () => useContext(NavContext);
|
|
@@ -10,7 +10,7 @@ import CloseIcon from '@material-ui/icons/Close';
|
|
|
10
10
|
declare const PCore: any;
|
|
11
11
|
|
|
12
12
|
export default function Assignment(props) {
|
|
13
|
-
const { getPConnect, children, itemKey,
|
|
13
|
+
const { getPConnect, children, itemKey, isInModal } = props;
|
|
14
14
|
const thePConn = getPConnect();
|
|
15
15
|
|
|
16
16
|
const [bHasNavigation, setHasNavigation] = useState(false);
|
|
@@ -164,7 +164,9 @@ export default function Assignment(props) {
|
|
|
164
164
|
// check if create stage (modal)
|
|
165
165
|
const { PUB_SUB_EVENTS } = PCore.getConstants();
|
|
166
166
|
const { publish } = PCore.getPubSubUtils();
|
|
167
|
-
|
|
167
|
+
const isAssignmentInCreateStage = thePConn.getCaseInfo().isAssignmentInCreateStage();
|
|
168
|
+
const isLocalAction = thePConn.getCaseInfo().isLocalAction() || getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION);
|
|
169
|
+
if (isAssignmentInCreateStage && isInModal && !isLocalAction) {
|
|
168
170
|
const cancelPromise = cancelCreateStageAssignment(itemKey);
|
|
169
171
|
|
|
170
172
|
cancelPromise
|
|
@@ -289,13 +291,13 @@ Assignment.propTypes = {
|
|
|
289
291
|
children: PropTypes.node.isRequired,
|
|
290
292
|
getPConnect: PropTypes.func.isRequired,
|
|
291
293
|
itemKey: PropTypes.string,
|
|
292
|
-
|
|
294
|
+
isInModal: PropTypes.bool
|
|
293
295
|
// actionButtons: PropTypes.object
|
|
294
296
|
// buildName: PropTypes.string
|
|
295
297
|
};
|
|
296
298
|
|
|
297
299
|
Assignment.defaultProps = {
|
|
298
300
|
itemKey: null,
|
|
299
|
-
|
|
301
|
+
isInModal: false
|
|
300
302
|
// buildName: null
|
|
301
303
|
};
|
|
@@ -286,7 +286,7 @@ const ModalViewContainer = props => {
|
|
|
286
286
|
</DialogTitle>
|
|
287
287
|
<DialogContent className={classes.dlgContent}>
|
|
288
288
|
{bShowModal ? (
|
|
289
|
-
<Assignment getPConnect={createdView.getPConnect} itemKey={itemKey}
|
|
289
|
+
<Assignment getPConnect={createdView.getPConnect} itemKey={itemKey} isInModal>
|
|
290
290
|
{arNewChildrenAsReact}
|
|
291
291
|
</Assignment>
|
|
292
292
|
) : (
|
|
@@ -34,7 +34,7 @@ import ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';
|
|
|
34
34
|
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
|
35
35
|
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
36
36
|
|
|
37
|
-
import { useNavBar } from "@pega/react-sdk-components/lib/components/
|
|
37
|
+
import { useNavBar } from "@pega/react-sdk-components/lib/components/helpers/reactContextHelpers";
|
|
38
38
|
import { logout } from '@pega/react-sdk-components/lib/components/helpers/authManager';
|
|
39
39
|
|
|
40
40
|
declare const PCore;
|
|
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles'
|
|
4
4
|
|
|
5
5
|
import Tabs from '@material-ui/core/Tabs';
|
|
6
|
-
import LeftAlignVerticalTab from '@pega/react-sdk-components/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs
|
|
6
|
+
import LeftAlignVerticalTab from '@pega/react-sdk-components/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs';
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// The MuiTabs-indicator class is in a span whose parent is div (under the Tabs root component)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React, { useEffect, useState
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
4
|
|
|
5
|
+
import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
6
|
+
|
|
5
7
|
// import {
|
|
6
8
|
// Avatar,
|
|
7
9
|
// Toaster,
|
|
@@ -33,9 +35,6 @@ const useStyles = makeStyles((theme) => ({
|
|
|
33
35
|
declare const PCore;
|
|
34
36
|
|
|
35
37
|
|
|
36
|
-
const NavContext = createContext({open: false, setOpen: f => f});
|
|
37
|
-
export const useNavBar = () => useContext(NavContext);
|
|
38
|
-
|
|
39
38
|
/*
|
|
40
39
|
* The wrapper handles knowing how to take in just children and mapping
|
|
41
40
|
* to the Cosmos template. This could be a combination of things but it knows...
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './AppShell';
|
|
1
|
+
export { default } from './AppShell';
|
|
@@ -27,7 +27,7 @@ export default function CaseViewActionsMenu(props) {
|
|
|
27
27
|
const actionsAPI = thePConn.getActionsApi();
|
|
28
28
|
const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);
|
|
29
29
|
|
|
30
|
-
openLocalAction( data.ID, { ...data});
|
|
30
|
+
openLocalAction( data.ID, { ...data, containerName: 'modal', type: 'express'});
|
|
31
31
|
// after doing the action, close the menu...
|
|
32
32
|
handleClose();
|
|
33
33
|
|
|
@@ -16,7 +16,9 @@ export default function FieldGroupTemplate(props) {
|
|
|
16
16
|
getPConnect,
|
|
17
17
|
lookForChildInConfig,
|
|
18
18
|
heading,
|
|
19
|
-
displayMode
|
|
19
|
+
displayMode,
|
|
20
|
+
fieldHeader,
|
|
21
|
+
allowTableEdit: allowAddEdit
|
|
20
22
|
} = props;
|
|
21
23
|
const pConn = getPConnect();
|
|
22
24
|
const resolvedList = getReferenceList(pConn);
|
|
@@ -25,13 +27,20 @@ export default function FieldGroupTemplate(props) {
|
|
|
25
27
|
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';
|
|
26
28
|
const HEADING = heading ?? 'Row';
|
|
27
29
|
|
|
30
|
+
const getDynamicHeaderProp = (item, index) => {
|
|
31
|
+
if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)]) {
|
|
32
|
+
return item[heading.substring(1)];
|
|
33
|
+
}
|
|
34
|
+
return `Row ${index + 1}`;
|
|
35
|
+
};
|
|
36
|
+
|
|
28
37
|
const addRecord = () => {
|
|
29
38
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
30
39
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
31
40
|
} else {
|
|
32
41
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
|
|
33
42
|
}
|
|
34
|
-
}
|
|
43
|
+
};
|
|
35
44
|
|
|
36
45
|
if (!isReadonlyMode) {
|
|
37
46
|
const addFieldGroupItem = () => {
|
|
@@ -44,14 +53,17 @@ export default function FieldGroupTemplate(props) {
|
|
|
44
53
|
pConn.getListActions().deleteEntry(index);
|
|
45
54
|
}
|
|
46
55
|
};
|
|
47
|
-
if (referenceList.length === 0) {
|
|
56
|
+
if (referenceList.length === 0 && allowAddEdit !== false) {
|
|
48
57
|
addFieldGroupItem();
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
const MemoisedChildren = useMemo(() => {
|
|
52
61
|
return referenceList.map((item, index) => ({
|
|
53
62
|
id: index,
|
|
54
|
-
name:
|
|
63
|
+
name:
|
|
64
|
+
fieldHeader === 'propertyRef'
|
|
65
|
+
? getDynamicHeaderProp(item, index)
|
|
66
|
+
: `${HEADING} ${index + 1}`,
|
|
55
67
|
children: buildView(pConn, index, lookForChildInConfig)
|
|
56
68
|
}));
|
|
57
69
|
}, [referenceList?.length]);
|
|
@@ -59,8 +71,8 @@ export default function FieldGroupTemplate(props) {
|
|
|
59
71
|
return (
|
|
60
72
|
<FieldGroupList
|
|
61
73
|
items={MemoisedChildren}
|
|
62
|
-
onAdd={addFieldGroupItem}
|
|
63
|
-
onDelete={deleteFieldGroupItem}
|
|
74
|
+
onAdd={allowAddEdit !== false ? addFieldGroupItem : undefined}
|
|
75
|
+
onDelete={allowAddEdit !== false ? deleteFieldGroupItem : undefined}
|
|
64
76
|
/>
|
|
65
77
|
);
|
|
66
78
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -8,7 +8,7 @@ import './FileUtility.css';
|
|
|
8
8
|
import { IconButton, Menu, MenuItem } from '@material-ui/core';
|
|
9
9
|
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
10
10
|
import { Button } from '@material-ui/core';
|
|
11
|
-
import { validateMaxSize } from '@pega/react-sdk-components/lib/components/
|
|
11
|
+
import { validateMaxSize } from '@pega/react-sdk-components/lib/components/widgets/Attachment/AttachmentUtils';
|
|
12
12
|
import { CircularProgress } from "@material-ui/core";
|
|
13
13
|
|
|
14
14
|
declare const PCore;
|
package/package.json
CHANGED