@pega/react-sdk-overrides 8.23.11 → 23.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 (233) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/SECURITY.md +10 -0
  4. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +12 -16
  5. package/lib/designSystemExtension/Banner/Banner.tsx +21 -7
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  7. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
  8. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
  9. package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
  10. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
  11. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +14 -11
  12. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
  13. package/lib/designSystemExtension/Operator/Operator.tsx +100 -84
  14. package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
  15. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
  16. package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
  17. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
  18. package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
  19. package/lib/field/AutoComplete/config-ext.json +2 -3
  20. package/lib/field/CancelAlert/CancelAlert.tsx +100 -81
  21. package/lib/field/CancelAlert/index.tsx +1 -1
  22. package/lib/field/Checkbox/Checkbox.tsx +27 -16
  23. package/lib/field/Checkbox/config-ext.json +2 -3
  24. package/lib/field/Currency/Currency.tsx +30 -47
  25. package/lib/field/Currency/config-ext.json +2 -3
  26. package/lib/field/Currency/currency-utils.ts +10 -21
  27. package/lib/field/Date/Date.tsx +24 -13
  28. package/lib/field/Date/config-ext.json +2 -3
  29. package/lib/field/DateTime/DateTime.tsx +21 -10
  30. package/lib/field/DateTime/config-ext.json +1 -2
  31. package/lib/field/Decimal/Decimal.tsx +31 -40
  32. package/lib/field/Decimal/config-ext.json +1 -2
  33. package/lib/field/Decimal/index.tsx +1 -1
  34. package/lib/field/Dropdown/Dropdown.tsx +128 -31
  35. package/lib/field/Dropdown/config-ext.json +1 -2
  36. package/lib/field/Email/Email.tsx +16 -7
  37. package/lib/field/Email/config-ext.json +1 -2
  38. package/lib/field/Email/index.tsx +1 -1
  39. package/lib/field/Group/Group.tsx +39 -0
  40. package/lib/field/Group/config-ext.json +7 -0
  41. package/lib/field/Group/index.tsx +1 -0
  42. package/lib/field/Integer/Integer.tsx +15 -6
  43. package/lib/field/Integer/config-ext.json +1 -2
  44. package/lib/field/Percentage/Percentage.tsx +52 -39
  45. package/lib/field/Percentage/config-ext.json +1 -2
  46. package/lib/field/Phone/Phone.tsx +15 -6
  47. package/lib/field/Phone/index.tsx +1 -1
  48. package/lib/field/RadioButtons/RadioButtons.tsx +26 -34
  49. package/lib/field/RadioButtons/config-ext.json +1 -2
  50. package/lib/field/RichText/RichText.tsx +96 -0
  51. package/lib/field/RichText/index.tsx +1 -0
  52. package/lib/field/ScalarList/ScalarList.tsx +63 -0
  53. package/lib/field/ScalarList/config-ext.json +7 -0
  54. package/lib/field/ScalarList/index.tsx +1 -0
  55. package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
  56. package/lib/field/SemanticLink/config-ext.json +1 -2
  57. package/lib/field/SemanticLink/utils.ts +8 -11
  58. package/lib/field/TextArea/TextArea.tsx +15 -5
  59. package/lib/field/TextArea/config-ext.json +1 -2
  60. package/lib/field/TextContent/TextContent.tsx +9 -2
  61. package/lib/field/TextContent/config-ext.json +1 -2
  62. package/lib/field/TextInput/TextInput.tsx +18 -7
  63. package/lib/field/TextInput/config-ext.json +1 -2
  64. package/lib/field/TextInput/index.tsx +1 -1
  65. package/lib/field/Time/Time.tsx +14 -19
  66. package/lib/field/Time/config-ext.json +1 -2
  67. package/lib/field/URL/URL.tsx +15 -6
  68. package/lib/field/URL/config-ext.json +1 -2
  69. package/lib/field/URL/index.tsx +1 -1
  70. package/lib/field/UserReference/UserReference.tsx +52 -60
  71. package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
  72. package/lib/field/UserReference/config-ext.json +1 -2
  73. package/lib/helpers/attachmentHelpers.ts +15 -10
  74. package/lib/helpers/case-utils.tsx +5 -10
  75. package/lib/helpers/common-utils.ts +6 -2
  76. package/lib/helpers/data_page.ts +3 -7
  77. package/lib/helpers/date-format-utils.ts +4 -4
  78. package/lib/helpers/event-utils.ts +4 -4
  79. package/lib/helpers/field-group-utils.ts +6 -8
  80. package/lib/helpers/formatters/Boolean.ts +9 -26
  81. package/lib/helpers/formatters/Currency.ts +22 -28
  82. package/lib/helpers/formatters/CurrencyMap.ts +512 -505
  83. package/lib/helpers/formatters/Date.ts +20 -26
  84. package/lib/helpers/formatters/common.ts +2 -7
  85. package/lib/helpers/formatters/index.ts +29 -22
  86. package/lib/helpers/reactContextHelpers.ts +2 -2
  87. package/lib/helpers/simpleTableHelpers.ts +63 -87
  88. package/lib/helpers/state-utils.tsx +5 -12
  89. package/lib/helpers/template-utils.ts +4 -10
  90. package/lib/helpers/utils.ts +5 -5
  91. package/lib/helpers/versionHelpers.ts +1 -7
  92. package/lib/infra/ActionButtons/ActionButtons.tsx +44 -45
  93. package/lib/infra/ActionButtons/index.tsx +1 -1
  94. package/lib/infra/Assignment/Assignment.tsx +102 -86
  95. package/lib/infra/Assignment/index.tsx +1 -1
  96. package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
  97. package/lib/infra/AssignmentCard/index.tsx +1 -1
  98. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +93 -240
  99. package/lib/infra/Containers/FlowContainer/helpers.ts +34 -48
  100. package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
  101. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
  102. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  103. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +229 -223
  104. package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
  105. package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
  106. package/lib/infra/Containers/SimpleView/helper.ts +125 -0
  107. package/lib/infra/Containers/SimpleView/index.tsx +1 -0
  108. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +47 -64
  109. package/lib/infra/Containers/helpers.ts +6 -0
  110. package/lib/infra/DashboardFilter/DashboardFilter.tsx +25 -54
  111. package/lib/infra/DashboardFilter/filterUtils.tsx +12 -42
  112. package/lib/infra/DeferLoad/DeferLoad.tsx +21 -33
  113. package/lib/infra/DeferLoad/index.tsx +1 -1
  114. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +21 -39
  115. package/lib/infra/MultiStep/MultiStep.css +11 -15
  116. package/lib/infra/MultiStep/MultiStep.tsx +180 -216
  117. package/lib/infra/MultiStep/index.tsx +1 -1
  118. package/lib/infra/NavBar/NavBar.css +103 -105
  119. package/lib/infra/NavBar/NavBar.tsx +26 -45
  120. package/lib/infra/Reference/Reference.tsx +16 -22
  121. package/lib/infra/Region/Region.tsx +9 -9
  122. package/lib/infra/RootContainer/RootContainer.tsx +75 -120
  123. package/lib/infra/RootContainer/index.tsx +1 -1
  124. package/lib/infra/Stages/Stages.tsx +36 -41
  125. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
  126. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
  127. package/lib/infra/View/View.tsx +25 -29
  128. package/lib/template/AppShell/AppShell.css +22 -23
  129. package/lib/template/AppShell/AppShell.tsx +47 -71
  130. package/lib/template/BannerPage/BannerPage.tsx +26 -33
  131. package/lib/template/CaseSummary/CaseSummary.tsx +66 -19
  132. package/lib/template/CaseSummary/config-ext.json +1 -2
  133. package/lib/template/CaseView/CaseView.tsx +44 -74
  134. package/lib/template/CaseView/config-ext.json +1 -2
  135. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +66 -31
  136. package/lib/template/Confirmation/Confirmation.tsx +24 -55
  137. package/lib/template/Confirmation/config-ext.json +1 -2
  138. package/lib/template/DataReference/DataReference.tsx +112 -142
  139. package/lib/template/DataReference/config-ext.json +1 -2
  140. package/lib/template/DefaultForm/DefaultForm.css +7 -3
  141. package/lib/template/DefaultForm/DefaultForm.tsx +15 -16
  142. package/lib/template/DefaultForm/config-ext.json +1 -2
  143. package/lib/template/Details/Details/Details.tsx +24 -28
  144. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
  145. package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
  146. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
  147. package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
  148. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
  149. package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
  150. package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
  151. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
  152. package/lib/template/Details/DynamicTabs/config.json +36 -0
  153. package/lib/template/Details/DynamicTabs/index.tsx +1 -0
  154. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +22 -35
  155. package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
  156. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
  157. package/lib/template/ListPage/ListPage.tsx +12 -16
  158. package/lib/template/ListPage/config-ext.json +1 -2
  159. package/lib/template/ListView/DefaultViewMeta.ts +1 -3
  160. package/lib/template/ListView/ListView.tsx +247 -309
  161. package/lib/template/ListView/config-ext.json +1 -2
  162. package/lib/template/ListView/hooks.ts +24 -26
  163. package/lib/template/ListView/utils.ts +205 -94
  164. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -34
  165. package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  166. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
  167. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
  168. package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
  169. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  170. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +17 -19
  171. package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
  172. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
  173. package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
  174. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
  175. package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
  176. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
  177. package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
  178. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
  179. package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
  180. package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
  181. package/lib/template/PromotedFilters/PromotedFilters.tsx +39 -33
  182. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +113 -15
  183. package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
  184. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -104
  185. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -44
  186. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
  187. package/lib/template/SubTabs/SubTabs.tsx +26 -45
  188. package/lib/template/SubTabs/config-ext.json +1 -2
  189. package/lib/template/SubTabs/tabUtils.ts +2 -9
  190. package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  191. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
  192. package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
  193. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
  194. package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
  195. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
  196. package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
  197. package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  198. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +29 -27
  199. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
  200. package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
  201. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  202. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +16 -18
  203. package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
  204. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
  205. package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
  206. package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
  207. package/lib/template/WssNavBar/WssNavBar.tsx +24 -10
  208. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
  209. package/lib/widget/AppAnnouncement/config-ext.json +1 -2
  210. package/lib/widget/Attachment/Attachment.css +60 -1
  211. package/lib/widget/Attachment/Attachment.tsx +379 -394
  212. package/lib/widget/Attachment/index.tsx +1 -1
  213. package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
  214. package/lib/widget/CaseHistory/config-ext.json +1 -2
  215. package/lib/widget/CaseHistory/index.tsx +1 -1
  216. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
  217. package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  218. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +322 -245
  219. package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
  220. package/lib/widget/Followers/Followers.tsx +27 -25
  221. package/lib/widget/Followers/config-ext.json +1 -2
  222. package/lib/widget/QuickCreate/QuickCreate.tsx +71 -39
  223. package/lib/widget/SummaryItem/SummaryItem.css +9 -9
  224. package/lib/widget/SummaryItem/SummaryItem.tsx +62 -52
  225. package/lib/widget/SummaryItem/index.tsx +1 -1
  226. package/lib/widget/SummaryList/SummaryList.tsx +15 -4
  227. package/lib/widget/ToDo/ToDo.css +4 -4
  228. package/lib/widget/ToDo/ToDo.tsx +72 -116
  229. package/lib/widget/ToDo/config-ext.json +1 -2
  230. package/package.json +5 -2
  231. package/lib/helpers/auth.js +0 -483
  232. package/lib/helpers/authManager.js +0 -634
  233. package/lib/helpers/config_access.js +0 -259
@@ -1,21 +1,28 @@
1
- import React, { useEffect, useState } from "react";
1
+ import { useEffect, useState } from 'react';
2
2
  import TextField from '@material-ui/core/TextField';
3
+
3
4
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
4
- import download from "downloadjs";
5
- import SummaryList from '@pega/react-sdk-components/lib/components/widget/SummaryList';
6
- import ActionButtonsForFileUtil from '@pega/react-sdk-components/lib/components/widget/FileUtility/ActionButtonsForFileUtil';
5
+
6
+ import download from 'downloadjs';
7
+ // import SummaryList from '../../SummaryList';
8
+ // import ActionButtonsForFileUtil from '../ActionButtonsForFileUtil';
7
9
  import './FileUtility.css';
8
- import { IconButton, Menu, MenuItem } from '@material-ui/core';
10
+ import { IconButton, Menu, MenuItem, Button, CircularProgress } from '@material-ui/core';
9
11
  import MoreVertIcon from '@material-ui/icons/MoreVert';
10
- import { Button } from '@material-ui/core';
12
+
11
13
  import { validateMaxSize } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
12
- import { CircularProgress } from "@material-ui/core";
14
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
15
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
13
16
 
14
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 5 errors)
15
- declare const PCore: any;
17
+ interface FileUtilityProps extends PConnProps {
18
+ // If any, enter additional props that only exist on this component
19
+ }
16
20
 
21
+ export default function FileUtility(props: FileUtilityProps) {
22
+ // Get emitted components from map (so we can get any override that may exist)
23
+ const SummaryList = getComponentFromMap('SummaryList');
24
+ const ActionButtonsForFileUtil = getComponentFromMap('ActionButtonsForFileUtil');
17
25
 
18
- export default function FileUtility(props) {
19
26
  const { getPConnect } = props;
20
27
  const thePConn = getPConnect();
21
28
  const required = true;
@@ -25,7 +32,7 @@ export default function FileUtility(props) {
25
32
  };
26
33
  const [list, setList] = useState(listTemp);
27
34
  const headerSvgIcon$ = Utils.getImageSrc('paper-clip', Utils.getSDKStaticConentUrl());
28
- const closeSvgIcon = Utils.getImageSrc("times", Utils.getSDKStaticConentUrl());
35
+ const closeSvgIcon = Utils.getImageSrc('times', Utils.getSDKStaticConentUrl());
29
36
  const configProps: any = thePConn.resolveConfigProps(thePConn.getConfigProps());
30
37
 
31
38
  const header = configProps.label;
@@ -33,78 +40,94 @@ export default function FileUtility(props) {
33
40
  showfileModal: false,
34
41
  fileList: [],
35
42
  attachedFiles: [],
36
- fileMainButtons: [{ actionID: "attach", jsAction: "attachFiles", name: thePConn.getLocalizedValue('Attach files')}],
37
- fileSecondaryButtons: [{ actionID: "cancel", jsAction: "cancel", name: thePConn.getLocalizedValue('Cancel')}]
43
+ fileMainButtons: [
44
+ {
45
+ actionID: 'attach',
46
+ jsAction: 'attachFiles',
47
+ name: thePConn.getLocalizedValue('Attach files', '', '')
48
+ }
49
+ ], // 2nd and 3rd args empty string until typedef marked correctly
50
+ fileSecondaryButtons: [
51
+ {
52
+ actionID: 'cancel',
53
+ jsAction: 'cancel',
54
+ name: thePConn.getLocalizedValue('Cancel', '', '')
55
+ }
56
+ ] // 2nd and 3rd args empty string until typedef marked correctly
38
57
  };
39
58
  const [fileData, setFileData] = useState(fileTemp);
40
59
  const linkTemp = {
41
60
  showLinkModal: false,
42
61
  linksList: [],
43
62
  attachedLinks: [],
44
- linkMainButtons: [{ actionID: "attach", jsAction: "attachLinks", name: thePConn.getLocalizedValue('Attach links')}],
45
- linkSecondaryButtons: [{ actionID: "cancel", jsAction: "cancel", name: thePConn.getLocalizedValue('Cancel')}]
63
+ linkMainButtons: [
64
+ {
65
+ actionID: 'attach',
66
+ jsAction: 'attachLinks',
67
+ name: thePConn.getLocalizedValue('Attach links', '', '')
68
+ }
69
+ ], // 2nd and 3rd args empty string until typedef marked correctly
70
+ linkSecondaryButtons: [
71
+ {
72
+ actionID: 'cancel',
73
+ jsAction: 'cancel',
74
+ name: thePConn.getLocalizedValue('Cancel', '', '')
75
+ }
76
+ ] // 2nd and 3rd args empty string until typedef marked correctly
46
77
  };
47
78
  const [linkData, setLinkData] = useState(linkTemp);
48
79
  const [anchorEl, setAnchorEl] = useState(null);
49
80
  const open = Boolean(anchorEl);
50
- const [link, setLink] = useState({title: '', url: '', disable: true});
81
+ const [link, setLink] = useState({ title: '', url: '', disable: true });
51
82
  const [inProgress, setProgress] = useState(false);
52
83
  const [showViewAllModal, setViewAll] = useState(false);
53
84
  const [vaItems, setFullAttachments] = useState([]);
54
85
 
55
- function addAttachments(attsFromResp: Array<any> = []) {
56
- attsFromResp = attsFromResp.map((respAtt) => {
57
- const updatedAtt = {
58
- ...respAtt,
59
- meta: `${respAtt.category} . ${Utils.generateDateTime(respAtt.createTime, "DateTime-Since")}, ${
60
- respAtt.createdBy
61
- }`
62
- };
63
- if (updatedAtt.type === "FILE") {
64
- updatedAtt.nameWithExt = updatedAtt.fileName;
65
- }
66
- return updatedAtt;
67
- });
68
- return attsFromResp;
86
+ function addAttachments(attsFromResp: any[] = []) {
87
+ attsFromResp = attsFromResp.map(respAtt => {
88
+ const updatedAtt = {
89
+ ...respAtt,
90
+ meta: `${respAtt.category} . ${Utils.generateDateTime(respAtt.createTime, 'DateTime-Since')}, ${respAtt.createdBy}`
91
+ };
92
+ if (updatedAtt.type === 'FILE') {
93
+ updatedAtt.nameWithExt = updatedAtt.fileName;
94
+ }
95
+ return updatedAtt;
96
+ });
97
+ return attsFromResp;
69
98
  }
70
99
 
71
- function getListUtilityItemProps({
72
- att,
73
- cancelFile,
74
- downloadFile,
75
- deleteFile,
76
- removeFile
77
- }) {
100
+ function getListUtilityItemProps({ att, cancelFile, downloadFile, deleteFile, removeFile }) {
78
101
  let actions;
79
102
 
80
103
  if (att.progress && att.progress !== 100) {
81
104
  actions = [
82
105
  {
83
106
  id: `Cancel-${att.ID}`,
84
- text: thePConn.getLocalizedValue('Cancel'),
85
- icon: "times",
107
+ text: thePConn.getLocalizedValue('Cancel', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
108
+ icon: 'times',
86
109
  onClick: cancelFile
87
110
  }
88
111
  ];
89
112
  } else if (att.links) {
90
- const isFile = att.type === "FILE";
91
- const ID = att.ID.replace(/\s/gi, "");
113
+ const isFile = att.type === 'FILE';
114
+ const ID = att.ID.replace(/\s/gi, '');
92
115
  const actionsMap = new Map([
93
116
  [
94
- "download",
117
+ 'download',
95
118
  {
96
119
  id: `download-${ID}`,
97
- text: isFile ? thePConn.getLocalizedValue('Download') : thePConn.getLocalizedValue('Open'),
98
- icon: isFile ? "download" : "open",
120
+ text: isFile ? thePConn.getLocalizedValue('Download', '', '') : thePConn.getLocalizedValue('Open', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
121
+ icon: isFile ? 'download' : 'open',
99
122
  onClick: downloadFile
100
123
  }
101
124
  ],
102
125
  [
103
- "delete",
126
+ 'delete',
104
127
  {
105
128
  id: `Delete-${ID}`,
106
- text: thePConn.getLocalizedValue('Delete'),
107
- icon: "trash",
129
+ text: thePConn.getLocalizedValue('Delete', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
130
+ icon: 'trash',
108
131
  onClick: deleteFile
109
132
  }
110
133
  ]
@@ -119,8 +142,8 @@ export default function FileUtility(props) {
119
142
  actions = [
120
143
  {
121
144
  id: `Remove-${att.ID}`,
122
- text: thePConn.getLocalizedValue('Remove'),
123
- icon: "trash",
145
+ text: thePConn.getLocalizedValue('Remove', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
146
+ icon: 'trash',
124
147
  onClick: removeFile
125
148
  }
126
149
  ];
@@ -130,13 +153,13 @@ export default function FileUtility(props) {
130
153
  id: att.ID,
131
154
  visual: {
132
155
  icon: Utils.getIconForAttachment(att),
133
- progress: att.progress === 100 ? undefined: att.progress,
156
+ progress: att.progress === 100 ? undefined : att.progress
134
157
  },
135
158
  primary: {
136
159
  type: att.type,
137
160
  name: att.name,
138
- icon: "open",
139
- click: downloadFile,
161
+ icon: 'open',
162
+ click: downloadFile
140
163
  },
141
164
  secondary: {
142
165
  text: att.meta
@@ -148,35 +171,37 @@ export default function FileUtility(props) {
148
171
  function fileDownload(data, fileName, ext) {
149
172
  const file = ext ? `${fileName}.${ext}` : fileName;
150
173
  download(atob(data), file);
151
- };
174
+ }
152
175
 
153
176
  function downloadAttachedFile(att: any) {
154
177
  const attachUtils = PCore.getAttachmentUtils();
155
- const {ID, name, extension, type} = att;
178
+ const { ID, name, extension, type } = att;
156
179
  const context = thePConn.getContextName();
157
180
 
158
181
  attachUtils
159
- .downloadAttachment(ID, context)
160
- .then((content) => {
161
- if (type === "FILE") {
162
- fileDownload(content.data, name, extension);
163
- } else if (type === "URL") {
164
- let { data } = content;
165
- if (!/^(http|https):\/\//.test(data)) {
166
- data = `//${data}`;
182
+ // @ts-ignore - 3rd parameter "responseEncoding" is optional
183
+ .downloadAttachment(ID, context)
184
+ .then((content: any) => {
185
+ if (type === 'FILE') {
186
+ fileDownload(content.data, name, extension);
187
+ } else if (type === 'URL') {
188
+ let { data } = content;
189
+ if (!/^(http|https):\/\//.test(data)) {
190
+ data = `//${data}`;
191
+ }
192
+ window.open(content.data, '_blank');
167
193
  }
168
- window.open(content.data, "_blank");
169
- }
170
- })
171
- .catch();
194
+ })
195
+ .catch();
172
196
  }
173
197
 
174
198
  function deleteAttachedFile(att: any) {
175
199
  const attachUtils = PCore.getAttachmentUtils();
176
- const {ID} = att;
200
+ const { ID } = att;
177
201
  const context = thePConn.getContextName();
178
202
 
179
- attachUtils.deleteAttachment(ID, context)
203
+ attachUtils
204
+ .deleteAttachment(ID, context)
180
205
  .then(() => {
181
206
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
182
207
  getAttachments();
@@ -185,60 +210,57 @@ export default function FileUtility(props) {
185
210
  }
186
211
 
187
212
  const getAttachments = () => {
188
-
189
213
  const attachmentUtils = PCore.getAttachmentUtils();
190
- const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
214
+ const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
191
215
 
192
- if (caseID && caseID !== "") {
216
+ if (caseID && caseID !== '') {
193
217
  const attPromise = attachmentUtils.getCaseAttachments(caseID, thePConn.getContextName());
194
218
 
195
- attPromise
196
- .then( (resp) => {
197
- const arFullListAttachments = addAttachments(resp);
198
- const attachmentsCount = arFullListAttachments.length;
199
- const arItems: any = arFullListAttachments.slice(0, 3).map((att) => {
200
- return getListUtilityItemProps({
201
- att,
202
- downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
203
- cancelFile: null,
204
- deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
205
- removeFile: null
206
- });
219
+ attPromise.then((resp: any) => {
220
+ const arFullListAttachments = addAttachments(resp);
221
+ const attachmentsCount = arFullListAttachments.length;
222
+ const arItems: any = arFullListAttachments.slice(0, 3).map(att => {
223
+ return getListUtilityItemProps({
224
+ att,
225
+ downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
226
+ cancelFile: null,
227
+ deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
228
+ removeFile: null
207
229
  });
208
- const viewAllarItems: any = arFullListAttachments.map((att) => {
209
- return getListUtilityItemProps({
210
- att,
211
- downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
212
- cancelFile: null,
213
- deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
214
- removeFile: null
215
- });
216
- });
217
- setProgress(false);
218
- setList((current) => {
219
- return {...current, count: attachmentsCount, data: arItems}
230
+ });
231
+ const viewAllarItems: any = arFullListAttachments.map(att => {
232
+ return getListUtilityItemProps({
233
+ att,
234
+ downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
235
+ cancelFile: null,
236
+ deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
237
+ removeFile: null
220
238
  });
221
- setFullAttachments(viewAllarItems);
222
239
  });
240
+ setProgress(false);
241
+ setList(current => {
242
+ return { ...current, count: attachmentsCount, data: arItems };
243
+ });
244
+ setFullAttachments(viewAllarItems);
245
+ });
223
246
  }
224
- }
247
+ };
225
248
 
226
249
  useEffect(() => {
227
250
  getAttachments();
228
251
  }, []);
229
252
 
230
-
231
253
  useEffect(() => {
232
254
  PCore.getPubSubUtils().subscribe(
233
- PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
255
+ (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
234
256
  getAttachments,
235
- "caseAttachmentsUpdateFromCaseview"
257
+ 'caseAttachmentsUpdateFromCaseview'
236
258
  );
237
259
 
238
260
  return () => {
239
261
  PCore.getPubSubUtils().unsubscribe(
240
- PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
241
- "caseAttachmentsUpdateFromCaseview"
262
+ (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
263
+ 'caseAttachmentsUpdateFromCaseview'
242
264
  );
243
265
  };
244
266
  }, []);
@@ -246,19 +268,19 @@ export default function FileUtility(props) {
246
268
  function setNewFiles(arFiles) {
247
269
  let index = 0;
248
270
  for (const file of arFiles) {
249
- if (!validateMaxSize(file, 5)) {
271
+ if (!validateMaxSize(file, '5')) {
250
272
  file.error = true;
251
- file.meta = "File is too big. Max allowed size is 5MB.";
273
+ file.meta = 'File is too big. Max allowed size is 5MB.';
252
274
  }
253
275
  file.mimeType = file.type;
254
276
  file.icon = Utils.getIconFromFileType(file.type);
255
277
  file.ID = `${new Date().getTime()}I${index}`;
256
- index+=1;
278
+ index += 1;
257
279
  }
258
280
  return arFiles;
259
281
  }
260
282
 
261
- function getFiles(arFiles: Array<any>): Array<any> {
283
+ function getFiles(arFiles: any[]): any[] {
262
284
  return setNewFiles(arFiles);
263
285
  }
264
286
 
@@ -277,14 +299,12 @@ export default function FileUtility(props) {
277
299
  removeFile: null
278
300
  });
279
301
  });
280
- setFileData((current) => {
281
- return {...current, fileList: arFileList$, attachedFiles: myFiles}
302
+ setFileData(current => {
303
+ return { ...current, fileList: arFileList$, attachedFiles: myFiles };
282
304
  });
283
305
  }
284
306
 
285
-
286
-
287
- const handleClick = (event) => {
307
+ const handleClick = event => {
288
308
  setAnchorEl(event.currentTarget);
289
309
  };
290
310
 
@@ -293,8 +313,8 @@ export default function FileUtility(props) {
293
313
  };
294
314
 
295
315
  function onAddFilesClick() {
296
- setFileData((current) => {
297
- return {...current, showfileModal: true}
316
+ setFileData(current => {
317
+ return { ...current, showfileModal: true };
298
318
  });
299
319
  setAnchorEl(null);
300
320
  }
@@ -305,82 +325,78 @@ export default function FileUtility(props) {
305
325
  if (item !== null) {
306
326
  attachedFiles = attachedFiles.filter(ele => ele.ID !== item.id);
307
327
  fileList = fileList.filter(ele => ele.id !== item.id);
308
- setFileData((current) => {
309
- return {...current, fileList, attachedFiles}
328
+ setFileData(current => {
329
+ return { ...current, fileList, attachedFiles };
310
330
  });
311
331
  }
312
332
  }
313
333
 
314
334
  function closeFilePopup() {
315
- setFileData((current) => {
316
- return {...current, showfileModal: false}
335
+ setFileData(current => {
336
+ return { ...current, showfileModal: false };
317
337
  });
318
338
  }
319
339
 
320
340
  function onAttachFiles() {
321
341
  const attachmentUtils = PCore.getAttachmentUtils();
322
- const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
342
+ const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
323
343
  const onUploadProgress = () => {};
324
344
  const errorHandler = () => {};
325
- closeFilePopup()
326
- if (fileData.attachedFiles && fileData.attachedFiles.length > 0 ) {
345
+ closeFilePopup();
346
+ if (fileData.attachedFiles && fileData.attachedFiles.length > 0) {
327
347
  setProgress(true);
328
348
  }
329
- for (const file of fileData.attachedFiles) {
330
- attachmentUtils
331
- .uploadAttachment(
332
- file,
333
- onUploadProgress,
334
- errorHandler,
335
- thePConn.getContextName()
336
- )
337
- .then((fileResponse) => {
338
- if (fileResponse.type === "File") {
339
- attachmentUtils.linkAttachmentsToCase(
340
- caseID,
341
- [ fileResponse ],
342
- "File",
343
- thePConn.getContextName()
344
- )
345
- .then(() => {
346
- setFileData((current) => {
347
- return {...current, fileList: [], attachedFiles: []};
348
- });
349
- getAttachments();
350
- })
351
- .catch();
349
+
350
+ Promise.allSettled(
351
+ fileData.attachedFiles.map(file => attachmentUtils.uploadAttachment(file, onUploadProgress, errorHandler, thePConn.getContextName()))
352
+ )
353
+ .then((fileResponses: any) => {
354
+ const uploadedFiles: any = [];
355
+ fileResponses.forEach(fileResponse => {
356
+ if (fileResponse.status === 'fulfilled') {
357
+ uploadedFiles.push(fileResponse.value);
358
+ }
359
+ });
360
+ if (uploadedFiles.length > 0) {
361
+ (attachmentUtils.linkAttachmentsToCase(caseID, uploadedFiles, 'File', thePConn.getContextName()) as Promise<any>)
362
+ .then(() => {
363
+ setFileData(current => {
364
+ return { ...current, fileList: [], attachedFiles: [] };
365
+ });
366
+ getAttachments();
367
+ })
368
+ .catch();
352
369
  }
353
370
  })
354
371
  .catch();
355
- }
356
372
  }
357
373
 
358
374
  function onAddLinksClick() {
359
- setLinkData((current) => {
360
- return {...current, showLinkModal: true}
375
+ setLinkData(current => {
376
+ return { ...current, showLinkModal: true };
361
377
  });
362
378
  setAnchorEl(null);
363
379
  }
364
380
 
365
381
  function closeAddLinksPopup() {
366
- setLinkData((current) => {
367
- return {...current, showLinkModal: false}
382
+ setLinkData(current => {
383
+ return { ...current, showLinkModal: false };
368
384
  });
369
385
  }
370
386
 
371
- const fieldlinkOnChange = (event) => {
387
+ const fieldlinkOnChange = event => {
372
388
  const title = event.target.value;
373
- setLink((current) => {
374
- const updatedData = {...current, title};
389
+ setLink(current => {
390
+ const updatedData = { ...current, title };
375
391
  updatedData.disable = !(updatedData.title && updatedData.url);
376
392
  return updatedData;
377
393
  });
378
- }
394
+ };
379
395
 
380
396
  function fieldurlOnChange(event) {
381
397
  const url = event.target.value;
382
- setLink((current) => {
383
- const updatedData = {...current, url}
398
+ setLink(current => {
399
+ const updatedData = { ...current, url };
384
400
  updatedData.disable = !(updatedData.title && updatedData.url);
385
401
  return updatedData;
386
402
  });
@@ -391,12 +407,12 @@ export default function FileUtility(props) {
391
407
  const localList: any = linkData.linksList.slice();
392
408
  const url = link.url;
393
409
  if (!/^(http|https):\/\//.test(link.url)) {
394
- link.url = `http://${link.url}`;
410
+ link.url = `http://${link.url}`;
395
411
  }
396
412
 
397
413
  // list for display
398
414
  let oLink: any = {};
399
- oLink.icon = "chain";
415
+ oLink.icon = 'chain';
400
416
  oLink.ID = `${new Date().getTime()}`;
401
417
  oLink = getListUtilityItemProps({
402
418
  att: oLink,
@@ -405,11 +421,11 @@ export default function FileUtility(props) {
405
421
  deleteFile: null,
406
422
  removeFile: null
407
423
  });
408
- oLink.type = "URL";
424
+ oLink.type = 'URL';
409
425
  oLink.primary.type = oLink.type;
410
- oLink.visual.icon = "chain";
426
+ oLink.visual.icon = 'chain';
411
427
  oLink.primary.name = link.title;
412
- oLink.primary.icon = "open";
428
+ oLink.primary.icon = 'open';
413
429
  oLink.secondary.text = url;
414
430
 
415
431
  localList.push(oLink);
@@ -423,11 +439,15 @@ export default function FileUtility(props) {
423
439
  attachedLink.url = url;
424
440
 
425
441
  attachedListTemp.push(attachedLink);
426
- setLinkData((current) => {
427
- return {...current, linksList: localList, attachedLinks: attachedListTemp}
442
+ setLinkData(current => {
443
+ return {
444
+ ...current,
445
+ linksList: localList,
446
+ attachedLinks: attachedListTemp
447
+ };
428
448
  });
429
449
  // clear values
430
- setLink({title: '', url: '', disable: true});
450
+ setLink({ title: '', url: '', disable: true });
431
451
  }
432
452
 
433
453
  function removeLinksFromList(item: any) {
@@ -436,133 +456,190 @@ export default function FileUtility(props) {
436
456
  if (item !== null) {
437
457
  attachedLinks = attachedLinks.filter(ele => ele.id !== item.id);
438
458
  linksList = linksList.filter(ele => ele.id !== item.id);
439
- setLinkData((current) => {
440
- return {...current, linksList, attachedLinks}
459
+ setLinkData(current => {
460
+ return { ...current, linksList, attachedLinks };
441
461
  });
442
462
  }
443
463
  }
444
464
 
445
465
  function onAttachLinks() {
446
466
  const attachmentUtils = PCore.getAttachmentUtils();
447
- const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
467
+ const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
448
468
  const links = linkData.attachedLinks;
449
469
  closeAddLinksPopup();
450
470
  const linksToAttach = links.map((item: any) => ({
451
- type: "URL",
452
- category: "URL",
471
+ type: 'URL',
472
+ category: 'URL',
453
473
  url: item.url,
454
474
  name: item.linkTitle
455
475
  }));
456
476
 
457
477
  if (linksToAttach && linksToAttach.length > 0) {
458
478
  setProgress(true);
459
- attachmentUtils
460
- .linkAttachmentsToCase(caseID, linksToAttach, "URL", thePConn.getContextName())
461
- .then( () => {
462
- setLinkData((current) => {
463
- return {...current, linksList: [], attachedLinks: []};
464
- });
465
- getAttachments();
466
- })
467
- .catch(setProgress(false));
479
+ (attachmentUtils.linkAttachmentsToCase(caseID, linksToAttach, 'URL', thePConn.getContextName()) as Promise<any>)
480
+ .then(() => {
481
+ setLinkData(current => {
482
+ return { ...current, linksList: [], attachedLinks: [] };
483
+ });
484
+ getAttachments();
485
+ })
486
+ .catch(() => setProgress(false));
468
487
  }
469
488
  }
470
489
 
471
490
  return (
472
- <div className="psdk-utility">
473
- {inProgress && (<div className="progress-div"><CircularProgress /></div>)}
474
- <div className="psdk-header">
475
- <img className="psdk-file-utility-card-svg-icon" src={headerSvgIcon$}></img>
476
- <div className="header-text">{header}</div>
477
- <div className="psdk-utility-count" id="attachments-count">{list.count}</div>
478
- <div style={{flexGrow: 1}}></div>
491
+ <div className='psdk-utility'>
492
+ {inProgress && (
493
+ <div className='progress-div'>
494
+ <CircularProgress />
495
+ </div>
496
+ )}
497
+ <div className='psdk-header'>
498
+ <img className='psdk-file-utility-card-svg-icon' src={headerSvgIcon$} />
499
+ <div className='header-text'>{header}</div>
500
+ <div className='psdk-utility-count' id='attachments-count'>
501
+ {list.count}
502
+ </div>
503
+ <div style={{ flexGrow: 1 }} />
479
504
  <div>
480
505
  <IconButton
481
- id="long-button"
506
+ id='long-button'
482
507
  aria-controls={open ? 'simple-menu' : undefined}
483
508
  aria-expanded={open ? 'true' : undefined}
484
- aria-haspopup="true"
509
+ aria-haspopup='true'
485
510
  onClick={handleClick}
486
511
  >
487
- <MoreVertIcon />
512
+ <MoreVertIcon />
488
513
  </IconButton>
489
- <Menu style={{marginTop: '3rem'}}
490
- id="simple-menu"
491
- anchorEl={anchorEl}
492
- keepMounted
493
- open={Boolean(anchorEl)}
494
- onClose={handleClose}
495
- >
496
- <MenuItem style={{fontSize: '14px'}} onClick={onAddFilesClick}>{thePConn.getLocalizedValue('Add files')}</MenuItem>
497
- <MenuItem style={{fontSize: '14px'}} onClick={onAddLinksClick}>{thePConn.getLocalizedValue('Add links')}</MenuItem>
514
+ <Menu style={{ marginTop: '3rem' }} id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
515
+ <MenuItem style={{ fontSize: '14px' }} onClick={onAddFilesClick}>
516
+ {thePConn.getLocalizedValue('Add files', '', '')}
517
+ </MenuItem>{' '}
518
+ {/* 2nd and 3rd args empty string until typedef marked correctly */}
519
+ <MenuItem style={{ fontSize: '14px' }} onClick={onAddLinksClick}>
520
+ {thePConn.getLocalizedValue('Add links', '', '')}
521
+ </MenuItem>{' '}
522
+ {/* 2nd and 3rd args empty string until typedef marked correctly */}
498
523
  </Menu>
499
524
  </div>
500
525
  </div>
501
- {list.data.length > 0 && (<div style={{marginTop: '1rem'}}>
502
- <SummaryList arItems$={list.data}></SummaryList>
503
- </div>)}
504
- {list.count > 3 && (<div className="psdk-utility-view-all">
505
- <Button style={{textTransform: 'none'}} color="primary" onClick = {() => setViewAll(true)}>View all</Button>
506
- </div>)}
526
+ {list.data.length > 0 && (
527
+ <div style={{ marginTop: '1rem' }}>
528
+ <SummaryList arItems$={list.data} />
529
+ </div>
530
+ )}
531
+ {list.count > 3 && (
532
+ <div className='psdk-utility-view-all'>
533
+ <Button style={{ textTransform: 'none' }} color='primary' onClick={() => setViewAll(true)}>
534
+ View all
535
+ </Button>
536
+ </div>
537
+ )}
507
538
  {fileData.showfileModal && (
508
- <div className="psdk-dialog-background">
509
- <div className="psdk-modal-file-top">
510
- <h3>{thePConn.getLocalizedValue('Add local files')}</h3>
511
- <div className="psdk-modal-body">
512
- <div className="psdk-modal-file-selector">
513
- <label htmlFor='upload-files'>
514
- <input style={{ display: 'none' }} id='upload-files' name='upload-files' type='file' multiple onChange={uploadMyFiles}/>
515
- <Button variant='outlined' color='primary' component="span">{thePConn.getLocalizedValue('Attach files')}</Button>
516
- </label>
539
+ <div className='psdk-dialog-background'>
540
+ <div className='psdk-modal-file-top'>
541
+ <h3>{thePConn.getLocalizedValue('Add local files', '', '')}</h3>
542
+ <div className='psdk-modal-body'>
543
+ <div className='psdk-modal-file-selector'>
544
+ <label htmlFor='upload-files'>
545
+ <input style={{ display: 'none' }} id='upload-files' name='upload-files' type='file' multiple onChange={uploadMyFiles} />
546
+ <Button variant='outlined' color='primary' component='span'>
547
+ {thePConn.getLocalizedValue('Attach files', '', '')}
548
+ </Button>{' '}
549
+ {/* 2nd and 3rd args empty string until typedef marked correctly */}
550
+ </label>
551
+ </div>
552
+ {fileData.fileList.length > 0 && (
553
+ <div style={{ marginTop: '1rem' }}>
554
+ <SummaryList menuIconOverride$='trash' arItems$={fileData.fileList} menuIconOverrideAction$={removeFileFromList} />
555
+ </div>
556
+ )}
557
+ {fileData.fileList.length === 0 && <div />}
558
+ <ActionButtonsForFileUtil
559
+ arMainButtons={fileData.fileMainButtons}
560
+ arSecondaryButtons={fileData.fileSecondaryButtons}
561
+ primaryAction={onAttachFiles}
562
+ secondaryAction={closeFilePopup}
563
+ />
517
564
  </div>
518
- {fileData.fileList.length > 0 && (<div style={{marginTop: '1rem'}}>
519
- <SummaryList menuIconOverride$='trash' arItems$={fileData.fileList} menuIconOverrideAction$={removeFileFromList}></SummaryList>
520
- </div>)}
521
- {fileData.fileList.length === 0 && (<div></div>)}
522
- <ActionButtonsForFileUtil arMainButtons={fileData.fileMainButtons} arSecondaryButtons={fileData.fileSecondaryButtons}
523
- primaryAction={onAttachFiles} secondaryAction={closeFilePopup}></ActionButtonsForFileUtil>
524
565
  </div>
525
566
  </div>
526
- </div>
527
567
  )}
528
568
  {linkData.showLinkModal && (
529
- <div className="psdk-dialog-background">
530
- <div className="psdk-modal-file-top">
531
- <h3>{thePConn.getLocalizedValue('Add links')}</h3>
532
- <div className="psdk-modal-body">
533
- <div className="psdk-modal-links-row">
534
- <div className="psdk-links-two-column">
535
- <div className="psdk-modal-link-data">
536
- <TextField fullWidth variant="outlined" label="Link title" size="small" required={required} value={link.title} onChange={fieldlinkOnChange}/>
537
- </div>
538
- <div className="psdk-modal-link-data">
539
- <TextField fullWidth variant="outlined" label="URL" size="small" required={required} value={link.url} onChange={fieldurlOnChange}/>
540
- </div>
569
+ <div className='psdk-dialog-background'>
570
+ <div className='psdk-modal-file-top'>
571
+ <h3>{thePConn.getLocalizedValue('Add links', '', '')}</h3> {/* 2nd and 3rd args empty string until typedef marked correctly */}
572
+ <div className='psdk-modal-body'>
573
+ <div className='psdk-modal-links-row'>
574
+ <div className='psdk-links-two-column'>
575
+ <div className='psdk-modal-link-data'>
576
+ <TextField
577
+ fullWidth
578
+ variant='outlined'
579
+ label='Link title'
580
+ size='small'
581
+ required={required}
582
+ value={link.title}
583
+ onChange={fieldlinkOnChange}
584
+ />
541
585
  </div>
542
- <div className="psdk-modal-link-add">
543
- <Button className="psdk-add-link-action" color="primary" variant="contained" component="span" onClick={addLink} disabled={link.disable}>{thePConn.getLocalizedValue('Add link')}</Button>
586
+ <div className='psdk-modal-link-data'>
587
+ <TextField
588
+ fullWidth
589
+ variant='outlined'
590
+ label='URL'
591
+ size='small'
592
+ required={required}
593
+ value={link.url}
594
+ onChange={fieldurlOnChange}
595
+ />
544
596
  </div>
545
597
  </div>
546
- {linkData.linksList.length > 0 && (<div style={{marginTop: '1rem'}}>
547
- <SummaryList menuIconOverride$='trash' arItems$={linkData.linksList} menuIconOverrideAction$={removeLinksFromList}></SummaryList>
548
- </div>)}
549
- <ActionButtonsForFileUtil arMainButtons={linkData.linkMainButtons} arSecondaryButtons={linkData.linkSecondaryButtons}
550
- primaryAction={onAttachLinks} secondaryAction={closeAddLinksPopup}></ActionButtonsForFileUtil>
598
+ <div className='psdk-modal-link-add'>
599
+ <Button
600
+ className='psdk-add-link-action'
601
+ color='primary'
602
+ variant='contained'
603
+ component='span'
604
+ onClick={addLink}
605
+ disabled={link.disable}
606
+ >
607
+ {thePConn.getLocalizedValue('Add link', '', '')}
608
+ </Button>{' '}
609
+ {/* 2nd and 3rd args empty string until typedef marked correctly */}
610
+ </div>
611
+ </div>
612
+ {linkData.linksList.length > 0 && (
613
+ <div style={{ marginTop: '1rem' }}>
614
+ <SummaryList menuIconOverride$='trash' arItems$={linkData.linksList} menuIconOverrideAction$={removeLinksFromList} />
615
+ </div>
616
+ )}
617
+ <ActionButtonsForFileUtil
618
+ arMainButtons={linkData.linkMainButtons}
619
+ arSecondaryButtons={linkData.linkSecondaryButtons}
620
+ primaryAction={onAttachLinks}
621
+ secondaryAction={closeAddLinksPopup}
622
+ />
551
623
  </div>
552
624
  </div>
553
625
  </div>
554
626
  )}
555
- {showViewAllModal && (<div className="psdk-dialog-background">
556
- <div className="psdk-modal-file-top">
557
- <div className="psdk-view-all-header">
558
- <h3>{thePConn.getLocalizedValue('Attachments')}</h3>
627
+ {showViewAllModal && (
628
+ <div className='psdk-dialog-background'>
629
+ <div className='psdk-modal-file-top'>
630
+ <div className='psdk-view-all-header'>
631
+ <h3>{thePConn.getLocalizedValue('Attachments', '', '')}</h3> {/* 2nd and 3rd args empty string until typedef marked correctly */}
559
632
  {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
560
- <button type="button" className="psdk-close-button" onClick = {() => setViewAll(false)}><img className="psdk-utility-card-actions-svg-icon" src={closeSvgIcon}></img></button>
633
+ <button type='button' className='psdk-close-button' onClick={() => setViewAll(false)}>
634
+ <img className='psdk-utility-card-actions-svg-icon' src={closeSvgIcon} />
635
+ </button>
636
+ </div>
637
+ <div className='psdk-view-all-body'>
638
+ <SummaryList arItems$={vaItems} />
639
+ </div>
561
640
  </div>
562
- <div className="psdk-view-all-body"><SummaryList arItems$={vaItems}></SummaryList></div>
563
641
  </div>
564
- </div>)}
642
+ )}
565
643
  </div>
566
-
567
- )
644
+ );
568
645
  }