@pega/react-sdk-overrides 0.23.36 → 0.23.38
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/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +10 -4
- package/lib/field/RichText/RichText.tsx +2 -2
- package/lib/field/UserReference/UserReference.tsx +11 -1
- package/lib/helpers/common-utils.ts +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +5 -2
- package/lib/infra/NavBar/NavBar.tsx +1 -1
- package/lib/template/DefaultForm/utils/index.ts +2 -7
- package/lib/template/ListView/ListView.tsx +2 -2
- package/package.json +1 -1
|
@@ -109,9 +109,9 @@ export default function CaseSummaryFields(props: CaseSummaryFieldsProps) {
|
|
|
109
109
|
label={field.config.label}
|
|
110
110
|
InputProps={{
|
|
111
111
|
readOnly: true,
|
|
112
|
+
disableUnderline: true,
|
|
112
113
|
inputProps: {
|
|
113
|
-
style: { cursor: 'pointer' }
|
|
114
|
-
disableUnderline: true
|
|
114
|
+
style: { cursor: 'pointer' }
|
|
115
115
|
}
|
|
116
116
|
}}
|
|
117
117
|
/>
|
|
@@ -9,6 +9,7 @@ interface FieldValueListProps {
|
|
|
9
9
|
name?: string;
|
|
10
10
|
value: any;
|
|
11
11
|
variant?: string;
|
|
12
|
+
isHtml?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const useStyles = makeStyles(theme => ({
|
|
@@ -45,7 +46,7 @@ function formatItemValue(value) {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export default function FieldValueList(props: FieldValueListProps) {
|
|
48
|
-
const { name, value, variant = 'inline' } = props;
|
|
49
|
+
const { name, value, variant = 'inline', isHtml = false } = props;
|
|
49
50
|
const classes = useStyles();
|
|
50
51
|
|
|
51
52
|
function getGridItemLabel() {
|
|
@@ -63,9 +64,14 @@ export default function FieldValueList(props: FieldValueListProps) {
|
|
|
63
64
|
|
|
64
65
|
return (
|
|
65
66
|
<Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
{isHtml ? (
|
|
68
|
+
// eslint-disable-next-line react/no-danger
|
|
69
|
+
<div dangerouslySetInnerHTML={{ __html: formattedValue }} />
|
|
70
|
+
) : (
|
|
71
|
+
<Typography variant={variant === 'stacked' ? 'h6' : 'body2'} component='span' className={classes.fieldValue}>
|
|
72
|
+
{formattedValue}
|
|
73
|
+
</Typography>
|
|
74
|
+
)}
|
|
69
75
|
</Grid>
|
|
70
76
|
);
|
|
71
77
|
}
|
|
@@ -24,11 +24,11 @@ export default function RichText(props: RichTextProps) {
|
|
|
24
24
|
const helperTextToDisplay = validatemessage || helperText;
|
|
25
25
|
|
|
26
26
|
if (displayMode === 'LABELS_LEFT') {
|
|
27
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
27
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml />;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
31
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
31
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml variant='stacked' />;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
let richTextComponent;
|
|
@@ -4,6 +4,7 @@ import { Typography } from '@material-ui/core';
|
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
5
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
|
|
7
|
+
import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
|
|
7
8
|
import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
|
|
8
9
|
|
|
9
10
|
const DROPDOWN_LIST = 'Drop-down list';
|
|
@@ -12,6 +13,7 @@ const SEARCH_BOX = 'Search box';
|
|
|
12
13
|
interface UserReferenceProps extends PConnProps {
|
|
13
14
|
// If any, enter additional props that only exist on URLComponent here
|
|
14
15
|
displayAs?: string;
|
|
16
|
+
displayMode?: string;
|
|
15
17
|
label?: string;
|
|
16
18
|
value?: any;
|
|
17
19
|
testId?: string;
|
|
@@ -36,6 +38,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
36
38
|
const {
|
|
37
39
|
label = '',
|
|
38
40
|
displayAs = '',
|
|
41
|
+
displayMode = '',
|
|
39
42
|
getPConnect,
|
|
40
43
|
value = '',
|
|
41
44
|
testId = '',
|
|
@@ -96,6 +99,14 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
96
99
|
|
|
97
100
|
let userReferenceComponent: any = null;
|
|
98
101
|
|
|
102
|
+
if (displayMode === 'LABELS_LEFT') {
|
|
103
|
+
return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
107
|
+
return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} variant='stacked' />;
|
|
108
|
+
}
|
|
109
|
+
|
|
99
110
|
if (readOnly && showAsFormattedText) {
|
|
100
111
|
if (userId) {
|
|
101
112
|
userReferenceComponent = (
|
|
@@ -172,7 +183,6 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
172
183
|
);
|
|
173
184
|
}
|
|
174
185
|
}
|
|
175
|
-
|
|
176
186
|
return userReferenceComponent;
|
|
177
187
|
};
|
|
178
188
|
|
package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx
CHANGED
|
@@ -49,10 +49,13 @@ function ListViewActionButtons(props: ListViewActionButtonsProps) {
|
|
|
49
49
|
getPConnect()
|
|
50
50
|
.getActionsApi()
|
|
51
51
|
.submitEmbeddedDataModal(context)
|
|
52
|
-
.then(() => {
|
|
53
|
-
.finally(() => {
|
|
52
|
+
.then(() => {
|
|
54
53
|
setIsDisabled(false);
|
|
55
54
|
closeActionsDialog();
|
|
55
|
+
})
|
|
56
|
+
.catch(err => {
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.log(err);
|
|
56
59
|
});
|
|
57
60
|
}}
|
|
58
61
|
>
|
|
@@ -249,7 +249,7 @@ export default function NavBar(props: NavBarProps) {
|
|
|
249
249
|
<Divider />
|
|
250
250
|
<List className='marginTopAuto'>
|
|
251
251
|
<>
|
|
252
|
-
<ListItem onClick={navPanelOperatorButtonClick}>
|
|
252
|
+
<ListItem onClick={navPanelOperatorButtonClick} style={{ cursor: 'pointer' }}>
|
|
253
253
|
<ListItemIcon>
|
|
254
254
|
<PersonOutlineIcon fontSize='large' />
|
|
255
255
|
</ListItemIcon>
|
|
@@ -20,13 +20,8 @@ export const getKeyForMappedField = field => {
|
|
|
20
20
|
|
|
21
21
|
const pConnect = field?.getPConnect?.();
|
|
22
22
|
|
|
23
|
-
if (pConnect?.meta
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Using label as a fallback if name is not defined.
|
|
28
|
-
if (pConnect?.meta?.type && pConnect?.meta?.config?.label) {
|
|
29
|
-
return `${pConnect.meta.type}_${pConnect.meta.config.label}`;
|
|
23
|
+
if (pConnect?.meta) {
|
|
24
|
+
return JSON.stringify(pConnect.meta);
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
return uuidv4();
|
|
@@ -1047,7 +1047,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1047
1047
|
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1048
1048
|
.map(row => {
|
|
1049
1049
|
return (
|
|
1050
|
-
<TableRow key={row.pxRefObjectInsName || row.pyID}>
|
|
1050
|
+
<TableRow key={row.pxRefObjectInsName || row.pyID || row.pyGUID}>
|
|
1051
1051
|
{arColumns.map(column => {
|
|
1052
1052
|
const value = row[column.id];
|
|
1053
1053
|
return (
|
|
@@ -1104,7 +1104,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1104
1104
|
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1105
1105
|
.map(row => {
|
|
1106
1106
|
return (
|
|
1107
|
-
<TableRow key={row
|
|
1107
|
+
<TableRow key={row.pxRefObjectInsName || row.pyGUID || row.pyID}>
|
|
1108
1108
|
{selectionMode === SELECTION_MODE.SINGLE && (
|
|
1109
1109
|
<TableCell>
|
|
1110
1110
|
<Radio
|
package/package.json
CHANGED