@pega/react-sdk-overrides 8.8.21 → 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 (128) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +9 -13
  2. package/lib/designSystemExtension/Banner/Banner.tsx +1 -12
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +10 -15
  4. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -10
  5. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +3 -10
  6. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +3 -11
  7. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +3 -11
  8. package/lib/designSystemExtension/Operator/Operator.tsx +12 -16
  9. package/lib/designSystemExtension/Pulse/Pulse.tsx +7 -11
  10. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -10
  11. package/lib/field/AutoComplete/AutoComplete.tsx +18 -37
  12. package/lib/field/CancelAlert/CancelAlert.tsx +4 -9
  13. package/lib/field/Checkbox/Checkbox.tsx +16 -39
  14. package/lib/field/Currency/Currency.tsx +15 -23
  15. package/lib/field/Currency/currency-utils.ts +5 -1
  16. package/lib/field/Date/Date.tsx +15 -22
  17. package/lib/field/DateTime/DateTime.tsx +14 -25
  18. package/lib/field/Decimal/Decimal.tsx +14 -25
  19. package/lib/field/Dropdown/Dropdown.tsx +26 -30
  20. package/lib/field/Email/Email.tsx +9 -17
  21. package/lib/field/Integer/Integer.tsx +7 -15
  22. package/lib/field/Percentage/Percentage.tsx +7 -15
  23. package/lib/field/Phone/Phone.tsx +11 -19
  24. package/lib/field/RadioButtons/RadioButtons.tsx +37 -25
  25. package/lib/field/SemanticLink/SemanticLink.tsx +25 -26
  26. package/lib/field/TextArea/TextArea.tsx +5 -14
  27. package/lib/field/TextContent/TextContent.tsx +1 -10
  28. package/lib/field/TextInput/TextInput.tsx +6 -15
  29. package/lib/field/Time/Time.tsx +27 -22
  30. package/lib/field/URL/URL.tsx +8 -16
  31. package/lib/field/UserReference/UserReference.tsx +60 -50
  32. package/lib/helpers/attachmentHelpers.ts +4 -4
  33. package/lib/helpers/auth.js +397 -741
  34. package/lib/helpers/authManager.js +634 -0
  35. package/lib/helpers/case-utils.tsx +9 -8
  36. package/lib/helpers/common-utils.ts +1 -1
  37. package/lib/helpers/config_access.js +73 -0
  38. package/lib/helpers/date-format-utils.ts +1 -1
  39. package/lib/helpers/event-utils.ts +1 -1
  40. package/lib/helpers/formatters/Currency.ts +11 -11
  41. package/lib/helpers/formatters/CurrencyMap.ts +5 -8
  42. package/lib/helpers/formatters/Date.ts +1 -1
  43. package/lib/helpers/formatters/common.ts +6 -2
  44. package/lib/helpers/formatters/index.ts +3 -3
  45. package/lib/helpers/simpleTableHelpers.ts +7 -7
  46. package/lib/helpers/state-utils.tsx +3 -0
  47. package/lib/helpers/template-utils.ts +6 -3
  48. package/lib/helpers/versionHelpers.ts +3 -0
  49. package/lib/infra/ActionButtons/ActionButtons.tsx +19 -9
  50. package/lib/infra/Assignment/Assignment.tsx +28 -21
  51. package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -15
  52. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +58 -57
  53. package/lib/infra/Containers/FlowContainer/helpers.ts +3 -0
  54. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +19 -14
  55. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -14
  56. package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -13
  57. package/lib/infra/DashboardFilter/filterUtils.tsx +1 -1
  58. package/lib/infra/DeferLoad/DeferLoad.tsx +20 -14
  59. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +14 -10
  60. package/lib/infra/MultiStep/MultiStep.tsx +22 -22
  61. package/lib/infra/NavBar/NavBar.tsx +21 -14
  62. package/lib/infra/Reference/Reference.tsx +18 -13
  63. package/lib/infra/Region/Region.tsx +6 -8
  64. package/lib/infra/RootContainer/RootContainer.tsx +25 -16
  65. package/lib/infra/Stages/Stages.tsx +8 -10
  66. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -8
  67. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
  68. package/lib/infra/View/View.tsx +22 -21
  69. package/lib/template/AppShell/AppShell.tsx +25 -36
  70. package/lib/template/BannerPage/BannerPage.tsx +31 -26
  71. package/lib/template/CaseSummary/CaseSummary.tsx +8 -15
  72. package/lib/template/CaseView/CaseView.tsx +25 -24
  73. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +19 -10
  74. package/lib/template/Confirmation/Confirmation.tsx +53 -27
  75. package/lib/template/DataReference/DataReference.tsx +52 -48
  76. package/lib/template/DefaultForm/DefaultForm.tsx +12 -14
  77. package/lib/template/Details/Details/Details.tsx +17 -16
  78. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +16 -13
  79. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +18 -19
  80. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +18 -20
  81. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +28 -22
  82. package/lib/template/InlineDashboard/InlineDashboard.tsx +7 -11
  83. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +17 -19
  84. package/lib/template/ListPage/ListPage.tsx +13 -14
  85. package/lib/template/ListView/ListView.tsx +186 -189
  86. package/lib/template/ListView/utils.ts +23 -170
  87. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +19 -10
  88. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +1 -16
  89. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +18 -19
  90. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +1 -9
  91. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
  92. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -8
  93. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
  94. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +7 -5
  95. package/lib/template/PromotedFilters/PromotedFilters.tsx +14 -16
  96. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -102
  97. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +7 -24
  98. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -23
  99. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +36 -34
  100. package/lib/template/SubTabs/SubTabs.tsx +11 -10
  101. package/lib/template/SubTabs/tabUtils.ts +4 -0
  102. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +15 -10
  103. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
  104. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +12 -10
  105. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +3 -17
  106. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +25 -35
  107. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +1 -7
  108. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +17 -15
  109. package/lib/template/WssNavBar/WssNavBar.tsx +1 -18
  110. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +21 -13
  111. package/lib/widget/Attachment/Attachment.tsx +16 -28
  112. package/lib/widget/CaseHistory/CaseHistory.tsx +10 -12
  113. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -13
  114. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +22 -35
  115. package/lib/widget/Followers/Followers.tsx +11 -10
  116. package/lib/widget/QuickCreate/QuickCreate.tsx +5 -11
  117. package/lib/widget/SummaryItem/SummaryItem.tsx +1 -11
  118. package/lib/widget/SummaryList/SummaryList.tsx +3 -17
  119. package/lib/widget/ToDo/ToDo.tsx +105 -62
  120. package/package.json +1 -1
  121. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +0 -121
  122. package/lib/designSystemExtension/RichTextEditor/index.tsx +0 -1
  123. package/lib/field/RichText/RichText.tsx +0 -93
  124. package/lib/field/RichText/index.tsx +0 -1
  125. package/lib/field/ScalarList/ScalarList.tsx +0 -64
  126. package/lib/field/ScalarList/config-ext.json +0 -8
  127. package/lib/field/ScalarList/index.tsx +0 -1
  128. package/lib/helpers/authManager.ts +0 -933
@@ -13,49 +13,13 @@ export const formatConstants = {
13
13
  WorkLink: 'WorkLink',
14
14
  };
15
15
 
16
- class DataApi {
17
- mappedPropertyToOriginalProperty: any;
18
- originalPropertyToMappedProperty: any;
19
- constructor() {
20
- ;
21
- this.originalPropertyToMappedProperty = {};
22
- this.mappedPropertyToOriginalProperty = {};
23
- this.setPropertyMaps = this.setPropertyMaps.bind(this);
24
- this.getMappedProperty = this.getMappedProperty.bind(this);
25
- this.getOriginalProperty = this.getOriginalProperty.bind(this);
26
- }
27
-
28
- setPropertyMaps(originalToMappedPropertyObj = {}, mappedToOriginalPropertyObj = {}) {
29
- this.originalPropertyToMappedProperty = {
30
- ...this.originalPropertyToMappedProperty,
31
- ...originalToMappedPropertyObj
32
- };
33
- this.mappedPropertyToOriginalProperty = {
34
- ...this.mappedPropertyToOriginalProperty,
35
- ...mappedToOriginalPropertyObj
36
- };
37
- }
38
-
39
- getMappedProperty(propertyName) {
40
- return this.originalPropertyToMappedProperty[propertyName] ?? propertyName;
41
- }
42
-
43
- getOriginalProperty(propertyName) {
44
- return this.mappedPropertyToOriginalProperty[propertyName] ?? propertyName;
45
- }
46
- }
47
-
48
16
  export async function getContext(componentConfig) {
49
17
  const {
50
18
  promisesArray = [], // array of promises which can be invoked paralelly,
51
19
  } = componentConfig;
52
20
  const promisesResponseArray = await Promise.all(promisesArray);
53
- const dataApi = new DataApi();
54
21
  return {
55
22
  promisesResponseArray,
56
- setPropertyMaps: dataApi.setPropertyMaps,
57
- getMappedProperty: dataApi.getMappedProperty,
58
- getOriginalProperty: dataApi.getOriginalProperty,
59
23
  };
60
24
  }
61
25
 
@@ -70,7 +34,7 @@ export async function getContext(componentConfig) {
70
34
  * getFieldNameFromEmbeddedFieldName('!P!Organisation:Name') return 'Organisation.Name'
71
35
  * getFieldNameFromEmbeddedFieldName('!PL!Employees:Name') return 'Employees.Name'
72
36
  */
73
- export function getFieldNameFromEmbeddedFieldName(propertyName) {
37
+ export function getFieldNameFromEmbeddedFieldName(propertyName) {
74
38
  let value = propertyName;
75
39
  if (value.startsWith(PAGE) || value.startsWith(PAGELIST)) {
76
40
  value = value.substring(value.lastIndexOf('!') + 1);
@@ -85,7 +49,7 @@ export function getFieldNameFromEmbeddedFieldName(propertyName) {
85
49
  * @ignore
86
50
  * @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
87
51
  */
88
- export function updateMetaEmbeddedFieldID(metaFields) {
52
+ export function updateMetaEmbeddedFieldID(metaFields) {
89
53
  return metaFields.forEach((metaField) => {
90
54
  if (metaField.fieldID?.startsWith(PAGE) || metaField.fieldID?.startsWith(PAGELIST)) {
91
55
  metaField.fieldID = getFieldNameFromEmbeddedFieldName(metaField.fieldID);
@@ -101,94 +65,6 @@ export const isEmbeddedField = (field) => {
101
65
  return field?.indexOf('.') > 0;
102
66
  };
103
67
 
104
- /**
105
- * [isPageListProperty]
106
- * Description - checking if propertyName is pageList or not
107
- * @ignore
108
- * @param {string} propertyName PropertyName
109
- * @returns {boolean} true if property is pageList else false
110
- *
111
- * @example <caption>Example for isPageListProperty </caption>
112
- * isPageListProperty('!PL!Employees.Name') return true
113
- * isPageListProperty('!P!Employees.Name') return false
114
- * isPageListProperty('Name') return false
115
- */
116
- export function isPageListProperty(propertyName) {
117
- return propertyName.startsWith(PAGELIST);
118
- }
119
-
120
- export const isPageListInPath = (propertyName, currentClassID) => {
121
- if (!propertyName.includes('.')) {
122
- return false;
123
- }
124
- const [first, ...rest] = propertyName.split('.');
125
- const metadata = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
126
- if (metadata?.type === 'Page List') {
127
- return true;
128
- }
129
- return isPageListInPath(rest.join('.'), metadata?.pageClass);
130
- };
131
-
132
- /**
133
- * [getEmbeddedFieldName]
134
- * Description - converting normal field name to embedded field starting with !P! or !PL!
135
- * @ignore
136
- * @param {string} propertyName Field name
137
- * @param {string} classID classID of datapage
138
- * @returns {string} returns converted string with !P! or !PL! and :
139
- *
140
- * @example <caption>Example for getEmbeddedFieldName </caption>
141
- * For page property, getEmbeddedFieldName('Organisation.Name') return '!P!Organisation:Name'
142
- * For pageList property, getEmbeddedFieldName('Employees.Name') return '!PL!Employees:Name'
143
- */
144
-
145
- export function getEmbeddedFieldName(propertyName, classID) {
146
- let value = propertyName;
147
- if (isPageListInPath(value, classID)) {
148
- value = `!PL!${value.replace(/\./g, ':')}`;
149
- } else {
150
- value = `!P!${value.replace(/\./g, ':')}`;
151
- }
152
- return value;
153
- }
154
-
155
- /**
156
- * [preparePropertyMaps]
157
- * Description - preparing maps for property names and set it in dataApi context
158
- * @ignore
159
- * @param {Array} fields fields array
160
- * @param {string} classID classID of datapage
161
- * @param {string} context dataApi context
162
- * @returns {boolean} true if pageListProperty is present
163
- */
164
- export function preparePropertyMaps(fields, classID, context) {
165
- const { setPropertyMaps } = context;
166
- const maps = fields.reduce(
167
- (acc, field) => {
168
- let { value } = field.config;
169
- if (value.startsWith('@')) {
170
- value = value.substring(value.indexOf(' ') + 1);
171
- if (value[0] === '.') value = value.substring(1);
172
- }
173
- let name = value;
174
- // Preparing name for embedded property
175
- if (isEmbeddedField(name)) {
176
- name = getEmbeddedFieldName(name, classID);
177
- }
178
- if (isPageListProperty(name) && !acc[2]) {
179
- acc[2] = true;
180
- }
181
- acc[0][value] = name;
182
- acc[1][name] = value;
183
-
184
- return acc;
185
- },
186
- [{}, {}, false]
187
- );
188
- setPropertyMaps(maps[0], maps[1]);
189
- return maps[2];
190
- }
191
-
192
68
  /**
193
69
  * [getConfigEmbeddedFieldsMeta]
194
70
  * Description - Get the metadata for configured embedded fields
@@ -198,7 +74,7 @@ export function preparePropertyMaps(fields, classID, context) {
198
74
  * @returns {Array} Metadata of configured embedded fields
199
75
  */
200
76
  export function getConfigEmbeddedFieldsMeta(configFields, classID) {
201
- const configEmbeddedFieldsMeta: Array<any> = [];
77
+ const configEmbeddedFieldsMeta:Array<any> = [];
202
78
  configFields.forEach((field) => {
203
79
  let value = field;
204
80
  if (isEmbeddedField(value)) {
@@ -241,7 +117,7 @@ const oldToNewFieldTypeMapping = {
241
117
  * @ignore
242
118
  * @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
243
119
  */
244
- function updateFieldType(metaFields) {
120
+ function updateFieldType(metaFields) {
245
121
  metaFields.forEach((metaField) => {
246
122
  if (metaField.type) metaField.type = oldToNewFieldTypeMapping[metaField.type] || metaField.type;
247
123
  });
@@ -267,7 +143,7 @@ function getPresetMetaAttribute(attribute) {
267
143
  * @param {string} classID Class ID from the response
268
144
  * @returns {Array} List of fields with updated meta objects.
269
145
  */
270
- function generateViewMetaData(rawFields, classID, showField) {
146
+ function generateViewMetaData(rawFields, classID, showField) {
271
147
  return rawFields.map((item) => getDefaultViewMeta(item, classID, showField));
272
148
  }
273
149
 
@@ -281,7 +157,7 @@ function generateViewMetaData(rawFields, classID, showField) {
281
157
  * @param {string} classID Class ID from the response
282
158
  * @returns {Array} List of all fields with their meta updated.
283
159
  */
284
- function getConfigFields(configFields, primaryFields, metaFields, classID) {
160
+ function getConfigFields(configFields, primaryFields, metaFields, classID) {
285
161
  const presetConfigFields = configFields;
286
162
  const primaryFieldsViewIndex = presetConfigFields.findIndex((field) => field.config.value === 'pyPrimaryFields');
287
163
  if (!primaryFields || !primaryFields.length) {
@@ -298,9 +174,9 @@ function getConfigFields(configFields, primaryFields, metaFields, classID) {
298
174
  (primaryField) =>
299
175
  !presetConfigFields.some((presetConfigField) => presetConfigField.config.value.split('.')[1] === primaryField)
300
176
  );
301
- const uncommonFieldsRawMeta: Array<any> = [];
177
+ const uncommonFieldsRawMeta:Array<any> = [];
302
178
  uncommonFieldsList.forEach((uncommonField) => {
303
- const uncommonFieldMeta = metaFields.find((metaField) => metaField.fieldID === uncommonField);
179
+ const uncommonFieldMeta= metaFields.find((metaField) => metaField.fieldID === uncommonField);
304
180
  if (uncommonFieldMeta) uncommonFieldsRawMeta.push(uncommonFieldMeta);
305
181
  });
306
182
  const uncommonFieldsConfigMeta = generateViewMetaData(uncommonFieldsRawMeta, classID, true);
@@ -322,7 +198,7 @@ function getConfigFields(configFields, primaryFields, metaFields, classID) {
322
198
  * @param {Array} metaFields List of all metafields
323
199
  * @returns {object} Table config object
324
200
  */
325
- export function getTableConfigFromPresetMeta(
201
+ export function getTableConfigFromPresetMeta(
326
202
  presetMeta,
327
203
  isMetaWithPresets,
328
204
  getPConnect,
@@ -407,7 +283,7 @@ export function getTableConfigFromPresetMeta(
407
283
  * @param {object} response -
408
284
  * @returns {Set} Set of columns from the report response
409
285
  */
410
- function getReportColumns(response) {
286
+ function getReportColumns(response) {
411
287
  const {
412
288
  data: { data: reportColumns }
413
289
  } = response;
@@ -431,7 +307,7 @@ function getReportColumns(response) {
431
307
  * config.value - Raw value
432
308
  * @returns {string} value - Value with out any annotations or "."
433
309
  */
434
- function getConfigFieldValue(config) {
310
+ function getConfigFieldValue(config) {
435
311
  let { value } = config;
436
312
  if (value.startsWith('@')) {
437
313
  value = value.substring(value.indexOf(' ') + 1);
@@ -466,7 +342,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
466
342
  * @param {string} fieldID Filter
467
343
  * @returns {object} config with its field value equal to fieldID, which means an authored field
468
344
  */
469
- function findAuthoredField(configFields, fieldID) {
345
+ function findAuthoredField(configFields, fieldID) {
470
346
  return configFields.find((configField) => {
471
347
  const val = getConfigFieldValue(configField.config);
472
348
  return val === fieldID;
@@ -481,7 +357,7 @@ function findAuthoredField(configFields, fieldID) {
481
357
  * @param {object} item Field item to copy displayAs and category information
482
358
  * @param {string} classId classID from the response
483
359
  */
484
- function findAndUpdateAuthoredFieldConfig(configFields, item, classId) {
360
+ function findAndUpdateAuthoredFieldConfig(configFields, item, classId) {
485
361
  const authoredField = findAuthoredField(configFields, item.fieldID);
486
362
  if (authoredField?.config) {
487
363
  if (item.displayAs) {
@@ -513,7 +389,7 @@ function findAndUpdateAuthoredFieldConfig(configFields, item, classId) {
513
389
  * @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
514
390
  * @returns {boolean} true If the field is an extra field else false.
515
391
  */
516
- function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classId, showDynamicFields) {
392
+ function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classId, showDynamicFields) {
517
393
  // Is the field already present in authoring metadata?
518
394
  // Mutates config fields to copy displayAs and category information
519
395
  if (configFieldSet.has(item.fieldID)) {
@@ -537,7 +413,7 @@ function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, cl
537
413
  * @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
538
414
  * @returns {Array} List of extra fields with their meta updated.
539
415
  */
540
- function prepareExtraFields(
416
+ function prepareExtraFields(
541
417
  metaFields,
542
418
  configFields,
543
419
  configFieldSet,
@@ -570,8 +446,8 @@ function populateRenderingOptions(name, config, field) {
570
446
  }
571
447
  }
572
448
  export function initializeColumns(
573
- fields: Array<any> = [],
574
- getMappedProperty: any = null
449
+ fields:Array<any> = [],
450
+ getMappedProperty:any = null
575
451
  ) {
576
452
  return fields.map((field, originalColIndex) => {
577
453
  let name = field.config.value;
@@ -621,9 +497,9 @@ export const getItemKey = (fields) => {
621
497
  };
622
498
 
623
499
  export function preparePatchQueryFields(fields, isDataObject = false, classID = '') {
624
- const queryFields: Array<any> = [];
500
+ const queryFields:Array<any> = [];
625
501
  fields.forEach((field) => {
626
- const patchFields: Array<any> = [];
502
+ const patchFields:Array<any> = [];
627
503
  if (field.cellRenderer === 'WorkLink') {
628
504
  if (field.customObject && field.customObject.isAssignmentLink) {
629
505
  const associationName = field.name.includes(':') ? `${field.name.split(':')[0]}:` : '';
@@ -656,23 +532,6 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
656
532
  return queryFields;
657
533
  }
658
534
 
659
- /**
660
- * Update the renderer type for the properties of type Page.
661
- */
662
- export function updatePageFieldsConfig(configFields, parentClassID) {
663
- return configFields.forEach((item) => {
664
- const {
665
- type,
666
- config: { value }
667
- } = item;
668
- const propertyName = PCore.getAnnotationUtils().getPropertyName(value);
669
- if (isEmbeddedField(value) && !isPageListInPath(propertyName, parentClassID)) {
670
- item.config.componentType = type;
671
- item.type = 'PagePropertyRenderer';
672
- }
673
- });
674
- }
675
-
676
535
  export const readContextResponse = async (context, params) => {
677
536
  const {
678
537
  getPConnect,
@@ -685,7 +544,7 @@ export const readContextResponse = async (context, params) => {
685
544
  } = params;
686
545
  const { promisesResponseArray, apiContext: otherContext } = context;
687
546
  // eslint-disable-next-line sonarjs/no-unused-collection
688
- const listOfComponents: Array<any> = [];
547
+ const listOfComponents:Array<any> = [];
689
548
  const {
690
549
  data: { fields: metaFields, classID, isQueryable }
691
550
  } = promisesResponseArray[0];
@@ -705,7 +564,7 @@ export const readContextResponse = async (context, params) => {
705
564
 
706
565
 
707
566
  if (isDataObject) {
708
- const compositeKeys: Array<any> = [];
567
+ const compositeKeys:Array<any> = [];
709
568
  const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
710
569
  const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
711
570
  dataPageKeys?.forEach((item) =>
@@ -760,19 +619,13 @@ export const readContextResponse = async (context, params) => {
760
619
  showDynamicFields
761
620
  );
762
621
 
763
- if (isQueryable) {
764
- updatePageFieldsConfig(configFields, classID);
765
- preparePropertyMaps([...configFields, ...extraFields], classID, context);
766
- }
767
-
768
- const { getMappedProperty } = context;
769
622
 
770
623
  fields = initializeColumns(
771
- [...configFields, ...extraFields], getMappedProperty
624
+ [...configFields, ...extraFields],
772
625
  );
773
626
  const patchQueryFields = preparePatchQueryFields(fields, isDataObject, classID);
774
627
  const itemKey = getItemKey(fields);
775
- tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable };
628
+ tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable}
776
629
  });
777
630
  const meta = tableConfig;
778
631
  setListContext({
@@ -1,15 +1,13 @@
1
+ import PropTypes from "prop-types";
1
2
  import React from "react";
2
- import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
- interface MultiReferenceReadOnlyProps extends PConnProps {
5
- config: { referenceList: any, readonlyContextList: any },
6
- label: string,
7
- hideLabel: boolean
8
- }
4
+ import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
5
+
6
+ declare const PCore: typeof PCoreType;
9
7
 
10
8
 
11
- export default function MultiReferenceReadOnly(props: MultiReferenceReadOnlyProps) {
12
- const { getPConnect, label = '', hideLabel = false, config } = props;
9
+ export default function MultiReferenceReadOnly(props) {
10
+ const { getPConnect, label, hideLabel, 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
@@ -28,10 +26,21 @@ export default function MultiReferenceReadOnly(props: MultiReferenceReadOnlyProp
28
26
  label,
29
27
  hideLabel
30
28
  }
31
- },
32
- null, null, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
29
+ });
33
30
 
34
31
  return (
35
32
  <React.Fragment>{component}</React.Fragment>
36
33
  )
37
34
  }
35
+
36
+ MultiReferenceReadOnly.defaultProps = {
37
+ label: "",
38
+ hideLabel: false
39
+ };
40
+
41
+ MultiReferenceReadOnly.propTypes = {
42
+ config: PropTypes.object.isRequired,
43
+ getPConnect: PropTypes.func.isRequired,
44
+ label: PropTypes.string,
45
+ hideLabel: PropTypes.bool
46
+ };
@@ -2,22 +2,7 @@ import React from "react";
2
2
 
3
3
  import './NarrowWide.css';
4
4
 
5
- // NarrowWide does NOT have getPConnect. So, no need to extend from PConnProps
6
- interface NarrowWideProps {
7
- // If any, enter additional props that only exist on this component
8
- a: any,
9
- b: any,
10
- children?: Array<any>,
11
- // eslint-disable-next-line react/no-unused-prop-types
12
- title?: string,
13
- // eslint-disable-next-line react/no-unused-prop-types
14
- cols?: string,
15
- // eslint-disable-next-line react/no-unused-prop-types
16
- icon?: string
17
- }
18
-
19
-
20
- export default function NarrowWide(props: NarrowWideProps) {
5
+ export default function NarrowWide(props) {
21
6
  // const {a, b /*, cols, icon, title */ } = props;
22
7
  const {a, b, children} = props;
23
8
 
@@ -1,27 +1,14 @@
1
1
  import React, { createElement } from 'react';
2
+ import PropTypes from 'prop-types';
2
3
  import Grid from '@material-ui/core/Grid';
3
4
  import { GridSize } from '@material-ui/core/Grid';
4
5
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
-
7
- // import type { PConnProps } from '../../../../types/PConnProps';
8
-
9
- // Can't use PConnProps until getPConnect().getChildren() type is ok
10
- // interface NarrowWideDetailsProps extends PConnProps {
11
- // // If any, enter additional props that only exist on this component
12
- // showLabel?: boolean,
13
- // label: string,
14
- // showHighlightedData?: boolean
15
- // }
16
-
6
+ import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
17
7
 
18
8
  const COLUMN_WIDTHS = [4, 8];
19
9
 
20
- export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */) {
21
- // Get emitted components from map (so we can get any override that may exist)
22
- const FieldGroup = getComponentFromMap('FieldGroup');
23
-
24
- const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
10
+ export default function NarrowWideDetails(props) {
11
+ const { label, showLabel, getPConnect, showHighlightedData } = props;
25
12
 
26
13
  // Get the inherited props from the parent to determine label settings
27
14
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
@@ -53,8 +40,7 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
53
40
  field.config.displayAsStatus = true;
54
41
  }
55
42
 
56
- return getPConnect().createComponent(field,
57
- '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
43
+ return getPConnect().createComponent(field);
58
44
  });
59
45
  }
60
46
 
@@ -79,3 +65,16 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
79
65
  </FieldGroup>
80
66
  );
81
67
  }
68
+
69
+ NarrowWideDetails.defaultProps = {
70
+ label: undefined,
71
+ showLabel: true,
72
+ showHighlightedData: false
73
+ };
74
+
75
+ NarrowWideDetails.propTypes = {
76
+ showLabel: PropTypes.bool,
77
+ label: PropTypes.string,
78
+ getPConnect: PropTypes.func.isRequired,
79
+ showHighlightedData: PropTypes.bool
80
+ };
@@ -2,15 +2,7 @@ import React from "react";
2
2
 
3
3
  import './NarrowWideForm.css';
4
4
 
5
- // NarrowWideForm does NOT have getPConnect. So, no need to extend from PConnProps
6
-
7
- interface NarrowWideFormProps {
8
- // If any, enter additional props that only exist on this component
9
- children: Array<any>
10
- }
11
-
12
-
13
- export default function NarrowWideForm(props: NarrowWideFormProps) {
5
+ export default function NarrowWideForm(props) {
14
6
  const {children} = props;
15
7
 
16
8
  return (
@@ -1,27 +1,15 @@
1
1
  import React, { Children } from "react";
2
- // import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
3
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
-
5
-
6
- // NarrowWidePage does NOT have getPConnect. So, no need to extend from PConnProps
7
- interface NarrowWidePageProps {
8
- // If any, enter additional props that only exist on this component
9
- children: Array<any>,
10
- title: string,
11
- templateCol: string,
12
- icon: string
13
- }
2
+ import PropTypes from "prop-types";
14
3
 
4
+ // import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
5
+ import NarrowWide from '@pega/react-sdk-components/lib/components/template/NarrowWide/NarrowWide';
15
6
 
16
7
  /*
17
8
  * The wrapper handles knowing how to take in just children and mapping
18
9
  * to the Cosmos template.
19
10
  */
20
- export default function NarrowWidePage(props: NarrowWidePageProps) {
21
- // Get emitted components from map (so we can get any override that may exist)
22
- const NarrowWide = getComponentFromMap('NarrowWide');
23
-
24
- const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
11
+ export default function NarrowWidePage(props) {
12
+ const { children, title, templateCol, icon } = props;
25
13
  const childArray = Children.toArray(children);
26
14
 
27
15
  return (
@@ -36,3 +24,15 @@ export default function NarrowWidePage(props: NarrowWidePageProps) {
36
24
  </div>
37
25
  );
38
26
  }
27
+
28
+ NarrowWidePage.propTypes = {
29
+ children: PropTypes.arrayOf(PropTypes.node).isRequired,
30
+ title: PropTypes.string.isRequired,
31
+ templateCol: PropTypes.string,
32
+ icon: PropTypes.string
33
+ };
34
+
35
+ NarrowWidePage.defaultProps = {
36
+ templateCol: "1fr 1fr",
37
+ icon: ""
38
+ };
@@ -1,14 +1,8 @@
1
1
  import React from "react";
2
+ import PropTypes from "prop-types";
2
3
  import { Grid } from "@material-ui/core";
3
4
  import { makeStyles } from '@material-ui/core/styles';
4
5
 
5
- // OneColumn does NOT have getPConnect. So, no need to extend from PConnProps
6
- interface OneColumnProps{
7
- // If any, enter additional props that only exist on this component
8
- children: Array<any>
9
- }
10
-
11
-
12
6
  const useStyles = makeStyles((/* theme */) => ({
13
7
  colStyles: {
14
8
  display: "grid",
@@ -18,7 +12,7 @@ const useStyles = makeStyles((/* theme */) => ({
18
12
  }));
19
13
 
20
14
 
21
- export default function OneColumn(props: OneColumnProps) {
15
+ export default function OneColumn(props) {
22
16
  const classes = useStyles();
23
17
 
24
18
  const { children} = props;
@@ -31,3 +25,8 @@ export default function OneColumn(props: OneColumnProps) {
31
25
  </Grid>
32
26
  )
33
27
  }
28
+
29
+ OneColumn.propTypes = {
30
+ children: PropTypes.arrayOf(PropTypes.node).isRequired,
31
+ // template: PropTypes.string.isRequired
32
+ };
@@ -1,20 +1,13 @@
1
1
  import React from "react";
2
- import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
-
4
- // OneColumnPage does NOT have getPConnect. So, no need to extend from PConnProps
5
- interface OneColumnPageProps{
6
- // If any, enter additional props that only exist on this component
7
- children: Array<any>
8
- }
2
+ import PropTypes from "prop-types";
9
3
 
4
+ import OneColumn from '@pega/react-sdk-components/lib/components/template/OneColumn/OneColumn';
10
5
 
11
6
  /*
12
7
  * The wrapper handles knowing how to take in just children
13
8
  * and mapping to the TwoColumn template.
14
9
  */
15
- export default function OneColumnPage(props: OneColumnPageProps) {
16
- // Get emitted components from map (so we can get any override that may exist)
17
- const OneColumn = getComponentFromMap('OneColumn');
10
+ export default function OneColumnPage(props) {
18
11
 
19
12
  return (
20
13
  <OneColumn
@@ -22,3 +15,10 @@ export default function OneColumnPage(props: OneColumnPageProps) {
22
15
  />
23
16
  );
24
17
  }
18
+
19
+ OneColumnPage.propTypes = {
20
+ children: PropTypes.arrayOf(PropTypes.node).isRequired,
21
+ };
22
+
23
+ OneColumnPage.defaultProps = {
24
+ };
@@ -1,10 +1,7 @@
1
1
  import React from "react";
2
+ import PropTypes from "prop-types";
2
3
 
3
- interface OneColumnTabProps{
4
- // If any, enter additional props that only exist on this component
5
- children: Array<any>
6
- }
7
- export default function OneColumnTab(props: OneColumnTabProps) {
4
+ export default function OneColumnTab(props) {
8
5
  const { children} = props;
9
6
 
10
7
  return (
@@ -13,3 +10,8 @@ export default function OneColumnTab(props: OneColumnTabProps) {
13
10
  </div>
14
11
  )
15
12
  }
13
+
14
+ OneColumnTab.propTypes = {
15
+ children: PropTypes.arrayOf(PropTypes.node).isRequired,
16
+ // template: PropTypes.string.isRequired
17
+ };