@pega/react-sdk-overrides 24.2.11 → 25.1.10

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 (164) hide show
  1. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  2. package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
  9. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
  13. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
  14. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  15. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  16. package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
  17. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  18. package/lib/field/Currency/Currency.tsx +3 -3
  19. package/lib/field/Currency/currency-utils.ts +1 -2
  20. package/lib/field/Date/Date.tsx +3 -7
  21. package/lib/field/DateTime/DateTime.tsx +3 -8
  22. package/lib/field/Decimal/Decimal.tsx +3 -5
  23. package/lib/field/Dropdown/Dropdown.tsx +5 -7
  24. package/lib/field/Email/Email.tsx +11 -13
  25. package/lib/field/Group/Group.tsx +10 -8
  26. package/lib/field/Integer/Integer.tsx +5 -7
  27. package/lib/field/Location/Location.css +4 -0
  28. package/lib/field/Location/Location.tsx +258 -0
  29. package/lib/field/Location/config-ext.json +8 -0
  30. package/lib/field/Location/index.tsx +1 -0
  31. package/lib/field/Multiselect/utils.ts +1 -1
  32. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  33. package/lib/field/ObjectReference/index.tsx +1 -0
  34. package/lib/field/ObjectReference/utils.ts +111 -0
  35. package/lib/field/Percentage/Percentage.tsx +3 -7
  36. package/lib/field/Phone/Phone.tsx +7 -5
  37. package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
  38. package/lib/field/RichText/RichText.css +79 -0
  39. package/lib/field/RichText/RichText.tsx +3 -1
  40. package/lib/field/ScalarList/ScalarList.tsx +2 -3
  41. package/lib/field/SelectableCard/SelectableCard.tsx +175 -0
  42. package/lib/field/SelectableCard/index.tsx +1 -0
  43. package/lib/field/SelectableCard/utils.tsx +223 -0
  44. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  45. package/lib/field/SemanticLink/utils.ts +1 -1
  46. package/lib/field/TextArea/TextArea.tsx +5 -7
  47. package/lib/field/TextContent/TextContent.tsx +1 -2
  48. package/lib/field/TextInput/TextInput.tsx +5 -7
  49. package/lib/field/Time/Time.tsx +3 -7
  50. package/lib/field/URL/URL.tsx +5 -7
  51. package/lib/field/UserReference/UserReference.tsx +2 -3
  52. package/lib/helpers/attachmentShared.ts +6 -0
  53. package/lib/helpers/common-utils.ts +3 -4
  54. package/lib/helpers/data_page.ts +0 -1
  55. package/lib/helpers/field-group-utils.ts +1 -1
  56. package/lib/helpers/formatters/Currency.ts +9 -4
  57. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  58. package/lib/helpers/object-utils.ts +10 -0
  59. package/lib/helpers/simpleTableHelpers.ts +118 -6
  60. package/lib/helpers/utils.ts +8 -1
  61. package/lib/helpers/versionHelpers.ts +0 -1
  62. package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
  63. package/lib/infra/Assignment/Assignment.tsx +37 -30
  64. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  65. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +17 -96
  66. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
  67. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +7 -6
  68. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +4 -5
  69. package/lib/infra/Containers/container-helpers.ts +47 -1
  70. package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
  71. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  72. package/lib/infra/DeferLoad/DeferLoad.tsx +2 -4
  73. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  74. package/lib/infra/MultiStep/MultiStep.css +48 -70
  75. package/lib/infra/MultiStep/MultiStep.tsx +27 -53
  76. package/lib/infra/NavBar/NavBar.css +1 -1
  77. package/lib/infra/NavBar/NavBar.tsx +43 -32
  78. package/lib/infra/Reference/Reference.tsx +3 -4
  79. package/lib/infra/Region/Region.tsx +1 -1
  80. package/lib/infra/RootContainer/RootContainer.tsx +2 -3
  81. package/lib/infra/Stages/Stages.tsx +3 -4
  82. package/lib/infra/View/View.tsx +4 -3
  83. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
  84. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
  85. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
  86. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  87. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  88. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  89. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  90. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  91. package/lib/template/AdvancedSearch/index.tsx +1 -0
  92. package/lib/template/AppShell/AppShell.css +1 -1
  93. package/lib/template/AppShell/AppShell.tsx +16 -17
  94. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  95. package/lib/template/CaseSummary/CaseSummary.tsx +28 -41
  96. package/lib/template/CaseView/CaseView.tsx +28 -35
  97. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  98. package/lib/template/Confirmation/Confirmation.tsx +2 -3
  99. package/lib/template/DataReference/DataReference.tsx +312 -106
  100. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
  101. package/lib/template/DataReference/SearchForm.tsx +149 -0
  102. package/lib/template/DataReference/utils.ts +90 -0
  103. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  104. package/lib/template/DefaultForm/utils/index.ts +1 -3
  105. package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
  106. package/lib/template/DefaultPage/index.tsx +1 -0
  107. package/lib/template/Details/Details/Details.tsx +11 -11
  108. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  109. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  110. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  111. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
  112. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -3
  113. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  114. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  115. package/lib/template/ListPage/ListPage.tsx +1 -1
  116. package/lib/template/ListView/ListView.tsx +278 -198
  117. package/lib/template/ListView/hooks.ts +1 -5
  118. package/lib/template/ListView/utils.ts +38 -5
  119. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  120. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  121. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  122. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  123. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  124. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  125. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  126. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  127. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  128. package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +145 -0
  129. package/lib/template/SelfServiceCaseView/index.tsx +1 -0
  130. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
  131. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +36 -33
  132. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
  133. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
  134. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  135. package/lib/template/SubTabs/tabUtils.ts +118 -1
  136. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  137. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  138. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  139. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  140. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  141. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  142. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  143. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  144. package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
  145. package/lib/template/utils.tsx +58 -0
  146. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  147. package/lib/widget/Attachment/Attachment.css +6 -8
  148. package/lib/widget/Attachment/Attachment.tsx +303 -225
  149. package/lib/widget/Attachment/Attachment.types.ts +96 -0
  150. package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
  151. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  152. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  153. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  154. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  155. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
  156. package/lib/widget/Followers/Followers.tsx +2 -4
  157. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  158. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  159. package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
  160. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  161. package/lib/widget/ToDo/ToDo.css +1 -13
  162. package/lib/widget/ToDo/ToDo.tsx +37 -36
  163. package/package.json +1 -1
  164. package/lib/helpers/attachmentHelpers.ts +0 -76
@@ -14,7 +14,6 @@ export default function useInit(props) {
14
14
  ref,
15
15
  showDynamicFields,
16
16
  isDataObject,
17
- xRayUid,
18
17
  cosmosTableRef
19
18
  } = props;
20
19
  let { editing, selectionMode } = props;
@@ -27,7 +26,6 @@ export default function useInit(props) {
27
26
 
28
27
  (async function init() {
29
28
  // promise to fetch metadata
30
- // @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
31
29
  const metaDataPromise: Promise<any> = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
32
30
 
33
31
  const promisesArray = [metaDataPromise];
@@ -73,8 +71,7 @@ export default function useInit(props) {
73
71
  getPConnect,
74
72
  compositeKeys,
75
73
  isSearchable,
76
- isCacheable: true,
77
- xRayUid
74
+ isCacheable: true
78
75
  }).then(async context => {
79
76
  if (isCompStillMounted) {
80
77
  return readContextResponse(context, {
@@ -83,7 +80,6 @@ export default function useInit(props) {
83
80
  selectionCountThreshold,
84
81
  ref,
85
82
  selectionMode,
86
- xRayUid,
87
83
  cosmosTableRef
88
84
  });
89
85
  }
@@ -13,14 +13,21 @@ export const formatConstants = {
13
13
  class DataApi {
14
14
  mappedPropertyToOriginalProperty: any;
15
15
  originalPropertyToMappedProperty: any;
16
- constructor() {
16
+ showRecords: any;
17
+ constructor(showRecords = true) {
18
+ this.showRecords = showRecords;
17
19
  this.originalPropertyToMappedProperty = {};
18
20
  this.mappedPropertyToOriginalProperty = {};
21
+ this.setShowRecords = this.setShowRecords.bind(this);
19
22
  this.setPropertyMaps = this.setPropertyMaps.bind(this);
20
23
  this.getMappedProperty = this.getMappedProperty.bind(this);
21
24
  this.getOriginalProperty = this.getOriginalProperty.bind(this);
22
25
  }
23
26
 
27
+ setShowRecords(showRecords) {
28
+ this.showRecords = showRecords;
29
+ }
30
+
24
31
  setPropertyMaps(originalToMappedPropertyObj = {}, mappedToOriginalPropertyObj = {}) {
25
32
  this.originalPropertyToMappedProperty = {
26
33
  ...this.originalPropertyToMappedProperty,
@@ -536,6 +543,28 @@ function prepareExtraFields(metaFields, configFields, configFieldSet, reportColu
536
543
 
537
544
  const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
538
545
 
546
+ function isFLProperty(label) {
547
+ return label?.startsWith('@FL');
548
+ }
549
+
550
+ function getFieldLabel(fieldConfig) {
551
+ const { label, classID, caption } = fieldConfig;
552
+ let fieldLabel = (label ?? caption)?.substring(4);
553
+ const labelSplit = fieldLabel?.split('.');
554
+ const propertyName = labelSplit?.pop();
555
+ const fieldMetaData: any = PCore.getMetadataUtils().getPropertyMetadata(propertyName, classID) ?? {};
556
+ fieldLabel = fieldMetaData.label ?? fieldMetaData.caption ?? propertyName;
557
+
558
+ const definedOnClassID = fieldMetaData.definedOnClassID;
559
+ const localeValue = PCore.getLocaleUtils().getLocaleValue(
560
+ fieldLabel,
561
+ `${definedOnClassID ?? fieldMetaData.classID ?? classID}.${propertyName}`,
562
+ PCore.getLocaleUtils().FIELD_LABELS_BUNDLE_KEY,
563
+ null
564
+ );
565
+ return localeValue || fieldLabel;
566
+ }
567
+
539
568
  function populateRenderingOptions(name, config, field) {
540
569
  const shouldDisplayAsSemanticLink = 'displayAsLink' in field.config && field.config.displayAsLink;
541
570
  if (shouldDisplayAsSemanticLink) {
@@ -550,6 +579,7 @@ function populateRenderingOptions(name, config, field) {
550
579
  config.cellRenderer = formatConstants.Integer;
551
580
  }
552
581
  }
582
+
553
583
  export function initializeColumns(fields: any[] = [], getMappedProperty: any = null) {
554
584
  return fields.map((field, originalColIndex) => {
555
585
  let name = field.config.value;
@@ -562,7 +592,9 @@ export function initializeColumns(fields: any[] = [], getMappedProperty: any = n
562
592
 
563
593
  let label = field.config.label || field.config.caption;
564
594
  const { show = true, displayAs } = field.config;
565
- if (label.startsWith('@')) {
595
+ if (isFLProperty(label)) {
596
+ label = getFieldLabel(field.config);
597
+ } else if (label.startsWith('@')) {
566
598
  label = label.substring(3);
567
599
  }
568
600
 
@@ -650,10 +682,11 @@ export function updatePageFieldsConfig(configFields, parentClassID) {
650
682
  }
651
683
 
652
684
  export const readContextResponse = async (context, params) => {
653
- const { getPConnect, apiContext, setListContext, children, showDynamicFields, referenceList, isDataObject } = params;
654
- const { promisesResponseArray, apiContext: otherContext } = context;
655
- // eslint-disable-next-line sonarjs/no-unused-collection
685
+ const { getPConnect, apiContext, setListContext, children, showDynamicFields, referenceList, isDataObject, ref } = params;
686
+ const { promisesResponseArray, setShowRecords, apiContext: otherContext } = context;
687
+
656
688
  const listOfComponents: any[] = [];
689
+ ref.setShowRecords = setShowRecords;
657
690
  const {
658
691
  data: { fields: metaFields, classID, isQueryable }
659
692
  } = promisesResponseArray[0];
@@ -1,4 +1,4 @@
1
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
2
 
3
3
  interface MultiReferenceReadOnlyProps extends PConnProps {
4
4
  config: { referenceList: any; readonlyContextList: any };
@@ -1,16 +1,16 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './NarrowWide.css';
4
4
 
5
5
  interface NarrowWideProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
7
7
  a: any;
8
8
  b: any;
9
- // eslint-disable-next-line react/no-unused-prop-types
9
+
10
10
  title?: string;
11
- // eslint-disable-next-line react/no-unused-prop-types
11
+
12
12
  cols?: string;
13
- // eslint-disable-next-line react/no-unused-prop-types
13
+
14
14
  icon?: string;
15
15
  }
16
16
 
@@ -1,10 +1,10 @@
1
1
  import { createElement } from 'react';
2
- import Grid, { GridSize } from '@mui/material/Grid';
2
+ import Grid2, { type GridSize } from '@mui/material/Grid2';
3
3
 
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
6
 
7
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
8
 
9
9
  interface NarrowWideDetailsProps extends PConnProps {
10
10
  // If any, enter additional props that only exist on this component
@@ -31,7 +31,7 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
31
31
  const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
32
32
  createElement(createPConnectComponent(), {
33
33
  ...configObject,
34
- // eslint-disable-next-line react/no-array-index-key
34
+
35
35
  key: index.toString()
36
36
  })
37
37
  );
@@ -56,21 +56,21 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
56
56
  return (
57
57
  <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
58
58
  {showHighlightedData && highlightedDataArr.length > 0 && (
59
- <Grid container spacing={1} style={{ padding: '0 0 1em' }}>
59
+ <Grid2 container spacing={1} style={{ padding: '0 0 1em' }}>
60
60
  {highlightedDataArr.map((child, i) => (
61
- <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`hf-${i + 1}`}>
61
+ <Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`hf-${i + 1}`}>
62
62
  {child}
63
- </Grid>
63
+ </Grid2>
64
64
  ))}
65
- </Grid>
65
+ </Grid2>
66
66
  )}
67
- <Grid container spacing={1}>
67
+ <Grid2 container spacing={1}>
68
68
  {children.map((child, i) => (
69
- <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`r-${i + 1}`}>
69
+ <Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`r-${i + 1}`}>
70
70
  {child}
71
- </Grid>
71
+ </Grid2>
72
72
  ))}
73
- </Grid>
73
+ </Grid2>
74
74
  </FieldGroup>
75
75
  );
76
76
  }
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
  import './NarrowWideForm.css';
4
4
 
5
5
  interface NarrowWideFormProps extends PConnProps {
@@ -1,6 +1,6 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
2
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
5
  interface NarrowWidePageProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component
@@ -1,7 +1,7 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { Grid } from '@mui/material';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import Grid2 from '@mui/material/Grid2';
3
3
  import makeStyles from '@mui/styles/makeStyles';
4
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
5
 
6
6
  interface OneColumnProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
@@ -21,12 +21,12 @@ export default function OneColumn(props: PropsWithChildren<OneColumnProps>) {
21
21
  const { children } = props;
22
22
 
23
23
  return (
24
- <Grid container spacing={2}>
25
- <Grid item xs={12} className={classes.colStyles}>
24
+ <Grid2 container spacing={2}>
25
+ <Grid2 size={{ xs: 12 }} className={classes.colStyles}>
26
26
  {(children as ReactElement[]).map(child => {
27
27
  return child;
28
28
  })}
29
- </Grid>
30
- </Grid>
29
+ </Grid2>
30
+ </Grid2>
31
31
  );
32
32
  }
@@ -1,5 +1,5 @@
1
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
4
  interface OneColumnPageProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren } from 'react';
2
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
3
 
4
4
  interface OneColumnTabProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component
@@ -6,7 +6,7 @@ import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers
6
6
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
7
7
  import './PromotedFilters.css';
8
8
 
9
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
10
10
 
11
11
  // Can't use PromotedFilterProps until getContainerManager() knows about addTransientItem
12
12
  // Currently just expects "object"
@@ -57,7 +57,6 @@ function Filters({ filters, transientItemID, localeReference }) {
57
57
  }
58
58
  });
59
59
 
60
- // eslint-disable-next-line react/no-array-index-key
61
60
  return <React.Fragment key={index}>{createElement(createPConnectComponent(), c11nEnv)}</React.Fragment>;
62
61
  });
63
62
  }
@@ -0,0 +1,145 @@
1
+ import { Avatar, Card, CardHeader, Divider, Typography } from '@mui/material';
2
+ import makeStyles from '@mui/styles/makeStyles';
3
+ import Grid2 from '@mui/material/Grid2';
4
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
+ import { prepareCaseSummaryData, filterUtilities } from '@pega/react-sdk-components/lib/components/template/utils';
6
+ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
7
+
8
+ const useStyles = makeStyles(theme => ({
9
+ root: {
10
+ paddingRight: theme.spacing(1),
11
+ paddingLeft: theme.spacing(1),
12
+ paddingTop: theme.spacing(1),
13
+ paddingBottom: theme.spacing(1),
14
+ marginRight: theme.spacing(1),
15
+ marginLeft: theme.spacing(1),
16
+ marginTop: theme.spacing(1),
17
+ marginBottom: theme.spacing(1)
18
+ },
19
+ caseViewHeader: {
20
+ backgroundColor: theme.palette.info.light,
21
+ color: theme.palette.getContrastText(theme.palette.info.light),
22
+ borderRadius: 'inherit'
23
+ },
24
+ caseViewIconBox: {
25
+ backgroundColor: theme.palette.info.dark,
26
+ width: theme.spacing(8),
27
+ height: theme.spacing(8),
28
+ padding: theme.spacing(1)
29
+ },
30
+ caseViewIconImage: {
31
+ filter: 'var(--svg-color)'
32
+ }
33
+ }));
34
+
35
+ export default function SelfServiceCaseView(props) {
36
+ const classes = useStyles();
37
+ const CaseViewActionsMenu = getComponentFromMap('CaseViewActionsMenu');
38
+ const CaseSummary = getComponentFromMap('CaseSummary');
39
+ const {
40
+ icon = '',
41
+ getPConnect,
42
+ header,
43
+ subheader,
44
+ showCaseLifecycle = true,
45
+ showSummaryRegion = true,
46
+ showUtilitiesRegion = true,
47
+ showCaseActions = true,
48
+ children,
49
+ caseClass,
50
+ caseInfo: { availableActions = [], availableProcesses = [], caseTypeID = '', caseTypeName = '' }
51
+ } = props;
52
+ const pConnect = getPConnect();
53
+ const [bShowCaseLifecycle, bShowSummaryRegion, bShowUtilitiesRegion, bShowCaseActions] = [
54
+ showCaseLifecycle,
55
+ showSummaryRegion,
56
+ showUtilitiesRegion,
57
+ showCaseActions
58
+ ].map((prop: boolean | string) => prop === true || prop === 'true');
59
+ const isObjectType: boolean = (PCore.getCaseUtils() as any).isObjectCaseType(caseClass);
60
+ const localeKey = pConnect?.getCaseLocaleReference();
61
+ const svgCase = Utils.getImageSrc(icon, Utils.getSDKStaticConentUrl());
62
+ const renderedRegions: any = isObjectType
63
+ ? {
64
+ caseSummary: children[0],
65
+ utilities: filterUtilities(children[2])
66
+ }
67
+ : {
68
+ caseSummary: children[0],
69
+ stages: children[1],
70
+ todo: children[2],
71
+ utilities: filterUtilities(children[4])
72
+ };
73
+ const { primarySummaryFields, secondarySummaryFields } = prepareCaseSummaryData(
74
+ renderedRegions.caseSummary,
75
+ (config: any) => config?.availableInChannel?.selfService === true
76
+ );
77
+
78
+ const isUtilitiesRegionNotEmpty: () => boolean = () => {
79
+ const utilitiesElement = renderedRegions.utilities;
80
+ if (utilitiesElement?.props?.getPConnect()?.getChildren()?.length > 0) {
81
+ return utilitiesElement.props
82
+ .getPConnect()
83
+ .getChildren()
84
+ .some((prop: { getPConnect: () => any }) => prop.getPConnect().getConfigProps().visibility !== false);
85
+ }
86
+ return false;
87
+ };
88
+
89
+ return (
90
+ <div>
91
+ {bShowCaseActions && (
92
+ <div style={{ display: 'flex', justifyContent: 'space-around', alignItems: 'center', margin: '10px' }}>
93
+ <div>{PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}</div>
94
+ <CaseViewActionsMenu
95
+ getPConnect={getPConnect}
96
+ availableActions={availableActions}
97
+ availableProcesses={availableProcesses}
98
+ caseTypeName={caseTypeName}
99
+ caseTypeID={caseTypeID}
100
+ />
101
+ </div>
102
+ )}
103
+ <div>
104
+ <Grid2 container>
105
+ <Grid2 size={{ xs: 3 }}>
106
+ {bShowSummaryRegion && (primarySummaryFields.length > 0 || secondarySummaryFields.length > 0) && (
107
+ <div>
108
+ <Card className={classes.root}>
109
+ <CardHeader
110
+ className={classes.caseViewHeader}
111
+ title={
112
+ <Typography variant='h6' component='div' id='case-name'>
113
+ {PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}
114
+ </Typography>
115
+ }
116
+ subheader={
117
+ <Typography variant='body1' component='div' id='caseId'>
118
+ {subheader}
119
+ </Typography>
120
+ }
121
+ avatar={
122
+ <Avatar className={classes.caseViewIconBox} variant='square'>
123
+ <img src={svgCase} className={classes.caseViewIconImage} />
124
+ </Avatar>
125
+ }
126
+ />
127
+ <Divider />
128
+ <CaseSummary arPrimaryFields={primarySummaryFields} arSecondaryFields={secondarySummaryFields}></CaseSummary>
129
+ <Divider />
130
+ </Card>
131
+ </div>
132
+ )}
133
+ </Grid2>
134
+
135
+ <Grid2 size={{ xs: 6 }}>
136
+ {bShowCaseLifecycle && renderedRegions.stages}
137
+ {renderedRegions.todo}
138
+ </Grid2>
139
+
140
+ {bShowUtilitiesRegion && isUtilitiesRegionNotEmpty() && <Grid2 size={{ xs: 3 }}>{renderedRegions.utilities}</Grid2>}
141
+ </Grid2>
142
+ </div>
143
+ </div>
144
+ );
145
+ }
@@ -0,0 +1 @@
1
+ export { default } from './SelfServiceCaseView';
@@ -1,10 +1,9 @@
1
- /* eslint-disable react-hooks/rules-of-hooks */
2
1
  import { useRef } from 'react';
3
2
 
4
3
  import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
5
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
5
 
7
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
7
 
9
8
  // Can't use SimpleTableProps until getComponentConfig() and getFieldMetadata() are NOT private
10
9
  interface SimpleTableProps extends PConnProps {
@@ -90,7 +89,7 @@ export default function SimpleTable(props: SimpleTableProps) {
90
89
  );
91
90
 
92
91
  const metaForPConnect = JSON.parse(JSON.stringify(metaForListView));
93
- // @ts-ignore - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided.
92
+ // @ts-expect-error - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided.
94
93
  metaForPConnect.config.parameters = rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
95
94
 
96
95
  const { referenceListStr: referenceList } = getContext(getPConnect());
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
1
+ import React, { type PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
2
2
  import Table from '@mui/material/Table';
3
3
  import TableBody from '@mui/material/TableBody';
4
4
  import TableCell from '@mui/material/TableCell';
@@ -29,7 +29,7 @@ import { getReferenceList } from '@pega/react-sdk-components/lib/components/help
29
29
  import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
30
30
  import { getGenericFieldsLocalizedValue } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
31
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';
32
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
33
33
  import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
34
34
 
35
35
  interface SimpleTableManualProps extends PConnProps {
@@ -74,7 +74,7 @@ const useStyles = makeStyles((/* theme */) => ({
74
74
  fontSize: '14px'
75
75
  },
76
76
  header: {
77
- background: '#f5f5f5'
77
+ background: 'var(--table-header-background)'
78
78
  },
79
79
  tableCell: {
80
80
  borderRight: '1px solid lightgray',
@@ -163,6 +163,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
163
163
  const menuIconOverride$ = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());
164
164
 
165
165
  const resolvedFields = children?.[0]?.children || presets?.[0].children?.[0].children;
166
+ const primaryFieldsViewIndex = resolvedFields.findIndex(field => field.config.value === 'pyPrimaryFields');
166
167
  // NOTE: props has each child.config with datasource and value undefined
167
168
  // but getRawMetadata() has each child.config with datasource and value showing their unresolved values (ex: "@P thePropName")
168
169
  // We need to use the prop name as the "glue" to tie the table dataSource, displayColumns and data together.
@@ -194,10 +195,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
194
195
  });
195
196
 
196
197
  useEffect(() => {
197
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
198
198
  buildElementsForTable();
199
199
  if (readOnlyMode || allowEditingInModal) {
200
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
201
200
  generateRowsData();
202
201
  }
203
202
  }, [referenceList]);
@@ -208,7 +207,10 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
208
207
  // Constellation DX Components do). It will also have the "label", and "meta" contains the original,
209
208
  // unchanged config info. For now, much of the info here is carried over from
210
209
  // Constellation DX Components.
211
- const fieldDefs = buildFieldsForTable(rawFields, resolvedFields, showDeleteButton);
210
+ const fieldDefs = buildFieldsForTable(rawFields, getPConnect(), showDeleteButton, {
211
+ primaryFieldsViewIndex,
212
+ fields: resolvedFields
213
+ });
212
214
 
213
215
  useLayoutEffect(() => {
214
216
  if (allowEditingInModal) {
@@ -219,7 +221,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
219
221
  fieldDefs.filter(item => item.name).map(item => item.name)
220
222
  );
221
223
  } else {
222
- // @ts-ignore - An argument for 'fields' was not provided
224
+ // @ts-expect-error - An argument for 'fields' was not provided
223
225
  getPConnect().getListActions().initDefaultPageInstructions(getPConnect().getReferenceList());
224
226
  }
225
227
  }, []);
@@ -246,7 +248,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
246
248
 
247
249
  // return the value that should be shown as the contents for the given row data
248
250
  // of the given row field
249
- function getRowValue(inRowData: Object, inColKey: string): any {
251
+ function getRowValue(inRowData: object, inColKey: string): any {
250
252
  // See what data (if any) we have to display
251
253
  const refKeys: string[] = inColKey?.split('.');
252
254
  let valBuilder = inRowData;
@@ -277,7 +279,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
277
279
  setRowData(data);
278
280
  })
279
281
  .catch(e => {
280
- // eslint-disable-next-line no-console
281
282
  console.log(e);
282
283
  });
283
284
  } else {
@@ -286,7 +287,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
286
287
  // we're using as the table's dataSource
287
288
  const data: any = [];
288
289
  for (const row of referenceList) {
289
- const dataForRow: Object = {};
290
+ const dataForRow: object = {};
290
291
  for (const col of displayedColumns) {
291
292
  const colKey: string = col;
292
293
  const theVal = getRowValue(row, colKey);
@@ -318,7 +319,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
318
319
  if (allowEditingInModal && defaultView) {
319
320
  pConn
320
321
  .getActionsApi()
321
- // @ts-ignore
322
+ // @ts-expect-error
322
323
  .openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
323
324
  } else {
324
325
  pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
@@ -334,7 +335,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
334
335
  if (typeof selectedRowIndex.current === 'number') {
335
336
  pConn
336
337
  .getActionsApi()
337
- // @ts-ignore
338
+ // @ts-expect-error
338
339
  .openEmbeddedDataModal(
339
340
  bUseSeparateViewForEdit ? editView : defaultView,
340
341
  pConn,
@@ -360,23 +361,25 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
360
361
  const data: any = [];
361
362
  rawFields.forEach(item => {
362
363
  // removing label field from config to hide title in the table cell
363
- item = { ...item, config: { ...item.config, label: '', displayMode: readOnlyMode || allowEditingInModal ? 'DISPLAY_ONLY' : undefined } };
364
- const referenceListData = getReferenceList(pConn);
365
- const isDatapage = referenceListData.startsWith('D_');
366
- const pageReferenceValue = isDatapage
367
- ? `${referenceListData}[${index}]`
368
- : `${pConn.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
369
- const config = {
370
- meta: item,
371
- options: {
372
- context,
373
- pageReference: pageReferenceValue,
374
- referenceList: referenceListData,
375
- hasForm: true
376
- }
377
- };
378
- const view = PCore.createPConnect(config);
379
- data.push(createElement(createPConnectComponent(), view));
364
+ if (!item.config.hide) {
365
+ item = { ...item, config: { ...item.config, label: '', displayMode: readOnlyMode || allowEditingInModal ? 'DISPLAY_ONLY' : undefined } };
366
+ const referenceListData = getReferenceList(pConn);
367
+ const isDatapage = referenceListData.startsWith('D_');
368
+ const pageReferenceValue = isDatapage
369
+ ? `${referenceListData}[${index}]`
370
+ : `${pConn.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
371
+ const config = {
372
+ meta: item,
373
+ options: {
374
+ context,
375
+ pageReference: pageReferenceValue,
376
+ referenceList: referenceListData,
377
+ hasForm: true
378
+ }
379
+ };
380
+ const view = PCore.createPConnect(config);
381
+ data.push(createElement(createPConnectComponent(), view));
382
+ }
380
383
  });
381
384
  eleData.push(data);
382
385
  });
@@ -419,7 +422,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
419
422
  function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
420
423
  const stabilizedThis = array.map((el, index) => [el, index] as [T, number]);
421
424
  stabilizedThis.sort((a, b) => {
422
- // eslint-disable-next-line @typescript-eslint/no-shadow
423
425
  const order = comparator(a[0], b[0]);
424
426
  if (order !== 0) return order;
425
427
  return a[1] - b[1];
@@ -574,7 +576,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
574
576
  function _showFilteredIcon(columnId) {
575
577
  for (const filterObj of filterByColumns) {
576
578
  if (filterObj.ref === columnId) {
577
- // eslint-disable-next-line sonarjs/prefer-single-boolean-return
578
579
  if (filterObj.containsFilterValue !== '') {
579
580
  return true;
580
581
  }
@@ -608,6 +609,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
608
609
  <TableHead className={classes.header}>
609
610
  <TableRow>
610
611
  {fieldDefs.map((field: any, index) => {
612
+ if (field?.meta?.config?.hide) {
613
+ return null; // Skip rendering if hide = true
614
+ }
611
615
  return (
612
616
  <TableCell key={`head-${displayedColumns[index]}`} className={classes.tableCell}>
613
617
  {(readOnlyMode || allowEditingInModal) && field.cellRenderer !== 'DeleteIcon' ? (
@@ -678,7 +682,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
678
682
  .slice(0)
679
683
  .map((row, index) => {
680
684
  return (
681
- // eslint-disable-next-line react/no-array-index-key
682
685
  <TableRow key={index}>
683
686
  {row.map((item, childIndex) => {
684
687
  const theColKey = displayedColumns[childIndex];
@@ -712,7 +715,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
712
715
  </Table>
713
716
  {((readOnlyMode && (!rowData || rowData?.length === 0)) || (editableMode && (!referenceList || referenceList?.length === 0))) && (
714
717
  <div className='no-records' id='no-records'>
715
- {getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}
718
+ {getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.')}
716
719
  </div>
717
720
  )}
718
721
  </TableContainer>
@@ -1,6 +1,6 @@
1
1
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
2
2
 
3
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
3
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
4
4
 
5
5
  interface SimpleTableSelectProps extends PConnProps {
6
6
  // If any, enter additional props that only exist on this component