@pega/react-sdk-overrides 0.242.2 → 0.242.4
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/field/DateTime/DateTime.tsx +8 -1
- package/lib/field/Email/Email.tsx +26 -5
- package/lib/field/Integer/Integer.tsx +20 -6
- package/lib/field/Phone/Phone.tsx +1 -0
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/TextArea/TextArea.tsx +24 -6
- package/lib/field/Time/Time.tsx +8 -5
- package/lib/field/URL/URL.tsx +24 -5
- package/lib/infra/Assignment/Assignment.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 +2 -1
- package/lib/template/AppShell/AppShell.tsx +34 -3
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +8 -1
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/widget/Attachment/Attachment.tsx +2 -0
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/package.json +1 -1
|
@@ -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
|
/>
|
|
@@ -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,8 +30,19 @@ 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
|
|
|
40
|
+
const [inputValue, setInputValue] = useState('');
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setInputValue(value);
|
|
44
|
+
}, [value]);
|
|
45
|
+
|
|
34
46
|
if (displayMode === 'LABELS_LEFT') {
|
|
35
47
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
36
48
|
}
|
|
@@ -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: (
|
|
@@ -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,9 +29,18 @@ 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
45
|
if (displayMode === 'LABELS_LEFT') {
|
|
36
46
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
@@ -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
|
/>
|
|
@@ -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,11 +31,19 @@ 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
|
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setInputValue(value);
|
|
45
|
+
}, [value]);
|
|
46
|
+
|
|
38
47
|
if (displayMode === 'LABELS_LEFT') {
|
|
39
48
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
40
49
|
}
|
|
@@ -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
|
);
|
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,9 +15,11 @@ 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
|
+
const pConn = getPConnect();
|
|
21
|
+
const actions = pConn.getActionsApi();
|
|
22
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
20
23
|
if (displayMode === 'LABELS_LEFT') {
|
|
21
24
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
22
25
|
}
|
|
@@ -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,6 +34,16 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
33
34
|
} = props;
|
|
34
35
|
const helperTextToDisplay = validatemessage || helperText;
|
|
35
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
|
+
|
|
36
47
|
if (displayMode === 'LABELS_LEFT') {
|
|
37
48
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
38
49
|
}
|
|
@@ -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 @@ 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);
|
|
@@ -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
|
@@ -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
|
);
|
|
@@ -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) => (
|
|
@@ -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';
|
|
@@ -40,6 +40,13 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
40
40
|
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';
|
|
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)];
|
|
@@ -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