@pega/react-sdk-overrides 24.2.11 → 25.1.11

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 (173) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  2. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  3. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  4. package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
  5. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
  7. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  8. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  9. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  10. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
  11. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  12. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  13. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
  14. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
  15. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
  16. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  17. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  18. package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
  19. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  20. package/lib/field/Currency/Currency.tsx +3 -3
  21. package/lib/field/Currency/currency-utils.ts +1 -2
  22. package/lib/field/Date/Date.tsx +3 -7
  23. package/lib/field/DateTime/DateTime.tsx +3 -8
  24. package/lib/field/Decimal/Decimal.tsx +3 -5
  25. package/lib/field/Dropdown/Dropdown.tsx +5 -7
  26. package/lib/field/Email/Email.tsx +11 -13
  27. package/lib/field/Group/Group.tsx +10 -8
  28. package/lib/field/Integer/Integer.tsx +5 -7
  29. package/lib/field/Location/Location.css +4 -0
  30. package/lib/field/Location/Location.tsx +258 -0
  31. package/lib/field/Location/config-ext.json +8 -0
  32. package/lib/field/Location/index.tsx +1 -0
  33. package/lib/field/Multiselect/utils.ts +1 -1
  34. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  35. package/lib/field/ObjectReference/index.tsx +1 -0
  36. package/lib/field/ObjectReference/utils.ts +111 -0
  37. package/lib/field/Percentage/Percentage.tsx +3 -7
  38. package/lib/field/Phone/Phone.tsx +7 -5
  39. package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
  40. package/lib/field/RichText/RichText.css +79 -0
  41. package/lib/field/RichText/RichText.tsx +3 -1
  42. package/lib/field/ScalarList/ScalarList.tsx +2 -3
  43. package/lib/field/SelectableCard/SelectableCard.tsx +189 -0
  44. package/lib/field/SelectableCard/index.tsx +1 -0
  45. package/lib/field/SelectableCard/utils.tsx +223 -0
  46. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  47. package/lib/field/SemanticLink/utils.ts +1 -1
  48. package/lib/field/TextArea/TextArea.tsx +5 -7
  49. package/lib/field/TextContent/TextContent.tsx +1 -2
  50. package/lib/field/TextInput/TextInput.tsx +5 -7
  51. package/lib/field/Time/Time.tsx +3 -7
  52. package/lib/field/URL/URL.tsx +5 -7
  53. package/lib/field/UserReference/UserReference.tsx +2 -3
  54. package/lib/helpers/attachmentShared.ts +6 -0
  55. package/lib/helpers/common-utils.ts +3 -4
  56. package/lib/helpers/data_page.ts +0 -1
  57. package/lib/helpers/field-group-utils.ts +1 -1
  58. package/lib/helpers/formatters/Currency.ts +9 -4
  59. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  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 +47 -31
  66. package/lib/infra/Assignment/useValidationBanner.ts +29 -0
  67. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  68. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +22 -102
  69. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
  70. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +12 -6
  71. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +8 -13
  72. package/lib/infra/Containers/container-helpers.ts +47 -1
  73. package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
  74. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  75. package/lib/infra/DeferLoad/DeferLoad.tsx +26 -13
  76. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  77. package/lib/infra/MultiStep/MultiStep.css +48 -70
  78. package/lib/infra/MultiStep/MultiStep.tsx +27 -53
  79. package/lib/infra/NavBar/NavBar.css +1 -1
  80. package/lib/infra/NavBar/NavBar.tsx +49 -34
  81. package/lib/infra/Reference/Reference.tsx +8 -4
  82. package/lib/infra/Region/Region.tsx +1 -1
  83. package/lib/infra/RootContainer/RootContainer.tsx +6 -8
  84. package/lib/infra/Stages/Stages.tsx +3 -4
  85. package/lib/infra/View/View.tsx +9 -9
  86. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
  87. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
  88. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
  89. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  90. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  91. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  92. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  93. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  94. package/lib/template/AdvancedSearch/index.tsx +1 -0
  95. package/lib/template/AppShell/AppShell.css +1 -5
  96. package/lib/template/AppShell/AppShell.tsx +16 -17
  97. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  98. package/lib/template/CaseSummary/CaseSummary.tsx +25 -43
  99. package/lib/template/CaseView/CaseView.tsx +28 -35
  100. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  101. package/lib/template/Confirmation/Confirmation.tsx +2 -3
  102. package/lib/template/DataReference/DataReference.tsx +312 -106
  103. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
  104. package/lib/template/DataReference/SearchForm.tsx +149 -0
  105. package/lib/template/DataReference/utils.ts +90 -0
  106. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  107. package/lib/template/DefaultForm/utils/index.ts +1 -3
  108. package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
  109. package/lib/template/DefaultPage/index.tsx +1 -0
  110. package/lib/template/Details/Details/Details.tsx +11 -11
  111. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  112. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  113. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  114. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
  115. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -6
  116. package/lib/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
  117. package/lib/template/HierarchicalForm/hooks.ts +224 -0
  118. package/lib/template/HierarchicalForm/index.tsx +1 -0
  119. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  120. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  121. package/lib/template/ListPage/ListPage.tsx +1 -1
  122. package/lib/template/ListView/ListView.tsx +342 -204
  123. package/lib/template/ListView/hooks.ts +1 -5
  124. package/lib/template/ListView/utils.ts +38 -5
  125. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +17 -2
  126. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  127. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  128. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  129. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  130. package/lib/template/ObjectPage/index.tsx +1 -0
  131. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  132. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  133. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  134. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  135. package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
  136. package/lib/template/SelfServiceCaseView/index.tsx +1 -0
  137. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
  138. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +45 -34
  139. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
  140. package/lib/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +179 -0
  141. package/lib/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
  142. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
  143. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  144. package/lib/template/SubTabs/tabUtils.ts +118 -1
  145. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  146. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  147. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  148. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  149. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  150. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  151. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  152. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  153. package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
  154. package/lib/template/utils.tsx +58 -0
  155. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  156. package/lib/widget/Attachment/Attachment.css +6 -8
  157. package/lib/widget/Attachment/Attachment.tsx +303 -225
  158. package/lib/widget/Attachment/Attachment.types.ts +96 -0
  159. package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
  160. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  161. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  162. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  163. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  164. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
  165. package/lib/widget/Followers/Followers.tsx +2 -4
  166. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  167. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  168. package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
  169. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  170. package/lib/widget/ToDo/ToDo.css +1 -13
  171. package/lib/widget/ToDo/ToDo.tsx +37 -36
  172. package/package.json +1 -1
  173. package/lib/helpers/attachmentHelpers.ts +0 -76
@@ -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
  };
@@ -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>
@@ -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
 
@@ -136,7 +129,7 @@ export default function ToDo(props: ToDoProps) {
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.11",
3
+ "version": "25.1.11",
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
- };