@pega/react-sdk-overrides 0.242.3 → 0.242.5
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/DetailsFields/DetailsFields.tsx +1 -1
- package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +1 -1
- package/lib/field/Currency/Currency.tsx +1 -1
- package/lib/field/Date/Date.tsx +1 -1
- package/lib/field/DateTime/DateTime.tsx +9 -2
- package/lib/field/Decimal/Decimal.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +1 -1
- package/lib/field/Email/Email.tsx +27 -6
- package/lib/field/Group/Group.tsx +1 -1
- package/lib/field/Integer/Integer.tsx +21 -7
- package/lib/field/Percentage/Percentage.tsx +1 -1
- package/lib/field/Phone/Phone.tsx +2 -1
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +1 -1
- package/lib/field/RichText/RichText.tsx +1 -1
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/ScalarList/ScalarList.tsx +2 -2
- package/lib/field/SemanticLink/SemanticLink.tsx +1 -1
- package/lib/field/TextArea/TextArea.tsx +25 -7
- package/lib/field/TextInput/TextInput.tsx +1 -1
- package/lib/field/Time/Time.tsx +9 -6
- package/lib/field/URL/URL.tsx +25 -6
- package/lib/field/UserReference/UserReference.tsx +1 -1
- package/lib/helpers/field-group-utils.ts +2 -2
- package/lib/infra/Assignment/Assignment.tsx +1 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +1 -1
- package/lib/infra/MultiStep/MultiStep.tsx +14 -8
- package/lib/infra/NavBar/NavBar.tsx +8 -1
- package/lib/infra/View/View.tsx +37 -3
- package/lib/template/AppShell/AppShell.tsx +34 -3
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/DataReference/DataReference.tsx +1 -1
- package/lib/template/Details/Details/Details.tsx +1 -1
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/template/ListView/utils.ts +1 -1
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/lib/widget/Attachment/Attachment.tsx +2 -0
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ export default function DetailsFields(props: DetailsFieldsProps) {
|
|
|
48
48
|
const { label } = thePConn.getConfigProps();
|
|
49
49
|
const configObj = thePConn?.getReferencedView();
|
|
50
50
|
configObj.config.readOnly = true;
|
|
51
|
-
configObj.config.displayMode = '
|
|
51
|
+
configObj.config.displayMode = 'DISPLAY_ONLY';
|
|
52
52
|
const propToUse = { ...thePConn.getInheritedProps() };
|
|
53
53
|
configObj.config.label = theCompType === 'reference' ? propToUse?.label : label;
|
|
54
54
|
fieldComponents.push({
|
|
@@ -150,7 +150,7 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
150
150
|
}
|
|
151
151
|
}, []);
|
|
152
152
|
|
|
153
|
-
if (displayMode === '
|
|
153
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
154
154
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -77,7 +77,7 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
77
77
|
}
|
|
78
78
|
}, [thePConn]);
|
|
79
79
|
|
|
80
|
-
if (displayMode === '
|
|
80
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
81
81
|
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -67,7 +67,7 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
67
67
|
let currencyProp = {};
|
|
68
68
|
currencyProp = { prefix: theCurrSym, decimalSeparator: theCurrDec, thousandSeparator: theCurrSep };
|
|
69
69
|
|
|
70
|
-
if (displayMode === '
|
|
70
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
71
71
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
72
72
|
}
|
|
73
73
|
|
package/lib/field/Date/Date.tsx
CHANGED
|
@@ -39,7 +39,7 @@ export default function Date(props: DateProps) {
|
|
|
39
39
|
dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;
|
|
40
40
|
dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;
|
|
41
41
|
|
|
42
|
-
if (displayMode === '
|
|
42
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
43
43
|
const formattedDate = format(props.value, 'date', {
|
|
44
44
|
format: dateFormatInfo.dateFormatString
|
|
45
45
|
});
|
|
@@ -34,7 +34,7 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
34
34
|
dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;
|
|
35
35
|
dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;
|
|
36
36
|
|
|
37
|
-
if (displayMode === '
|
|
37
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
38
38
|
const formattedDateTime = format(props.value, 'datetime', {
|
|
39
39
|
format: `${dateFormatInfo.dateFormatString} hh:mm a`
|
|
40
40
|
});
|
|
@@ -53,6 +53,12 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
53
53
|
return <TextInput {...props} value={formattedDateTime} />;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
let testProp = {};
|
|
57
|
+
|
|
58
|
+
testProp = {
|
|
59
|
+
'data-test-id': testId
|
|
60
|
+
};
|
|
61
|
+
|
|
56
62
|
const handleChange = date => {
|
|
57
63
|
setDateValue(date);
|
|
58
64
|
const changeValue = date && date.isValid() ? date.toISOString() : null;
|
|
@@ -83,7 +89,8 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
83
89
|
placeholder: `${dateFormatInfo.dateFormatStringLC} hh:mm a`,
|
|
84
90
|
error: status === 'error',
|
|
85
91
|
helperText: helperTextToDisplay,
|
|
86
|
-
size: 'small'
|
|
92
|
+
size: 'small',
|
|
93
|
+
InputProps: { ...testProp }
|
|
87
94
|
}
|
|
88
95
|
}}
|
|
89
96
|
/>
|
|
@@ -71,7 +71,7 @@ export default function Decimal(props: DecimalProps) {
|
|
|
71
71
|
formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
if (displayMode === '
|
|
74
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
75
75
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import { InputAdornment, TextField } from '@mui/material';
|
|
2
3
|
import MailOutlineIcon from '@mui/icons-material/MailOutline';
|
|
3
4
|
|
|
4
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
8
|
|
|
7
9
|
interface EmailProps extends PConnFieldProps {
|
|
8
10
|
// If any, enter additional props that only exist on Date here
|
|
@@ -14,14 +16,13 @@ export default function Email(props: EmailProps) {
|
|
|
14
16
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
15
17
|
|
|
16
18
|
const {
|
|
19
|
+
getPConnect,
|
|
17
20
|
label,
|
|
18
21
|
required,
|
|
19
22
|
disabled,
|
|
20
23
|
value = '',
|
|
21
24
|
validatemessage,
|
|
22
25
|
status,
|
|
23
|
-
onChange,
|
|
24
|
-
onBlur,
|
|
25
26
|
readOnly,
|
|
26
27
|
testId,
|
|
27
28
|
helperText,
|
|
@@ -29,9 +30,20 @@ export default function Email(props: EmailProps) {
|
|
|
29
30
|
hideLabel,
|
|
30
31
|
placeholder
|
|
31
32
|
} = props;
|
|
33
|
+
|
|
34
|
+
const pConn = getPConnect();
|
|
35
|
+
const actions = pConn.getActionsApi();
|
|
36
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
37
|
+
|
|
32
38
|
const helperTextToDisplay = validatemessage || helperText;
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
const [inputValue, setInputValue] = useState('');
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setInputValue(value);
|
|
44
|
+
}, [value]);
|
|
45
|
+
|
|
46
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
35
47
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
36
48
|
}
|
|
37
49
|
|
|
@@ -49,6 +61,15 @@ export default function Email(props: EmailProps) {
|
|
|
49
61
|
'data-test-id': testId
|
|
50
62
|
};
|
|
51
63
|
|
|
64
|
+
function handleChange(event) {
|
|
65
|
+
// update internal value
|
|
66
|
+
setInputValue(event?.target?.value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleBlur() {
|
|
70
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
71
|
+
}
|
|
72
|
+
|
|
52
73
|
return (
|
|
53
74
|
<TextField
|
|
54
75
|
fullWidth
|
|
@@ -58,11 +79,11 @@ export default function Email(props: EmailProps) {
|
|
|
58
79
|
size='small'
|
|
59
80
|
required={required}
|
|
60
81
|
disabled={disabled}
|
|
61
|
-
onChange={
|
|
62
|
-
onBlur={!readOnly ?
|
|
82
|
+
onChange={handleChange}
|
|
83
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
63
84
|
error={status === 'error'}
|
|
64
85
|
label={label}
|
|
65
|
-
value={
|
|
86
|
+
value={inputValue}
|
|
66
87
|
type='email'
|
|
67
88
|
InputProps={{
|
|
68
89
|
startAdornment: (
|
|
@@ -15,7 +15,7 @@ interface GroupProps extends PConnFieldProps {
|
|
|
15
15
|
export default function Group(props: GroupProps) {
|
|
16
16
|
const { children, heading, showHeading, instructions, collapsible, displayMode, type } = props;
|
|
17
17
|
|
|
18
|
-
const isReadOnly = displayMode === '
|
|
18
|
+
const isReadOnly = displayMode === 'DISPLAY_ONLY';
|
|
19
19
|
|
|
20
20
|
const content = useMemo(() => {
|
|
21
21
|
return (
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import { TextField } from '@mui/material';
|
|
2
3
|
|
|
4
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
3
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
7
|
|
|
@@ -13,14 +15,13 @@ export default function Integer(props: IntegerProps) {
|
|
|
13
15
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
14
16
|
|
|
15
17
|
const {
|
|
18
|
+
getPConnect,
|
|
16
19
|
label,
|
|
17
20
|
required,
|
|
18
21
|
disabled,
|
|
19
22
|
value = '',
|
|
20
23
|
validatemessage,
|
|
21
24
|
status,
|
|
22
|
-
onChange,
|
|
23
|
-
onBlur,
|
|
24
25
|
readOnly,
|
|
25
26
|
testId,
|
|
26
27
|
helperText,
|
|
@@ -28,11 +29,20 @@ export default function Integer(props: IntegerProps) {
|
|
|
28
29
|
hideLabel,
|
|
29
30
|
placeholder
|
|
30
31
|
} = props;
|
|
32
|
+
|
|
33
|
+
const pConn = getPConnect();
|
|
34
|
+
const actions = pConn.getActionsApi();
|
|
35
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
36
|
+
|
|
31
37
|
const helperTextToDisplay = validatemessage || helperText;
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
const [inputValue, setInputValue] = useState('');
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setInputValue(value);
|
|
43
|
+
}, [value]);
|
|
34
44
|
|
|
35
|
-
if (displayMode === '
|
|
45
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
36
46
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
37
47
|
}
|
|
38
48
|
|
|
@@ -64,7 +74,11 @@ export default function Integer(props: IntegerProps) {
|
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
// Pass through to the Constellation change handler
|
|
67
|
-
|
|
77
|
+
setInputValue(event.target.value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function handleBlur() {
|
|
81
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
68
82
|
}
|
|
69
83
|
|
|
70
84
|
return (
|
|
@@ -77,10 +91,10 @@ export default function Integer(props: IntegerProps) {
|
|
|
77
91
|
required={required}
|
|
78
92
|
disabled={disabled}
|
|
79
93
|
onChange={intOnChange}
|
|
80
|
-
onBlur={!readOnly ?
|
|
94
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
81
95
|
error={status === 'error'}
|
|
82
96
|
label={label}
|
|
83
|
-
value={
|
|
97
|
+
value={inputValue}
|
|
84
98
|
type='text'
|
|
85
99
|
inputProps={{ inputMode: 'numeric', pattern: '[0-9]*', ...testProp }}
|
|
86
100
|
/>
|
|
@@ -58,7 +58,7 @@ export default function Percentage(props: PercentageProps) {
|
|
|
58
58
|
readOnlyProp = { readOnly: true };
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
if (displayMode === '
|
|
61
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
62
62
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -45,7 +45,7 @@ export default function Phone(props: PhoneProps) {
|
|
|
45
45
|
'data-test-id': testId
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
if (displayMode === '
|
|
48
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
49
49
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -62,6 +62,7 @@ export default function Phone(props: PhoneProps) {
|
|
|
62
62
|
helperText={helperTextToDisplay}
|
|
63
63
|
placeholder={placeholder ?? ''}
|
|
64
64
|
size='small'
|
|
65
|
+
defaultCountry='us'
|
|
65
66
|
required={required}
|
|
66
67
|
disabled={disabled}
|
|
67
68
|
onChange={onChange}
|
|
@@ -23,7 +23,7 @@ export default function RichText(props: RichTextProps) {
|
|
|
23
23
|
|
|
24
24
|
const helperTextToDisplay = validatemessage || helperText;
|
|
25
25
|
|
|
26
|
-
if (displayMode === '
|
|
26
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
27
27
|
return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml />;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@ export default function ScalarList(props: ScalarListProps) {
|
|
|
38
38
|
config: {
|
|
39
39
|
// @ts-ignore - Type '{ readOnly: true; displayInModal: boolean; value: any; displayMode: string; label: string; }' is not assignable to type 'ComponentMetadataConfig'.
|
|
40
40
|
value: scalarValue,
|
|
41
|
-
displayMode: '
|
|
41
|
+
displayMode: 'DISPLAY_ONLY',
|
|
42
42
|
label,
|
|
43
43
|
...restProps,
|
|
44
44
|
// @ts-ignore - Type 'string' is not assignable to type 'boolean | undefined'.
|
|
@@ -51,7 +51,7 @@ export default function ScalarList(props: ScalarListProps) {
|
|
|
51
51
|
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
if (['
|
|
54
|
+
if (['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
|
|
55
55
|
return (
|
|
56
56
|
<div>
|
|
57
57
|
<CommaSeparatedList items={items} />
|
|
@@ -52,7 +52,7 @@ export default function SemanticLink(props: SemanticLinkProps) {
|
|
|
52
52
|
const { text, displayMode, label, hideLabel } = props;
|
|
53
53
|
const classes = useStyles();
|
|
54
54
|
|
|
55
|
-
if (displayMode === '
|
|
55
|
+
if (displayMode === 'DISPLAY_ONLY' || (!displayMode && label !== undefined)) {
|
|
56
56
|
const value = text || '---';
|
|
57
57
|
return (
|
|
58
58
|
<Grid container spacing={1} style={{ padding: '4px 0px' }} id='semantic-link-grid'>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import { TextField } from '@mui/material';
|
|
2
3
|
|
|
4
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
3
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
7
|
|
|
@@ -13,14 +15,13 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
13
15
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
14
16
|
|
|
15
17
|
const {
|
|
18
|
+
getPConnect,
|
|
16
19
|
label,
|
|
17
20
|
required,
|
|
18
21
|
disabled,
|
|
19
22
|
value = '',
|
|
20
23
|
validatemessage,
|
|
21
24
|
status,
|
|
22
|
-
onChange,
|
|
23
|
-
onBlur,
|
|
24
25
|
readOnly,
|
|
25
26
|
testId,
|
|
26
27
|
fieldMetadata,
|
|
@@ -30,12 +31,20 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
30
31
|
placeholder
|
|
31
32
|
} = props;
|
|
32
33
|
const helperTextToDisplay = validatemessage || helperText;
|
|
33
|
-
|
|
34
|
+
const pConn = getPConnect();
|
|
35
|
+
const actions = pConn.getActionsApi();
|
|
36
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
34
37
|
const maxLength = fieldMetadata?.maxLength;
|
|
35
38
|
|
|
39
|
+
const [inputValue, setInputValue] = useState('');
|
|
40
|
+
|
|
36
41
|
let readOnlyProp = {};
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setInputValue(value);
|
|
45
|
+
}, [value]);
|
|
46
|
+
|
|
47
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
39
48
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
40
49
|
}
|
|
41
50
|
|
|
@@ -55,6 +64,15 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
55
64
|
'data-test-id': testId
|
|
56
65
|
};
|
|
57
66
|
|
|
67
|
+
function handleChange(event) {
|
|
68
|
+
// update internal value
|
|
69
|
+
setInputValue(event?.target?.value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function handleBlur() {
|
|
73
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
74
|
+
}
|
|
75
|
+
|
|
58
76
|
return (
|
|
59
77
|
<TextField
|
|
60
78
|
multiline
|
|
@@ -67,11 +85,11 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
67
85
|
size='small'
|
|
68
86
|
required={required}
|
|
69
87
|
disabled={disabled}
|
|
70
|
-
onChange={
|
|
71
|
-
onBlur={!readOnly ?
|
|
88
|
+
onChange={handleChange}
|
|
89
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
72
90
|
error={status === 'error'}
|
|
73
91
|
label={label}
|
|
74
|
-
value={
|
|
92
|
+
value={inputValue}
|
|
75
93
|
InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}
|
|
76
94
|
/>
|
|
77
95
|
);
|
|
@@ -47,7 +47,7 @@ export default function TextInput(props: TextInputProps) {
|
|
|
47
47
|
setInputValue(value);
|
|
48
48
|
}, [value]);
|
|
49
49
|
|
|
50
|
-
if (displayMode === '
|
|
50
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
51
51
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
52
52
|
}
|
|
53
53
|
|
package/lib/field/Time/Time.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
|
2
2
|
// import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
|
|
5
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
7
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
8
|
|
|
@@ -14,10 +15,12 @@ export default function Time(props: TimeProps) {
|
|
|
14
15
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
15
16
|
const TextInput = getComponentFromMap('TextInput');
|
|
16
17
|
|
|
17
|
-
const { label, required, disabled, value = '', validatemessage, status,
|
|
18
|
+
const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, helperText, displayMode, hideLabel, testId } = props;
|
|
18
19
|
const helperTextToDisplay = validatemessage || helperText;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const pConn = getPConnect();
|
|
21
|
+
const actions = pConn.getActionsApi();
|
|
22
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
23
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
21
24
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -37,11 +40,11 @@ export default function Time(props: TimeProps) {
|
|
|
37
40
|
|
|
38
41
|
const handleChange = date => {
|
|
39
42
|
const theValue = date && date.isValid() ? date.format('HH:mm') : null;
|
|
40
|
-
|
|
43
|
+
handleEvent(actions, 'changeNblur', propName, theValue);
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
let timeValue: any = null;
|
|
44
|
-
if (value) {
|
|
47
|
+
if (value && Object.keys(value).length) {
|
|
45
48
|
const timeArray = value.split(':').map(itm => Number(itm));
|
|
46
49
|
timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
|
|
47
50
|
}
|
|
@@ -72,7 +75,7 @@ export default function Time(props: TimeProps) {
|
|
|
72
75
|
error: status === 'error',
|
|
73
76
|
helperText: helperTextToDisplay,
|
|
74
77
|
size: 'small',
|
|
75
|
-
InputProps: {
|
|
78
|
+
InputProps: { ...testProp }
|
|
76
79
|
}
|
|
77
80
|
}}
|
|
78
81
|
/>
|
package/lib/field/URL/URL.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import { TextField } from '@mui/material';
|
|
2
3
|
|
|
4
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
3
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
7
|
|
|
@@ -16,14 +18,13 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
16
18
|
const TextInput = getComponentFromMap('TextInput');
|
|
17
19
|
|
|
18
20
|
const {
|
|
21
|
+
getPConnect,
|
|
19
22
|
label,
|
|
20
23
|
required,
|
|
21
24
|
disabled,
|
|
22
25
|
value = '',
|
|
23
26
|
validatemessage,
|
|
24
27
|
status,
|
|
25
|
-
onChange,
|
|
26
|
-
onBlur,
|
|
27
28
|
readOnly,
|
|
28
29
|
testId,
|
|
29
30
|
helperText,
|
|
@@ -33,7 +34,17 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
33
34
|
} = props;
|
|
34
35
|
const helperTextToDisplay = validatemessage || helperText;
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
const [inputValue, setInputValue] = useState('');
|
|
38
|
+
|
|
39
|
+
const pConn = getPConnect();
|
|
40
|
+
const actions = pConn.getActionsApi();
|
|
41
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setInputValue(value);
|
|
45
|
+
}, [value]);
|
|
46
|
+
|
|
47
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
37
48
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
38
49
|
}
|
|
39
50
|
|
|
@@ -51,6 +62,14 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
51
62
|
'data-test-id': testId
|
|
52
63
|
};
|
|
53
64
|
|
|
65
|
+
const handleChange = event => {
|
|
66
|
+
setInputValue(event?.target?.value);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
function handleBlur() {
|
|
70
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
71
|
+
}
|
|
72
|
+
|
|
54
73
|
return (
|
|
55
74
|
<TextField
|
|
56
75
|
type='url'
|
|
@@ -61,11 +80,11 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
61
80
|
size='small'
|
|
62
81
|
required={required}
|
|
63
82
|
disabled={disabled}
|
|
64
|
-
onChange={
|
|
65
|
-
onBlur={!readOnly ?
|
|
83
|
+
onChange={handleChange}
|
|
84
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
66
85
|
error={status === 'error'}
|
|
67
86
|
label={label}
|
|
68
|
-
value={
|
|
87
|
+
value={inputValue}
|
|
69
88
|
InputProps={{ inputProps: { ...testProp } }}
|
|
70
89
|
/>
|
|
71
90
|
);
|
|
@@ -99,7 +99,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
99
99
|
|
|
100
100
|
let userReferenceComponent: any = null;
|
|
101
101
|
|
|
102
|
-
if (displayMode === '
|
|
102
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
103
103
|
return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -49,8 +49,8 @@ export function buildView(pConn, index, viewConfigPath): ReactElement {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const view = PCore.createPConnect(config);
|
|
52
|
-
if (pConn.getConfigProps()?.displayMode === '
|
|
53
|
-
view.getPConnect()?.setInheritedProp('displayMode', '
|
|
52
|
+
if (pConn.getConfigProps()?.displayMode === 'DISPLAY_ONLY') {
|
|
53
|
+
view.getPConnect()?.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
54
54
|
}
|
|
55
55
|
return createElement(createPConnectComponent(), view);
|
|
56
56
|
}
|
|
@@ -99,7 +99,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
99
99
|
const oData: any = thePConn.getDataObject(''); // 1st arg empty string until typedefs allow it to be optional
|
|
100
100
|
|
|
101
101
|
if (oWorkData?.caseInfo && oWorkData.caseInfo.assignments !== null) {
|
|
102
|
-
const oCaseInfo = oData
|
|
102
|
+
const oCaseInfo = oData?.caseInfo;
|
|
103
103
|
|
|
104
104
|
if (oCaseInfo && oCaseInfo.actionButtons) {
|
|
105
105
|
setActionButtons(oCaseInfo.actionButtons);
|
|
@@ -95,7 +95,7 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
const configObject = PCore.createPConnect(config);
|
|
98
|
-
configObject.getPConnect().setInheritedProp('displayMode', '
|
|
98
|
+
configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
99
99
|
setContent(createElement(createPConnectComponent(), configObject));
|
|
100
100
|
if (deferLoadId) {
|
|
101
101
|
PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
|
|
@@ -11,7 +11,7 @@ interface MultiStepProps extends PConnProps {
|
|
|
11
11
|
actionButtons: any[];
|
|
12
12
|
onButtonPress: any;
|
|
13
13
|
bIsVertical: boolean;
|
|
14
|
-
arNavigationSteps: any
|
|
14
|
+
arNavigationSteps: any;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
@@ -21,6 +21,12 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
21
21
|
const { getPConnect, children, itemKey = '', actionButtons, onButtonPress } = props;
|
|
22
22
|
const { bIsVertical, arNavigationSteps } = props;
|
|
23
23
|
|
|
24
|
+
let currentStep = arNavigationSteps.find(({ visited_status: vs }) => vs === 'current');
|
|
25
|
+
if (!currentStep) {
|
|
26
|
+
const lastActiveStepIndex = arNavigationSteps.findLastIndex(({ visited_status: vs }) => vs === 'success');
|
|
27
|
+
currentStep = arNavigationSteps[lastActiveStepIndex >= 0 ? lastActiveStepIndex : 0];
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
// const svgCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
|
|
25
31
|
// const svgNotCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
|
|
26
32
|
|
|
@@ -48,16 +54,16 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
48
54
|
return 'psdk-vertical-step-body';
|
|
49
55
|
}
|
|
50
56
|
|
|
51
|
-
function _getHIconClass(
|
|
52
|
-
if (
|
|
57
|
+
function _getHIconClass(step): string {
|
|
58
|
+
if (step.ID === currentStep?.ID) {
|
|
53
59
|
return 'psdk-horizontal-step-icon-selected';
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
return 'psdk-horizontal-step-icon';
|
|
57
63
|
}
|
|
58
64
|
|
|
59
|
-
function _getHLabelClass(
|
|
60
|
-
if (
|
|
65
|
+
function _getHLabelClass(step): string {
|
|
66
|
+
if (step.ID === currentStep?.ID) {
|
|
61
67
|
return 'psdk-horizontal-step-label-selected';
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -138,12 +144,12 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
138
144
|
return (
|
|
139
145
|
<React.Fragment key={mainStep.actionID}>
|
|
140
146
|
<div className='psdk-horizontal-step-header'>
|
|
141
|
-
<div className={_getHIconClass(mainStep
|
|
147
|
+
<div className={_getHIconClass(mainStep)}>
|
|
142
148
|
<div className='psdk-horizontal-step-icon-content'>
|
|
143
149
|
<span>{index + 1}</span>
|
|
144
150
|
</div>
|
|
145
151
|
</div>
|
|
146
|
-
<div className={_getHLabelClass(mainStep
|
|
152
|
+
<div className={_getHLabelClass(mainStep)}>
|
|
147
153
|
<div className='psdk-horizontal-step-text-label' id='selected-label'>
|
|
148
154
|
{mainStep.name}
|
|
149
155
|
</div>
|
|
@@ -176,7 +182,7 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
176
182
|
))}
|
|
177
183
|
</ul>
|
|
178
184
|
)}
|
|
179
|
-
{!mainStep?.steps && mainStep.
|
|
185
|
+
{!mainStep?.steps && mainStep.ID === currentStep?.ID && (
|
|
180
186
|
<AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
|
|
181
187
|
{children}
|
|
182
188
|
</AssignmentCard>
|
|
@@ -22,6 +22,9 @@ import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
|
|
|
22
22
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
23
23
|
import FlagOutlinedIcon from '@mui/icons-material/FlagOutlined';
|
|
24
24
|
import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined';
|
|
25
|
+
import TabletAndroidOutlineIcon from '@mui/icons-material/TabletAndroidOutlined';
|
|
26
|
+
import AirportShuttleOutlinedIcon from '@mui/icons-material/AirportShuttleOutlined';
|
|
27
|
+
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
|
25
28
|
import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
26
29
|
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
27
30
|
import AddIcon from '@mui/icons-material/Add';
|
|
@@ -49,7 +52,11 @@ interface NavBarProps extends PConnProps {
|
|
|
49
52
|
const iconMap = {
|
|
50
53
|
'pi pi-headline': <HomeOutlinedIcon fontSize='large' />,
|
|
51
54
|
'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />,
|
|
52
|
-
'pi pi-home-solid': <HomeOutlinedIcon fontSize='large'
|
|
55
|
+
'pi pi-home-solid': <HomeOutlinedIcon fontSize='large' />,
|
|
56
|
+
'pi pi-tablet': <TabletAndroidOutlineIcon fontSize='large' />,
|
|
57
|
+
'pi pi-ambulance': <AirportShuttleOutlinedIcon fontSize='large' />,
|
|
58
|
+
'pi pi-ink-solid': <EditOutlinedIcon fontSize='large' />,
|
|
59
|
+
'pi pi-columns': <HomeOutlinedIcon fontSize='large' />
|
|
53
60
|
};
|
|
54
61
|
|
|
55
62
|
const drawerWidth = 300;
|
package/lib/infra/View/View.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
4
|
import { getAllFields } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
|
|
@@ -18,6 +18,7 @@ interface ViewProps extends PConnProps {
|
|
|
18
18
|
visibility?: boolean;
|
|
19
19
|
name?: string;
|
|
20
20
|
bInForm?: boolean;
|
|
21
|
+
type?: any;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
//
|
|
@@ -36,12 +37,14 @@ const NO_HEADER_TEMPLATES = [
|
|
|
36
37
|
'NarrowWideDetails',
|
|
37
38
|
'WideNarrowDetails',
|
|
38
39
|
'Confirmation',
|
|
39
|
-
'DynamicTabs'
|
|
40
|
+
'DynamicTabs',
|
|
41
|
+
'DetailsSubTabs'
|
|
40
42
|
];
|
|
41
43
|
|
|
42
44
|
export default function View(props: PropsWithChildren<ViewProps>) {
|
|
43
|
-
const { children, template, getPConnect, mode, visibility, name: pageName } = props;
|
|
45
|
+
const { children, template, getPConnect, mode, visibility, name: pageName, type, title } = props;
|
|
44
46
|
let { label = '', showLabel = false } = props;
|
|
47
|
+
const { PAGE_TYPES: { PAGE, LANDINGPAGE, LISTPAGE } = {}, MODAL } = PCore.getConstants();
|
|
45
48
|
|
|
46
49
|
// Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
|
|
47
50
|
// Putting this logic here instead of copy/paste in every Form template index.js
|
|
@@ -49,12 +52,43 @@ export default function View(props: PropsWithChildren<ViewProps>) {
|
|
|
49
52
|
const inheritedProps: any = getPConnect().getInheritedProps(); // try to remove any when getInheritedProps typedefs are fixed
|
|
50
53
|
label = inheritedProps.label || label;
|
|
51
54
|
showLabel = inheritedProps.showLabel || showLabel;
|
|
55
|
+
const localeUtils = PCore.getLocaleUtils();
|
|
52
56
|
|
|
53
57
|
const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible
|
|
54
58
|
if (isEmbeddedDataView && showLabel === undefined) {
|
|
55
59
|
showLabel = true;
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
// Get the localized application label
|
|
64
|
+
let applicationLabel = PCore.getEnvironmentInfo().getApplicationLabel();
|
|
65
|
+
applicationLabel = localeUtils.getLocaleValue(`${applicationLabel}`, '', '');
|
|
66
|
+
const caseInfo = getPConnect().getCaseInfo();
|
|
67
|
+
const isAssignmentInCreateStage = caseInfo && caseInfo.isAssignmentInCreateStage();
|
|
68
|
+
const isRenderingInModal = getPConnect().getContainerName().includes(MODAL);
|
|
69
|
+
const isRenderingInPreviewPanel = getPConnect().getContainerName().includes('preview');
|
|
70
|
+
|
|
71
|
+
/* If assignment is in create stage and rendering in modal don't update the title.
|
|
72
|
+
Title will be updated on completion of create stage and when the assignment is rendered inline to the page.
|
|
73
|
+
*/
|
|
74
|
+
const canUpdateTitle =
|
|
75
|
+
!isRenderingInPreviewPanel &&
|
|
76
|
+
(type === PAGE || type === LANDINGPAGE || type === LISTPAGE) &&
|
|
77
|
+
!(isRenderingInModal && isAssignmentInCreateStage) &&
|
|
78
|
+
PCore.getEnvironmentInfo().getRenderingMode() === 'FULL_PORTAL';
|
|
79
|
+
// Incase of home route title is same as applicationLabel so setting to empty to just show applicationLabel
|
|
80
|
+
let titleVar = title === applicationLabel ? '' : title;
|
|
81
|
+
|
|
82
|
+
if (canUpdateTitle) {
|
|
83
|
+
if (caseInfo) {
|
|
84
|
+
const name = caseInfo.getName();
|
|
85
|
+
const id = caseInfo.getBusinessID();
|
|
86
|
+
titleVar = name && id ? `${name} (${id})` : titleVar;
|
|
87
|
+
}
|
|
88
|
+
document.title = titleVar ? `${titleVar} - ${applicationLabel}` : applicationLabel;
|
|
89
|
+
}
|
|
90
|
+
}, [type, title, getPConnect, PAGE, LANDINGPAGE, LISTPAGE]);
|
|
91
|
+
|
|
58
92
|
const key = `${getPConnect().getContextName()}_${getPConnect().getPageReference()}_${pageName}`;
|
|
59
93
|
// As long as the template is defined in the dependencies of the view
|
|
60
94
|
// it will be loaded, otherwise fall back to single column
|
|
@@ -24,6 +24,8 @@ interface AppShellProps extends PConnProps {
|
|
|
24
24
|
portalName: string;
|
|
25
25
|
portalLogo: string;
|
|
26
26
|
navDisplayOptions: { alignment: string; position: string };
|
|
27
|
+
httpMessages: string[];
|
|
28
|
+
pageMessages: string[];
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
const useStyles = makeStyles(theme => ({
|
|
@@ -49,8 +51,21 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
|
49
51
|
// Get emitted components from map (so we can get any override that may exist)
|
|
50
52
|
const NavBar = getComponentFromMap('NavBar');
|
|
51
53
|
const WssNavBar = getComponentFromMap('WssNavBar');
|
|
54
|
+
const AlertBanner = getComponentFromMap('AlertBanner');
|
|
52
55
|
|
|
53
|
-
const {
|
|
56
|
+
const {
|
|
57
|
+
pages = [],
|
|
58
|
+
caseTypes = [],
|
|
59
|
+
showAppName,
|
|
60
|
+
children = [],
|
|
61
|
+
getPConnect,
|
|
62
|
+
httpMessages = [],
|
|
63
|
+
pageMessages = [],
|
|
64
|
+
portalTemplate,
|
|
65
|
+
portalName,
|
|
66
|
+
portalLogo,
|
|
67
|
+
navDisplayOptions
|
|
68
|
+
} = props;
|
|
54
69
|
|
|
55
70
|
const [open, setOpen] = useState(true);
|
|
56
71
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -75,6 +90,15 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
|
75
90
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
76
91
|
const [mapChildren, setMapChildren] = useState([]);
|
|
77
92
|
|
|
93
|
+
const messages = [...httpMessages, ...pageMessages];
|
|
94
|
+
|
|
95
|
+
const hasBanner = messages && messages.length ? messages.length > 0 : false;
|
|
96
|
+
let banners: any = null;
|
|
97
|
+
banners = hasBanner && (
|
|
98
|
+
<div style={{ display: 'flex', flexDirection: 'column', padding: '1em 0' }}>
|
|
99
|
+
<AlertBanner id='AppShell' variant='urgent' messages={messages} />
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
78
102
|
// Initial setting of appName and mapChildren
|
|
79
103
|
useEffect(() => {
|
|
80
104
|
setAppName(PCore.getEnvironmentInfo().getApplicationName());
|
|
@@ -206,7 +230,10 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
|
206
230
|
operator={getOperator()}
|
|
207
231
|
navDisplayOptions={navDisplayOptions}
|
|
208
232
|
/>
|
|
209
|
-
<div className={classes.wsscontent}>
|
|
233
|
+
<div className={classes.wsscontent}>
|
|
234
|
+
{banners}
|
|
235
|
+
{children}
|
|
236
|
+
</div>
|
|
210
237
|
</div>
|
|
211
238
|
);
|
|
212
239
|
}
|
|
@@ -222,7 +249,11 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
|
222
249
|
pages={pages}
|
|
223
250
|
caseTypes={caseTypes}
|
|
224
251
|
/>
|
|
225
|
-
|
|
252
|
+
|
|
253
|
+
<div className={classes.content}>
|
|
254
|
+
{banners}
|
|
255
|
+
{children}
|
|
256
|
+
</div>
|
|
226
257
|
</div>
|
|
227
258
|
</NavContext.Provider>
|
|
228
259
|
);
|
|
@@ -52,7 +52,7 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
|
|
|
52
52
|
const refList = rawViewMetadata.config.referenceList;
|
|
53
53
|
const canBeChangedInReviewMode = allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');
|
|
54
54
|
let propName;
|
|
55
|
-
const isDisplayModeEnabled = ['
|
|
55
|
+
const isDisplayModeEnabled = ['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode);
|
|
56
56
|
let firstChildPConnect;
|
|
57
57
|
|
|
58
58
|
/* Only for dropdown when it has param use data api to get the data back and add it to datasource */
|
|
@@ -23,7 +23,7 @@ export default function Details(props: DetailsProps) {
|
|
|
23
23
|
|
|
24
24
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
25
25
|
// in a readonly (display) mode instead of a editable
|
|
26
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
26
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
27
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
28
28
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
29
|
createElement(createPConnectComponent(), {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
-
import { Tab, Tabs
|
|
2
|
+
import { Tab, Tabs } from '@mui/material';
|
|
3
3
|
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
4
|
|
|
5
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/react-sdk-components/lib/components/template/SubTabs/tabUtils';
|
|
@@ -39,7 +39,7 @@ export default function DetailsSubTabs(props: PropsWithChildren<DetailsSubTabsPr
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<>
|
|
42
|
-
{propsToUse.showLabel && <
|
|
42
|
+
{propsToUse.showLabel && <h3>{propsToUse.label}</h3>}
|
|
43
43
|
<TabContext value={currentTabId.toString()}>
|
|
44
44
|
<Tabs onChange={handleTabClick} value={currentTabId}>
|
|
45
45
|
{tabItems.map((tab: any) => (
|
|
@@ -23,7 +23,7 @@ export default function DetailsThreeColumn(props: DetailsThreeColumnProps) {
|
|
|
23
23
|
|
|
24
24
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
25
25
|
// in a readonly (display) mode instead of a editable
|
|
26
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
26
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
27
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
28
28
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
29
|
createElement(createPConnectComponent(), {
|
|
@@ -23,7 +23,7 @@ export default function DetailsTwoColumn(props: DetailsTwoColumnProps) {
|
|
|
23
23
|
|
|
24
24
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
25
25
|
// in a readonly (display) mode instead of a editable
|
|
26
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
26
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
27
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
28
28
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
29
|
createElement(createPConnectComponent(), {
|
|
@@ -31,7 +31,7 @@ function DynamicTabs(props: DynamicTabsProps) {
|
|
|
31
31
|
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
32
32
|
const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
33
33
|
const memoisedTabViews = useMemo(() => {
|
|
34
|
-
pConnect.setInheritedProp('displayMode', '
|
|
34
|
+
pConnect.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
35
35
|
pConnect.setInheritedProp('readOnly', true);
|
|
36
36
|
|
|
37
37
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { useLayoutEffect, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -37,9 +37,16 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
37
37
|
const resolvedList = getReferenceList(pConn);
|
|
38
38
|
pConn.setReferenceList(resolvedList);
|
|
39
39
|
const pageReference = `${pConn.getPageReference()}${resolvedList}`;
|
|
40
|
-
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === '
|
|
40
|
+
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
|
|
41
41
|
const HEADING = heading ?? 'Row';
|
|
42
42
|
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
if (!isReadonlyMode) {
|
|
45
|
+
// @ts-ignore - Expected 3 arguments, but got 1
|
|
46
|
+
pConn.getListActions().initDefaultPageInstructions(resolvedList);
|
|
47
|
+
}
|
|
48
|
+
}, [referenceList?.length]);
|
|
49
|
+
|
|
43
50
|
const getDynamicHeaderProp = (item, index) => {
|
|
44
51
|
if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)]) {
|
|
45
52
|
return item[heading.substring(1)];
|
|
@@ -89,7 +96,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
89
96
|
);
|
|
90
97
|
}
|
|
91
98
|
|
|
92
|
-
pConn.setInheritedProp('displayMode', '
|
|
99
|
+
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
93
100
|
const memoisedReadOnlyList = useMemo(() => {
|
|
94
101
|
return referenceList.map((item, index) => {
|
|
95
102
|
const key = item[heading] || `field-group-row-${index}`;
|
|
@@ -678,7 +678,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
678
678
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
679
679
|
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
|
|
680
680
|
if (compositeKeys.length) {
|
|
681
|
-
otherContext
|
|
681
|
+
otherContext?.setCompositeKeys(compositeKeys);
|
|
682
682
|
}
|
|
683
683
|
if (otherContext) {
|
|
684
684
|
otherContext.fetchRowActionDetails = null;
|
|
@@ -26,7 +26,7 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
|
|
|
26
26
|
|
|
27
27
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
28
28
|
// in a readonly (display) mode instead of a editable
|
|
29
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
29
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
30
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
31
31
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
32
32
|
createElement(createPConnectComponent(), {
|
|
@@ -26,7 +26,7 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
|
26
26
|
|
|
27
27
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
28
28
|
// in a readonly (display) mode instead of a editable
|
|
29
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
29
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
30
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
31
31
|
const children = (getPConnect().getChildren() as any[])?.map((configObject, index) => {
|
|
32
32
|
let theConfigObject: object = configObject;
|
|
@@ -217,9 +217,11 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
217
217
|
};
|
|
218
218
|
if (!validateMaxSize(f, maxAttachmentSize)) {
|
|
219
219
|
f.props.error = true;
|
|
220
|
+
f.inProgress = false;
|
|
220
221
|
f.props.meta = pConn.getLocalizedValue(`File is too big. Max allowed size is ${maxAttachmentSize}MB.`, '', '');
|
|
221
222
|
} else if (!validateFileExtension(f, extensions)) {
|
|
222
223
|
f.props.error = true;
|
|
224
|
+
f.inProgress = false;
|
|
223
225
|
f.props.meta = `${pConn.getLocalizedValue('File has invalid extension. Allowed extensions are:', '', '')} ${extensions.replaceAll(
|
|
224
226
|
'.',
|
|
225
227
|
''
|
package/package.json
CHANGED