@pega/react-sdk-overrides 23.1.10 → 23.1.12

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 (232) 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 +6 -14
  5. package/lib/designSystemExtension/Banner/Banner.tsx +14 -11
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  7. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +27 -22
  8. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +14 -20
  9. package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
  10. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +44 -19
  11. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -12
  12. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +21 -32
  13. package/lib/designSystemExtension/Operator/Operator.tsx +94 -82
  14. package/lib/designSystemExtension/Pulse/Pulse.tsx +14 -16
  15. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +6 -5
  16. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +14 -14
  17. package/lib/field/AutoComplete/AutoComplete.tsx +24 -26
  18. package/lib/field/AutoComplete/config-ext.json +2 -3
  19. package/lib/field/CancelAlert/CancelAlert.tsx +98 -84
  20. package/lib/field/CancelAlert/index.tsx +1 -1
  21. package/lib/field/Checkbox/Checkbox.tsx +120 -63
  22. package/lib/field/Checkbox/config-ext.json +2 -3
  23. package/lib/field/Currency/Currency.tsx +25 -50
  24. package/lib/field/Currency/config-ext.json +2 -3
  25. package/lib/field/Currency/currency-utils.ts +9 -16
  26. package/lib/field/Date/Date.tsx +15 -11
  27. package/lib/field/Date/config-ext.json +2 -3
  28. package/lib/field/DateTime/DateTime.tsx +9 -9
  29. package/lib/field/DateTime/config-ext.json +1 -2
  30. package/lib/field/Decimal/Decimal.tsx +33 -44
  31. package/lib/field/Decimal/config-ext.json +1 -2
  32. package/lib/field/Decimal/index.tsx +1 -1
  33. package/lib/field/Dropdown/Dropdown.tsx +122 -31
  34. package/lib/field/Dropdown/config-ext.json +1 -2
  35. package/lib/field/Email/Email.tsx +11 -10
  36. package/lib/field/Email/config-ext.json +1 -2
  37. package/lib/field/Email/index.tsx +1 -1
  38. package/lib/field/Group/Group.tsx +39 -0
  39. package/lib/field/Group/config-ext.json +7 -0
  40. package/lib/field/Group/index.tsx +1 -0
  41. package/lib/field/Integer/Integer.tsx +8 -7
  42. package/lib/field/Integer/config-ext.json +1 -2
  43. package/lib/field/MultiSelect/Multiselect.tsx +244 -0
  44. package/lib/field/MultiSelect/index.tsx +1 -0
  45. package/lib/field/MultiSelect/utils.ts +230 -0
  46. package/lib/field/Percentage/Percentage.tsx +46 -41
  47. package/lib/field/Percentage/config-ext.json +1 -2
  48. package/lib/field/Phone/Phone.tsx +13 -12
  49. package/lib/field/Phone/index.tsx +1 -1
  50. package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
  51. package/lib/field/RadioButtons/config-ext.json +1 -2
  52. package/lib/field/RichText/RichText.tsx +8 -7
  53. package/lib/field/ScalarList/ScalarList.tsx +3 -13
  54. package/lib/field/ScalarList/config-ext.json +1 -2
  55. package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
  56. package/lib/field/SemanticLink/config-ext.json +1 -2
  57. package/lib/field/SemanticLink/utils.ts +8 -11
  58. package/lib/field/TextArea/TextArea.tsx +7 -6
  59. package/lib/field/TextArea/config-ext.json +1 -2
  60. package/lib/field/TextContent/TextContent.tsx +4 -6
  61. package/lib/field/TextContent/config-ext.json +1 -2
  62. package/lib/field/TextInput/TextInput.tsx +9 -7
  63. package/lib/field/TextInput/config-ext.json +1 -2
  64. package/lib/field/TextInput/index.tsx +1 -1
  65. package/lib/field/Time/Time.tsx +11 -11
  66. package/lib/field/Time/config-ext.json +1 -2
  67. package/lib/field/URL/URL.tsx +9 -8
  68. package/lib/field/URL/config-ext.json +1 -2
  69. package/lib/field/URL/index.tsx +1 -1
  70. package/lib/field/UserReference/UserReference.tsx +18 -16
  71. package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
  72. package/lib/field/UserReference/config-ext.json +1 -2
  73. package/lib/helpers/attachmentHelpers.ts +13 -8
  74. package/lib/helpers/case-utils.tsx +4 -8
  75. package/lib/helpers/common-utils.ts +5 -1
  76. package/lib/helpers/data_page.ts +3 -7
  77. package/lib/helpers/date-format-utils.ts +3 -3
  78. package/lib/helpers/event-utils.ts +3 -3
  79. package/lib/helpers/field-group-utils.ts +1 -1
  80. package/lib/helpers/formatters/Boolean.ts +9 -26
  81. package/lib/helpers/formatters/Currency.ts +15 -21
  82. package/lib/helpers/formatters/CurrencyMap.ts +505 -501
  83. package/lib/helpers/formatters/Date.ts +20 -26
  84. package/lib/helpers/formatters/common.ts +1 -2
  85. package/lib/helpers/formatters/index.ts +26 -19
  86. package/lib/helpers/instructions-utils.ts +38 -0
  87. package/lib/helpers/reactContextHelpers.ts +2 -2
  88. package/lib/helpers/simpleTableHelpers.ts +59 -83
  89. package/lib/helpers/state-utils.tsx +5 -9
  90. package/lib/helpers/template-utils.ts +3 -6
  91. package/lib/helpers/utils.ts +5 -5
  92. package/lib/helpers/versionHelpers.ts +1 -4
  93. package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
  94. package/lib/infra/ActionButtons/index.tsx +1 -1
  95. package/lib/infra/Assignment/Assignment.tsx +99 -79
  96. package/lib/infra/Assignment/index.tsx +1 -1
  97. package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
  98. package/lib/infra/AssignmentCard/index.tsx +1 -1
  99. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
  100. package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
  101. package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
  102. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
  103. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  104. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
  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 +36 -46
  110. package/lib/infra/Containers/helpers.ts +6 -0
  111. package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
  112. package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
  113. package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
  114. package/lib/infra/DeferLoad/index.tsx +1 -1
  115. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
  116. package/lib/infra/MultiStep/MultiStep.css +11 -15
  117. package/lib/infra/MultiStep/MultiStep.tsx +176 -212
  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 +19 -31
  121. package/lib/infra/Reference/Reference.tsx +16 -18
  122. package/lib/infra/Region/Region.tsx +4 -6
  123. package/lib/infra/RootContainer/RootContainer.tsx +75 -111
  124. package/lib/infra/RootContainer/index.tsx +1 -1
  125. package/lib/infra/Stages/Stages.tsx +32 -39
  126. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
  127. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
  128. package/lib/infra/View/View.tsx +17 -21
  129. package/lib/template/AppShell/AppShell.css +22 -23
  130. package/lib/template/AppShell/AppShell.tsx +39 -74
  131. package/lib/template/BannerPage/BannerPage.tsx +12 -14
  132. package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
  133. package/lib/template/CaseSummary/config-ext.json +1 -2
  134. package/lib/template/CaseView/CaseView.tsx +34 -63
  135. package/lib/template/CaseView/config-ext.json +1 -2
  136. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
  137. package/lib/template/Confirmation/Confirmation.tsx +12 -17
  138. package/lib/template/Confirmation/config-ext.json +1 -2
  139. package/lib/template/DataReference/DataReference.tsx +95 -121
  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 +13 -16
  143. package/lib/template/DefaultForm/config-ext.json +1 -2
  144. package/lib/template/Details/Details/Details.tsx +19 -22
  145. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
  146. package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
  147. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
  148. package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
  149. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
  150. package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
  151. package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
  152. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +15 -14
  153. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
  154. package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
  155. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
  156. package/lib/template/ListPage/ListPage.tsx +5 -10
  157. package/lib/template/ListPage/config-ext.json +1 -2
  158. package/lib/template/ListView/DefaultViewMeta.ts +1 -3
  159. package/lib/template/ListView/ListView.tsx +185 -175
  160. package/lib/template/ListView/config-ext.json +1 -2
  161. package/lib/template/ListView/hooks.ts +24 -26
  162. package/lib/template/ListView/utils.ts +51 -87
  163. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
  164. package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
  165. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
  166. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
  167. package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
  168. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
  169. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +14 -24
  170. package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
  171. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
  172. package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
  173. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
  174. package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
  175. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
  176. package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
  177. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
  178. package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
  179. package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
  180. package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
  181. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
  182. package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
  183. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -121
  184. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
  185. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
  186. package/lib/template/SubTabs/SubTabs.tsx +22 -40
  187. package/lib/template/SubTabs/config-ext.json +1 -2
  188. package/lib/template/SubTabs/tabUtils.ts +2 -5
  189. package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
  190. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
  191. package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
  192. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
  193. package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
  194. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
  195. package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
  196. package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
  197. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +22 -34
  198. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
  199. package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
  200. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
  201. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +13 -21
  202. package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
  203. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
  204. package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
  205. package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
  206. package/lib/template/WssNavBar/WssNavBar.tsx +18 -21
  207. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
  208. package/lib/widget/AppAnnouncement/config-ext.json +1 -2
  209. package/lib/widget/Attachment/Attachment.css +60 -1
  210. package/lib/widget/Attachment/Attachment.tsx +378 -405
  211. package/lib/widget/Attachment/index.tsx +1 -1
  212. package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
  213. package/lib/widget/CaseHistory/config-ext.json +1 -2
  214. package/lib/widget/CaseHistory/index.tsx +1 -1
  215. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
  216. package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
  217. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
  218. package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
  219. package/lib/widget/Followers/Followers.tsx +23 -20
  220. package/lib/widget/Followers/config-ext.json +1 -2
  221. package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
  222. package/lib/widget/SummaryItem/SummaryItem.css +9 -9
  223. package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
  224. package/lib/widget/SummaryItem/index.tsx +1 -1
  225. package/lib/widget/SummaryList/SummaryList.tsx +7 -10
  226. package/lib/widget/ToDo/ToDo.css +4 -4
  227. package/lib/widget/ToDo/ToDo.tsx +52 -53
  228. package/lib/widget/ToDo/config-ext.json +1 -2
  229. package/package.json +5 -2
  230. package/lib/helpers/auth.js +0 -834
  231. package/lib/helpers/authManager.ts +0 -933
  232. package/lib/helpers/config_access.js +0 -186
@@ -4,6 +4,5 @@
4
4
  "description": "Table Template",
5
5
  "type": "Template",
6
6
  "subtype": "LIST",
7
- "properties": [
8
- ]
7
+ "properties": []
9
8
  }
@@ -1,8 +1,6 @@
1
1
  import { useEffect } from 'react';
2
- import { getContext, readContextResponse } from './utils';
3
2
 
4
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
5
- declare const PCore: any;
3
+ import { getContext, readContextResponse } from './utils';
6
4
 
7
5
  export default function useInit(props) {
8
6
  const {
@@ -29,21 +27,22 @@ export default function useInit(props) {
29
27
 
30
28
  (async function init() {
31
29
  // promise to fetch metadata
32
- const metaDataPromise = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
30
+ // @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
31
+ const metaDataPromise: Promise<any> = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
33
32
 
34
33
  const promisesArray = [metaDataPromise];
35
34
 
36
35
  // promise to fetch report configured columns
37
- const reportColumnsPromise = PCore.getAnalyticsUtils()
38
- .getFieldsForDataSource(referenceList, false, getPConnect().getContextName())
39
- .catch(() => {
40
- return Promise.resolve({
41
- data: { data: [] }
42
- });
36
+ const reportColumnsPromise = (
37
+ PCore.getAnalyticsUtils().getFieldsForDataSource(referenceList, false, getPConnect().getContextName()) as Promise<any>
38
+ ).catch(() => {
39
+ return Promise.resolve({
40
+ data: { data: [] }
43
41
  });
42
+ });
44
43
  promisesArray.push(reportColumnsPromise);
45
44
 
46
- const fetchEditDetails = async (metadata) => {
45
+ const fetchEditDetails = async metadata => {
47
46
  const {
48
47
  data: { isQueryable }
49
48
  } = metadata;
@@ -64,7 +63,7 @@ export default function useInit(props) {
64
63
  return Promise.resolve();
65
64
  };
66
65
 
67
- const editPromise = metaDataPromise.then((metadata) => fetchEditDetails(metadata));
66
+ const editPromise = metaDataPromise.then(metadata => fetchEditDetails(metadata));
68
67
  promisesArray.push(editPromise);
69
68
  getContext({
70
69
  tableSource: referenceList,
@@ -76,20 +75,19 @@ export default function useInit(props) {
76
75
  isSearchable,
77
76
  isCacheable: true,
78
77
  xRayUid
79
- })
80
- .then(async (context) => {
81
- if (isCompStillMounted) {
82
- return readContextResponse(context, {
83
- ...props,
84
- editing,
85
- selectionCountThreshold,
86
- ref,
87
- selectionMode,
88
- xRayUid,
89
- cosmosTableRef
90
- });
91
- }
92
- });
78
+ }).then(async context => {
79
+ if (isCompStillMounted) {
80
+ return readContextResponse(context, {
81
+ ...props,
82
+ editing,
83
+ selectionCountThreshold,
84
+ ref,
85
+ selectionMode,
86
+ xRayUid,
87
+ cosmosTableRef
88
+ });
89
+ }
90
+ });
93
91
  })();
94
92
 
95
93
  return () => {
@@ -1,8 +1,5 @@
1
1
  import getDefaultViewMeta from './DefaultViewMeta';
2
2
 
3
- // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 5 errors)
4
- declare const PCore: any;
5
-
6
3
  const USER_REFERENCE = 'UserReference';
7
4
  const PAGE = '!P!';
8
5
  const PAGELIST = '!PL!';
@@ -10,14 +7,13 @@ const PAGELIST = '!PL!';
10
7
  export const formatConstants = {
11
8
  WorkStatus: 'WorkStatus',
12
9
  Integer: 'Integer',
13
- WorkLink: 'WorkLink',
10
+ WorkLink: 'WorkLink'
14
11
  };
15
12
 
16
13
  class DataApi {
17
14
  mappedPropertyToOriginalProperty: any;
18
15
  originalPropertyToMappedProperty: any;
19
16
  constructor() {
20
- ;
21
17
  this.originalPropertyToMappedProperty = {};
22
18
  this.mappedPropertyToOriginalProperty = {};
23
19
  this.setPropertyMaps = this.setPropertyMaps.bind(this);
@@ -47,7 +43,7 @@ class DataApi {
47
43
 
48
44
  export async function getContext(componentConfig) {
49
45
  const {
50
- promisesArray = [], // array of promises which can be invoked paralelly,
46
+ promisesArray = [] // array of promises which can be invoked paralelly,
51
47
  } = componentConfig;
52
48
  const promisesResponseArray = await Promise.all(promisesArray);
53
49
  const dataApi = new DataApi();
@@ -55,7 +51,7 @@ export async function getContext(componentConfig) {
55
51
  promisesResponseArray,
56
52
  setPropertyMaps: dataApi.setPropertyMaps,
57
53
  getMappedProperty: dataApi.getMappedProperty,
58
- getOriginalProperty: dataApi.getOriginalProperty,
54
+ getOriginalProperty: dataApi.getOriginalProperty
59
55
  };
60
56
  }
61
57
 
@@ -86,14 +82,14 @@ export function getFieldNameFromEmbeddedFieldName(propertyName) {
86
82
  * @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
87
83
  */
88
84
  export function updateMetaEmbeddedFieldID(metaFields) {
89
- return metaFields.forEach((metaField) => {
85
+ return metaFields.forEach(metaField => {
90
86
  if (metaField.fieldID?.startsWith(PAGE) || metaField.fieldID?.startsWith(PAGELIST)) {
91
87
  metaField.fieldID = getFieldNameFromEmbeddedFieldName(metaField.fieldID);
92
88
  }
93
89
  });
94
90
  }
95
91
 
96
- export const isEmbeddedField = (field) => {
92
+ export const isEmbeddedField = field => {
97
93
  if (field?.startsWith('@')) {
98
94
  field = field.substring(field.indexOf(' ') + 1);
99
95
  if (field[0] === '.') field = field.substring(1);
@@ -122,7 +118,7 @@ export const isPageListInPath = (propertyName, currentClassID) => {
122
118
  return false;
123
119
  }
124
120
  const [first, ...rest] = propertyName.split('.');
125
- const metadata = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
121
+ const metadata: any = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
126
122
  if (metadata?.type === 'Page List') {
127
123
  return true;
128
124
  }
@@ -198,15 +194,16 @@ export function preparePropertyMaps(fields, classID, context) {
198
194
  * @returns {Array} Metadata of configured embedded fields
199
195
  */
200
196
  export function getConfigEmbeddedFieldsMeta(configFields, classID) {
201
- const configEmbeddedFieldsMeta: Array<any> = [];
202
- configFields.forEach((field) => {
197
+ const configEmbeddedFieldsMeta: any[] = [];
198
+ configFields.forEach(field => {
203
199
  let value = field;
204
200
  if (isEmbeddedField(value)) {
205
201
  // conversion Page.PageList[].property => Page.PageList.property
206
202
  if (value.includes('[')) {
207
203
  value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
208
204
  }
209
- const meta = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
205
+ // @ts-ignore - Expected 3 arguments, but got 2.
206
+ const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
210
207
  meta.fieldID = field;
211
208
  configEmbeddedFieldsMeta.push(meta);
212
209
  }
@@ -223,8 +220,8 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) {
223
220
  */
224
221
  export function mergeConfigEmbeddedFieldsMeta(configEmbeddedFieldsMeta, metaFields) {
225
222
  const mergedMetaFields = [...metaFields];
226
- configEmbeddedFieldsMeta.forEach((configFieldMeta) => {
227
- const fieldMeta = metaFields.find((metaField) => metaField.fieldID === configFieldMeta.fieldID);
223
+ configEmbeddedFieldsMeta.forEach(configFieldMeta => {
224
+ const fieldMeta = metaFields.find(metaField => metaField.fieldID === configFieldMeta.fieldID);
228
225
  if (!fieldMeta) mergedMetaFields.push(configFieldMeta);
229
226
  });
230
227
  return mergedMetaFields;
@@ -242,7 +239,7 @@ const oldToNewFieldTypeMapping = {
242
239
  * @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
243
240
  */
244
241
  function updateFieldType(metaFields) {
245
- metaFields.forEach((metaField) => {
242
+ metaFields.forEach(metaField => {
246
243
  if (metaField.type) metaField.type = oldToNewFieldTypeMapping[metaField.type] || metaField.type;
247
244
  });
248
245
  }
@@ -268,7 +265,7 @@ function getPresetMetaAttribute(attribute) {
268
265
  * @returns {Array} List of fields with updated meta objects.
269
266
  */
270
267
  function generateViewMetaData(rawFields, classID, showField) {
271
- return rawFields.map((item) => getDefaultViewMeta(item, classID, showField));
268
+ return rawFields.map(item => getDefaultViewMeta(item, classID, showField));
272
269
  }
273
270
 
274
271
  /**
@@ -283,7 +280,7 @@ function generateViewMetaData(rawFields, classID, showField) {
283
280
  */
284
281
  function getConfigFields(configFields, primaryFields, metaFields, classID) {
285
282
  const presetConfigFields = configFields;
286
- const primaryFieldsViewIndex = presetConfigFields.findIndex((field) => field.config.value === 'pyPrimaryFields');
283
+ const primaryFieldsViewIndex = presetConfigFields.findIndex(field => field.config.value === 'pyPrimaryFields');
287
284
  if (!primaryFields || !primaryFields.length) {
288
285
  if (primaryFieldsViewIndex < 0) return presetConfigFields;
289
286
 
@@ -295,12 +292,11 @@ function getConfigFields(configFields, primaryFields, metaFields, classID) {
295
292
  if (primaryFieldsViewIndex > -1) {
296
293
  // list of uncommon fields - non overlap of primary fields grouped view and independent entity columns of primary type
297
294
  const uncommonFieldsList = primaryFields.filter(
298
- (primaryField) =>
299
- !presetConfigFields.some((presetConfigField) => presetConfigField.config.value.split('.')[1] === primaryField)
295
+ primaryField => !presetConfigFields.some(presetConfigField => presetConfigField.config.value.split('.')[1] === primaryField)
300
296
  );
301
- const uncommonFieldsRawMeta: Array<any> = [];
302
- uncommonFieldsList.forEach((uncommonField) => {
303
- const uncommonFieldMeta = metaFields.find((metaField) => metaField.fieldID === uncommonField);
297
+ const uncommonFieldsRawMeta: any[] = [];
298
+ uncommonFieldsList.forEach(uncommonField => {
299
+ const uncommonFieldMeta = metaFields.find(metaField => metaField.fieldID === uncommonField);
304
300
  if (uncommonFieldMeta) uncommonFieldsRawMeta.push(uncommonFieldMeta);
305
301
  });
306
302
  const uncommonFieldsConfigMeta = generateViewMetaData(uncommonFieldsRawMeta, classID, true);
@@ -322,14 +318,7 @@ function getConfigFields(configFields, primaryFields, metaFields, classID) {
322
318
  * @param {Array} metaFields List of all metafields
323
319
  * @returns {object} Table config object
324
320
  */
325
- export function getTableConfigFromPresetMeta(
326
- presetMeta,
327
- isMetaWithPresets,
328
- getPConnect,
329
- classID,
330
- primaryFields,
331
- metaFields
332
- ) {
321
+ export function getTableConfigFromPresetMeta(presetMeta, isMetaWithPresets, getPConnect, classID, primaryFields, metaFields) {
333
322
  let presetId;
334
323
  let presetName;
335
324
  let cardHeader;
@@ -354,7 +343,7 @@ export function getTableConfigFromPresetMeta(
354
343
  [fieldsMeta] = presetMeta.children;
355
344
  if (
356
345
  presetMeta.timelineTitle &&
357
- !fieldsMeta.children.find((fieldMeta) => {
346
+ !fieldsMeta.children.find(fieldMeta => {
358
347
  return fieldMeta?.config?.value === presetMeta.timelineTitle?.config?.value;
359
348
  })
360
349
  ) {
@@ -363,7 +352,7 @@ export function getTableConfigFromPresetMeta(
363
352
  }
364
353
  if (
365
354
  presetMeta.timelineDate &&
366
- !fieldsMeta.children.find((fieldMeta) => {
355
+ !fieldsMeta.children.find(fieldMeta => {
367
356
  return fieldMeta?.config?.value === presetMeta.timelineDate?.config?.value;
368
357
  })
369
358
  ) {
@@ -377,7 +366,7 @@ export function getTableConfigFromPresetMeta(
377
366
  fieldsMeta
378
367
  .getPConnect()
379
368
  .getChildren()
380
- ?.map((child) => {
369
+ ?.map(child => {
381
370
  return child.getPConnect().getRawMetadata();
382
371
  }),
383
372
  primaryFields,
@@ -412,7 +401,7 @@ function getReportColumns(response) {
412
401
  data: { data: reportColumns }
413
402
  } = response;
414
403
  const reportColumnsSet = new Set();
415
- reportColumns?.forEach((item) => {
404
+ reportColumns?.forEach(item => {
416
405
  let val = item.pyFieldName;
417
406
  // Remove '.' from index 0 only, if '.' is present
418
407
  if (val[0] === '.') {
@@ -450,7 +439,7 @@ function getConfigFieldValue(config) {
450
439
  */
451
440
  function prepareConfigFields(configFields, pushToComponentsList) {
452
441
  const configFieldSet = new Set();
453
- configFields.forEach((item) => {
442
+ configFields.forEach(item => {
454
443
  pushToComponentsList(item.type);
455
444
  const val = getConfigFieldValue(item.config);
456
445
  configFieldSet.add(val);
@@ -467,7 +456,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
467
456
  * @returns {object} config with its field value equal to fieldID, which means an authored field
468
457
  */
469
458
  function findAuthoredField(configFields, fieldID) {
470
- return configFields.find((configField) => {
459
+ return configFields.find(configField => {
471
460
  const val = getConfigFieldValue(configField.config);
472
461
  return val === fieldID;
473
462
  });
@@ -537,16 +526,9 @@ function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, cl
537
526
  * @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
538
527
  * @returns {Array} List of extra fields with their meta updated.
539
528
  */
540
- function prepareExtraFields(
541
- metaFields,
542
- configFields,
543
- configFieldSet,
544
- reportColumnsSet,
545
- classID,
546
- showDynamicFields
547
- ) {
529
+ function prepareExtraFields(metaFields, configFields, configFieldSet, reportColumnsSet, classID, showDynamicFields) {
548
530
  // Filter all the extra fields
549
- const extraFileds = metaFields.filter((item) => {
531
+ const extraFileds = metaFields.filter(item => {
550
532
  return isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classID, showDynamicFields);
551
533
  });
552
534
  return generateViewMetaData(extraFileds, classID, false);
@@ -569,10 +551,7 @@ function populateRenderingOptions(name, config, field) {
569
551
  config.cellRenderer = formatConstants.Integer;
570
552
  }
571
553
  }
572
- export function initializeColumns(
573
- fields: Array<any> = [],
574
- getMappedProperty: any = null
575
- ) {
554
+ export function initializeColumns(fields: any[] = [], getMappedProperty: any = null) {
576
555
  return fields.map((field, originalColIndex) => {
577
556
  let name = field.config.value;
578
557
 
@@ -601,7 +580,7 @@ export function initializeColumns(
601
580
  fieldType: field.config.fieldType,
602
581
  meta: {
603
582
  ...field
604
- },
583
+ }
605
584
  };
606
585
 
607
586
  populateRenderingOptions(name, config, field);
@@ -610,9 +589,9 @@ export function initializeColumns(
610
589
  });
611
590
  }
612
591
 
613
- export const getItemKey = (fields) => {
592
+ export const getItemKey = fields => {
614
593
  let itemKey;
615
- if (fields.findIndex((field) => field.id === 'pyGUID') > -1) {
594
+ if (fields.findIndex(field => field.id === 'pyGUID') > -1) {
616
595
  itemKey = 'pyGUID';
617
596
  } else {
618
597
  itemKey = 'pzInsKey';
@@ -621,9 +600,9 @@ export const getItemKey = (fields) => {
621
600
  };
622
601
 
623
602
  export function preparePatchQueryFields(fields, isDataObject = false, classID = '') {
624
- const queryFields: Array<any> = [];
625
- fields.forEach((field) => {
626
- const patchFields: Array<any> = [];
603
+ const queryFields: any[] = [];
604
+ fields.forEach(field => {
605
+ const patchFields: any[] = [];
627
606
  if (field.cellRenderer === 'WorkLink') {
628
607
  if (field.customObject && field.customObject.isAssignmentLink) {
629
608
  const associationName = field.name.includes(':') ? `${field.name.split(':')[0]}:` : '';
@@ -637,17 +616,15 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
637
616
  } else if (isDataObject) {
638
617
  const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
639
618
  const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
640
- dataPageKeys?.forEach((item) =>
641
- item.isAlternateKeyStorage ? patchFields.push(item.linkedField) : patchFields.push(item.keyName)
642
- );
619
+ dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? patchFields.push(item.linkedField) : patchFields.push(item.keyName)));
643
620
  } else {
644
621
  patchFields.push('pyID');
645
622
  patchFields.push('pzInsKey');
646
623
  patchFields.push('pxObjClass');
647
624
  }
648
625
  }
649
- patchFields.forEach((k) => {
650
- if (!queryFields.find((q) => q === k)) {
626
+ patchFields.forEach(k => {
627
+ if (!queryFields.find(q => q === k)) {
651
628
  queryFields.push(k);
652
629
  }
653
630
  });
@@ -660,7 +637,7 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
660
637
  * Update the renderer type for the properties of type Page.
661
638
  */
662
639
  export function updatePageFieldsConfig(configFields, parentClassID) {
663
- return configFields.forEach((item) => {
640
+ return configFields.forEach(item => {
664
641
  const {
665
642
  type,
666
643
  config: { value }
@@ -674,18 +651,10 @@ export function updatePageFieldsConfig(configFields, parentClassID) {
674
651
  }
675
652
 
676
653
  export const readContextResponse = async (context, params) => {
677
- const {
678
- getPConnect,
679
- apiContext,
680
- setListContext,
681
- children,
682
- showDynamicFields,
683
- referenceList,
684
- isDataObject
685
- } = params;
654
+ const { getPConnect, apiContext, setListContext, children, showDynamicFields, referenceList, isDataObject } = params;
686
655
  const { promisesResponseArray, apiContext: otherContext } = context;
687
656
  // eslint-disable-next-line sonarjs/no-unused-collection
688
- const listOfComponents: Array<any> = [];
657
+ const listOfComponents: any[] = [];
689
658
  const {
690
659
  data: { fields: metaFields, classID, isQueryable }
691
660
  } = promisesResponseArray[0];
@@ -694,7 +663,7 @@ export const readContextResponse = async (context, params) => {
694
663
  } = promisesResponseArray[0];
695
664
  // When list is configured with Include all class fields configuration, provide support for Primary fields column
696
665
  if (showDynamicFields) {
697
- const sourceMetadata = PCore.getMetadataUtils().getDataPageMetadata(referenceList);
666
+ const sourceMetadata: any = PCore.getMetadataUtils().getDataPageMetadata(referenceList);
698
667
  if (sourceMetadata?.primaryFields) {
699
668
  primaryFields = sourceMetadata.primaryFields;
700
669
  }
@@ -703,18 +672,17 @@ export const readContextResponse = async (context, params) => {
703
672
  }
704
673
  updateFieldType(metaFields);
705
674
 
706
-
707
675
  if (isDataObject) {
708
- const compositeKeys: Array<any> = [];
676
+ const compositeKeys: any[] = [];
709
677
  const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
710
678
  const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
711
- dataPageKeys?.forEach((item) =>
712
- item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)
713
- );
679
+ dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
714
680
  if (compositeKeys.length) {
715
681
  otherContext.setCompositeKeys(compositeKeys);
716
682
  }
717
- otherContext.fetchRowActionDetails = null;
683
+ if (otherContext) {
684
+ otherContext.fetchRowActionDetails = null;
685
+ }
718
686
  }
719
687
 
720
688
  const presetArray = [];
@@ -726,9 +694,7 @@ export const readContextResponse = async (context, params) => {
726
694
  let fields;
727
695
  let tableConfig;
728
696
  childrenIterator?.forEach((presetMeta, index) => {
729
- const {
730
- configFields
731
- } = getTableConfigFromPresetMeta(
697
+ const { configFields } = getTableConfigFromPresetMeta(
732
698
  { ...presetMeta, label: resolvedPresets[index].label },
733
699
  isMetaWithPresets,
734
700
  getPConnect,
@@ -736,7 +702,7 @@ export const readContextResponse = async (context, params) => {
736
702
  primaryFields,
737
703
  metaFields
738
704
  );
739
- const pushToComponentsList = (fieldType) => {
705
+ const pushToComponentsList = fieldType => {
740
706
  listOfComponents.push(fieldType);
741
707
  };
742
708
  // read report columns response - in case of nonqueryable ignore the response and rely only on the fields configured at authoing time in presets
@@ -767,9 +733,7 @@ export const readContextResponse = async (context, params) => {
767
733
 
768
734
  const { getMappedProperty } = context;
769
735
 
770
- fields = initializeColumns(
771
- [...configFields, ...extraFields], getMappedProperty
772
- );
736
+ fields = initializeColumns([...configFields, ...extraFields], getMappedProperty);
773
737
  const patchQueryFields = preparePatchQueryFields(fields, isDataObject, classID);
774
738
  const itemKey = getItemKey(fields);
775
739
  tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable };
@@ -779,7 +743,7 @@ export const readContextResponse = async (context, params) => {
779
743
  meta,
780
744
  presets: presetArray,
781
745
  apiContext: {
782
- ...apiContext,
746
+ ...apiContext
783
747
  }
784
748
  });
785
749
  };
@@ -1,37 +1,37 @@
1
- import React from "react";
2
- import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
2
 
4
3
  interface MultiReferenceReadOnlyProps extends PConnProps {
5
- config: { referenceList: any, readonlyContextList: any },
6
- label: string,
7
- hideLabel: boolean
4
+ config: { referenceList: any; readonlyContextList: any };
5
+ label: string;
6
+ hideLabel: boolean;
8
7
  }
9
8
 
10
-
11
9
  export default function MultiReferenceReadOnly(props: MultiReferenceReadOnlyProps) {
12
10
  const { getPConnect, label = '', hideLabel = false, config } = props;
13
11
  const { referenceList, readonlyContextList } = config;
14
12
 
15
13
  // When referenceList does not contain selected values, it should be replaced with readonlyContextList while calling SimpleTableManual
16
14
  let readonlyContextObject;
17
- if ( !PCore.getAnnotationUtils().isProperty(referenceList)) {
15
+ if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
18
16
  readonlyContextObject = {
19
17
  referenceList: readonlyContextList
20
18
  };
21
19
  }
22
20
 
23
- const component = getPConnect().createComponent({
24
- type: "SimpleTable",
25
- config: {
26
- ...config,
27
- ...readonlyContextObject,
28
- label,
29
- hideLabel
30
- }
31
- },
32
- '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
21
+ const component = getPConnect().createComponent(
22
+ {
23
+ type: 'SimpleTable',
24
+ config: {
25
+ ...config,
26
+ ...readonlyContextObject,
27
+ label,
28
+ hideLabel
29
+ }
30
+ },
31
+ '',
32
+ '',
33
+ {}
34
+ ); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
33
35
 
34
- return (
35
- <React.Fragment>{component}</React.Fragment>
36
- )
36
+ return <>{component}</>;
37
37
  }
@@ -9,7 +9,6 @@
9
9
  float: left;
10
10
  padding: 0rem 0.3125rem 0rem 0rem;
11
11
  height: 100%;
12
-
13
12
  }
14
13
 
15
14
  .psdk-narrow-wide-column .psdk-wide-column-column {
@@ -17,5 +16,4 @@
17
16
  float: left;
18
17
  padding: 0rem 0rem 0rem 0.3125rem;
19
18
  height: 100%;
20
-
21
19
  }
@@ -1,50 +1,37 @@
1
- import React from "react";
2
-
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './NarrowWide.css';
4
4
 
5
- // NarrowWide does NOT have getPConnect. So, no need to extend from PConnProps
6
- interface NarrowWideProps {
5
+ interface NarrowWideProps extends PConnProps {
7
6
  // If any, enter additional props that only exist on this component
8
- a: any,
9
- b: any,
10
- children?: Array<any>,
7
+ a: any;
8
+ b: any;
11
9
  // eslint-disable-next-line react/no-unused-prop-types
12
- title?: string,
10
+ title?: string;
13
11
  // eslint-disable-next-line react/no-unused-prop-types
14
- cols?: string,
12
+ cols?: string;
15
13
  // eslint-disable-next-line react/no-unused-prop-types
16
- icon?: string
14
+ icon?: string;
17
15
  }
18
16
 
19
-
20
- export default function NarrowWide(props: NarrowWideProps) {
17
+ export default function NarrowWide(props: PropsWithChildren<NarrowWideProps>) {
21
18
  // const {a, b /*, cols, icon, title */ } = props;
22
- const {a, b, children} = props;
19
+ const { a, b, children } = props;
23
20
 
24
21
  return (
25
- <React.Fragment>
26
- {children && children.length === 2 &&
27
- <div className="psdk-narrow-wide-column">
28
- <div className="psdk-narrow-column-column">
29
- {children[0]}
30
- </div>
31
- <div className="psdk-wide-column-column">
32
- {children[1]}
33
- </div>
34
- </div>
35
- }
36
- {a && b &&
37
- <div className="psdk-narrow-wide-column">
38
- <div className="psdk-narrow-column-column">
39
- {a}
40
- </div>
41
- <div className="psdk-wide-column-column">
42
- {b}
43
- </div>
44
- </div>
45
- }
46
- </React.Fragment>
47
-
48
- )
49
-
22
+ <>
23
+ {children && (children as ReactElement[]).length === 2 && (
24
+ <div className='psdk-narrow-wide-column'>
25
+ <div className='psdk-narrow-column-column'>{children[0]}</div>
26
+ <div className='psdk-wide-column-column'>{children[1]}</div>
27
+ </div>
28
+ )}
29
+ {a && b && (
30
+ <div className='psdk-narrow-wide-column'>
31
+ <div className='psdk-narrow-column-column'>{a}</div>
32
+ <div className='psdk-wide-column-column'>{b}</div>
33
+ </div>
34
+ )}
35
+ </>
36
+ );
50
37
  }