@pega/react-sdk-components 8.23.10 → 8.23.11-debug

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 (262) hide show
  1. package/lib/bridge/Context/StoreContext.d.ts +3 -2
  2. package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
  3. package/lib/bridge/Context/StoreContext.js +2 -3
  4. package/lib/bridge/Context/StoreContext.js.map +1 -1
  5. package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
  6. package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
  7. package/lib/bridge/helpers/sdk_component_map.js +22 -0
  8. package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
  9. package/lib/bridge/react_pconnect.d.ts.map +1 -1
  10. package/lib/bridge/react_pconnect.js +2 -14
  11. package/lib/bridge/react_pconnect.js.map +1 -1
  12. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +13 -0
  13. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
  14. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +26 -0
  15. package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
  16. package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
  17. package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
  18. package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
  19. package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
  20. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
  21. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +1 -1
  22. package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
  23. package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
  24. package/lib/components/designSystemExtension/Operator/Operator.js +12 -10
  25. package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
  26. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
  27. package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
  28. package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
  29. package/lib/components/field/CancelAlert/CancelAlert.js +9 -7
  30. package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
  31. package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
  32. package/lib/components/field/Checkbox/Checkbox.js +3 -3
  33. package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
  34. package/lib/components/field/Currency/currency-utils.d.ts +1 -1
  35. package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
  36. package/lib/components/field/Currency/currency-utils.js.map +1 -1
  37. package/lib/components/field/Date/Date.d.ts.map +1 -1
  38. package/lib/components/field/Date/Date.js +11 -5
  39. package/lib/components/field/Date/Date.js.map +1 -1
  40. package/lib/components/field/DateTime/DateTime.js +1 -1
  41. package/lib/components/field/DateTime/DateTime.js.map +1 -1
  42. package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
  43. package/lib/components/field/Decimal/Decimal.js +41 -8
  44. package/lib/components/field/Decimal/Decimal.js.map +1 -1
  45. package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
  46. package/lib/components/field/Dropdown/Dropdown.js +21 -7
  47. package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
  48. package/lib/components/field/Phone/Phone.d.ts.map +1 -1
  49. package/lib/components/field/Phone/Phone.js +2 -1
  50. package/lib/components/field/Phone/Phone.js.map +1 -1
  51. package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
  52. package/lib/components/field/RadioButtons/RadioButtons.js +17 -4
  53. package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
  54. package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
  55. package/lib/components/field/SemanticLink/utils.js.map +1 -1
  56. package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
  57. package/lib/components/field/TextInput/TextInput.js +20 -3
  58. package/lib/components/field/TextInput/TextInput.js.map +1 -1
  59. package/lib/components/field/Time/Time.d.ts.map +1 -1
  60. package/lib/components/field/Time/Time.js +6 -2
  61. package/lib/components/field/Time/Time.js.map +1 -1
  62. package/lib/components/field/URL/URL.d.ts.map +1 -1
  63. package/lib/components/field/URL/URL.js +6 -2
  64. package/lib/components/field/URL/URL.js.map +1 -1
  65. package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
  66. package/lib/components/field/UserReference/UserReference.js.map +1 -1
  67. package/lib/components/helpers/attachmentHelpers.d.ts +5 -5
  68. package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
  69. package/lib/components/helpers/attachmentHelpers.js +2 -2
  70. package/lib/components/helpers/attachmentHelpers.js.map +1 -1
  71. package/lib/components/helpers/auth.d.ts.map +1 -1
  72. package/lib/components/helpers/auth.js +11 -3
  73. package/lib/components/helpers/auth.js.map +1 -1
  74. package/lib/components/helpers/authManager.d.ts.map +1 -1
  75. package/lib/components/helpers/authManager.js +15 -12
  76. package/lib/components/helpers/authManager.js.map +1 -1
  77. package/lib/components/helpers/case-utils.d.ts +20 -0
  78. package/lib/components/helpers/case-utils.d.ts.map +1 -0
  79. package/lib/components/helpers/case-utils.js +81 -0
  80. package/lib/components/helpers/case-utils.js.map +1 -0
  81. package/lib/components/helpers/common-utils.d.ts +2 -0
  82. package/lib/components/helpers/common-utils.d.ts.map +1 -0
  83. package/lib/components/helpers/common-utils.js +5 -0
  84. package/lib/components/helpers/common-utils.js.map +1 -0
  85. package/lib/components/helpers/config_access.d.ts.map +1 -1
  86. package/lib/components/helpers/config_access.js +75 -82
  87. package/lib/components/helpers/config_access.js.map +1 -1
  88. package/lib/components/helpers/data_page.d.ts.map +1 -1
  89. package/lib/components/helpers/data_page.js.map +1 -1
  90. package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
  91. package/lib/components/helpers/date-format-utils.js +23 -14
  92. package/lib/components/helpers/date-format-utils.js.map +1 -1
  93. package/lib/components/helpers/event-utils.d.ts +1 -1
  94. package/lib/components/helpers/event-utils.d.ts.map +1 -1
  95. package/lib/components/helpers/event-utils.js.map +1 -1
  96. package/lib/components/helpers/field-group-utils.d.ts +15 -2
  97. package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
  98. package/lib/components/helpers/field-group-utils.js +3 -3
  99. package/lib/components/helpers/field-group-utils.js.map +1 -1
  100. package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
  101. package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
  102. package/lib/components/helpers/formatters/Boolean.js.map +1 -1
  103. package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
  104. package/lib/components/helpers/formatters/Currency.js +4 -3
  105. package/lib/components/helpers/formatters/Currency.js.map +1 -1
  106. package/lib/components/helpers/formatters/CurrencyMap.d.ts +1132 -1399
  107. package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
  108. package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
  109. package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
  110. package/lib/components/helpers/formatters/Date.js +1 -1
  111. package/lib/components/helpers/formatters/Date.js.map +1 -1
  112. package/lib/components/helpers/formatters/common.d.ts +2 -2
  113. package/lib/components/helpers/formatters/common.d.ts.map +1 -1
  114. package/lib/components/helpers/formatters/common.js +4 -5
  115. package/lib/components/helpers/formatters/common.js.map +1 -1
  116. package/lib/components/helpers/formatters/index.d.ts +1 -1
  117. package/lib/components/helpers/formatters/index.d.ts.map +1 -1
  118. package/lib/components/helpers/formatters/index.js.map +1 -1
  119. package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
  120. package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
  121. package/lib/components/helpers/reactContextHelpers.js.map +1 -1
  122. package/lib/components/helpers/simpleTableHelpers.d.ts +2 -2
  123. package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
  124. package/lib/components/helpers/simpleTableHelpers.js +5 -2
  125. package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
  126. package/lib/components/helpers/state-utils.d.ts +4 -0
  127. package/lib/components/helpers/state-utils.d.ts.map +1 -0
  128. package/lib/components/helpers/state-utils.js +36 -0
  129. package/lib/components/helpers/state-utils.js.map +1 -0
  130. package/lib/components/helpers/template-utils.d.ts.map +1 -1
  131. package/lib/components/helpers/template-utils.js +0 -1
  132. package/lib/components/helpers/template-utils.js.map +1 -1
  133. package/lib/components/helpers/utils.d.ts +1 -1
  134. package/lib/components/helpers/utils.d.ts.map +1 -1
  135. package/lib/components/helpers/utils.js +9 -3
  136. package/lib/components/helpers/utils.js.map +1 -1
  137. package/lib/components/helpers/versionHelpers.d.ts +0 -6
  138. package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
  139. package/lib/components/helpers/versionHelpers.js +0 -6
  140. package/lib/components/helpers/versionHelpers.js.map +1 -1
  141. package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
  142. package/lib/components/infra/ActionButtons/ActionButtons.js +4 -2
  143. package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
  144. package/lib/components/infra/Assignment/Assignment.d.ts +1 -0
  145. package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
  146. package/lib/components/infra/Assignment/Assignment.js +27 -15
  147. package/lib/components/infra/Assignment/Assignment.js.map +1 -1
  148. package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
  149. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +17 -9
  150. package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
  151. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
  152. package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
  153. package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
  154. package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
  155. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
  156. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +17 -8
  157. package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
  158. package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
  159. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +4 -2
  160. package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
  161. package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
  162. package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
  163. package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
  164. package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
  165. package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
  166. package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
  167. package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
  168. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +7 -4
  169. package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
  170. package/lib/components/infra/MultiStep/MultiStep.js +2 -2
  171. package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
  172. package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
  173. package/lib/components/infra/NavBar/NavBar.js +6 -4
  174. package/lib/components/infra/NavBar/NavBar.js.map +1 -1
  175. package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
  176. package/lib/components/infra/RootContainer/RootContainer.js +12 -15
  177. package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
  178. package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
  179. package/lib/components/infra/Stages/Stages.js +2 -1
  180. package/lib/components/infra/Stages/Stages.js.map +1 -1
  181. package/lib/components/infra/View/View.d.ts +1 -1
  182. package/lib/components/infra/View/View.d.ts.map +1 -1
  183. package/lib/components/infra/View/View.js +6 -34
  184. package/lib/components/infra/View/View.js.map +1 -1
  185. package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
  186. package/lib/components/template/AppShell/AppShell.js +8 -8
  187. package/lib/components/template/AppShell/AppShell.js.map +1 -1
  188. package/lib/components/template/CaseView/CaseView.d.ts +1 -1
  189. package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
  190. package/lib/components/template/CaseView/CaseView.js +37 -28
  191. package/lib/components/template/CaseView/CaseView.js.map +1 -1
  192. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +3 -1
  193. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
  194. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +13 -8
  195. package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
  196. package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
  197. package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
  198. package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
  199. package/lib/components/template/DataReference/DataReference.js.map +1 -1
  200. package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
  201. package/lib/components/template/DefaultForm/DefaultForm.js +9 -5
  202. package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
  203. package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
  204. package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
  205. package/lib/components/template/DefaultForm/utils/index.js +27 -0
  206. package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
  207. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
  208. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +1 -1
  209. package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
  210. package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
  211. package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
  212. package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
  213. package/lib/components/template/ListView/ListView.d.ts.map +1 -1
  214. package/lib/components/template/ListView/ListView.js +1 -1
  215. package/lib/components/template/ListView/ListView.js.map +1 -1
  216. package/lib/components/template/ListView/hooks.d.ts.map +1 -1
  217. package/lib/components/template/ListView/hooks.js +0 -1
  218. package/lib/components/template/ListView/hooks.js.map +1 -1
  219. package/lib/components/template/ListView/utils.d.ts +28 -16
  220. package/lib/components/template/ListView/utils.d.ts.map +1 -1
  221. package/lib/components/template/ListView/utils.js +1 -2
  222. package/lib/components/template/ListView/utils.js.map +1 -1
  223. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
  224. package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
  225. package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
  226. package/lib/components/template/PromotedFilters/PromotedFilters.js +2 -2
  227. package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
  228. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
  229. package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
  230. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
  231. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -3
  232. package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
  233. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
  234. package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
  235. package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
  236. package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
  237. package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
  238. package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
  239. package/lib/components/widget/Attachment/Attachment.css +15 -3
  240. package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
  241. package/lib/components/widget/Attachment/Attachment.js +29 -25
  242. package/lib/components/widget/Attachment/Attachment.js.map +1 -1
  243. package/lib/components/widget/CaseHistory/CaseHistory.js +3 -3
  244. package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
  245. package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
  246. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +17 -17
  247. package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
  248. package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
  249. package/lib/components/widget/QuickCreate/QuickCreate.js +2 -2
  250. package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
  251. package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
  252. package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
  253. package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
  254. package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
  255. package/lib/components/widget/ToDo/ToDo.js +10 -6
  256. package/lib/components/widget/ToDo/ToDo.js.map +1 -1
  257. package/lib/components_map.d.ts +3 -3
  258. package/lib/components_map.d.ts.map +1 -1
  259. package/lib/components_map.js +819 -818
  260. package/lib/components_map.js.map +1 -1
  261. package/lib/doc/KeyReleaseUpdates.md +44 -9
  262. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
1
  /* eslint-disable react/jsx-boolean-value */
2
- import React, { useState, useEffect, useContext } from "react";
3
- import PropTypes from "prop-types";
2
+ import React, { useState, useEffect, useContext } from 'react';
3
+ import PropTypes from 'prop-types';
4
4
  import { Utils } from '../../helpers/utils';
5
- import { Card, CardHeader, Avatar, Typography, Divider } from "@material-ui/core";
5
+ import { Card, CardHeader, Avatar, Typography, Divider } from '@material-ui/core';
6
6
  import { makeStyles } from '@material-ui/core/styles';
7
7
  import Box from '@material-ui/core/Box';
8
8
  import Button from '@material-ui/core/Button';
9
9
  import Grid from '@material-ui/core/Grid';
10
- import StoreContext from "../../../bridge/Context/StoreContext";
11
- import CaseViewActionsMenu from "../CaseViewActionsMenu";
10
+ import StoreContext from '../../../bridge/Context/StoreContext';
11
+ import CaseViewActionsMenu from '../CaseViewActionsMenu';
12
12
  import VerticalTabs from '../../infra/VerticalTabs/VerticalTabs';
13
13
  import DeferLoad from '../../infra/DeferLoad';
14
- const useStyles = makeStyles((theme) => ({
14
+ const useStyles = makeStyles(theme => ({
15
15
  root: {
16
16
  paddingRight: theme.spacing(1),
17
17
  paddingLeft: theme.spacing(1),
@@ -20,51 +20,58 @@ const useStyles = makeStyles((theme) => ({
20
20
  marginRight: theme.spacing(1),
21
21
  marginLeft: theme.spacing(1),
22
22
  marginTop: theme.spacing(1),
23
- marginBottom: theme.spacing(1),
23
+ marginBottom: theme.spacing(1)
24
24
  },
25
25
  caseViewHeader: {
26
26
  backgroundColor: theme.palette.info.light,
27
27
  color: theme.palette.getContrastText(theme.palette.info.light),
28
- borderRadius: "inherit",
28
+ borderRadius: 'inherit'
29
29
  },
30
30
  caseViewIconBox: {
31
31
  backgroundColor: theme.palette.info.dark,
32
32
  width: theme.spacing(8),
33
33
  height: theme.spacing(8),
34
- padding: theme.spacing(1),
34
+ padding: theme.spacing(1)
35
35
  },
36
36
  caseViewIconImage: {
37
37
  filter: 'invert(100%)'
38
38
  }
39
39
  }));
40
40
  export default function CaseView(props) {
41
- const { getPConnect, icon, header, subheader, children, caseInfo: { availableActions = [], availableProcesses = [], hasNewAttachments } } = props;
41
+ const { getPConnect, icon, header, subheader, children, caseInfo: { availableActions = [], availableProcesses = [], hasNewAttachments, caseTypeID = '', caseTypeName = '' } } = props;
42
42
  const currentCaseID = props.caseInfo.ID;
43
43
  let isComponentMounted = true;
44
44
  const { displayOnlyFA } = useContext(StoreContext);
45
45
  const thePConn = getPConnect();
46
46
  const classes = useStyles();
47
- const editAction = availableActions.find((action) => action.ID === 'pyUpdateCaseDetails');
47
+ const editAction = availableActions.find(action => action.ID === 'pyUpdateCaseDetails');
48
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
49
+ const localeCategory = 'CaseView';
50
+ const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();
48
51
  /**
49
52
  *
50
53
  * @param inName the metadata <em>name</em> that will cause a region to be returned
51
54
  */
52
55
  function getChildRegionByName(inName) {
53
56
  for (const child of children) {
54
- const theMetadataType = child.props.getPConnect().getRawMetadata()['type'].toLowerCase();
55
- const theMetadataName = child.props.getPConnect().getRawMetadata()['name'].toLowerCase();
56
- if ((theMetadataType === "region") && (theMetadataName === inName)) {
57
+ const theMetadataType = child.props
58
+ .getPConnect()
59
+ .getRawMetadata()['type'].toLowerCase();
60
+ const theMetadataName = child.props
61
+ .getPConnect()
62
+ .getRawMetadata()['name'].toLowerCase();
63
+ if (theMetadataType === 'region' && theMetadataName === inName) {
57
64
  return child;
58
65
  }
59
66
  }
60
67
  return null;
61
68
  }
62
- const theSummaryRegion = getChildRegionByName("summary");
63
- const theStagesRegion = getChildRegionByName("stages");
64
- const theTodoRegion = getChildRegionByName("todo");
65
- const theUtilitiesRegion = getChildRegionByName("utilities");
66
- const theTabsRegion = getChildRegionByName("tabs");
67
- const svgCase = Utils.getImageSrc(icon, PCore.getAssetLoader().getStaticServerUrl());
69
+ const theSummaryRegion = getChildRegionByName('summary');
70
+ const theStagesRegion = getChildRegionByName('stages');
71
+ const theTodoRegion = getChildRegionByName('todo');
72
+ const theUtilitiesRegion = getChildRegionByName('utilities');
73
+ const theTabsRegion = getChildRegionByName('tabs');
74
+ const svgCase = Utils.getImageSrc(icon, Utils.getSDKStaticConentUrl());
68
75
  const [activeVertTab, setActiveVertTab] = useState(0);
69
76
  // const tmpLoadData1 = { config: { label: "Details", name: "pyDetailsTabContent" }, type: "DeferLoad" };
70
77
  // const tmpLoadData2 = { config: { label: "Case History", name: "CaseHistory" }, type: "DeferLoad" };
@@ -127,9 +134,11 @@ export default function CaseView(props) {
127
134
  openLocalAction(editAction.ID, { ...editAction });
128
135
  }
129
136
  function getActionButtonsHtml() {
130
- const aBHtml = React.createElement(Box, null,
131
- editAction && (React.createElement(Button, { onClick: () => { _editClick(); } }, "Edit")),
132
- React.createElement(CaseViewActionsMenu, { getPConnect: getPConnect, availableActions: availableActions, availableProcesses: availableProcesses }));
137
+ const aBHtml = (React.createElement(Box, null,
138
+ editAction && (React.createElement(Button, { onClick: () => {
139
+ _editClick();
140
+ } }, localizedVal('Edit', localeCategory))),
141
+ React.createElement(CaseViewActionsMenu, { getPConnect: getPConnect, availableActions: availableActions, availableProcesses: availableProcesses, caseTypeName: caseTypeName, caseTypeID: caseTypeID })));
133
142
  return aBHtml;
134
143
  }
135
144
  function getContainerContents() {
@@ -137,9 +146,9 @@ export default function CaseView(props) {
137
146
  // show full portal
138
147
  return (React.createElement(Grid, { container: true },
139
148
  React.createElement(Grid, { item: true, xs: 3 },
140
- React.createElement("div", { hidden: true, id: "current-caseID" }, currentCaseID),
149
+ React.createElement("div", { hidden: true, id: 'current-caseID' }, currentCaseID),
141
150
  React.createElement(Card, { className: classes.root },
142
- React.createElement(CardHeader, { className: classes.caseViewHeader, title: React.createElement(Typography, { variant: "h6", component: "div" }, header), subheader: React.createElement(Typography, { variant: "body1", component: "div", id: "caseId" }, subheader), avatar: React.createElement(Avatar, { className: classes.caseViewIconBox, variant: "square" },
151
+ React.createElement(CardHeader, { className: classes.caseViewHeader, title: React.createElement(Typography, { variant: 'h6', component: 'div' }, PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)), subheader: React.createElement(Typography, { variant: 'body1', component: 'div', id: 'caseId' }, subheader), avatar: React.createElement(Avatar, { className: classes.caseViewIconBox, variant: 'square' },
143
152
  React.createElement("img", { src: svgCase, className: classes.caseViewIconImage })) }),
144
153
  getActionButtonsHtml(),
145
154
  React.createElement(Divider, null),
@@ -149,7 +158,7 @@ export default function CaseView(props) {
149
158
  React.createElement(Grid, { item: true, xs: 6 },
150
159
  theStagesRegion,
151
160
  theTodoRegion,
152
- deferLoadInfo.length > 0 && React.createElement(DeferLoad, { getPConnect: getPConnect, name: deferLoadInfo[activeVertTab].config.name, isTab: true })),
161
+ deferLoadInfo.length > 0 && (React.createElement(DeferLoad, { getPConnect: getPConnect, name: deferLoadInfo[activeVertTab].config.name, isTab: true }))),
153
162
  React.createElement(Grid, { item: true, xs: 3 }, theUtilitiesRegion)));
154
163
  }
155
164
  else {
@@ -158,10 +167,10 @@ export default function CaseView(props) {
158
167
  React.createElement(Grid, { item: true, xs: 12 }, theTodoRegion)));
159
168
  }
160
169
  }
161
- return (getContainerContents());
170
+ return getContainerContents();
162
171
  }
163
172
  CaseView.defaultProps = {
164
- icon: "",
173
+ icon: '',
165
174
  children: [],
166
175
  caseInfo: {},
167
176
  showIconInHeader: true,
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../../src/components/template/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAE1C,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,YAAY,MAAM,uCAAuC,CAAC;AACjE,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAK9C,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE;QACJ,YAAY,EAAE,KA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;oBACZ,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,oBAAC,SAAS,IAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,IAAI,EAAG,KAAK,SAAG,CACvH;gBAEP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,IACb,kBAAkB,CACd,CACF,CACN,CAAA;SACF;aAAM;YACL,8CAA8C;YAC9C,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS;gBACb,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,IACd,aAAa,CACT,CACF,CACR,CAAA;SACF;IACH,CAAC;IAGD,OAAO,CACH,oBAAoB,EAAE,CACzB,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,YAAY,GAAG;IACtB,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,QAAQ,CAAC,SAAS,GAAG;IACnB,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;IAC3C,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACtC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACnC,gBAAgB,EAAE,SAAS,CAAC,IAAI;IAChC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;CAC5B,CAAC","sourcesContent":["/* eslint-disable react/jsx-boolean-value */\n\nimport React, { useState, useEffect, useContext } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Utils } from '../../helpers/utils';\nimport { Card, CardHeader, Avatar, Typography, Divider } from \"@material-ui/core\";\nimport { makeStyles } from '@material-ui/core/styles';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\n\nimport StoreContext from \"../../../bridge/Context/StoreContext\";\nimport CaseViewActionsMenu from \"../CaseViewActionsMenu\";\nimport VerticalTabs from '../../infra/VerticalTabs/VerticalTabs';\nimport DeferLoad from '../../infra/DeferLoad';\n\n\ndeclare const PCore;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n caseViewHeader: {\n backgroundColor: theme.palette.info.light,\n color: theme.palette.getContrastText(theme.palette.info.light),\n borderRadius: \"inherit\",\n },\n caseViewIconBox: {\n backgroundColor: theme.palette.info.dark,\n width: theme.spacing(8),\n height: theme.spacing(8),\n padding: theme.spacing(1),\n },\n caseViewIconImage: {\n filter: 'invert(100%)'\n }\n}));\n\nexport default function CaseView(props) {\n const {\n getPConnect,\n icon,\n header,\n subheader,\n children,\n caseInfo: { availableActions = [], availableProcesses = [], hasNewAttachments }\n } = props;\n const currentCaseID = props.caseInfo.ID;\n let isComponentMounted = true;\n\n const { displayOnlyFA } = useContext(StoreContext);\n\n const thePConn = getPConnect();\n\n const classes = useStyles();\n\n const editAction = availableActions.find((action) => action.ID === 'pyUpdateCaseDetails');\n\n /**\n *\n * @param inName the metadata <em>name</em> that will cause a region to be returned\n */\n function getChildRegionByName(inName: string): any {\n\n for (const child of children) {\n const theMetadataType: string = child.props.getPConnect().getRawMetadata()['type'].toLowerCase();\n const theMetadataName: string = child.props.getPConnect().getRawMetadata()['name'].toLowerCase();\n\n if ((theMetadataType === \"region\") && (theMetadataName === inName )) {\n return child;\n }\n }\n\n return null;\n }\n\n\n const theSummaryRegion = getChildRegionByName(\"summary\");\n const theStagesRegion = getChildRegionByName(\"stages\");\n const theTodoRegion = getChildRegionByName(\"todo\");\n const theUtilitiesRegion = getChildRegionByName(\"utilities\");\n const theTabsRegion = getChildRegionByName(\"tabs\");\n\n const svgCase = Utils.getImageSrc(icon, PCore.getAssetLoader().getStaticServerUrl());\n\n const [activeVertTab, setActiveVertTab] = useState(0);\n\n // const tmpLoadData1 = { config: { label: \"Details\", name: \"pyDetailsTabContent\" }, type: \"DeferLoad\" };\n // const tmpLoadData2 = { config: { label: \"Case History\", name: \"CaseHistory\" }, type: \"DeferLoad\" };\n\n // Extract the tabs we need to display from theTabsRegion (one tab per entry in theTabsRegionChildren)\n const theTabsRegionChildren = theTabsRegion.props.getPConnect().getChildren();\n\n // vertTabInfo is sent to VerticalTabs component\n const vertTabInfo: Array<Object> = [];\n\n // deferLoadInfo is sent to DeferLoad component (currently selected entry)\n const deferLoadInfo: Array<any> = [];\n\n if (theTabsRegionChildren) {\n // populate vertTabInfo and deferLoadInfo\n theTabsRegionChildren.forEach((tabComp, index) => {\n const theTabCompConfig = tabComp.getPConnect().getConfigProps();\n // eslint-disable-next-line prefer-const\n let { label, inheritedProps } = theTabCompConfig;\n // For some tabs, \"label\" property is not avaialable in theTabCompConfig, so will get them from inheritedProps\n if (!label) {\n inheritedProps.forEach(inheritedProp => {\n if (inheritedProp.prop === 'label') {\n label = inheritedProp.value;\n }\n });\n }\n // We'll display the tabs when either visibility property doesn't exist or is true(if exists)\n if (theTabCompConfig.visibility === undefined || theTabCompConfig.visibility === true) {\n vertTabInfo.push({ name: label, id: index });\n deferLoadInfo.push({ type: 'DeferLoad', config: theTabCompConfig });\n }\n });\n }\n\n\n\n function handleVerticalTabClick(eventDetail: any) {\n const theItem = parseInt(eventDetail.additionalData.itemClicked, 10);\n\n // only call useEffectSetter if the component is mounted\n if (isComponentMounted) {\n setActiveVertTab(theItem);\n }\n }\n\n\n // Add and Remove event listener for VerticalTabClick only at startup and teardown\n useEffect(() => {\n document.addEventListener('VerticalTabClick', (event: any) => {\n handleVerticalTabClick(event.detail);\n });\n\n return ():void => {\n // inform that the component is unmounted so other code can\n // know not to try to call useState setters (to avoid console warnings)\n isComponentMounted = false;\n\n document.removeEventListener('VerticalTabClick', (event: any) => {\n handleVerticalTabClick(event.detail);\n });\n }\n }, [])\n\n useEffect(() => {\n if (hasNewAttachments) {\n PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);\n }\n }, [hasNewAttachments]);\n\n function _editClick() {\n\n const actionsAPI = thePConn.getActionsApi();\n const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);\n\n openLocalAction( editAction.ID, { ...editAction});\n }\n\n\n function getActionButtonsHtml(): any {\n\n const aBHtml = <Box>\n {editAction && (<Button onClick={() => {_editClick()}}>Edit</Button>)}\n <CaseViewActionsMenu getPConnect={getPConnect} availableActions={availableActions} availableProcesses={availableProcesses} />\n </Box>;\n\n\n return aBHtml;\n\n }\n\n\n function getContainerContents() {\n\n if (!displayOnlyFA) {\n // show full portal\n return (\n <Grid container>\n <Grid item xs={3}>\n <div hidden={true} id=\"current-caseID\">{currentCaseID}</div>\n <Card className={classes.root} >\n <CardHeader className={classes.caseViewHeader}\n title={<Typography variant=\"h6\" component=\"div\">{header}</Typography>}\n subheader={<Typography variant=\"body1\" component=\"div\" id=\"caseId\">{subheader}</Typography>}\n avatar={\n <Avatar className={classes.caseViewIconBox} variant=\"square\">\n <img src={svgCase} className={classes.caseViewIconImage}/>\n </Avatar>\n }\n />\n {getActionButtonsHtml()}\n <Divider />\n {theSummaryRegion}\n <Divider />\n { vertTabInfo.length > 1 && <VerticalTabs tabconfig={vertTabInfo} />}\n </Card>\n </Grid>\n\n <Grid item xs={6}>\n {theStagesRegion}\n {theTodoRegion}\n { deferLoadInfo.length > 0 && <DeferLoad getPConnect={getPConnect} name={deferLoadInfo[activeVertTab].config.name } isTab />}\n </Grid>\n\n <Grid item xs={3}>\n {theUtilitiesRegion}\n </Grid>\n </Grid>\n )\n } else {\n // displayOnlyFA - only show the \"todo\" region\n return (\n <Grid container>\n <Grid item xs={12}>\n {theTodoRegion}\n </Grid>\n </Grid>\n )\n }\n }\n\n\n return (\n getContainerContents()\n );\n}\n\nCaseView.defaultProps = {\n icon: \"\",\n children: [],\n caseInfo: {},\n showIconInHeader: true,\n getPConnect: null\n};\n\nCaseView.propTypes = {\n icon: PropTypes.string,\n children: PropTypes.arrayOf(PropTypes.node),\n subheader: PropTypes.string.isRequired,\n header: PropTypes.string.isRequired,\n showIconInHeader: PropTypes.bool,\n caseInfo: PropTypes.objectOf(PropTypes.any),\n getPConnect: PropTypes.func\n};\n"]}
1
+ {"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../../src/components/template/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAE1C,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,YAAY,MAAM,uCAAuC,CAAC;AACjE,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAM9C,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,EAAE;QACJ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QA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SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;CAC5B,CAAC","sourcesContent":["/* eslint-disable react/jsx-boolean-value */\n\nimport React, { useState, useEffect, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { Utils } from '../../helpers/utils';\nimport { Card, CardHeader, Avatar, Typography, Divider } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\n\nimport StoreContext from '../../../bridge/Context/StoreContext';\nimport CaseViewActionsMenu from '../CaseViewActionsMenu';\nimport VerticalTabs from '../../infra/VerticalTabs/VerticalTabs';\nimport DeferLoad from '../../infra/DeferLoad';\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 2 errors)\ndeclare const PCore: any;\n\n\nconst useStyles = makeStyles(theme => ({\n root: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n caseViewHeader: {\n backgroundColor: theme.palette.info.light,\n color: theme.palette.getContrastText(theme.palette.info.light),\n borderRadius: 'inherit'\n },\n caseViewIconBox: {\n backgroundColor: theme.palette.info.dark,\n width: theme.spacing(8),\n height: theme.spacing(8),\n padding: theme.spacing(1)\n },\n caseViewIconImage: {\n filter: 'invert(100%)'\n }\n}));\n\nexport default function CaseView(props) {\n const {\n getPConnect,\n icon,\n header,\n subheader,\n children,\n caseInfo: {\n availableActions = [],\n availableProcesses = [],\n hasNewAttachments,\n caseTypeID = '',\n caseTypeName = ''\n }\n } = props;\n const currentCaseID = props.caseInfo.ID;\n let isComponentMounted = true;\n\n const { displayOnlyFA } = useContext<any>(StoreContext);\n\n const thePConn = getPConnect();\n\n const classes = useStyles();\n\n const editAction = availableActions.find(action => action.ID === 'pyUpdateCaseDetails');\n\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'CaseView';\n const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();\n\n /**\n *\n * @param inName the metadata <em>name</em> that will cause a region to be returned\n */\n function getChildRegionByName(inName: string): any {\n for (const child of children) {\n const theMetadataType: string = child.props\n .getPConnect()\n .getRawMetadata()\n ['type'].toLowerCase();\n const theMetadataName: string = child.props\n .getPConnect()\n .getRawMetadata()\n ['name'].toLowerCase();\n\n if (theMetadataType === 'region' && theMetadataName === inName) {\n return child;\n }\n }\n\n return null;\n }\n\n const theSummaryRegion = getChildRegionByName('summary');\n const theStagesRegion = getChildRegionByName('stages');\n const theTodoRegion = getChildRegionByName('todo');\n const theUtilitiesRegion = getChildRegionByName('utilities');\n const theTabsRegion = getChildRegionByName('tabs');\n\n const svgCase = Utils.getImageSrc(icon, Utils.getSDKStaticConentUrl());\n\n const [activeVertTab, setActiveVertTab] = useState(0);\n\n // const tmpLoadData1 = { config: { label: \"Details\", name: \"pyDetailsTabContent\" }, type: \"DeferLoad\" };\n // const tmpLoadData2 = { config: { label: \"Case History\", name: \"CaseHistory\" }, type: \"DeferLoad\" };\n\n // Extract the tabs we need to display from theTabsRegion (one tab per entry in theTabsRegionChildren)\n const theTabsRegionChildren = theTabsRegion.props.getPConnect().getChildren();\n\n // vertTabInfo is sent to VerticalTabs component\n const vertTabInfo: Array<Object> = [];\n\n // deferLoadInfo is sent to DeferLoad component (currently selected entry)\n const deferLoadInfo: Array<any> = [];\n\n if (theTabsRegionChildren) {\n // populate vertTabInfo and deferLoadInfo\n theTabsRegionChildren.forEach((tabComp, index) => {\n const theTabCompConfig = tabComp.getPConnect().getConfigProps();\n // eslint-disable-next-line prefer-const\n let { label, inheritedProps } = theTabCompConfig;\n // For some tabs, \"label\" property is not avaialable in theTabCompConfig, so will get them from inheritedProps\n if (!label) {\n inheritedProps.forEach(inheritedProp => {\n if (inheritedProp.prop === 'label') {\n label = inheritedProp.value;\n }\n });\n }\n // We'll display the tabs when either visibility property doesn't exist or is true(if exists)\n if (theTabCompConfig.visibility === undefined || theTabCompConfig.visibility === true) {\n vertTabInfo.push({ name: label, id: index });\n deferLoadInfo.push({ type: 'DeferLoad', config: theTabCompConfig });\n }\n });\n }\n\n function handleVerticalTabClick(eventDetail: any) {\n const theItem = parseInt(eventDetail.additionalData.itemClicked, 10);\n\n // only call useEffectSetter if the component is mounted\n if (isComponentMounted) {\n setActiveVertTab(theItem);\n }\n }\n\n // Add and Remove event listener for VerticalTabClick only at startup and teardown\n useEffect(() => {\n document.addEventListener('VerticalTabClick', (event: any) => {\n handleVerticalTabClick(event.detail);\n });\n\n return (): void => {\n // inform that the component is unmounted so other code can\n // know not to try to call useState setters (to avoid console warnings)\n isComponentMounted = false;\n\n document.removeEventListener('VerticalTabClick', (event: any) => {\n handleVerticalTabClick(event.detail);\n });\n };\n }, []);\n\n useEffect(() => {\n if (hasNewAttachments) {\n PCore.getPubSubUtils().publish(\n PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,\n true\n );\n }\n }, [hasNewAttachments]);\n\n function _editClick() {\n const actionsAPI = thePConn.getActionsApi();\n const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);\n\n openLocalAction(editAction.ID, { ...editAction });\n }\n\n function getActionButtonsHtml(): any {\n const aBHtml = (\n <Box>\n {editAction && (\n <Button\n onClick={() => {\n _editClick();\n }}\n >\n {localizedVal('Edit', localeCategory)}\n </Button>\n )}\n <CaseViewActionsMenu\n getPConnect={getPConnect}\n availableActions={availableActions}\n availableProcesses={availableProcesses}\n caseTypeName={caseTypeName}\n caseTypeID={caseTypeID}\n />\n </Box>\n );\n\n return aBHtml;\n }\n\n function getContainerContents() {\n if (!displayOnlyFA) {\n // show full portal\n return (\n <Grid container>\n <Grid item xs={3}>\n <div hidden={true} id='current-caseID'>\n {currentCaseID}\n </div>\n <Card className={classes.root}>\n <CardHeader\n className={classes.caseViewHeader}\n title={\n <Typography variant='h6' component='div'>\n {PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}\n </Typography>\n }\n subheader={\n <Typography variant='body1' component='div' id='caseId'>\n {subheader}\n </Typography>\n }\n avatar={\n <Avatar className={classes.caseViewIconBox} variant='square'>\n <img src={svgCase} className={classes.caseViewIconImage} />\n </Avatar>\n }\n />\n {getActionButtonsHtml()}\n <Divider />\n {theSummaryRegion}\n <Divider />\n {vertTabInfo.length > 1 && <VerticalTabs tabconfig={vertTabInfo} />}\n </Card>\n </Grid>\n\n <Grid item xs={6}>\n {theStagesRegion}\n {theTodoRegion}\n {deferLoadInfo.length > 0 && (\n <DeferLoad\n getPConnect={getPConnect}\n name={deferLoadInfo[activeVertTab].config.name}\n isTab\n />\n )}\n </Grid>\n\n <Grid item xs={3}>\n {theUtilitiesRegion}\n </Grid>\n </Grid>\n );\n } else {\n // displayOnlyFA - only show the \"todo\" region\n return (\n <Grid container>\n <Grid item xs={12}>\n {theTodoRegion}\n </Grid>\n </Grid>\n );\n }\n }\n\n return getContainerContents();\n}\n\nCaseView.defaultProps = {\n icon: '',\n children: [],\n caseInfo: {},\n showIconInHeader: true,\n getPConnect: null\n};\n\nCaseView.propTypes = {\n icon: PropTypes.string,\n children: PropTypes.arrayOf(PropTypes.node),\n subheader: PropTypes.string.isRequired,\n header: PropTypes.string.isRequired,\n showIconInHeader: PropTypes.bool,\n caseInfo: PropTypes.objectOf(PropTypes.any),\n getPConnect: PropTypes.func\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import PropTypes from "prop-types";
2
+ import PropTypes from 'prop-types';
3
3
  declare function CaseViewActionsMenu(props: any): JSX.Element;
4
4
  declare namespace CaseViewActionsMenu {
5
5
  var defaultProps: {
@@ -10,6 +10,8 @@ declare namespace CaseViewActionsMenu {
10
10
  getPConnect: PropTypes.Validator<(...args: any[]) => any>;
11
11
  availableActions: PropTypes.Requireable<(object | null | undefined)[]>;
12
12
  availableProcesses: PropTypes.Requireable<any[]>;
13
+ caseTypeID: PropTypes.Requireable<string>;
14
+ caseTypeName: PropTypes.Requireable<string>;
13
15
  };
14
16
  }
15
17
  export default CaseViewActionsMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseViewActionsMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,iBAAwB,mBAAmB,CAAC,KAAK,KAAA,eAuDhD;kBAvDuB,mBAAmB;;;;;;;;;;;eAAnB,mBAAmB"}
1
+ {"version":3,"file":"CaseViewActionsMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,iBAAwB,mBAAmB,CAAC,KAAK,KAAA,eAyDhD;kBAzDuB,mBAAmB;;;;;;;;;;;;;eAAnB,mBAAmB"}
@@ -1,11 +1,14 @@
1
1
  import React, { useState } from 'react';
2
- import PropTypes from "prop-types";
2
+ import PropTypes from 'prop-types';
3
3
  import Button from '@material-ui/core/Button';
4
4
  import Menu from '@material-ui/core/Menu';
5
5
  import MenuItem from '@material-ui/core/MenuItem';
6
6
  export default function CaseViewActionsMenu(props) {
7
- const { getPConnect, availableActions, availableProcesses } = props;
7
+ const { getPConnect, availableActions, availableProcesses, caseTypeID, caseTypeName } = props;
8
8
  const thePConn = getPConnect();
9
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
10
+ const localeCategory = 'CaseView';
11
+ const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();
9
12
  const [anchorEl, setAnchorEl] = useState(null);
10
13
  const handleClick = (event) => {
11
14
  setAnchorEl(event.currentTarget);
@@ -21,15 +24,15 @@ export default function CaseViewActionsMenu(props) {
21
24
  // after doing the action, close the menu...
22
25
  handleClose();
23
26
  }
24
- availableActions.forEach((action) => {
25
- arMenuItems.push(React.createElement(MenuItem, { key: action.ID, onClick: () => _actionMenuActionsClick(action) }, action.name));
27
+ availableActions.forEach(action => {
28
+ arMenuItems.push(React.createElement(MenuItem, { key: action.ID, onClick: () => _actionMenuActionsClick(action) }, localizedVal(action.name, '', localeKey)));
26
29
  });
27
- availableProcesses.forEach((process) => {
30
+ availableProcesses.forEach(process => {
28
31
  arMenuItems.push(React.createElement(MenuItem, { onClick: handleClose }, process.name));
29
32
  });
30
33
  return (React.createElement(React.Fragment, null,
31
- React.createElement(Button, { "aria-controls": "simple-menu", "aria-haspopup": "true", onClick: handleClick }, "Actions..."),
32
- React.createElement(Menu, { id: "simple-menu", anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleClose }, arMenuItems)));
34
+ React.createElement(Button, { "aria-controls": 'simple-menu', "aria-haspopup": 'true', onClick: handleClick }, localizedVal('Actions...', localeCategory)),
35
+ React.createElement(Menu, { id: 'simple-menu', anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleClose }, arMenuItems)));
33
36
  }
34
37
  CaseViewActionsMenu.defaultProps = {
35
38
  availableActions: [],
@@ -38,6 +41,8 @@ CaseViewActionsMenu.defaultProps = {
38
41
  CaseViewActionsMenu.propTypes = {
39
42
  getPConnect: PropTypes.func.isRequired,
40
43
  availableActions: PropTypes.arrayOf(PropTypes.object),
41
- availableProcesses: PropTypes.arrayOf(PropTypes.any)
44
+ availableProcesses: PropTypes.arrayOf(PropTypes.any),
45
+ caseTypeID: PropTypes.string,
46
+ caseTypeName: PropTypes.string
42
47
  };
43
48
  //# sourceMappingURL=CaseViewActionsMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseViewActionsMenu.js","sourceRoot":"","sources":["../../../../src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE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AM,CAAC,IAAI,CAAY,CAAE,CAAA;IACxH,CAAC,CAAC,CAAC;IAEH,kBAAkB,CAAC,OAAO,CAAE,CAAC,OAAO,EAAE,EAAE;QACtC,WAAW,CAAC,IAAI,CAAE,oBAAC,QAAQ,IAAC,OAAO,EAAE,WAAW,IAAG,OAAO,CAAC,IAAI,CAAY,CAAE,CAAA;IAC/E,CAAC,CAAC,CAAC;IAGH,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ;QACb,oBAAC,MAAM,qBAAe,aAAa,mBAAe,MAAM,EAAC,OAAO,EAAE,WAAW,iBAEpE;QACT,oBAAC,IAAI,IACH,EAAE,EAAC,aAAa,EAChB,QAAQ,EAAE,QAAQ,EAClB,WAAW,QACX,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EACvB,OAAO,EAAE,WAAW,IAEnB,WAAW,CACP,CACQ,CAClB,CAAC;AACJ,CAAC;AAED,mBAAmB,CAAC,YAAY,GAAG;IACjC,gBAAgB,EAAE,EAAE;IACpB,kBAAkB,EAAE,EAAE;CACvB,CAAA;AAED,mBAAmB,CAAC,SAAS,GAAG;IAC9B,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,gBAAgB,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IACrD,kBAAkB,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;CACrD,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from \"prop-types\";\nimport Button from '@material-ui/core/Button';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nexport default function CaseViewActionsMenu(props) {\n const {getPConnect, availableActions, availableProcesses} = props;\n const thePConn = getPConnect();\n\n\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const arMenuItems: Array<any> = [];\n\n\n function _actionMenuActionsClick(data) {\n\n const actionsAPI = thePConn.getActionsApi();\n const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);\n\n openLocalAction( data.ID, { ...data, containerName: 'modal', type: 'express'});\n // after doing the action, close the menu...\n handleClose();\n\n }\n\n\n availableActions.forEach( (action) => {\n arMenuItems.push( <MenuItem key={action.ID} onClick={() => _actionMenuActionsClick(action)}>{action.name}</MenuItem> )\n });\n\n availableProcesses.forEach( (process) => {\n arMenuItems.push( <MenuItem onClick={handleClose}>{process.name}</MenuItem> )\n });\n\n\n return (\n <React.Fragment>\n <Button aria-controls=\"simple-menu\" aria-haspopup=\"true\" onClick={handleClick}>\n Actions...\n </Button>\n <Menu\n id=\"simple-menu\"\n anchorEl={anchorEl}\n keepMounted\n open={Boolean(anchorEl)}\n onClose={handleClose}\n >\n {arMenuItems}\n </Menu>\n </React.Fragment>\n );\n}\n\nCaseViewActionsMenu.defaultProps = {\n availableActions: [],\n availableProcesses: []\n}\n\nCaseViewActionsMenu.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n availableActions: PropTypes.arrayOf(PropTypes.object),\n availableProcesses: PropTypes.arrayOf(PropTypes.any)\n};\n"]}
1
+ {"version":3,"file":"CaseViewActionsMenu.js","sourceRoot":"","sources":["../../../../src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAOlD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK;IAC/C,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,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,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACnC,WAAW,CAAC,IAAI,CAAC,oBAAC,QAAQ,IAAC,OAAO,EAAE,WAAW,IAAG,OAAO,CAAC,IAAI,CAAY,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ;QACb,oBAAC,MAAM,qBAAe,aAAa,mBAAe,MAAM,EAAC,OAAO,EAAE,WAAW,IAC1E,YAAY,CAAC,YAAY,EAAE,cAAc,CAAC,CACpC;QACT,oBAAC,IAAI,IACH,EAAE,EAAC,aAAa,EAChB,QAAQ,EAAE,QAAQ,EAClB,WAAW,QACX,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EACvB,OAAO,EAAE,WAAW,IAEnB,WAAW,CACP,CACQ,CAClB,CAAC;AACJ,CAAC;AAED,mBAAmB,CAAC,YAAY,GAAG;IACjC,gBAAgB,EAAE,EAAE;IACpB,kBAAkB,EAAE,EAAE;CACvB,CAAC;AAEF,mBAAmB,CAAC,SAAS,GAAG;IAC9B,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,gBAAgB,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IACrD,kBAAkB,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;IACpD,UAAU,EAAE,SAAS,CAAC,MAAM;IAC5B,YAAY,EAAE,SAAS,CAAC,MAAM;CAC/B,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@material-ui/core/Button';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\n\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nexport default function CaseViewActionsMenu(props) {\n const { getPConnect, availableActions, availableProcesses, caseTypeID, caseTypeName } = props;\n const thePConn = getPConnect();\n\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'CaseView';\n const localeKey = `${caseTypeID}!CASE!${caseTypeName}`.toUpperCase();\n\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const arMenuItems: Array<any> = [];\n\n function _actionMenuActionsClick(data) {\n const actionsAPI = thePConn.getActionsApi();\n const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);\n\n openLocalAction(data.ID, { ...data, containerName: 'modal', type: 'express' });\n // after doing the action, close the menu...\n handleClose();\n }\n\n availableActions.forEach(action => {\n arMenuItems.push(\n <MenuItem key={action.ID} onClick={() => _actionMenuActionsClick(action)}>\n {localizedVal(action.name, '', localeKey)}\n </MenuItem>\n );\n });\n\n availableProcesses.forEach(process => {\n arMenuItems.push(<MenuItem onClick={handleClose}>{process.name}</MenuItem>);\n });\n\n return (\n <React.Fragment>\n <Button aria-controls='simple-menu' aria-haspopup='true' onClick={handleClick}>\n {localizedVal('Actions...', localeCategory)}\n </Button>\n <Menu\n id='simple-menu'\n anchorEl={anchorEl}\n keepMounted\n open={Boolean(anchorEl)}\n onClose={handleClose}\n >\n {arMenuItems}\n </Menu>\n </React.Fragment>\n );\n}\n\nCaseViewActionsMenu.defaultProps = {\n availableActions: [],\n availableProcesses: []\n};\n\nCaseViewActionsMenu.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n availableActions: PropTypes.arrayOf(PropTypes.object),\n availableProcesses: PropTypes.arrayOf(PropTypes.any),\n caseTypeID: PropTypes.string,\n caseTypeName: PropTypes.string\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAIA,OAAO,SAAS,MAAM,YAAY,CAAC;AAsBnC,iBAAwB,YAAY,CAAC,KAAK,KAAA,sBA6DzC;kBA7DuB,YAAY;;;;;;;;;;;;;;;eAAZ,YAAY"}
1
+ {"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAIA,OAAO,SAAS,MAAM,YAAY,CAAC;AAyBnC,iBAAwB,YAAY,CAAC,KAAK,KAAA,sBA6DzC;kBA7DuB,YAAY;;;;;;;;;;;;;;;eAAZ,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,mCAAmC;AACnC,sCAAsC;AACtC,OAAO,EAAY,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI7D,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,EAAE;QACJ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5B,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/B,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5B,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CA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AAC,IAAI,OACC,KAAK,EACT,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAChC,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,UAAU,EAAC,OAAO,EAClB,SAAS,SACT,CACG,CACR,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,YAAY,CAAC,YAAY,GAAG;IAC1B,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF,YAAY,CAAC,SAAS,GAAG;IACvB,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC7C,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-nested-ternary */\nimport { Fragment, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getToDoAssignments } from '../../infra/Containers/FlowContainer/helpers';\nimport ToDo from '../../widget/ToDo';\nimport Details from '../Details/Details';\nimport { Button, Card, makeStyles } from '@material-ui/core';\n\ndeclare const PCore;\n\nconst useStyles = makeStyles(theme => ({\n root: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n }\n}));\n\nexport default function Confirmation(props) {\n const classes = useStyles();\n const CONSTS = PCore.getConstants();\n const [showConfirmView, setShowConfirmView] = useState(true);\n const { showTasks, getPConnect, datasource } = props;\n // Get the inherited props from the parent to determine label settings\n // Not using whatsNext at the moment, need to figure out the use of it\n const whatsNext = datasource?.source;\n const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';\n const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(\n getPConnect().getTarget()\n );\n const rootInfo = PCore.getContainerUtils().getContainerItemData(\n getPConnect().getTarget(),\n activeContainerItemID\n );\n const onConfirmViewClose = () => {\n setShowConfirmView(false);\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,\n rootInfo\n );\n };\n const todoProps = { ...props, renderTodoInConfirm: true };\n const toDoList = getToDoAssignments(getPConnect());\n const detailProps = { ...props, showLabel: false };\n const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;\n return showConfirmView ? (\n <Card className={classes.root}>\n <h2 id='confirm-label'>{props.showLabel ? props.label : ''}</h2>\n {showDetails ? <Details {...detailProps} /> : undefined}\n {showTasks ? (\n toDoList && toDoList.length > 0 ? (\n <ToDo\n {...todoProps}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Open Tasks'\n isConfirm\n />\n ) : undefined\n ) : undefined}\n <div style={{ display: 'flex', justifyContent: 'flex-end' }}>\n <Button variant='contained' color='primary' onClick={onConfirmViewClose}>\n Done\n </Button>\n </div>\n </Card>\n ) : toDoList && toDoList.length > 0 ? (\n <Card className={classes.root}>\n <ToDo\n {...props}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Tasks'\n isConfirm\n />\n </Card>\n ) : null;\n}\n\nConfirmation.defaultProps = {\n datasource: undefined,\n label: '',\n showLabel: true\n};\n\nConfirmation.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n datasource: PropTypes.objectOf(PropTypes.any),\n label: PropTypes.string,\n showLabel: PropTypes.bool\n};\n"]}
1
+ {"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../../src/components/template/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,sDAAsD;A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AAU;IACtC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAC7C,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-nested-ternary */\nimport { Fragment, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getToDoAssignments } from '../../infra/Containers/FlowContainer/helpers';\nimport ToDo from '../../widget/ToDo';\nimport Details from '../Details/Details';\nimport { Button, Card, makeStyles } from '@material-ui/core';\n\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nconst useStyles = makeStyles(theme => ({\n root: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n }\n}));\n\nexport default function Confirmation(props) {\n const classes = useStyles();\n const CONSTS = PCore.getConstants();\n const [showConfirmView, setShowConfirmView] = useState(true);\n const { showTasks, getPConnect, datasource } = props;\n // Get the inherited props from the parent to determine label settings\n // Not using whatsNext at the moment, need to figure out the use of it\n const whatsNext = datasource?.source;\n const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';\n const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(\n getPConnect().getTarget()\n );\n const rootInfo = PCore.getContainerUtils().getContainerItemData(\n getPConnect().getTarget(),\n activeContainerItemID\n );\n const onConfirmViewClose = () => {\n setShowConfirmView(false);\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,\n rootInfo\n );\n };\n const todoProps = { ...props, renderTodoInConfirm: true };\n const toDoList = getToDoAssignments(getPConnect());\n const detailProps = { ...props, showLabel: false };\n const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;\n return showConfirmView ? (\n <Card className={classes.root}>\n <h2 id='confirm-label'>{props.showLabel ? props.label : ''}</h2>\n {showDetails ? <Details {...detailProps} /> : undefined}\n {showTasks ? (\n toDoList && toDoList.length > 0 ? (\n <ToDo\n {...todoProps}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Open Tasks'\n isConfirm\n />\n ) : undefined\n ) : undefined}\n <div style={{ display: 'flex', justifyContent: 'flex-end' }}>\n <Button variant='contained' color='primary' onClick={onConfirmViewClose}>\n Done\n </Button>\n </div>\n </Card>\n ) : toDoList && toDoList.length > 0 ? (\n <Card className={classes.root}>\n <ToDo\n {...props}\n datasource={{ source: toDoList }}\n getPConnect={getPConnect}\n type={CONSTS.TODO}\n headerText='Tasks'\n isConfirm\n />\n </Card>\n ) : null;\n}\n\nConfirmation.defaultProps = {\n datasource: undefined,\n label: '',\n showLabel: true\n};\n\nConfirmation.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n datasource: PropTypes.objectOf(PropTypes.any),\n label: PropTypes.string,\n showLabel: PropTypes.bool\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DataReference.d.ts","sourceRoot":"","sources":["../../../../src/components/template/DataReference/DataReference.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,OA4P1C;kBA5PuB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAb,aAAa"}
1
+ {"version":3,"file":"DataReference.d.ts","sourceRoot":"","sources":["../../../../src/components/template/DataReference/DataReference.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,iBAAwB,aAAa,CAAC,KAAK,KAAA,OA4P1C;kBA5PuB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAb,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataReference.js","sourceRoot":"","sources":["../../../../src/components/template/DataReference/DataReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,uBAAuB,MAAM,4BAA4B,CAAC;AACjE,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAE/D,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAI5D,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK;IACzC,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,SAAS,EACT,WAAW,EACX,kCAAkC,EAClC,aAAa,EACb,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACV,GAAG,KAAK,CAAC;IACV,IAAI,gBAAgB,GAAG,QAAQ,CAAC;IAChC,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,iBAAiB,EAAE,EAAE,CAAC;IACtE,IAAI,UAAU,CAAC,SAAS,KAAK,KAAK,EAAE;QAClC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;KACvB;IACD,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC;IACtC,MAAM,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC;IAClD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,aAAa,CAAC;IACrD,MAAM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OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC","sourcesContent":["import React, { useMemo, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport SingleReferenceReadonly from '../SingleReferenceReadOnly';\nimport MultiReferenceReadonly from '../MultiReferenceReadOnly';\n\nconst SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };\n\ndeclare const PCore: any;\n\nexport default function DataReference(props) {\n const {\n children,\n getPConnect,\n label,\n showLabel,\n displayMode,\n allowAndPersistChangesInReviewMode,\n referenceType,\n selectionMode,\n displayAs,\n ruleClass,\n parameters,\n hideLabel\n } = props;\n let childrenToRender = children;\n const pConn = getPConnect();\n const [dropDownDataSource, setDropDownDataSource] = useState(null);\n const propsToUse = { label, showLabel, ...pConn.getInheritedProps() };\n if (propsToUse.showLabel === false) {\n propsToUse.label = '';\n }\n const rawViewMetadata = pConn.getRawMetadata();\n const viewName = rawViewMetadata.name;\n const [firstChildMeta] = rawViewMetadata.children;\n const refList = rawViewMetadata.config.referenceList;\n const canBeChangedInReviewMode = allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');\n let propName;\n const isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);\n let firstChildPConnect;\n\n /* Only for dropdown when it has param use data api to get the data back and add it to datasource */\n useEffect(() => {\n if (\n firstChildMeta?.type === \"Dropdown\" &&\n rawViewMetadata.config?.parameters\n ) {\n const { value, key, text } = firstChildMeta.config.datasource.fields;\n PCore.getDataApiUtils()\n .getData(refList, {\n dataViewParameters: parameters\n })\n .then((res) => {\n if (res.data.data !== null) {\n const ddDataSource = res.data.data\n .map((listItem) => ({\n key: listItem[key.split(\" .\", 2)[1]],\n text: listItem[text.split(\" .\", 2)[1]],\n value: listItem[value.split(\" .\", 2)[1]]\n }))\n .filter((item) => item.key);\n // Filtering out undefined entries that will break preview\n setDropDownDataSource(ddDataSource);\n } else {\n const ddDataSource: any = []\n setDropDownDataSource(ddDataSource);\n }\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err?.stack);\n return Promise.resolve({\n data: { data: [] }\n });\n });\n }\n }, [firstChildMeta, rawViewMetadata, parameters]);\n\n if (firstChildMeta?.type !== 'Region') {\n firstChildPConnect = getPConnect().getChildren()[0].getPConnect;\n /* remove refresh When condition from those old view so that it will not be used for runtime */\n if (firstChildMeta.config?.readOnly) {\n delete firstChildMeta.config.readOnly;\n }\n if (firstChildMeta?.type === 'Dropdown') {\n firstChildMeta.config.datasource.source = rawViewMetadata.config?.parameters\n ? dropDownDataSource\n : '@DATASOURCE '.concat(refList).concat('.pxResults');\n } else if (firstChildMeta?.type === 'AutoComplete') {\n firstChildMeta.config.datasource = refList;\n\n /* Insert the parameters to the component only if present */\n if (rawViewMetadata.config?.parameters) {\n firstChildMeta.config.parameters = parameters;\n }\n }\n // set displayMode conditionally\n if (!canBeChangedInReviewMode) {\n firstChildMeta.config.displayMode = displayMode;\n }\n if (firstChildMeta.type === 'SimpleTableSelect' && selectionMode === SELECTION_MODE.MULTI) {\n propName = PCore.getAnnotationUtils().getPropertyName(firstChildMeta.config.selectionList);\n } else {\n propName = PCore.getAnnotationUtils().getPropertyName(firstChildMeta.config.value);\n }\n }\n\n const handleSelection = event => {\n const caseKey = pConn.getCaseInfo().getKey();\n const refreshOptions = { autoDetectRefresh: true };\n if (canBeChangedInReviewMode && pConn.getValue('__currentPageTabViewName')) {\n getPConnect()\n .getActionsApi()\n .refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName'), null, refreshOptions);\n PCore.getDeferLoadManager().refreshActiveComponents(pConn.getContextName());\n } else {\n const pgRef = pConn.getPageReference().replace('caseInfo.content', '');\n getPConnect().getActionsApi().refreshCaseView(caseKey, viewName, pgRef, refreshOptions);\n }\n\n // AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value\n const propValue = event?.id || event?.target.value;\n if (propValue && canBeChangedInReviewMode && isDisplayModeEnabled) {\n PCore.getDataApiUtils()\n .getCaseEditLock(caseKey)\n .then(caseResponse => {\n const pageTokens = pConn.getPageReference().replace('caseInfo.content', '').split('.');\n let curr = {};\n const commitData = curr;\n\n pageTokens.forEach(el => {\n if (el !== '') {\n curr[el] = {};\n curr = curr[el];\n }\n });\n\n // expecting format like {Customer: {pyID:\"C-100\"}}\n const propArr = propName.split('.');\n propArr.forEach((element, idx) => {\n if (idx + 1 === propArr.length) {\n curr[element] = propValue;\n } else {\n curr[element] = {};\n curr = curr[element];\n }\n });\n\n PCore.getDataApiUtils()\n .updateCaseEditFieldsData(\n caseKey,\n { [caseKey]: commitData },\n caseResponse.headers.etag,\n pConn.getContextName()\n )\n .then(response => {\n PCore.getContainerUtils().updateChildContainersEtag(\n pConn.getContextName(),\n response.headers.etag\n );\n });\n });\n }\n };\n\n // Re-create first child with overridden props\n // Memoized child in order to stop unmount and remount of the child component when data reference\n // rerenders without any actual change\n const recreatedFirstChild = useMemo(() => {\n const { type, config } = firstChildMeta;\n if (firstChildMeta?.type !== 'Region') {\n pConn.clearErrorMessages({\n property: propName\n });\n if (!canBeChangedInReviewMode && isDisplayModeEnabled && selectionMode === SELECTION_MODE.SINGLE) {\n return (\n <SingleReferenceReadonly\n config={config}\n getPConnect={firstChildPConnect}\n label={propsToUse.label}\n type={type}\n displayAs={displayAs}\n displayMode={displayMode}\n ruleClass={ruleClass}\n referenceType={referenceType}\n hideLabel={hideLabel}\n dataRelationshipContext={\n rawViewMetadata.config.contextClass && rawViewMetadata.config.name ? rawViewMetadata.config.name : null\n }\n />\n );\n }\n\n if (isDisplayModeEnabled && selectionMode === SELECTION_MODE.MULTI) {\n return (\n <MultiReferenceReadonly\n config={config}\n getPConnect={firstChildPConnect}\n label={propsToUse.label}\n hideLabel={hideLabel}\n />\n );\n }\n\n // In the case of a datasource with parameters you cannot load the dropdown before the parameters\n if (\n type === 'Dropdown' &&\n rawViewMetadata.config?.parameters &&\n dropDownDataSource === null\n ) {\n return null;\n }\n\n return firstChildPConnect().createComponent({\n type,\n config: {\n ...config,\n required: propsToUse.required,\n visibility: propsToUse.visibility,\n disabled: propsToUse.disabled,\n label: propsToUse.label,\n viewName: getPConnect().getCurrentView(),\n parameters: rawViewMetadata.config.parameters,\n readOnly: false,\n localeReference: rawViewMetadata.config.localeReference,\n ...(selectionMode === SELECTION_MODE.SINGLE ? { referenceType } : ''),\n dataRelationshipContext:\n rawViewMetadata.config.contextClass && rawViewMetadata.config.name\n ? rawViewMetadata.config.name\n : null,\n hideLabel,\n onRecordChange: handleSelection\n }\n });\n }\n }, [\n firstChildMeta.config?.datasource?.source,\n parameters,\n dropDownDataSource,\n propsToUse.required,\n propsToUse.disabled\n ]);\n\n // Only include the views region for rendering when it has content\n if (firstChildMeta?.type !== 'Region') {\n const viewsRegion = rawViewMetadata.children[1];\n if (viewsRegion?.name === 'Views' && viewsRegion.children.length) {\n childrenToRender = [recreatedFirstChild, ...children.slice(1)];\n } else {\n childrenToRender = [recreatedFirstChild];\n }\n }\n\n return childrenToRender.length === 1 ? (\n childrenToRender[0] ?? null\n ) : (\n <div>\n {childrenToRender.map(child => (\n <React.Fragment>{child}</React.Fragment>\n ))}\n </div>\n );\n}\n\nDataReference.defaultProps = {\n label: undefined,\n showLabel: undefined,\n displayMode: undefined,\n allowAndPersistChangesInReviewMode: false,\n referenceType: '',\n selectionMode: '',\n displayAs: '',\n ruleClass: '',\n parameters: undefined,\n hideLabel: false\n};\n\nDataReference.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n getPConnect: PropTypes.func.isRequired,\n label: PropTypes.string,\n showLabel: PropTypes.func,\n displayMode: PropTypes.string,\n allowAndPersistChangesInReviewMode: PropTypes.bool,\n referenceType: PropTypes.string,\n selectionMode: PropTypes.string,\n displayAs: PropTypes.string,\n ruleClass: PropTypes.string,\n parameters: PropTypes.arrayOf(PropTypes.string), // need to fix\n hideLabel: PropTypes.bool\n};\n"]}
1
+ {"version":3,"file":"D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AS,CAAC,IAAI;CAC1B,CAAC","sourcesContent":["import React, { useMemo, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport SingleReferenceReadonly from '../SingleReferenceReadOnly';\nimport MultiReferenceReadonly from '../MultiReferenceReadOnly';\n\nconst SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows ~7 errors)\ndeclare const PCore: any;\n\n\nexport default function DataReference(props) {\n const {\n children,\n getPConnect,\n label,\n showLabel,\n displayMode,\n allowAndPersistChangesInReviewMode,\n referenceType,\n selectionMode,\n displayAs,\n ruleClass,\n parameters,\n hideLabel\n } = props;\n let childrenToRender = children;\n const pConn = getPConnect();\n const [dropDownDataSource, setDropDownDataSource] = useState(null);\n const propsToUse = { label, showLabel, ...pConn.getInheritedProps() };\n if (propsToUse.showLabel === false) {\n propsToUse.label = '';\n }\n const rawViewMetadata = pConn.getRawMetadata();\n const viewName = rawViewMetadata.name;\n const [firstChildMeta] = rawViewMetadata.children;\n const refList = rawViewMetadata.config.referenceList;\n const canBeChangedInReviewMode = allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');\n let propName;\n const isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);\n let firstChildPConnect;\n\n /* Only for dropdown when it has param use data api to get the data back and add it to datasource */\n useEffect(() => {\n if (\n firstChildMeta?.type === \"Dropdown\" &&\n rawViewMetadata.config?.parameters\n ) {\n const { value, key, text } = firstChildMeta.config.datasource.fields;\n PCore.getDataApiUtils()\n .getData(refList, {\n dataViewParameters: parameters\n })\n .then((res) => {\n if (res.data.data !== null) {\n const ddDataSource = res.data.data\n .map((listItem) => ({\n key: listItem[key.split(\" .\", 2)[1]],\n text: listItem[text.split(\" .\", 2)[1]],\n value: listItem[value.split(\" .\", 2)[1]]\n }))\n .filter((item) => item.key);\n // Filtering out undefined entries that will break preview\n setDropDownDataSource(ddDataSource);\n } else {\n const ddDataSource: any = []\n setDropDownDataSource(ddDataSource);\n }\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err?.stack);\n return Promise.resolve({\n data: { data: [] }\n });\n });\n }\n }, [firstChildMeta, rawViewMetadata, parameters]);\n\n if (firstChildMeta?.type !== 'Region') {\n firstChildPConnect = getPConnect().getChildren()[0].getPConnect;\n /* remove refresh When condition from those old view so that it will not be used for runtime */\n if (firstChildMeta.config?.readOnly) {\n delete firstChildMeta.config.readOnly;\n }\n if (firstChildMeta?.type === 'Dropdown') {\n firstChildMeta.config.datasource.source = rawViewMetadata.config?.parameters\n ? dropDownDataSource\n : '@DATASOURCE '.concat(refList).concat('.pxResults');\n } else if (firstChildMeta?.type === 'AutoComplete') {\n firstChildMeta.config.datasource = refList;\n\n /* Insert the parameters to the component only if present */\n if (rawViewMetadata.config?.parameters) {\n firstChildMeta.config.parameters = parameters;\n }\n }\n // set displayMode conditionally\n if (!canBeChangedInReviewMode) {\n firstChildMeta.config.displayMode = displayMode;\n }\n if (firstChildMeta.type === 'SimpleTableSelect' && selectionMode === SELECTION_MODE.MULTI) {\n propName = PCore.getAnnotationUtils().getPropertyName(firstChildMeta.config.selectionList);\n } else {\n propName = PCore.getAnnotationUtils().getPropertyName(firstChildMeta.config.value);\n }\n }\n\n const handleSelection = event => {\n const caseKey = pConn.getCaseInfo().getKey();\n const refreshOptions = { autoDetectRefresh: true };\n if (canBeChangedInReviewMode && pConn.getValue('__currentPageTabViewName')) {\n getPConnect()\n .getActionsApi()\n .refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName'), null, refreshOptions);\n PCore.getDeferLoadManager().refreshActiveComponents(pConn.getContextName());\n } else {\n const pgRef = pConn.getPageReference().replace('caseInfo.content', '');\n getPConnect().getActionsApi().refreshCaseView(caseKey, viewName, pgRef, refreshOptions);\n }\n\n // AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value\n const propValue = event?.id || event?.target.value;\n if (propValue && canBeChangedInReviewMode && isDisplayModeEnabled) {\n PCore.getDataApiUtils()\n .getCaseEditLock(caseKey)\n .then(caseResponse => {\n const pageTokens = pConn.getPageReference().replace('caseInfo.content', '').split('.');\n let curr = {};\n const commitData = curr;\n\n pageTokens.forEach(el => {\n if (el !== '') {\n curr[el] = {};\n curr = curr[el];\n }\n });\n\n // expecting format like {Customer: {pyID:\"C-100\"}}\n const propArr = propName.split('.');\n propArr.forEach((element, idx) => {\n if (idx + 1 === propArr.length) {\n curr[element] = propValue;\n } else {\n curr[element] = {};\n curr = curr[element];\n }\n });\n\n PCore.getDataApiUtils()\n .updateCaseEditFieldsData(\n caseKey,\n { [caseKey]: commitData },\n caseResponse.headers.etag,\n pConn.getContextName()\n )\n .then(response => {\n PCore.getContainerUtils().updateChildContainersEtag(\n pConn.getContextName(),\n response.headers.etag\n );\n });\n });\n }\n };\n\n // Re-create first child with overridden props\n // Memoized child in order to stop unmount and remount of the child component when data reference\n // rerenders without any actual change\n const recreatedFirstChild = useMemo(() => {\n const { type, config } = firstChildMeta;\n if (firstChildMeta?.type !== 'Region') {\n pConn.clearErrorMessages({\n property: propName\n });\n if (!canBeChangedInReviewMode && isDisplayModeEnabled && selectionMode === SELECTION_MODE.SINGLE) {\n return (\n <SingleReferenceReadonly\n config={config}\n getPConnect={firstChildPConnect}\n label={propsToUse.label}\n type={type}\n displayAs={displayAs}\n displayMode={displayMode}\n ruleClass={ruleClass}\n referenceType={referenceType}\n hideLabel={hideLabel}\n dataRelationshipContext={\n rawViewMetadata.config.contextClass && rawViewMetadata.config.name ? rawViewMetadata.config.name : null\n }\n />\n );\n }\n\n if (isDisplayModeEnabled && selectionMode === SELECTION_MODE.MULTI) {\n return (\n <MultiReferenceReadonly\n config={config}\n getPConnect={firstChildPConnect}\n label={propsToUse.label}\n hideLabel={hideLabel}\n />\n );\n }\n\n // In the case of a datasource with parameters you cannot load the dropdown before the parameters\n if (\n type === 'Dropdown' &&\n rawViewMetadata.config?.parameters &&\n dropDownDataSource === null\n ) {\n return null;\n }\n\n return firstChildPConnect().createComponent({\n type,\n config: {\n ...config,\n required: propsToUse.required,\n visibility: propsToUse.visibility,\n disabled: propsToUse.disabled,\n label: propsToUse.label,\n viewName: getPConnect().getCurrentView(),\n parameters: rawViewMetadata.config.parameters,\n readOnly: false,\n localeReference: rawViewMetadata.config.localeReference,\n ...(selectionMode === SELECTION_MODE.SINGLE ? { referenceType } : ''),\n dataRelationshipContext:\n rawViewMetadata.config.contextClass && rawViewMetadata.config.name\n ? rawViewMetadata.config.name\n : null,\n hideLabel,\n onRecordChange: handleSelection\n }\n });\n }\n }, [\n firstChildMeta.config?.datasource?.source,\n parameters,\n dropDownDataSource,\n propsToUse.required,\n propsToUse.disabled\n ]);\n\n // Only include the views region for rendering when it has content\n if (firstChildMeta?.type !== 'Region') {\n const viewsRegion = rawViewMetadata.children[1];\n if (viewsRegion?.name === 'Views' && viewsRegion.children.length) {\n childrenToRender = [recreatedFirstChild, ...children.slice(1)];\n } else {\n childrenToRender = [recreatedFirstChild];\n }\n }\n\n return childrenToRender.length === 1 ? (\n childrenToRender[0] ?? null\n ) : (\n <div>\n {childrenToRender.map(child => (\n <React.Fragment>{child}</React.Fragment>\n ))}\n </div>\n );\n}\n\nDataReference.defaultProps = {\n label: undefined,\n showLabel: undefined,\n displayMode: undefined,\n allowAndPersistChangesInReviewMode: false,\n referenceType: '',\n selectionMode: '',\n displayAs: '',\n ruleClass: '',\n parameters: undefined,\n hideLabel: false\n};\n\nDataReference.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n getPConnect: PropTypes.func.isRequired,\n label: PropTypes.string,\n showLabel: PropTypes.func,\n displayMode: PropTypes.string,\n allowAndPersistChangesInReviewMode: PropTypes.bool,\n referenceType: PropTypes.string,\n selectionMode: PropTypes.string,\n displayAs: PropTypes.string,\n ruleClass: PropTypes.string,\n parameters: PropTypes.arrayOf(PropTypes.string), // need to fix\n hideLabel: PropTypes.bool\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultForm.d.ts","sourceRoot":"","sources":["../../../../src/components/template/DefaultForm/DefaultForm.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,mBAAmB,CAAC;AAE3B,iBAAwB,WAAW,CAAC,KAAK,KAAA,eA0CxC;kBA1CuB,WAAW;;;;;;;;eAAX,WAAW"}
1
+ {"version":3,"file":"DefaultForm.d.ts","sourceRoot":"","sources":["../../../../src/components/template/DefaultForm/DefaultForm.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,OAAO,mBAAmB,CAAC;AAQ3B,iBAAwB,WAAW,CAAC,KAAK,KAAA,eA0CxC;kBA1CuB,WAAW;;;;;;;;eAAX,WAAW"}
@@ -2,11 +2,16 @@ import React, { createElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { getInstructions } from '../../helpers/template-utils';
4
4
  import createPConnectComponent from '../../../bridge/react_pconnect';
5
+ import connectToState from '../../helpers/state-utils';
6
+ import { getKeyForMappedField, mapStateToProps } from './utils';
5
7
  import './DefaultForm.css';
8
+ const Child = connectToState(mapStateToProps)(props => {
9
+ const { key, visibility, ...rest } = props;
10
+ return createElement(createPConnectComponent(), { ...rest, key, visibility });
11
+ });
6
12
  export default function DefaultForm(props) {
7
13
  const { getPConnect, NumCols } = props;
8
14
  const instructions = getInstructions(getPConnect(), props.instructions);
9
- const instructionText = instructions?.replace(/<\/?[^>]+(>|$)/g, '');
10
15
  let divClass;
11
16
  const numCols = NumCols || '1';
12
17
  switch (numCols) {
@@ -28,11 +33,10 @@ export default function DefaultForm(props) {
28
33
  // to take the children and create components for them, put in an array and pass as the
29
34
  // defaultForm kids
30
35
  const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
31
- const dfChildren = arChildren.map((kid, idx) =>
32
- // eslint-disable-next-line react/no-array-index-key
33
- createElement(createPConnectComponent(), { ...kid, key: idx }));
36
+ const dfChildren = arChildren.map(kid => React.createElement(Child, { key: getKeyForMappedField(kid), ...kid }));
34
37
  return (React.createElement(React.Fragment, null,
35
- instructionText && (React.createElement("div", { className: 'psdk-default-form-instruction-text' }, instructionText)),
38
+ instructions && (React.createElement("div", { className: 'psdk-default-form-instruction-text' },
39
+ React.createElement("div", { key: "instructions", id: "instruction-text", dangerouslySetInnerHTML: { __html: instructions } }))),
36
40
  React.createElement("div", { className: divClass }, dfChildren)));
37
41
  }
38
42
  DefaultForm.propTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultForm.js","sourceRoot":"","sources":["../../../../src/components/template/DefaultForm/DefaultForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AAErE,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK;IACvC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACxE,MAAM,eAAe,GAAG,YAAY,EAAE,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAErE,IAAI,QAAgB,CAAC;IAErB,MAAM,OAAO,GAAG,OAAO,IAAI,GAAG,CAAC;IAC/B,QAAQ,OAAO,EAAE;QACf,KAAK,GAAG;YACN,QAAQ,GAAG,8BAA8B,CAAC;YAC1C,MAAM;QACR,KAAK,GAAG;YACN,QAAQ,GAAG,8BAA8B,CAAC;YAC1C,MAAM;QACR,KAAK,GAAG;YACN,QAAQ,GAAG,gCAAgC,CAAC;YAC5C,MAAM;QACR;YACE,QAAQ,GAAG,8BAA8B,CAAC;YAC1C,MAAM;KACT;IAED,YAAY;IAEZ,yFAAyF;IACzF,uFAAuF;IACvF,mBAAmB;IACnB,MAAM,UAAU,GAAG,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9E,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,oDAAoD;IACpD,aAAa,CAAC,uBAAuB,EAAE,EAAE,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAC/D,CAAC;IAEF,OAAO,CACL;QACG,eAAe,IAAI,CAClB,6BAAK,SAAS,EAAC,oCAAoC,IAAE,eAAe,CAAO,CAC5E;QACD,6BAAK,SAAS,EAAE,QAAQ,IAAG,UAAU,CAAO,CAC3C,CACJ,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,0DAA0D;IAC1D,OAAO,EAAE,SAAS,CAAC,MAAM;CAC1B,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG;IACzB,OAAO,EAAE,GAAG;CACb,CAAC","sourcesContent":["import React, { createElement } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { getInstructions } from '../../helpers/template-utils';\nimport createPConnectComponent from '../../../bridge/react_pconnect';\n\nimport './DefaultForm.css';\n\nexport default function DefaultForm(props) {\n const { getPConnect, NumCols } = props;\n const instructions = getInstructions(getPConnect(), props.instructions);\n const instructionText = instructions?.replace(/<\\/?[^>]+(>|$)/g, '');\n\n let divClass: string;\n\n const numCols = NumCols || '1';\n switch (numCols) {\n case '1':\n divClass = 'psdk-default-form-one-column';\n break;\n case '2':\n divClass = 'psdk-default-form-two-column';\n break;\n case '3':\n divClass = 'psdk-default-form-three-column';\n break;\n default:\n divClass = 'psdk-default-form-one-column';\n break;\n }\n\n // debugger;\n\n // repoint the children because they are in a region and we need to not render the region\n // to take the children and create components for them, put in an array and pass as the\n // defaultForm kids\n const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();\n const dfChildren = arChildren.map((kid, idx) =>\n // eslint-disable-next-line react/no-array-index-key\n createElement(createPConnectComponent(), { ...kid, key: idx })\n );\n\n return (\n <>\n {instructionText && (\n <div className='psdk-default-form-instruction-text'>{instructionText}</div>\n )}\n <div className={divClass}>{dfChildren}</div>\n </>\n );\n}\n\nDefaultForm.propTypes = {\n // children: PropTypes.arrayOf(PropTypes.node).isRequired,\n NumCols: PropTypes.string\n};\n\nDefaultForm.defaultProps = {\n NumCols: '1'\n};\n"]}
1
+ {"version":3,"file":"DefaultForm.js","sourceRoot":"","sources":["../../../../src/components/template/DefaultForm/DefaultForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhE,OAAO,mBAAmB,CAAC;AAE3B,MAAM,KAAK,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,EAAE;IACpD,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAE3C,OAAO,aAAa,CAAC,uBAAuB,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK;IACvC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAExE,IAAI,QAAgB,CAAC;IAErB,MAAM,OAAO,GAAG,OAAO,IAAI,GAAG,CAAC;IAC/B,QAAQ,OAAO,EAAE;QACf,KAAK,GAAG;YACN,QAAQ,GAAG,8BAA8B,CAAC;YAC1C,MAAM;QACR,KAAK,GAAG;YACN,QAAQ,GAAG,8BAA8B,CAAC;YAC1C,MAAM;QACR,KAAK,GAAG;YACN,QAAQ,GAAG,gCAAgC,CAAC;YAC5C,MAAM;QACR;YACE,QAAQ,GAAG,8BAA8B,CAAC;YAC1C,MAAM;KACT;IAED,YAAY;IAEZ,yFAAyF;IACzF,uFAAuF;IACvF,mBAAmB;IACnB,MAAM,UAAU,GAAG,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9E,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAC,KAAK,IAAC,GAAG,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAM,GAAG,GAAI,CAAC,CAAC;IAE7F,OAAO,CACL;QACG,YAAY,IAAI,CACf,6BAAK,SAAS,EAAC,oCAAoC;YAGjD,6BAAK,GAAG,EAAC,cAAc,EAAC,EAAE,EAAC,kBAAkB,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,GAAI,CAC/F,CACP;QACD,6BAAK,SAAS,EAAE,QAAQ,IAAG,UAAU,CAAO,CAC3C,CACJ,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,0DAA0D;IAC1D,OAAO,EAAE,SAAS,CAAC,MAAM;CAC1B,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG;IACzB,OAAO,EAAE,GAAG;CACb,CAAC","sourcesContent":["import React, { createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport { getInstructions } from '../../helpers/template-utils';\nimport createPConnectComponent from '../../../bridge/react_pconnect';\nimport connectToState from '../../helpers/state-utils';\nimport { getKeyForMappedField, mapStateToProps } from './utils';\n\nimport './DefaultForm.css';\n\nconst Child = connectToState(mapStateToProps)(props => {\n const { key, visibility, ...rest } = props;\n\n return createElement(createPConnectComponent(), { ...rest, key, visibility });\n});\n\nexport default function DefaultForm(props) {\n const { getPConnect, NumCols } = props;\n const instructions = getInstructions(getPConnect(), props.instructions);\n\n let divClass: string;\n\n const numCols = NumCols || '1';\n switch (numCols) {\n case '1':\n divClass = 'psdk-default-form-one-column';\n break;\n case '2':\n divClass = 'psdk-default-form-two-column';\n break;\n case '3':\n divClass = 'psdk-default-form-three-column';\n break;\n default:\n divClass = 'psdk-default-form-one-column';\n break;\n }\n\n // debugger;\n\n // repoint the children because they are in a region and we need to not render the region\n // to take the children and create components for them, put in an array and pass as the\n // defaultForm kids\n const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();\n const dfChildren = arChildren.map(kid => <Child key={getKeyForMappedField(kid)} {...kid} />);\n\n return (\n <>\n {instructions && (\n <div className='psdk-default-form-instruction-text'>\n {/* server performs sanitization method for instructions html content */}\n { /* eslint-disable react/no-danger */ }\n <div key=\"instructions\" id=\"instruction-text\" dangerouslySetInnerHTML={{ __html: instructions }} />\n </div>\n )}\n <div className={divClass}>{dfChildren}</div>\n </>\n );\n}\n\nDefaultForm.propTypes = {\n // children: PropTypes.arrayOf(PropTypes.node).isRequired,\n NumCols: PropTypes.string\n};\n\nDefaultForm.defaultProps = {\n NumCols: '1'\n};\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const mapStateToProps: any;
2
+ export declare const getKeyForMappedField: (field: any) => any;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/DefaultForm/utils/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,EAAE,GAO7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,qBAqBhC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+ export const mapStateToProps = (_, ownProps) => {
3
+ const { getPConnect } = ownProps;
4
+ return {
5
+ visibility: getPConnect().getComputedVisibility(),
6
+ getPConnect
7
+ };
8
+ };
9
+ export const getKeyForMappedField = field => {
10
+ if (Array.isArray(field)) {
11
+ return field
12
+ .map(item => {
13
+ return getKeyForMappedField(item);
14
+ })
15
+ .join('__');
16
+ }
17
+ const pConnect = field?.getPConnect?.();
18
+ if (pConnect?.meta?.type && pConnect?.meta?.config?.name) {
19
+ return `${pConnect.meta.type}_${pConnect.meta.config.name}`;
20
+ }
21
+ // Using label as a fallback if name is not defined.
22
+ if (pConnect?.meta?.type && pConnect?.meta?.config?.label) {
23
+ return `${pConnect.meta.type}_${pConnect.meta.config.label}`;
24
+ }
25
+ return uuidv4();
26
+ };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/template/DefaultForm/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,MAAM,CAAC,MAAM,eAAe,GAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE;IAClD,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;IAEjC,OAAO;QACL,UAAU,EAAE,WAAW,EAAE,CAAC,qBAAqB,EAAE;QACjD,WAAW;KACZ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK;aACT,GAAG,CAAC,IAAI,CAAC,EAAE;YACV,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;KACf;IAED,MAAM,QAAQ,GAAG,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;IAExC,IAAI,QAAQ,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QACxD,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAC7D;IAED,oDAAoD;IACpD,IAAI,QAAQ,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;QACzD,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;KAC9D;IAED,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC,CAAC","sourcesContent":["import { v4 as uuidv4 } from 'uuid';\n\nexport const mapStateToProps: any = (_, ownProps) => {\n const { getPConnect } = ownProps;\n\n return {\n visibility: getPConnect().getComputedVisibility(),\n getPConnect\n };\n};\n\nexport const getKeyForMappedField = field => {\n if (Array.isArray(field)) {\n return field\n .map(item => {\n return getKeyForMappedField(item);\n })\n .join('__');\n }\n\n const pConnect = field?.getPConnect?.();\n\n if (pConnect?.meta?.type && pConnect?.meta?.config?.name) {\n return `${pConnect.meta.type}_${pConnect.meta.config.name}`;\n }\n\n // Using label as a fallback if name is not defined.\n if (pConnect?.meta?.type && pConnect?.meta?.config?.label) {\n return `${pConnect.meta.type}_${pConnect.meta.config.label}`;\n }\n\n return uuidv4();\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldGroupTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,iBAAwB,kBAAkB,CAAC,KAAK,KAAA,eAqF/C;kBArFuB,kBAAkB;;;;;;;;;;;;;;;;;eAAlB,kBAAkB"}
1
+ {"version":3,"file":"FieldGroupTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,YAAY,CAAC;AAWnC,iBAAwB,kBAAkB,CAAC,KAAK,KAAA,eAqF/C;kBArFuB,kBAAkB;;;;;;;;;;;;;;;;;eAAlB,kBAAkB"}
@@ -23,7 +23,7 @@ export default function FieldGroupTemplate(props) {
23
23
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
24
24
  }
25
25
  else {
26
- pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
26
+ pConn.getListActions().insert({}, referenceList.length);
27
27
  }
28
28
  };
29
29
  if (!isReadonlyMode) {