@pega/react-sdk-overrides 23.1.12 → 24.2.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.
Files changed (99) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +1 -1
  2. package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +13 -4
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +4 -4
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +5 -5
  9. package/lib/designSystemExtension/Operator/Operator.tsx +6 -5
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +2 -2
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
  13. package/lib/field/AutoComplete/AutoComplete.tsx +4 -4
  14. package/lib/field/CancelAlert/CancelAlert.tsx +5 -3
  15. package/lib/field/Checkbox/Checkbox.tsx +4 -4
  16. package/lib/field/Currency/Currency.tsx +37 -27
  17. package/lib/field/Date/Date.tsx +23 -42
  18. package/lib/field/DateTime/DateTime.tsx +29 -34
  19. package/lib/field/Decimal/Decimal.tsx +34 -20
  20. package/lib/field/Dropdown/Dropdown.tsx +3 -3
  21. package/lib/field/Email/Email.tsx +29 -8
  22. package/lib/field/Group/Group.tsx +2 -2
  23. package/lib/field/Integer/Integer.tsx +22 -8
  24. package/lib/field/{MultiSelect → Multiselect}/Multiselect.tsx +9 -15
  25. package/lib/field/Percentage/Percentage.tsx +34 -19
  26. package/lib/field/Phone/Phone.tsx +22 -12
  27. package/lib/field/Phone/config-ext.json +8 -0
  28. package/lib/field/RadioButtons/RadioButtons.tsx +3 -3
  29. package/lib/field/RichText/RichText.tsx +1 -1
  30. package/lib/field/RichText/config-ext.json +10 -0
  31. package/lib/field/ScalarList/ScalarList.tsx +4 -2
  32. package/lib/field/SemanticLink/SemanticLink.tsx +4 -4
  33. package/lib/field/TextArea/TextArea.tsx +26 -8
  34. package/lib/field/TextContent/TextContent.tsx +1 -1
  35. package/lib/field/TextInput/TextInput.tsx +2 -2
  36. package/lib/field/Time/Time.tsx +27 -20
  37. package/lib/field/URL/URL.tsx +26 -7
  38. package/lib/field/UserReference/UserReference.tsx +12 -2
  39. package/lib/helpers/common-utils.ts +1 -5
  40. package/lib/helpers/field-group-utils.ts +2 -2
  41. package/lib/helpers/simpleTableHelpers.ts +1 -1
  42. package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
  43. package/lib/infra/Assignment/Assignment.tsx +38 -7
  44. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +16 -13
  45. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +7 -4
  46. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
  47. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
  48. package/lib/infra/DashboardFilter/DashboardFilter.tsx +2 -2
  49. package/lib/infra/DashboardFilter/filterUtils.tsx +2 -1
  50. package/lib/infra/DeferLoad/DeferLoad.tsx +8 -4
  51. package/lib/infra/MultiStep/MultiStep.tsx +17 -9
  52. package/lib/infra/NavBar/NavBar.css +1 -0
  53. package/lib/infra/NavBar/NavBar.tsx +27 -19
  54. package/lib/infra/RootContainer/RootContainer.tsx +5 -6
  55. package/lib/infra/Stages/Stages.tsx +4 -4
  56. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
  57. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
  58. package/lib/infra/View/View.tsx +37 -3
  59. package/lib/template/AppShell/AppShell.tsx +55 -5
  60. package/lib/template/BannerPage/config-ext.json +9 -0
  61. package/lib/template/CaseView/CaseView.tsx +7 -6
  62. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +8 -8
  63. package/lib/template/Confirmation/Confirmation.tsx +2 -1
  64. package/lib/template/DataReference/DataReference.tsx +3 -3
  65. package/lib/template/DefaultForm/utils/index.ts +2 -7
  66. package/lib/template/Details/Details/Details.tsx +3 -3
  67. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +3 -3
  68. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +3 -3
  69. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +3 -3
  70. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +4 -3
  71. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -3
  72. package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
  73. package/lib/template/InlineDashboardPage/config-ext.json +9 -0
  74. package/lib/template/ListView/ListView.tsx +88 -91
  75. package/lib/template/ListView/utils.ts +1 -1
  76. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  77. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +3 -3
  78. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +2 -2
  79. package/lib/template/PromotedFilters/PromotedFilters.tsx +2 -1
  80. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +46 -30
  81. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  82. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  83. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +2 -2
  84. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +2 -2
  85. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +3 -3
  86. package/lib/template/WssNavBar/WssNavBar.tsx +9 -9
  87. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +2 -2
  88. package/lib/widget/Attachment/Attachment.tsx +8 -4
  89. package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
  90. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
  91. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +5 -4
  92. package/lib/widget/Followers/Followers.tsx +2 -2
  93. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -0
  94. package/lib/widget/QuickCreate/config-ext.json +9 -0
  95. package/lib/widget/SummaryItem/SummaryItem.tsx +3 -2
  96. package/lib/widget/ToDo/ToDo.tsx +91 -21
  97. package/package.json +1 -1
  98. /package/lib/field/{MultiSelect → Multiselect}/index.tsx +0 -0
  99. /package/lib/field/{MultiSelect → Multiselect}/utils.ts +0 -0
@@ -1,5 +1,7 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { useEffect, useState } from 'react';
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
- if (displayMode === 'LABELS_LEFT') {
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={onChange}
71
- onBlur={!readOnly ? onBlur : undefined}
88
+ onChange={handleChange}
89
+ onBlur={!readOnly ? handleBlur : undefined}
72
90
  error={status === 'error'}
73
91
  label={label}
74
- value={value}
92
+ value={inputValue}
75
93
  InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}
76
94
  />
77
95
  );
@@ -1,4 +1,4 @@
1
- import { Typography } from '@material-ui/core';
1
+ import { Typography } from '@mui/material';
2
2
 
3
3
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { TextField } from '@material-ui/core';
2
+ import { TextField } from '@mui/material';
3
3
 
4
4
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
@@ -47,7 +47,7 @@ export default function TextInput(props: TextInputProps) {
47
47
  setInputValue(value);
48
48
  }, [value]);
49
49
 
50
- if (displayMode === 'LABELS_LEFT') {
50
+ if (displayMode === 'DISPLAY_ONLY') {
51
51
  return <FieldValueList name={hideLabel ? '' : label} value={value} />;
52
52
  }
53
53
 
@@ -1,7 +1,8 @@
1
- import { KeyboardTimePicker } from '@material-ui/pickers';
2
- import AccessTimeIcon from '@material-ui/icons/AccessTime';
1
+ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
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, onChange, readOnly, helperText, displayMode, hideLabel, testId } = props;
18
+ const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, helperText, displayMode, hideLabel, testId } = props;
18
19
  const helperTextToDisplay = validatemessage || helperText;
19
-
20
- if (displayMode === 'LABELS_LEFT') {
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
- onChange({ value: theValue });
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
  }
@@ -52,25 +55,29 @@ export default function Time(props: TimeProps) {
52
55
  //
53
56
 
54
57
  return (
55
- <KeyboardTimePicker
56
- variant='inline'
57
- inputVariant='outlined'
58
- placeholder='hh:mm am'
59
- keyboardIcon={<AccessTimeIcon />}
60
- fullWidth
61
- required={required}
58
+ <TimePicker
59
+ // keyboardIcon={<AccessTimeIcon />}
60
+ // fullWidth
61
+
62
62
  disabled={disabled}
63
- error={status === 'error'}
64
- helperText={helperTextToDisplay}
65
63
  minutesStep={5}
66
- size='small'
67
64
  label={label}
68
- autoOk
69
- mask='__:__ _m'
65
+ // autoOk
66
+ // mask='__:__ _m'
70
67
  format='hh:mm a'
71
68
  value={timeValue}
72
69
  onChange={handleChange}
73
- InputProps={{ inputProps: { ...testProp } }}
70
+ slotProps={{
71
+ textField: {
72
+ variant: 'outlined',
73
+ placeholder: 'hh:mm am',
74
+ required,
75
+ error: status === 'error',
76
+ helperText: helperTextToDisplay,
77
+ size: 'small',
78
+ InputProps: { ...testProp }
79
+ }
80
+ }}
74
81
  />
75
82
  );
76
83
  }
@@ -1,5 +1,7 @@
1
- import { TextField } from '@material-ui/core';
1
+ import { useEffect, useState } from 'react';
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
- if (displayMode === 'LABELS_LEFT') {
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={onChange}
65
- onBlur={!readOnly ? onBlur : undefined}
83
+ onChange={handleChange}
84
+ onBlur={!readOnly ? handleBlur : undefined}
66
85
  error={status === 'error'}
67
86
  label={label}
68
- value={value}
87
+ value={inputValue}
69
88
  InputProps={{ inputProps: { ...testProp } }}
70
89
  />
71
90
  );
@@ -1,9 +1,10 @@
1
1
  import { memo, useEffect, useState } from 'react';
2
- import { Typography } from '@material-ui/core';
2
+ import { Typography } from '@mui/material';
3
3
 
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 === 'DISPLAY_ONLY') {
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
 
@@ -1,8 +1,4 @@
1
+ /* eslint-disable import/prefer-default-export */
1
2
  export function isEmptyObject(obj: Object): boolean {
2
3
  return Object.keys(obj).length === 0;
3
4
  }
4
-
5
- export function isInfinity23OrHigher() {
6
- const pCoreVersion = PCore.getPCoreVersion();
7
- return ['8.23.0', '23.1.1', '23.1.2'].includes(pCoreVersion);
8
- }
@@ -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 === 'LABELS_LEFT') {
53
- view.getPConnect()?.setInheritedProp('displayMode', 'LABELS_LEFT');
52
+ if (pConn.getConfigProps()?.displayMode === 'DISPLAY_ONLY') {
53
+ view.getPConnect()?.setInheritedProp('displayMode', 'DISPLAY_ONLY');
54
54
  }
55
55
  return createElement(createPConnectComponent(), view);
56
56
  }
@@ -231,7 +231,7 @@ export const filterData = filterByColumns => {
231
231
  case 'Date':
232
232
  case 'DateTime':
233
233
  case 'Time':
234
- value = item[filterObj.ref] !== null ?? item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;
234
+ value = (item[filterObj.ref] !== null ?? item[filterObj.ref] !== '') ? Utils.getSeconds(item[filterObj.ref]) : null;
235
235
  filterValue =
236
236
  filterObj.containsFilterValue !== null && filterObj.containsFilterValue !== '' ? Utils.getSeconds(filterObj.containsFilterValue) : null;
237
237
 
@@ -1,6 +1,6 @@
1
- import { makeStyles } from '@material-ui/core/styles';
2
- import Button from '@material-ui/core/Button';
3
- import { Grid, Divider } from '@material-ui/core';
1
+ import makeStyles from '@mui/styles/makeStyles';
2
+ import Button from '@mui/material/Button';
3
+ import { Grid, Divider } from '@mui/material';
4
4
 
5
5
  // ActionButtons does NOT have getPConnect. So, no need to extend from PConnProps
6
6
  interface ActionButtonsProps {
@@ -1,9 +1,10 @@
1
1
  import React, { PropsWithChildren, useEffect, useState } from 'react';
2
- import Snackbar from '@material-ui/core/Snackbar';
3
- import IconButton from '@material-ui/core/IconButton';
4
- import CloseIcon from '@material-ui/icons/Close';
2
+ import Snackbar from '@mui/material/Snackbar';
3
+ import IconButton from '@mui/material/IconButton';
4
+ import CloseIcon from '@mui/icons-material/Close';
5
5
 
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
+ import { useFocusFirstField, useScrolltoTop } from '@pega/react-sdk-components/lib/hooks';
7
8
 
8
9
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
10
 
@@ -41,6 +42,8 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
41
42
  const cancelAssignment = actionsAPI.cancelAssignment.bind(actionsAPI);
42
43
  const saveAssignment = actionsAPI.saveAssignment?.bind(actionsAPI);
43
44
  const cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);
45
+ const approveCase = actionsAPI.approveCase?.bind(actionsAPI);
46
+ const rejectCase = actionsAPI.rejectCase?.bind(actionsAPI);
44
47
  // const showPage = actionsAPI.showPage.bind(actionsAPI);
45
48
 
46
49
  const [showSnackbar, setShowSnackbar] = useState(false);
@@ -84,6 +87,10 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
84
87
  return formedSteps;
85
88
  }
86
89
 
90
+ const scrollId = window.location.href.includes('embedded') ? '#pega-part-of-page' : '#portal';
91
+ useScrolltoTop(scrollId, children);
92
+ useFocusFirstField('Assignment', children);
93
+
87
94
  useEffect(() => {
88
95
  if (children) {
89
96
  const firstChild = Array.isArray(children) ? children[0] : children;
@@ -92,7 +99,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
92
99
  const oData: any = thePConn.getDataObject(''); // 1st arg empty string until typedefs allow it to be optional
93
100
 
94
101
  if (oWorkData?.caseInfo && oWorkData.caseInfo.assignments !== null) {
95
- const oCaseInfo = oData.caseInfo;
102
+ const oCaseInfo = oData?.caseInfo;
96
103
 
97
104
  if (oCaseInfo && oCaseInfo.actionButtons) {
98
105
  setActionButtons(oCaseInfo.actionButtons);
@@ -132,7 +139,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
132
139
  setShowSnackbar(true);
133
140
  }
134
141
 
135
- function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {
142
+ function handleSnackbarClose(event: React.SyntheticEvent<any> | Event, reason?: string) {
136
143
  if (reason === 'clickaway') {
137
144
  return;
138
145
  }
@@ -167,6 +174,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
167
174
 
168
175
  savePromise
169
176
  .then(() => {
177
+ // @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'.
170
178
  const caseType = thePConn.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
171
179
  onSaveActionSuccess({ caseType, caseID, assignmentID });
172
180
  })
@@ -211,11 +219,22 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
211
219
  break;
212
220
  }
213
221
 
222
+ case 'rejectCase': {
223
+ const rejectPromise = rejectCase(itemKey);
224
+
225
+ rejectPromise
226
+ .then(() => {})
227
+ .catch(() => {
228
+ showToast(`${localizedVal('Rejection failed!', localeCategory)}`);
229
+ });
230
+
231
+ break;
232
+ }
233
+
214
234
  default:
215
235
  break;
216
236
  }
217
237
  } else if (sButtonType === 'primary') {
218
- // eslint-disable-next-line sonarjs/no-small-switch
219
238
  switch (sAction) {
220
239
  case 'finishAssignment': {
221
240
  const finishPromise = finishAssignment(itemKey);
@@ -229,6 +248,18 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
229
248
  break;
230
249
  }
231
250
 
251
+ case 'approveCase': {
252
+ const approvePromise = approveCase(itemKey);
253
+
254
+ approvePromise
255
+ .then(() => {})
256
+ .catch(() => {
257
+ showToast(`${localizedVal('Approve failed!', localeCategory)}`);
258
+ });
259
+
260
+ break;
261
+ }
262
+
232
263
  default:
233
264
  break;
234
265
  }
@@ -263,7 +294,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
263
294
  refreshProps.forEach(prop => {
264
295
  PCore.getRefreshManager().registerForRefresh(
265
296
  'PROP_CHANGE',
266
- thePConn.getActionsApi().refreshCaseView.bind(thePConn.getActionsApi(), caseKey, null, pageReference, {
297
+ thePConn.getActionsApi().refreshCaseView.bind(thePConn.getActionsApi(), caseKey, '', pageReference, {
267
298
  ...refreshOptions,
268
299
  refreshFor: prop[0]
269
300
  }),
@@ -1,11 +1,8 @@
1
1
  /* eslint-disable no-nested-ternary */
2
2
 
3
3
  import { useState, useEffect, useContext } from 'react';
4
- import { makeStyles } from '@material-ui/core/styles';
5
- import { Card, CardHeader, Avatar, Typography } from '@material-ui/core';
6
- import { Alert } from '@material-ui/lab';
7
- import DayjsUtils from '@date-io/dayjs';
8
- import { MuiPickersUtilsProvider } from '@material-ui/pickers';
4
+ import makeStyles from '@mui/styles/makeStyles';
5
+ import { Alert, Card, CardHeader, Avatar, Typography } from '@mui/material';
9
6
 
10
7
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
11
8
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
@@ -15,6 +12,8 @@ import { withSimpleViewContainerRenderer } from '../SimpleView/SimpleView';
15
12
 
16
13
  import { addContainerItem, getToDoAssignments, showBanner, hasContainerItems } from './helpers';
17
14
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
15
+ import { LocalizationProvider } from '@mui/x-date-pickers';
16
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
18
17
 
19
18
  interface FlowContainerProps extends PConnProps {
20
19
  // If any, enter additional props that only exist on this component
@@ -99,6 +98,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
99
98
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
100
99
  const localeCategory = 'Messages';
101
100
 
101
+ const key = `${thePConn.getCaseInfo().getClassName()}!CASE!${thePConn.getCaseInfo().getName()}`.toUpperCase();
102
102
  const classes = useStyles();
103
103
 
104
104
  function getBuildName(): string {
@@ -266,7 +266,9 @@ export const FlowContainer = (props: FlowContainerProps) => {
266
266
  // if have caseMessage show message and end
267
267
  const theCaseMessages = localizedVal(thePConn.getValue('caseMessages', ''), localeCategory); // 2nd arg empty string until typedefs properly allow optional
268
268
 
269
- if (theCaseMessages || !hasAssignments()) {
269
+ // caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
270
+ // Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
271
+ if (!hasAssignments()) {
270
272
  // Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.
271
273
  // So, if we get here and caseMessages$ is empty, use default value in DX API response
272
274
  setCaseMessages(theCaseMessages || localizedVal('Thank you! The next step in this case has been routed appropriately.', localeCategory));
@@ -306,26 +308,27 @@ export const FlowContainer = (props: FlowContainerProps) => {
306
308
  !displayOnlyFA ? (
307
309
  <Card className={`${classes.root} psdk-root`}>
308
310
  <CardHeader
309
- title={<Typography variant='h6'>{containerName}</Typography>}
310
- subheader={`Task in ${caseId} \u2022 Priority ${urgency}`}
311
+ id='assignment-header'
312
+ title={<Typography variant='h6'>{localizedVal(containerName, undefined, key)}</Typography>}
313
+ subheader={`${localizedVal('Task in', 'Todo')} ${caseId} \u2022 ${localizedVal('Priority', 'Todo')} ${urgency}`}
311
314
  avatar={<Avatar className={`${classes.avatar} psdk-avatar`}>{operatorInitials}</Avatar>}
312
315
  />
313
316
  {displayPageMessages()}
314
- <MuiPickersUtilsProvider utils={DayjsUtils}>
317
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
315
318
  <Assignment getPConnect={getPConnect} itemKey={itemKey}>
316
319
  {rootViewElement}
317
320
  </Assignment>
318
- </MuiPickersUtilsProvider>
321
+ </LocalizationProvider>
319
322
  </Card>
320
323
  ) : (
321
324
  <Card className={`${classes.root} psdk-root`}>
322
- <Typography variant='h6'>{containerName}</Typography>
325
+ <Typography variant='h6'>{localizedVal(containerName, undefined, key)}</Typography>
323
326
  {displayPageMessages()}
324
- <MuiPickersUtilsProvider utils={DayjsUtils}>
327
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
325
328
  <Assignment getPConnect={getPConnect} itemKey={itemKey}>
326
329
  {rootViewElement}
327
330
  </Assignment>
328
- </MuiPickersUtilsProvider>
331
+ </LocalizationProvider>
329
332
  </Card>
330
333
  )
331
334
  ) : (
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
- import Button from '@material-ui/core/Button';
3
- import { makeStyles } from '@material-ui/core/styles';
2
+ import Button from '@mui/material/Button';
3
+ import makeStyles from '@mui/styles/makeStyles';
4
4
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  const useStyles = makeStyles((/* theme */) => ({
@@ -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
  >
@@ -1,10 +1,10 @@
1
1
  import { createElement, useEffect, useRef, useState } from 'react';
2
- import Dialog from '@material-ui/core/Dialog';
3
- import DialogContent from '@material-ui/core/DialogContent';
4
- import DialogTitle from '@material-ui/core/DialogTitle';
5
- import { makeStyles } from '@material-ui/core/styles';
6
- import { MuiPickersUtilsProvider } from '@material-ui/pickers';
7
- import DayjsUtils from '@date-io/dayjs';
2
+ import Dialog from '@mui/material/Dialog';
3
+ import DialogContent from '@mui/material/DialogContent';
4
+ import DialogTitle from '@mui/material/DialogTitle';
5
+ import makeStyles from '@mui/styles/makeStyles';
6
+ import { LocalizationProvider } from '@mui/x-date-pickers';
7
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
8
8
  import difference from 'lodash.difference';
9
9
 
10
10
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
@@ -315,7 +315,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
315
315
  </DialogTitle>
316
316
  <DialogContent className={`${classes.dlgContent} psdk-dialog-content`}>
317
317
  {bShowModal ? (
318
- <MuiPickersUtilsProvider utils={DayjsUtils}>
318
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
319
319
  <Assignment
320
320
  getPConnect={createdView.configObject.getPConnect}
321
321
  itemKey={itemKey}
@@ -327,7 +327,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
327
327
  >
328
328
  {arNewChildrenAsReact}
329
329
  </Assignment>
330
- </MuiPickersUtilsProvider>
330
+ </LocalizationProvider>
331
331
  ) : null}
332
332
  </DialogContent>
333
333
 
@@ -1,5 +1,5 @@
1
1
  import React, { createElement, useContext, useEffect, useState } from 'react';
2
- import { Box, CircularProgress } from '@material-ui/core';
2
+ import { Box, CircularProgress } from '@mui/material';
3
3
 
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
5
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-shadow */
2
2
  /* eslint-disable operator-assignment */
3
3
  import { forwardRef, PropsWithChildren, useEffect, useRef, useState } from 'react';
4
- import { TextField } from '@material-ui/core';
4
+ import { TextField } from '@mui/material';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
6
  import { debounce } from 'throttle-debounce';
7
7
  import DatePicker from 'react-datepicker';
@@ -97,7 +97,7 @@ export default function DashboardFilter(props: PropsWithChildren<DashboardFilter
97
97
  metadata.config.onRecordChange = e => {
98
98
  fireFilterChange(e.id);
99
99
  };
100
- return getPConnect().createComponent(metadata, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
100
+ return getPConnect().createComponent(metadata, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
101
101
  };
102
102
 
103
103
  const onChange = dates => {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable prefer-template */
2
2
  /** This file contains various utility methods to generate filter components, regionLayout data, filter expressions, etc. */
3
3
 
4
- import { Grid, Link } from '@material-ui/core';
4
+ import { Grid, Link } from '@mui/material';
5
5
 
6
6
  import DashboardFilter from './DashboardFilter';
7
7
 
@@ -85,6 +85,7 @@ export const buildFilterComponents = (getPConnect, allFilters) => {
85
85
  // @ts-ignore - second parameter “payload” for publish method should be optional
86
86
  PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL);
87
87
  }}
88
+ underline='hover'
88
89
  >
89
90
  Clear All
90
91
  </Link>