@pega/react-sdk-overrides 24.2.10 → 25.1.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 (169) hide show
  1. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  2. package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +8 -9
  9. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
  13. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
  14. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  15. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  16. package/lib/field/CancelAlert/CancelAlert.tsx +7 -10
  17. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  18. package/lib/field/Currency/Currency.tsx +10 -7
  19. package/lib/field/Currency/currency-utils.ts +1 -2
  20. package/lib/field/Date/Date.tsx +8 -8
  21. package/lib/field/DateTime/DateTime.tsx +16 -13
  22. package/lib/field/Decimal/Decimal.tsx +10 -7
  23. package/lib/field/Dropdown/Dropdown.tsx +30 -25
  24. package/lib/field/Email/Email.tsx +11 -13
  25. package/lib/field/Group/Group.tsx +10 -8
  26. package/lib/field/Integer/Integer.tsx +5 -7
  27. package/lib/field/Location/Location.css +4 -0
  28. package/lib/field/Location/Location.tsx +258 -0
  29. package/lib/field/Location/config-ext.json +8 -0
  30. package/lib/field/Location/index.tsx +1 -0
  31. package/lib/field/Multiselect/utils.ts +1 -1
  32. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  33. package/lib/field/ObjectReference/index.tsx +1 -0
  34. package/lib/field/ObjectReference/utils.ts +111 -0
  35. package/lib/field/Percentage/Percentage.tsx +9 -9
  36. package/lib/field/Phone/Phone.tsx +7 -5
  37. package/lib/field/RadioButtons/RadioButtons.tsx +47 -5
  38. package/lib/field/RichText/RichText.css +79 -0
  39. package/lib/field/RichText/RichText.tsx +3 -1
  40. package/lib/field/ScalarList/ScalarList.tsx +2 -4
  41. package/lib/field/SelectableCard/SelectableCard.tsx +175 -0
  42. package/lib/field/SelectableCard/index.tsx +1 -0
  43. package/lib/field/SelectableCard/utils.tsx +223 -0
  44. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  45. package/lib/field/SemanticLink/utils.ts +1 -1
  46. package/lib/field/TextArea/TextArea.tsx +5 -7
  47. package/lib/field/TextContent/TextContent.tsx +1 -2
  48. package/lib/field/TextInput/TextInput.tsx +5 -7
  49. package/lib/field/Time/Time.tsx +4 -8
  50. package/lib/field/URL/URL.tsx +5 -7
  51. package/lib/field/UserReference/UserReference.tsx +3 -6
  52. package/lib/helpers/attachmentShared.ts +6 -0
  53. package/lib/helpers/common-utils.ts +24 -2
  54. package/lib/helpers/data_page.ts +0 -1
  55. package/lib/helpers/field-group-utils.ts +1 -1
  56. package/lib/helpers/formatters/Currency.ts +20 -20
  57. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  58. package/lib/helpers/formatters/common.ts +2 -1
  59. package/lib/helpers/formatters/index.ts +2 -4
  60. package/lib/helpers/object-utils.ts +10 -0
  61. package/lib/helpers/simpleTableHelpers.ts +118 -6
  62. package/lib/helpers/utils.ts +8 -1
  63. package/lib/helpers/versionHelpers.ts +0 -1
  64. package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
  65. package/lib/infra/Assignment/Assignment.tsx +39 -36
  66. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  67. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +21 -113
  68. package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
  69. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +4 -3
  70. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +7 -6
  71. package/lib/infra/Containers/SimpleView/helper.ts +1 -1
  72. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +4 -5
  73. package/lib/infra/Containers/container-helpers.ts +52 -0
  74. package/lib/infra/DashboardFilter/DashboardFilter.tsx +5 -9
  75. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -6
  76. package/lib/infra/DeferLoad/DeferLoad.tsx +7 -9
  77. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  78. package/lib/infra/MultiStep/MultiStep.css +48 -70
  79. package/lib/infra/MultiStep/MultiStep.tsx +27 -58
  80. package/lib/infra/NavBar/NavBar.css +1 -1
  81. package/lib/infra/NavBar/NavBar.tsx +43 -32
  82. package/lib/infra/Reference/Reference.tsx +3 -4
  83. package/lib/infra/Region/Region.tsx +1 -1
  84. package/lib/infra/RootContainer/RootContainer.tsx +3 -4
  85. package/lib/infra/Stages/Stages.tsx +3 -4
  86. package/lib/infra/View/View.tsx +4 -3
  87. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
  88. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
  89. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
  90. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  91. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  92. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  93. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  94. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  95. package/lib/template/AdvancedSearch/index.tsx +1 -0
  96. package/lib/template/AppShell/AppShell.css +1 -1
  97. package/lib/template/AppShell/AppShell.tsx +22 -23
  98. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  99. package/lib/template/CaseSummary/CaseSummary.tsx +28 -41
  100. package/lib/template/CaseView/CaseView.tsx +32 -38
  101. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  102. package/lib/template/Confirmation/Confirmation.tsx +3 -4
  103. package/lib/template/DataReference/DataReference.tsx +312 -106
  104. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
  105. package/lib/template/DataReference/SearchForm.tsx +149 -0
  106. package/lib/template/DataReference/utils.ts +90 -0
  107. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  108. package/lib/template/DefaultForm/utils/index.ts +1 -3
  109. package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
  110. package/lib/template/DefaultPage/index.tsx +1 -0
  111. package/lib/template/Details/Details/Details.tsx +11 -11
  112. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  113. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  114. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  115. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -2
  116. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -5
  117. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  118. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  119. package/lib/template/ListPage/ListPage.tsx +1 -1
  120. package/lib/template/ListView/ListView.tsx +285 -204
  121. package/lib/template/ListView/hooks.ts +1 -5
  122. package/lib/template/ListView/utils.ts +38 -6
  123. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  124. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  125. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  126. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  127. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  128. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  129. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  130. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  131. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -3
  132. package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +145 -0
  133. package/lib/template/SelfServiceCaseView/index.tsx +1 -0
  134. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -5
  135. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +99 -84
  136. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +3 -5
  137. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
  138. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  139. package/lib/template/SubTabs/tabUtils.ts +118 -1
  140. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  141. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  142. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  143. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  144. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  145. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  146. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  147. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  148. package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
  149. package/lib/template/utils.tsx +58 -0
  150. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  151. package/lib/widget/Attachment/Attachment.css +7 -8
  152. package/lib/widget/Attachment/Attachment.tsx +304 -231
  153. package/lib/widget/Attachment/Attachment.types.ts +96 -0
  154. package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
  155. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  156. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  157. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  158. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  159. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +30 -23
  160. package/lib/widget/Followers/Followers.tsx +2 -4
  161. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -3
  162. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  163. package/lib/widget/SummaryItem/SummaryItem.tsx +3 -3
  164. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  165. package/lib/widget/ToDo/ToDo.css +1 -13
  166. package/lib/widget/ToDo/ToDo.tsx +38 -37
  167. package/package.json +1 -1
  168. package/lib/helpers/attachmentHelpers.ts +0 -76
  169. package/lib/infra/Containers/helpers.ts +0 -6
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface QuickCreateProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
@@ -21,7 +21,6 @@ export default function QuickCreate(props: QuickCreateProps) {
21
21
  .getActionsApi()
22
22
  .createWork(className, {} as any)
23
23
  .catch(error => {
24
- // eslint-disable-next-line no-console
25
24
  console.log('Error in case creation: ', error?.message);
26
25
  });
27
26
  };
@@ -35,7 +34,6 @@ export default function QuickCreate(props: QuickCreateProps) {
35
34
  const defaultCases: any = [];
36
35
  const envInfo = PCore.getEnvironmentInfo();
37
36
  if (envInfo?.environmentInfoObject?.pyCaseTypeList) {
38
- // @ts-ignore - Property 'forEach' does not exist on type 'string'
39
37
  envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => {
40
38
  if (casetype.pyWorkTypeName && casetype.pyWorkTypeImplementationClassName) {
41
39
  defaultCases.push({
@@ -11,6 +11,10 @@
11
11
  flex-direction: row;
12
12
  padding: 0.25rem 0rem 0.25rem 0.25rem;
13
13
  margin-bottom: 0.5rem;
14
+ align-items: center;
15
+ border: 0.0625rem solid var(--utility-card-border-color);
16
+ border-radius: calc(0.25rem);
17
+ min-height: 3rem;
14
18
  }
15
19
 
16
20
  .psdk-utility-card-icon {
@@ -23,6 +27,7 @@
23
27
  .psdk-utility-card-svg-icon {
24
28
  width: 2.5rem;
25
29
  display: inline-block;
30
+ filter: var(--svg-color);
26
31
  }
27
32
 
28
33
  .psdk-utility-card-main {
@@ -40,14 +45,7 @@
40
45
  .psdk-utility-card-action-svg-icon {
41
46
  width: 1.4rem;
42
47
  display: inline-block;
43
- }
44
-
45
- .psdk-utility-card {
46
- display: flex;
47
- align-items: center;
48
- border: 0.0625rem solid rgb(207, 207, 207);
49
- border-radius: calc(0.25rem);
50
- min-height: 3rem;
48
+ filter: var(--svg-color);
51
49
  }
52
50
 
53
51
  .psdk-utility-button {
@@ -65,14 +63,14 @@
65
63
  width: 1.4rem;
66
64
  display: inline-block;
67
65
  vertical-align: middle;
68
- filter: invert(28%) sepia(20%) saturate(3903%) hue-rotate(209deg) brightness(101%) contrast(87%);
66
+ filter: var(--svg-color);
69
67
  }
70
68
 
71
- .psdk-link-button {
69
+ .psdk-utility-link-button {
72
70
  background: none;
73
71
  border: none;
74
72
  align-items: center;
75
73
  display: flex;
76
74
  padding: 0;
77
- color: #3f51b5;
75
+ color: var(--link-button-color);
78
76
  }
@@ -2,7 +2,7 @@ import { useState } from 'react';
2
2
  import { IconButton, Menu, MenuItem } from '@mui/material';
3
3
  import MoreVertIcon from '@mui/icons-material/MoreVert';
4
4
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
5
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
7
  import './SummaryItem.css';
8
8
 
@@ -47,7 +47,7 @@ export default function SummaryItem(props: SummaryItemProps) {
47
47
  {item.primary.type !== 'URL' && <div className='psdk-utility-card-main-primary-label'>{item.primary.name}</div>}
48
48
  {item.primary.type === 'URL' && (
49
49
  <div className='psdk-utility-card-main-primary-url'>
50
- <button type='button' className='psdk-link-button'>
50
+ <button type='button' className='psdk-utility-link-button'>
51
51
  {item.primary.name}&nbsp;
52
52
  <img className='psdk-utility-card-actions-svg-icon' src={`${imagePath$}${item.primary.icon}.svg`} />
53
53
  </button>
@@ -73,7 +73,7 @@ export default function SummaryItem(props: SummaryItemProps) {
73
73
  >
74
74
  <MoreVertIcon />
75
75
  </IconButton>
76
- <Menu style={{ marginTop: '3rem' }} id='file-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
76
+ <Menu id='file-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
77
77
  {item.actions &&
78
78
  item.actions.map(option => (
79
79
  <MenuItem style={{ fontSize: '14px' }} key={option.id || option.text} onClick={option.onClick}>
@@ -1,5 +1,5 @@
1
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
4
  interface SummaryListProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -41,7 +41,7 @@
41
41
  text-align: center;
42
42
  display: flex;
43
43
  background: var(--app-primary-color);
44
- color: white;
44
+ color: var(--app-text-color);
45
45
  font-weight: bold;
46
46
  font-size: 1.25rem;
47
47
  }
@@ -56,18 +56,6 @@
56
56
  display: inline-flex;
57
57
  }
58
58
 
59
- .psdk-todo-assignment-status {
60
- background-color: var(--app-neutral-light-color);
61
- border-radius: 0.125rem;
62
- color: darkslategray;
63
- font-size: 0.75rem;
64
- font-weight: bold;
65
- line-height: calc(0.5rem * 2.5);
66
- height: calc(0.5rem * 2.5);
67
- padding: 0 0.5rem;
68
- text-transform: uppercase;
69
- }
70
-
71
59
  .psdk-todo-assignment-task {
72
60
  color: var(--app-neutral-color);
73
61
  }
@@ -1,19 +1,5 @@
1
- /* eslint-disable @typescript-eslint/no-shadow */
2
1
  import React, { useCallback, useEffect, useState } from 'react';
3
- import {
4
- Box,
5
- Button,
6
- Card,
7
- CardContent,
8
- CardHeader,
9
- Avatar,
10
- Typography,
11
- Badge,
12
- List,
13
- ListItem,
14
- ListItemText,
15
- ListItemSecondaryAction
16
- } from '@mui/material';
2
+ import { Box, Button, Card, CardContent, CardHeader, Avatar, Typography, Badge, List, ListItem, ListItemText } from '@mui/material';
17
3
  import Snackbar from '@mui/material/Snackbar';
18
4
  import IconButton from '@mui/material/IconButton';
19
5
  import CloseIcon from '@mui/icons-material/Close';
@@ -23,7 +9,7 @@ import makeStyles from '@mui/styles/makeStyles';
23
9
  import useMediaQuery from '@mui/material/useMediaQuery';
24
10
 
25
11
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
26
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
12
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
27
13
 
28
14
  import './ToDo.css';
29
15
 
@@ -64,10 +50,10 @@ interface ToDoProps extends PConnProps {
64
50
  // If any, enter additional props that only exist on this component
65
51
  datasource?: any;
66
52
  myWorkList?: any;
67
- // eslint-disable-next-line react/no-unused-prop-types
53
+
68
54
  caseInfoID?: string;
69
55
  headerText?: string;
70
- // eslint-disable-next-line react/no-unused-prop-types
56
+
71
57
  itemKey?: string;
72
58
  showTodoList?: boolean;
73
59
  type?: string;
@@ -96,21 +82,28 @@ function getID(assignment: any) {
96
82
 
97
83
  const useStyles = makeStyles(theme => ({
98
84
  root: {
99
- marginTop: theme.spacing(1),
100
85
  marginBottom: theme.spacing(1),
101
86
  paddingBottom: theme.spacing(1),
102
- borderLeft: '6px solid',
103
- borderLeftColor: theme.palette.primary.light
87
+ borderRadius: 16
104
88
  },
105
89
  avatar: {
106
90
  backgroundColor: theme.palette.primary.light,
107
91
  color: theme.palette.getContrastText(theme.palette.primary.light)
108
92
  },
109
93
  todoWrapper: {
110
- borderLeft: '6px solid',
111
- borderLeftColor: theme.palette.primary.light,
112
94
  padding: theme.spacing(1),
113
95
  margin: theme.spacing(1)
96
+ },
97
+ psdkTodoAssignmentStatus: {
98
+ backgroundColor: 'var(--app-neutral-light-color)',
99
+ borderRadius: '0.125rem',
100
+ color: theme.embedded.resolutionTextColor,
101
+ fontSize: '0.75rem',
102
+ fontWeight: 'bold',
103
+ lineHeight: 'calc(0.5rem * 2.5)',
104
+ height: 'calc(0.5rem * 2.5)',
105
+ padding: '0 0.5rem',
106
+ textTransform: 'uppercase'
114
107
  }
115
108
  }));
116
109
 
@@ -129,14 +122,14 @@ export default function ToDo(props: ToDoProps) {
129
122
  const CONSTS = PCore.getConstants();
130
123
 
131
124
  const bLogging = true;
132
- const currentUser = PCore.getEnvironmentInfo().getOperatorName();
125
+ const currentUser = PCore.getEnvironmentInfo().getOperatorName() ?? '';
133
126
  const currentUserInitials = Utils.getInitials(currentUser);
134
127
  const assignmentsSource = datasource?.source || myWorkList?.source;
135
128
 
136
129
  const [bShowMore, setBShowMore] = useState(true);
137
130
  const [showSnackbar, setShowSnackbar] = useState(false);
138
131
  const [snackbarMessage, setSnackbarMessage]: any = useState('');
139
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
132
+
140
133
  const [assignments, setAssignments] = useState<any[]>(initAssignments());
141
134
 
142
135
  const thePConn = getPConnect();
@@ -187,12 +180,14 @@ export default function ToDo(props: ToDoProps) {
187
180
  };
188
181
 
189
182
  const getAssignmentName = assignment => {
190
- return type === CONSTS.TODO ? assignment.name : assignment.stepName;
183
+ return type === CONSTS.TODO
184
+ ? localizedVal(assignment.name, '', PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname))
185
+ : localizedVal(assignment.stepName, '', PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname));
191
186
  };
192
187
 
193
188
  function showToast(message: string) {
194
189
  const theMessage = `Assignment: ${message}`;
195
- // eslint-disable-next-line no-console
190
+
196
191
  console.error(theMessage);
197
192
  setSnackbarMessage(message);
198
193
  setShowSnackbar(true);
@@ -251,7 +246,6 @@ export default function ToDo(props: ToDoProps) {
251
246
  .openAssignment(id, classname, options)
252
247
  .then(() => {
253
248
  if (bLogging) {
254
- // eslint-disable-next-line no-console
255
249
  console.log(`openAssignment completed`);
256
250
  }
257
251
  })
@@ -271,13 +265,16 @@ export default function ToDo(props: ToDoProps) {
271
265
  };
272
266
 
273
267
  const getListItemComponent = assignment => {
268
+ const caseLocaleRef = PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname);
274
269
  if (isDesktop) {
275
270
  return (
276
271
  <>
277
- {localizedVal('Task in', localeCategory)}
272
+ {localizedVal('In', localeCategory)}
278
273
  {renderTaskId(type, getPConnect, showTodoList, assignment)}
279
274
  {type === CONSTS.WORKLIST && assignment.status ? `\u2022 ` : undefined}
280
- {type === CONSTS.WORKLIST && assignment.status ? <span className='psdk-todo-assignment-status'>{assignment.status}</span> : undefined}
275
+ {type === CONSTS.WORKLIST && assignment.status ? (
276
+ <span className='psdk-todo-assignment-status'>{localizedVal(assignment.status, '', caseLocaleRef)}</span>
277
+ ) : undefined}
281
278
  {` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
282
279
  </>
283
280
  );
@@ -290,7 +287,6 @@ export default function ToDo(props: ToDoProps) {
290
287
  );
291
288
  };
292
289
 
293
- // eslint-disable-next-line no-nested-ternary
294
290
  const getCount = () => (assignmentsSource ? assignmentsSource.length : type === CONSTS.WORKLIST ? count : 0);
295
291
 
296
292
  const toDoContent = (
@@ -311,8 +307,8 @@ export default function ToDo(props: ToDoProps) {
311
307
  {currentUserInitials}
312
308
  </Avatar>
313
309
  <div style={{ display: 'block' }}>
314
- <Typography variant='h6'>{assignment?.name}</Typography>
315
- {`${localizedVal('Task in', localeCategory)} ${renderTaskId(type, getPConnect, showTodoList, assignment)} \u2022 ${localizedVal(
310
+ <Typography variant='h6'>{localizedVal(assignment?.name, localeCategory)}</Typography>
311
+ {`${localizedVal('In', localeCategory)} ${getID(assignment)} \u2022 ${localizedVal(
316
312
  'Urgency',
317
313
  localeCategory
318
314
  )} ${getPriority(assignment)}`}
@@ -347,13 +343,18 @@ export default function ToDo(props: ToDoProps) {
347
343
  <CardContent>
348
344
  <List>
349
345
  {assignments.map(assignment => (
350
- <ListItem key={getAssignmentId(assignment)} dense divider onClick={() => clickGo(assignment)}>
351
- <ListItemText primary={getAssignmentName(assignment)} secondary={getListItemComponent(assignment)} />
352
- <ListItemSecondaryAction>
346
+ <ListItem
347
+ key={getAssignmentId(assignment)}
348
+ dense
349
+ divider
350
+ onClick={() => clickGo(assignment)}
351
+ secondaryAction={
353
352
  <IconButton onClick={() => clickGo(assignment)} size='large'>
354
353
  <ArrowForwardIosOutlinedIcon />
355
354
  </IconButton>
356
- </ListItemSecondaryAction>
355
+ }
356
+ >
357
+ <ListItemText primary={getAssignmentName(assignment)} secondary={getListItemComponent(assignment)} />
357
358
  </ListItem>
358
359
  ))}
359
360
  </List>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/react-sdk-overrides",
3
- "version": "24.2.10",
3
+ "version": "25.1.10",
4
4
  "description": "React SDK - Code for overriding components",
5
5
  "_filesComment": "During packing, npm ignores everything NOT in the files list",
6
6
  "files": [
@@ -1,76 +0,0 @@
1
- import download from 'downloadjs';
2
-
3
- export const validateMaxSize = (fileObj: any, maxSizeInMB: string): boolean => {
4
- const fileSize = (fileObj.size / 1048576).toFixed(2);
5
- return parseFloat(fileSize) < parseFloat(maxSizeInMB);
6
- };
7
-
8
- export const fileDownload = (data, fileName, ext) => {
9
- const name = ext ? `${fileName}.${ext}` : fileName;
10
- // Temp fix: downloading EMAIl type attachment as html file
11
- if (ext === 'html') {
12
- download(data, name, 'text/html');
13
- } else {
14
- download(atob(data), name);
15
- }
16
- };
17
-
18
- export const getIconFromFileType = (fileType): string => {
19
- let icon = 'document-doc';
20
- if (!fileType) return icon;
21
- if (fileType.startsWith('audio')) {
22
- icon = 'audio';
23
- } else if (fileType.startsWith('video')) {
24
- icon = 'video';
25
- } else if (fileType.startsWith('image')) {
26
- icon = 'picture';
27
- } else if (fileType.includes('pdf')) {
28
- icon = 'document-pdf';
29
- } else {
30
- const [, subtype] = fileType.split('/');
31
- const foundMatch = sources => {
32
- return sources.some(key => subtype.includes(key));
33
- };
34
-
35
- if (foundMatch(['excel', 'spreadsheet'])) {
36
- icon = 'document-xls';
37
- } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {
38
- icon = 'document-compress';
39
- }
40
- }
41
-
42
- return icon;
43
- };
44
-
45
- export const getIconForAttachment = (inThis: any, attachment: any): string => {
46
- let icon;
47
- switch (attachment.type) {
48
- case 'FILE':
49
- icon = inThis.getIconFromFileType(attachment.mimeType);
50
- break;
51
- case 'URL':
52
- icon = 'chain';
53
- break;
54
- default:
55
- icon = 'document-doc';
56
- }
57
- return icon;
58
- };
59
-
60
- export const buildFilePropsFromResponse = (
61
- respObj
62
- ): {
63
- props: { meta: string; name: string; icon: string };
64
- responseProps: any;
65
- } => {
66
- return {
67
- props: {
68
- meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,
69
- name: respObj.pyAttachName,
70
- icon: getIconFromFileType(respObj.pyMimeFileExtension)
71
- },
72
- responseProps: {
73
- ...respObj
74
- }
75
- };
76
- };
@@ -1,6 +0,0 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
- export const isContainerInitialized = pConnect => {
3
- const context = pConnect.getContextName();
4
- const containerName = pConnect.getContainerName();
5
- return PCore.getContainerUtils().isContainerInitialized(context, containerName);
6
- };