@pega/react-sdk-overrides 0.23.26 → 0.23.28

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 (238) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/SECURITY.md +10 -0
  4. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +39 -0
  5. package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
  6. package/lib/designSystemExtension/Banner/Banner.tsx +21 -7
  7. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  8. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
  9. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
  10. package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
  11. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
  12. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +13 -12
  13. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
  14. package/lib/designSystemExtension/Operator/Operator.tsx +106 -87
  15. package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
  16. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
  17. package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
  18. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
  19. package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
  20. package/lib/field/AutoComplete/config-ext.json +2 -3
  21. package/lib/field/CancelAlert/CancelAlert.tsx +21 -15
  22. package/lib/field/CancelAlert/index.tsx +1 -1
  23. package/lib/field/Checkbox/Checkbox.tsx +29 -19
  24. package/lib/field/Checkbox/config-ext.json +2 -3
  25. package/lib/field/Currency/Currency.tsx +27 -38
  26. package/lib/field/Currency/config-ext.json +2 -3
  27. package/lib/field/Currency/currency-utils.ts +10 -18
  28. package/lib/field/Date/Date.tsx +33 -15
  29. package/lib/field/Date/config-ext.json +2 -3
  30. package/lib/field/DateTime/DateTime.tsx +22 -11
  31. package/lib/field/DateTime/config-ext.json +1 -2
  32. package/lib/field/Decimal/Decimal.tsx +64 -17
  33. package/lib/field/Decimal/config-ext.json +1 -2
  34. package/lib/field/Decimal/index.tsx +1 -1
  35. package/lib/field/Dropdown/Dropdown.tsx +154 -18
  36. package/lib/field/Dropdown/config-ext.json +1 -2
  37. package/lib/field/Email/Email.tsx +16 -7
  38. package/lib/field/Email/config-ext.json +1 -2
  39. package/lib/field/Email/index.tsx +1 -1
  40. package/lib/field/Group/Group.tsx +37 -0
  41. package/lib/field/Group/config-ext.json +7 -0
  42. package/lib/field/Group/index.tsx +1 -0
  43. package/lib/field/Integer/Integer.tsx +15 -6
  44. package/lib/field/Integer/config-ext.json +1 -2
  45. package/lib/field/Percentage/Percentage.tsx +14 -6
  46. package/lib/field/Percentage/config-ext.json +1 -2
  47. package/lib/field/Phone/Phone.tsx +17 -7
  48. package/lib/field/Phone/index.tsx +1 -1
  49. package/lib/field/RadioButtons/RadioButtons.tsx +55 -24
  50. package/lib/field/RadioButtons/config-ext.json +1 -2
  51. package/lib/field/RichText/RichText.tsx +96 -0
  52. package/lib/field/RichText/index.tsx +1 -0
  53. package/lib/field/ScalarList/ScalarList.tsx +63 -0
  54. package/lib/field/ScalarList/config-ext.json +7 -0
  55. package/lib/field/ScalarList/index.tsx +1 -0
  56. package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
  57. package/lib/field/SemanticLink/config-ext.json +1 -2
  58. package/lib/field/SemanticLink/utils.ts +8 -10
  59. package/lib/field/TextArea/TextArea.tsx +15 -5
  60. package/lib/field/TextArea/config-ext.json +1 -2
  61. package/lib/field/TextContent/TextContent.tsx +9 -2
  62. package/lib/field/TextContent/config-ext.json +1 -2
  63. package/lib/field/TextInput/TextInput.tsx +41 -10
  64. package/lib/field/TextInput/config-ext.json +1 -2
  65. package/lib/field/TextInput/index.tsx +1 -1
  66. package/lib/field/Time/Time.tsx +21 -18
  67. package/lib/field/Time/config-ext.json +1 -2
  68. package/lib/field/URL/URL.tsx +23 -6
  69. package/lib/field/URL/config-ext.json +1 -2
  70. package/lib/field/URL/index.tsx +1 -1
  71. package/lib/field/UserReference/UserReference.tsx +52 -58
  72. package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
  73. package/lib/field/UserReference/config-ext.json +1 -2
  74. package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +16 -11
  75. package/lib/helpers/case-utils.tsx +99 -0
  76. package/lib/helpers/common-utils.ts +8 -0
  77. package/lib/helpers/data_page.ts +3 -6
  78. package/lib/helpers/date-format-utils.ts +29 -19
  79. package/lib/helpers/{event-utils.js → event-utils.ts} +4 -4
  80. package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +9 -10
  81. package/lib/helpers/formatters/Boolean.ts +21 -0
  82. package/lib/helpers/formatters/{Currency.js → Currency.ts} +22 -27
  83. package/lib/helpers/formatters/CurrencyMap.ts +915 -0
  84. package/lib/helpers/formatters/{Date.js → Date.ts} +20 -26
  85. package/lib/helpers/formatters/{common.js → common.ts} +3 -4
  86. package/lib/helpers/formatters/{index.js → index.ts} +22 -22
  87. package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +2 -2
  88. package/lib/helpers/simpleTableHelpers.ts +65 -85
  89. package/lib/helpers/state-utils.tsx +43 -0
  90. package/lib/helpers/template-utils.ts +4 -8
  91. package/lib/helpers/utils.ts +16 -8
  92. package/lib/helpers/versionHelpers.ts +1 -5
  93. package/lib/infra/ActionButtons/ActionButtons.tsx +46 -42
  94. package/lib/infra/ActionButtons/index.tsx +1 -1
  95. package/lib/infra/Assignment/Assignment.tsx +99 -84
  96. package/lib/infra/Assignment/index.tsx +1 -1
  97. package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
  98. package/lib/infra/AssignmentCard/index.tsx +1 -1
  99. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +98 -232
  100. package/lib/infra/Containers/FlowContainer/helpers.ts +138 -0
  101. package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
  102. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +66 -0
  103. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  104. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +105 -70
  105. package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
  106. package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
  107. package/lib/infra/Containers/SimpleView/helper.ts +125 -0
  108. package/lib/infra/Containers/SimpleView/index.tsx +1 -0
  109. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +49 -64
  110. package/lib/infra/Containers/helpers.ts +6 -0
  111. package/lib/infra/DashboardFilter/DashboardFilter.tsx +26 -51
  112. package/lib/infra/DashboardFilter/filterUtils.tsx +12 -40
  113. package/lib/infra/DeferLoad/DeferLoad.tsx +22 -31
  114. package/lib/infra/DeferLoad/index.tsx +1 -1
  115. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +25 -38
  116. package/lib/infra/MultiStep/MultiStep.css +11 -15
  117. package/lib/infra/MultiStep/MultiStep.tsx +180 -216
  118. package/lib/infra/MultiStep/index.tsx +1 -1
  119. package/lib/infra/NavBar/NavBar.css +103 -105
  120. package/lib/infra/NavBar/NavBar.tsx +28 -43
  121. package/lib/infra/Reference/Reference.tsx +16 -22
  122. package/lib/infra/Region/Region.tsx +9 -9
  123. package/lib/infra/RootContainer/RootContainer.tsx +82 -125
  124. package/lib/infra/RootContainer/index.tsx +1 -1
  125. package/lib/infra/Stages/Stages.tsx +38 -39
  126. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
  127. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
  128. package/lib/infra/View/View.tsx +32 -63
  129. package/lib/template/AppShell/AppShell.css +22 -23
  130. package/lib/template/AppShell/AppShell.tsx +51 -69
  131. package/lib/template/BannerPage/BannerPage.tsx +26 -33
  132. package/lib/template/CaseSummary/CaseSummary.tsx +23 -18
  133. package/lib/template/CaseSummary/config-ext.json +1 -2
  134. package/lib/template/CaseView/CaseView.tsx +122 -114
  135. package/lib/template/CaseView/config-ext.json +1 -2
  136. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +46 -35
  137. package/lib/template/Confirmation/Confirmation.tsx +25 -53
  138. package/lib/template/Confirmation/config-ext.json +1 -2
  139. package/lib/template/DataReference/DataReference.tsx +112 -140
  140. package/lib/template/DataReference/config-ext.json +1 -2
  141. package/lib/template/DefaultForm/DefaultForm.css +7 -3
  142. package/lib/template/DefaultForm/DefaultForm.tsx +26 -20
  143. package/lib/template/DefaultForm/config-ext.json +1 -2
  144. package/lib/template/DefaultForm/utils/index.ts +33 -0
  145. package/lib/template/Details/Details/Details.tsx +24 -28
  146. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
  147. package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
  148. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
  149. package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
  150. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
  151. package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
  152. package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
  153. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
  154. package/lib/template/Details/DynamicTabs/config.json +36 -0
  155. package/lib/template/Details/DynamicTabs/index.tsx +1 -0
  156. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -34
  157. package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
  158. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
  159. package/lib/template/ListPage/ListPage.tsx +12 -16
  160. package/lib/template/ListPage/config-ext.json +1 -2
  161. package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +1 -3
  162. package/lib/template/ListView/ListView.tsx +245 -306
  163. package/lib/template/ListView/config-ext.json +1 -2
  164. package/lib/template/ListView/{hooks.js → hooks.ts} +24 -24
  165. package/lib/template/ListView/{utils.js → utils.ts} +202 -91
  166. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -30
  167. package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  168. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
  169. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
  170. package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
  171. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  172. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +17 -19
  173. package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
  174. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
  175. package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
  176. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
  177. package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
  178. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
  179. package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
  180. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
  181. package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
  182. package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
  183. package/lib/template/PromotedFilters/PromotedFilters.tsx +44 -34
  184. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +115 -14
  185. package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
  186. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +171 -100
  187. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +34 -40
  188. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
  189. package/lib/template/SubTabs/SubTabs.tsx +26 -45
  190. package/lib/template/SubTabs/config-ext.json +1 -2
  191. package/lib/template/SubTabs/tabUtils.ts +2 -7
  192. package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  193. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
  194. package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
  195. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
  196. package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
  197. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
  198. package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
  199. package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  200. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +29 -27
  201. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
  202. package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
  203. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  204. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +16 -18
  205. package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
  206. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
  207. package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
  208. package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
  209. package/lib/template/WssNavBar/WssNavBar.tsx +20 -9
  210. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
  211. package/lib/widget/AppAnnouncement/config-ext.json +1 -2
  212. package/lib/widget/Attachment/Attachment.css +75 -4
  213. package/lib/widget/Attachment/Attachment.tsx +370 -388
  214. package/lib/widget/Attachment/index.tsx +1 -1
  215. package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
  216. package/lib/widget/CaseHistory/config-ext.json +1 -2
  217. package/lib/widget/CaseHistory/index.tsx +1 -1
  218. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
  219. package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  220. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +324 -246
  221. package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
  222. package/lib/widget/Followers/Followers.tsx +27 -25
  223. package/lib/widget/Followers/config-ext.json +1 -2
  224. package/lib/widget/QuickCreate/QuickCreate.tsx +24 -16
  225. package/lib/widget/SummaryItem/SummaryItem.css +9 -9
  226. package/lib/widget/SummaryItem/SummaryItem.tsx +62 -54
  227. package/lib/widget/SummaryItem/index.tsx +1 -1
  228. package/lib/widget/SummaryList/SummaryList.tsx +15 -4
  229. package/lib/widget/ToDo/ToDo.css +4 -4
  230. package/lib/widget/ToDo/ToDo.tsx +80 -116
  231. package/lib/widget/ToDo/config-ext.json +1 -2
  232. package/package.json +5 -2
  233. package/lib/helpers/auth.js +0 -483
  234. package/lib/helpers/authManager.js +0 -631
  235. package/lib/helpers/config_access.js +0 -268
  236. package/lib/helpers/formatters/Boolean.js +0 -38
  237. package/lib/helpers/formatters/CurrencyMap.js +0 -908
  238. package/lib/infra/Containers/FlowContainer/helpers.js +0 -147
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-nested-ternary */
2
- import React, { useEffect, useState } from 'react';
2
+ import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';
3
3
  import Table from '@material-ui/core/Table';
4
4
  import TableBody from '@material-ui/core/TableBody';
5
5
  import TableCell from '@material-ui/core/TableCell';
@@ -8,15 +8,8 @@ import TableHead from '@material-ui/core/TableHead';
8
8
  import TableRow from '@material-ui/core/TableRow';
9
9
  import Paper from '@material-ui/core/Paper';
10
10
  import { makeStyles } from '@material-ui/core/styles';
11
- import { buildFieldsForTable, filterData } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
12
- import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
13
11
  import Link from '@material-ui/core/Link';
14
- import { getReferenceList } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
15
- import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
16
12
  import { createElement } from 'react';
17
-
18
- import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
19
-
20
13
  import TableSortLabel from '@material-ui/core/TableSortLabel';
21
14
  import MoreIcon from '@material-ui/icons/MoreVert';
22
15
  import Menu from '@material-ui/core/Menu';
@@ -31,6 +24,36 @@ import Select from '@material-ui/core/Select';
31
24
  import Button from '@material-ui/core/Button';
32
25
  import TextField from '@material-ui/core/TextField';
33
26
 
27
+ import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
28
+ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
29
+ import { getReferenceList } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
30
+ import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
31
+ import { buildFieldsForTable, filterData, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
32
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
33
+ import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
34
+
35
+ interface SimpleTableManualProps extends PConnProps {
36
+ // If any, enter additional props that only exist on this component
37
+ hideAddRow?: boolean;
38
+ hideDeleteRow?: boolean;
39
+ referenceList?: any[];
40
+ renderMode?: string;
41
+ presets?: any[];
42
+ label?: string;
43
+ showLabel?: boolean;
44
+ dataPageName?: string;
45
+ contextClass?: string;
46
+ propertyLabel?: string;
47
+ fieldMetadata?: any;
48
+ editMode?: string;
49
+ addAndEditRowsWithin?: any;
50
+ viewForAddAndEditModal?: any;
51
+ editModeConfig?: any;
52
+ displayMode?: string;
53
+ useSeparateViewForEdit: any;
54
+ viewForEditModal: any;
55
+ }
56
+
34
57
  const useStyles = makeStyles((/* theme */) => ({
35
58
  label: {
36
59
  margin: '8px'
@@ -58,15 +81,14 @@ const useStyles = makeStyles((/* theme */) => ({
58
81
  }
59
82
  }));
60
83
 
61
- declare const PCore: any;
62
-
63
84
  let menuColumnId = '';
64
85
  let menuColumnType = '';
65
86
  let menuColumnLabel = '';
66
87
 
67
- const filterByColumns: Array<any> = [];
68
- let myRows: Array<any>;
69
- export default function SimpleTableManual(props) {
88
+ const filterByColumns: any[] = [];
89
+ let myRows: any[];
90
+
91
+ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableManualProps>) {
70
92
  const classes = useStyles();
71
93
  const {
72
94
  getPConnect,
@@ -81,7 +103,14 @@ export default function SimpleTableManual(props) {
81
103
  hideAddRow,
82
104
  hideDeleteRow,
83
105
  propertyLabel,
84
- fieldMetadata
106
+ fieldMetadata,
107
+ editMode,
108
+ addAndEditRowsWithin,
109
+ viewForAddAndEditModal,
110
+ editModeConfig,
111
+ displayMode,
112
+ useSeparateViewForEdit,
113
+ viewForEditModal
85
114
  } = props;
86
115
  const pConn = getPConnect();
87
116
  const [rowData, setRowData] = useState([]);
@@ -89,20 +118,21 @@ export default function SimpleTableManual(props) {
89
118
  const [order, setOrder] = useState<Order>('asc');
90
119
  const [orderBy, setOrderBy] = useState<keyof any>('');
91
120
  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
121
+ const [editAnchorEl, setEditAnchorEl] = useState<null | HTMLElement>(null);
92
122
  const [open, setOpen] = useState(false);
93
123
  const [filterBy, setFilterBy] = useState<string>();
94
124
  const [containsDateOrTime, setContainsDateOrTime] = useState<boolean>(false);
95
125
  const [filterType, setFilterType] = useState<string>('string');
96
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
126
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
97
127
  const [displayDialogFilterName, setDisplayDialogFilterName] = useState<string>('');
98
- const [displayDialogContainsFilter, setDisplayDialogContainsFilter] =
99
- useState<string>('contains');
128
+ const [displayDialogContainsFilter, setDisplayDialogContainsFilter] = useState<string>('contains');
100
129
  const [displayDialogContainsValue, setDisplayDialogContainsValue] = useState<string>('');
101
130
  const [displayDialogDateFilter, setDisplayDialogDateFilter] = useState<string>('notequal');
102
131
  const [displayDialogDateValue, setDisplayDialogDateValue] = useState<string>('');
132
+ const selectedRowIndex: any = useRef(null);
103
133
 
104
134
  const parameters = fieldMetadata?.datasource?.parameters;
105
-
135
+ const { referenceListStr } = getContext(getPConnect());
106
136
  const label = labelProp || propertyLabel;
107
137
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
108
138
  if (propsToUse.showLabel === false) {
@@ -113,14 +143,14 @@ export default function SimpleTableManual(props) {
113
143
  const resolvedList = getReferenceList(pConn);
114
144
  const pageReference = `${pConn.getPageReference()}${resolvedList}`;
115
145
  pConn.setReferenceList(resolvedList);
116
- const menuIconOverride$ = Utils.getImageSrc('trash', PCore.getAssetLoader().getStaticServerUrl());
146
+ const menuIconOverride$ = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());
117
147
 
118
148
  const resolvedFields = children?.[0]?.children || presets?.[0].children?.[0].children;
119
149
  // NOTE: props has each child.config with datasource and value undefined
120
150
  // but getRawMetadata() has each child.config with datasource and value showing their unresolved values (ex: "@P thePropName")
121
151
  // We need to use the prop name as the "glue" to tie the table dataSource, displayColumns and data together.
122
152
  // So, in the code below, we'll use the unresolved config.value (but replacing the space with an underscore to keep things happy)
123
- const rawMetadata = getPConnect().getRawMetadata();
153
+ const rawMetadata: any = getPConnect().getRawMetadata();
124
154
 
125
155
  // get raw config since @P and other annotations are processed and don't appear in the resolved config.
126
156
  // Destructure "raw" children into array var: "rawFields"
@@ -130,22 +160,35 @@ export default function SimpleTableManual(props) {
130
160
  // Neither of these appear in the resolved props
131
161
 
132
162
  const rawConfig = rawMetadata?.config;
133
- const rawFields =
134
- rawConfig?.children?.[0]?.children || rawConfig?.presets?.[0].children?.[0]?.children;
135
-
163
+ const rawFields = rawConfig?.children?.[0]?.children || rawConfig?.presets?.[0].children?.[0]?.children;
164
+ const isDisplayModeEnabled = displayMode === 'DISPLAY_ONLY';
136
165
  const readOnlyMode = renderMode === 'ReadOnly';
137
166
  const editableMode = renderMode === 'Editable';
138
167
  const showAddRowButton = !readOnlyMode && !hideAddRow;
139
- const showDeleteButton = !readOnlyMode && !hideDeleteRow;
168
+ const allowEditingInModal =
169
+ (editMode ? editMode === 'modal' : addAndEditRowsWithin === 'modal') && !(renderMode === 'ReadOnly' || isDisplayModeEnabled);
170
+ const showDeleteButton = editableMode && !hideDeleteRow;
171
+ const defaultView = editModeConfig ? editModeConfig.defaultView : viewForAddAndEditModal;
172
+ const bUseSeparateViewForEdit = editModeConfig ? editModeConfig.useSeparateViewForEdit : useSeparateViewForEdit;
173
+ const editView = editModeConfig ? editModeConfig.editView : viewForEditModal;
174
+
175
+ const fieldsWithPropNames = rawFields.map((field, index) => {
176
+ return { ...resolvedFields[index], propName: field.config.value.replace('@P .', '') };
177
+ });
178
+
140
179
  useEffect(() => {
141
- if (editableMode) {
180
+ if (editableMode && !allowEditingInModal) {
142
181
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
143
182
  buildElementsForTable();
144
- } else {
183
+ }
184
+ }, [referenceList.length]);
185
+
186
+ useEffect(() => {
187
+ if (readOnlyMode || allowEditingInModal) {
145
188
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
146
189
  generateRowsData();
147
190
  }
148
- }, [referenceList.length]);
191
+ }, [referenceList]);
149
192
 
150
193
  // fieldDefs will be an array where each entry will have a "name" which will be the
151
194
  // "resolved" property name (that we can use as the colId) though it's not really
@@ -159,6 +202,19 @@ export default function SimpleTableManual(props) {
159
202
  return field.name ? field.name : field.cellRenderer;
160
203
  });
161
204
 
205
+ const getFormattedValue = (val, key) => {
206
+ const rawField = fieldsWithPropNames.find(item => item.propName === key);
207
+ let options = {};
208
+ if (rawField && ['Boolean', 'Checkbox'].includes(rawField.type)) {
209
+ const { trueLabel, falseLabel } = rawField.config;
210
+ options = {
211
+ trueLabel,
212
+ falseLabel
213
+ };
214
+ }
215
+ return rawField ? format(val, rawField.type, options) : val;
216
+ };
217
+
162
218
  // console.log(`SimpleTable displayedColumns:`);
163
219
  // console.log(displayedColumns);
164
220
 
@@ -166,16 +222,16 @@ export default function SimpleTableManual(props) {
166
222
  // of the given row field
167
223
  function getRowValue(inRowData: Object, inColKey: string): any {
168
224
  // See what data (if any) we have to display
169
- const refKeys: Array<string> = inColKey.split('.');
225
+ const refKeys: string[] = inColKey?.split('.');
170
226
  let valBuilder = inRowData;
171
227
  for (const key of refKeys) {
172
228
  valBuilder = valBuilder[key];
173
229
  }
174
- return valBuilder;
230
+ return getFormattedValue(valBuilder, inColKey);
175
231
  }
176
232
 
177
233
  const formatRowsData = data => {
178
- if(!data) return {};
234
+ if (!data) return {};
179
235
 
180
236
  return data.map(item => {
181
237
  return displayedColumns.reduce((dataForRow, colKey) => {
@@ -186,8 +242,8 @@ export default function SimpleTableManual(props) {
186
242
  };
187
243
 
188
244
  function generateRowsData() {
189
- // if dataPageName property value exists then make a datapage fetch call and get the list of data.
190
- if (dataPageName) {
245
+ // if referenceList is empty and dataPageName property value exists then make a datapage fetch call and get the list of data.
246
+ if (!referenceList.length && dataPageName) {
191
247
  getDataPage(dataPageName, parameters, context).then(listData => {
192
248
  const data = formatRowsData(listData);
193
249
  myRows = data;
@@ -228,18 +284,38 @@ export default function SimpleTableManual(props) {
228
284
  // console.log(JSON.stringify(rowData));
229
285
 
230
286
  const addRecord = () => {
231
- if (PCore.getPCoreVersion()?.includes('8.7')) {
287
+ if (allowEditingInModal && defaultView) {
288
+ pConn
289
+ .getActionsApi()
290
+ .openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
291
+ } else if (PCore.getPCoreVersion()?.includes('8.7')) {
232
292
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
233
293
  } else {
234
- pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
294
+ pConn.getListActions().insert({ classID: contextClass }, referenceList.length, ''); // 3rd arg null until typedef marked correctly as optional
295
+ }
296
+ };
297
+
298
+ const editRecord = () => {
299
+ setEditAnchorEl(null);
300
+ if (typeof selectedRowIndex.current === 'number') {
301
+ pConn
302
+ .getActionsApi()
303
+ .openEmbeddedDataModal(
304
+ bUseSeparateViewForEdit ? editView : defaultView,
305
+ pConn,
306
+ referenceListStr,
307
+ selectedRowIndex.current,
308
+ PCore.getConstants().RESOURCE_STATUS.UPDATE
309
+ );
235
310
  }
236
311
  };
237
312
 
238
- const deleteRecord = index => {
313
+ const deleteRecord = () => {
314
+ setEditAnchorEl(null);
239
315
  if (PCore.getPCoreVersion()?.includes('8.7')) {
240
- pConn.getListActions().deleteEntry(index, pageReference);
316
+ pConn.getListActions().deleteEntry(selectedRowIndex.current, pageReference);
241
317
  } else {
242
- pConn.getListActions().deleteEntry(index);
318
+ pConn.getListActions().deleteEntry(selectedRowIndex.current, ''); // 2nd arg empty string until typedef marked correctly as optional
243
319
  }
244
320
  };
245
321
 
@@ -249,14 +325,12 @@ export default function SimpleTableManual(props) {
249
325
  const data: any = [];
250
326
  rawFields.forEach(item => {
251
327
  // removing label field from config to hide title in the table cell
252
- item = {...item, config: {...item.config, label: ''}};
328
+ item = { ...item, config: { ...item.config, label: '' } };
253
329
  const referenceListData = getReferenceList(pConn);
254
330
  const isDatapage = referenceListData.startsWith('D_');
255
331
  const pageReferenceValue = isDatapage
256
332
  ? `${referenceListData}[${index}]`
257
- : `${pConn.getPageReference()}${referenceListData.substring(
258
- referenceListData.lastIndexOf('.')
259
- )}[${index}]`;
333
+ : `${pConn.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
260
334
  const config = {
261
335
  meta: item,
262
336
  options: {
@@ -299,18 +373,14 @@ export default function SimpleTableManual(props) {
299
373
  function getComparator<Key extends keyof any>(
300
374
  theOrder: Order,
301
375
  orderedBy: Key
302
- // eslint-disable-next-line no-unused-vars
303
376
  ): (a: { [key in Key]: number | string }, b: { [key in Key]: number | string }) => number {
304
- return theOrder === 'desc'
305
- ? (a, b) => descendingComparator(a, b, orderedBy)
306
- : (a, b) => -descendingComparator(a, b, orderedBy);
377
+ return theOrder === 'desc' ? (a, b) => descendingComparator(a, b, orderedBy) : (a, b) => -descendingComparator(a, b, orderedBy);
307
378
  }
308
379
 
309
- // eslint-disable-next-line no-unused-vars
310
- function stableSort<T>(array: Array<T>, comparator: (a: T, b: T) => number) {
380
+ function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
311
381
  const stabilizedThis = array.map((el, index) => [el, index] as [T, number]);
312
382
  stabilizedThis.sort((a, b) => {
313
- // eslint-disable-next-line @typescript-eslint/no-shadow, no-shadow
383
+ // eslint-disable-next-line @typescript-eslint/no-shadow
314
384
  const order = comparator(a[0], b[0]);
315
385
  if (order !== 0) return order;
316
386
  return a[1] - b[1];
@@ -327,8 +397,14 @@ export default function SimpleTableManual(props) {
327
397
  setAnchorEl(event.currentTarget);
328
398
  }
329
399
 
400
+ function editMenuClick(event, index) {
401
+ selectedRowIndex.current = index;
402
+ setEditAnchorEl(event.currentTarget);
403
+ }
404
+
330
405
  function _menuClose() {
331
406
  setAnchorEl(null);
407
+ setEditAnchorEl(null);
332
408
  }
333
409
 
334
410
  function _filterMenu() {
@@ -339,11 +415,7 @@ export default function SimpleTableManual(props) {
339
415
  for (const filterObj of filterByColumns) {
340
416
  if (filterObj.ref === menuColumnId) {
341
417
  setFilterBy(menuColumnLabel);
342
- if (
343
- filterObj.type === 'Date' ||
344
- filterObj.type === 'DateTime' ||
345
- filterObj.type === 'Time'
346
- ) {
418
+ if (filterObj.type === 'Date' || filterObj.type === 'DateTime' || filterObj.type === 'Time') {
347
419
  setContainsDateOrTime(true);
348
420
  setFilterType(filterObj.type);
349
421
  setDisplayDialogDateFilter(filterObj.containsFilter);
@@ -418,14 +490,14 @@ export default function SimpleTableManual(props) {
418
490
  function updateFilterWithInfo() {
419
491
  let bFound = false;
420
492
  for (const filterObj of filterByColumns) {
421
- if (filterObj['ref'] === menuColumnId) {
422
- filterObj['type'] = filterType;
493
+ if (filterObj.ref === menuColumnId) {
494
+ filterObj.type = filterType;
423
495
  if (containsDateOrTime) {
424
- filterObj['containsFilter'] = displayDialogDateFilter;
425
- filterObj['containsFilterValue'] = displayDialogDateValue;
496
+ filterObj.containsFilter = displayDialogDateFilter;
497
+ filterObj.containsFilterValue = displayDialogDateValue;
426
498
  } else {
427
- filterObj['containsFilter'] = displayDialogContainsFilter;
428
- filterObj['containsFilterValue'] = displayDialogContainsValue;
499
+ filterObj.containsFilter = displayDialogContainsFilter;
500
+ filterObj.containsFilterValue = displayDialogContainsValue;
429
501
  }
430
502
  bFound = true;
431
503
  break;
@@ -436,13 +508,13 @@ export default function SimpleTableManual(props) {
436
508
  // add in
437
509
  const filterObj: any = {};
438
510
  filterObj.ref = menuColumnId;
439
- filterObj['type'] = filterType;
511
+ filterObj.type = filterType;
440
512
  if (containsDateOrTime) {
441
- filterObj['containsFilter'] = displayDialogDateFilter;
442
- filterObj['containsFilterValue'] = displayDialogDateValue;
513
+ filterObj.containsFilter = displayDialogDateFilter;
514
+ filterObj.containsFilterValue = displayDialogDateValue;
443
515
  } else {
444
- filterObj['containsFilter'] = displayDialogContainsFilter;
445
- filterObj['containsFilterValue'] = displayDialogContainsValue;
516
+ filterObj.containsFilter = displayDialogContainsFilter;
517
+ filterObj.containsFilterValue = displayDialogContainsValue;
446
518
  }
447
519
 
448
520
  filterByColumns.push(filterObj);
@@ -458,9 +530,9 @@ export default function SimpleTableManual(props) {
458
530
 
459
531
  function _showFilteredIcon(columnId) {
460
532
  for (const filterObj of filterByColumns) {
461
- if (filterObj['ref'] === columnId) {
533
+ if (filterObj.ref === columnId) {
462
534
  // eslint-disable-next-line sonarjs/prefer-single-boolean-return
463
- if (filterObj['containsFilterValue'] !== '') {
535
+ if (filterObj.containsFilterValue !== '') {
464
536
  return true;
465
537
  }
466
538
  return false;
@@ -481,8 +553,8 @@ export default function SimpleTableManual(props) {
481
553
  }
482
554
 
483
555
  return (
484
- <React.Fragment>
485
- <TableContainer component={Paper} style={{ margin: '4px 0px' }} id="simple-table-manual">
556
+ <>
557
+ <TableContainer component={Paper} style={{ margin: '4px 0px' }} id='simple-table-manual'>
486
558
  {propsToUse.label && (
487
559
  <h3 className={classes.label}>
488
560
  {propsToUse.label} {results()}
@@ -502,13 +574,9 @@ export default function SimpleTableManual(props) {
502
574
  onClick={createSortHandler(displayedColumns[index])}
503
575
  >
504
576
  {field.label}
505
- {_showFilteredIcon(field.name) && (
506
- <FilterListIcon className={classes.moreIcon} />
507
- )}
577
+ {_showFilteredIcon(field.name) && <FilterListIcon className={classes.moreIcon} />}
508
578
  {orderBy === displayedColumns[index] ? (
509
- <span className={classes.visuallyHidden}>
510
- {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
511
- </span>
579
+ <span className={classes.visuallyHidden}>{order === 'desc' ? 'sorted descending' : 'sorted ascending'}</span>
512
580
  ) : null}
513
581
  </TableSortLabel>
514
582
  <MoreIcon
@@ -547,34 +615,48 @@ export default function SimpleTableManual(props) {
547
615
  type='button'
548
616
  className='psdk-utility-button'
549
617
  id='delete-button'
550
- onClick={() => deleteRecord(index)}
618
+ aria-label='Delete Cell'
619
+ onClick={() => deleteRecord()}
551
620
  >
552
- <img
553
- className='psdk-utility-card-action-svg-icon'
554
- src={menuIconOverride$}
555
- ></img>
621
+ <img className='psdk-utility-card-action-svg-icon' src={menuIconOverride$} />
556
622
  </button>
557
623
  </TableCell>
558
624
  )}
559
625
  </TableRow>
560
626
  );
561
627
  })}
562
- {readOnlyMode &&
628
+ {(readOnlyMode || allowEditingInModal) &&
563
629
  rowData &&
564
630
  rowData.length > 0 &&
565
631
  stableSort(rowData, getComparator(order, orderBy))
566
632
  .slice(0)
567
- .map(row => {
633
+ .map((row, index) => {
568
634
  return (
569
635
  <TableRow key={row[displayedColumns[0]]}>
570
636
  {displayedColumns.map(colKey => {
571
637
  return (
572
638
  <TableCell key={colKey} className={classes.tableCell}>
573
- {typeof row[colKey] === 'boolean' && !row[colKey]
574
- ? 'False'
575
- : typeof row[colKey] === 'boolean' && row[colKey]
576
- ? 'True'
577
- : row[colKey]}
639
+ {showDeleteButton && colKey === 'DeleteIcon' ? (
640
+ <div>
641
+ <MoreIcon
642
+ id='table-edit-menu-icon'
643
+ className={classes.moreIcon}
644
+ onClick={event => {
645
+ editMenuClick(event, index);
646
+ }}
647
+ />
648
+ <Menu id='table-edit-menu' anchorEl={editAnchorEl} keepMounted open={Boolean(editAnchorEl)} onClose={_menuClose}>
649
+ <MenuItem onClick={() => editRecord()}>Edit</MenuItem>
650
+ <MenuItem onClick={() => deleteRecord()}>Delete</MenuItem>
651
+ </Menu>
652
+ </div>
653
+ ) : typeof row[colKey] === 'boolean' && !row[colKey] ? (
654
+ 'False'
655
+ ) : typeof row[colKey] === 'boolean' && row[colKey] ? (
656
+ 'True'
657
+ ) : (
658
+ row[colKey]
659
+ )}
578
660
  </TableCell>
579
661
  );
580
662
  })}
@@ -601,13 +683,7 @@ export default function SimpleTableManual(props) {
601
683
  </Link>
602
684
  </div>
603
685
  )}
604
- <Menu
605
- id='simple-menu'
606
- anchorEl={anchorEl}
607
- keepMounted
608
- open={Boolean(anchorEl)}
609
- onClose={_menuClose}
610
- >
686
+ <Menu id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={_menuClose}>
611
687
  <MenuItem onClick={_filterMenu}>
612
688
  <FilterListIcon /> Filter
613
689
  </MenuItem>
@@ -664,12 +740,7 @@ export default function SimpleTableManual(props) {
664
740
  </>
665
741
  ) : (
666
742
  <>
667
- <Select
668
- id='filter'
669
- fullWidth
670
- onChange={_dialogContainsFilter}
671
- value={displayDialogContainsFilter}
672
- >
743
+ <Select id='filter' fullWidth onChange={_dialogContainsFilter} value={displayDialogContainsFilter}>
673
744
  <MenuItem value='contains'>Contains</MenuItem>
674
745
  <MenuItem value='equals'>Equals</MenuItem>
675
746
  <MenuItem value='startswith'>Starts with</MenuItem>
@@ -695,6 +766,6 @@ export default function SimpleTableManual(props) {
695
766
  </Button>
696
767
  </DialogActions>
697
768
  </Dialog>
698
- </React.Fragment>
769
+ </>
699
770
  );
700
771
  }
@@ -1,21 +1,36 @@
1
- import PropTypes from 'prop-types';
2
- import React from "react";
3
- import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
4
- import SimpleTable from '@pega/react-sdk-components/lib/components/template/SimpleTable/SimpleTable';
5
-
6
- import PromotedFilters from '@pega/react-sdk-components/lib/components/template/PromotedFilters';
1
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
+
3
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+
5
+ interface SimpleTableSelectProps extends PConnProps {
6
+ // If any, enter additional props that only exist on this component
7
+ label: string;
8
+ referenceList: object[] | string;
9
+ renderMode: string;
10
+ showLabel: boolean;
11
+ promptedFilters: object[];
12
+ viewName: string;
13
+ parameters: any;
14
+ readonlyContextList: object[] | string;
15
+ dataRelationshipContext: string;
16
+ }
7
17
 
8
18
  const isSelfReferencedProperty = (param, referenceProp) => {
9
19
  const [, parentPropName] = param.split('.');
10
20
  return parentPropName === referenceProp;
11
21
  };
12
- declare const PCore;
22
+
13
23
  /**
14
24
  * SimpleTable react component
15
25
  * @param {*} props - props
16
26
  */
17
- export default function SimpleTableSelect(props) {
18
- const { label, getPConnect, renderMode, showLabel, viewName, parameters, dataRelationshipContext } = props;
27
+ export default function SimpleTableSelect(props: SimpleTableSelectProps) {
28
+ // Get emitted components from map (so we can get any override that may exist)
29
+ const ListView = getComponentFromMap('ListView');
30
+ const SimpleTable = getComponentFromMap('SimpleTable');
31
+ const PromotedFilters = getComponentFromMap('PromotedFilters');
32
+
33
+ const { label, getPConnect, renderMode = '', showLabel = true, viewName = '', parameters, dataRelationshipContext = null } = props;
19
34
 
20
35
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
21
36
  if (propsToUse.showLabel === false) {
@@ -24,7 +39,7 @@ export default function SimpleTableSelect(props) {
24
39
 
25
40
  const pConn = getPConnect();
26
41
  const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
27
- const { selectionMode, selectionList } = pConn.getConfigProps();
42
+ const { selectionMode, selectionList } = pConn.getConfigProps() as any;
28
43
  const isMultiSelectMode = selectionMode === MULTI;
29
44
 
30
45
  if (isMultiSelectMode && renderMode === 'ReadOnly') {
@@ -34,20 +49,23 @@ export default function SimpleTableSelect(props) {
34
49
  const pageReference = pConn.getPageReference();
35
50
  let referenceProp = isMultiSelectMode ? selectionList.substring(1) : pageReference.substring(pageReference.lastIndexOf('.') + 1);
36
51
  // Replace here to use the context name instead
37
- let contextPageReference = null;
52
+ let contextPageReference: string | null = null;
38
53
  if (props.dataRelationshipContext !== null && selectionMode === 'single') {
39
54
  referenceProp = dataRelationshipContext;
40
55
  contextPageReference = pageReference.concat('.').concat(referenceProp);
41
56
  }
42
57
 
58
+ // Need to get this written so typedefs work
43
59
  const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode
44
- ? pConn.getFieldMetadata(`@P .${referenceProp}`)
45
- : pConn.getCurrentPageFieldMetadata(contextPageReference);
60
+ ? // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
61
+ pConn.getFieldMetadata(`@P .${referenceProp}`)
62
+ : // @ts-ignore - Property 'getCurrentPageFieldMetadata' is private and only accessible within class 'C11nEnv'.
63
+ pConn.getCurrentPageFieldMetadata(contextPageReference);
46
64
 
47
- const compositeKeys: Array<any> = [];
65
+ const compositeKeys: any[] = [];
48
66
  Object.values(fieldParameters).forEach((param: any) => {
49
67
  if (isSelfReferencedProperty(param, referenceProp)) {
50
- compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
68
+ compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
51
69
  }
52
70
  });
53
71
 
@@ -86,7 +104,7 @@ export default function SimpleTableSelect(props) {
86
104
  parameters
87
105
  };
88
106
 
89
- const filters = getPConnect().getRawMetadata().config.promotedFilters ?? [];
107
+ const filters = (getPConnect().getRawMetadata() as any).config.promotedFilters ?? [];
90
108
 
91
109
  const isSearchable = filters.length > 0;
92
110
 
@@ -104,27 +122,3 @@ export default function SimpleTableSelect(props) {
104
122
  }
105
123
  return <ListView {...listViewProps} />;
106
124
  }
107
-
108
- SimpleTableSelect.defaultProps = {
109
- label: undefined,
110
- renderMode: '',
111
- showLabel: true,
112
- promptedFilters: [],
113
- viewName: '',
114
- parameters: undefined,
115
- readonlyContextList: [],
116
- dataRelationshipContext: null
117
- };
118
-
119
- SimpleTableSelect.propTypes = {
120
- label: PropTypes.string,
121
- getPConnect: PropTypes.func.isRequired,
122
- referenceList: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.string]).isRequired,
123
- renderMode: PropTypes.string,
124
- showLabel: PropTypes.bool,
125
- promptedFilters: PropTypes.arrayOf(PropTypes.object),
126
- viewName: PropTypes.string,
127
- parameters: PropTypes.objectOf(PropTypes.any),
128
- readonlyContextList: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.string]),
129
- dataRelationshipContext: PropTypes.string
130
- };