@pega/react-sdk-overrides 24.2.11 → 25.1.11

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 (173) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  2. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  3. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  4. package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
  5. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
  7. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  8. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  9. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  10. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
  11. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  12. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  13. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
  14. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
  15. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
  16. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  17. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  18. package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
  19. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  20. package/lib/field/Currency/Currency.tsx +3 -3
  21. package/lib/field/Currency/currency-utils.ts +1 -2
  22. package/lib/field/Date/Date.tsx +3 -7
  23. package/lib/field/DateTime/DateTime.tsx +3 -8
  24. package/lib/field/Decimal/Decimal.tsx +3 -5
  25. package/lib/field/Dropdown/Dropdown.tsx +5 -7
  26. package/lib/field/Email/Email.tsx +11 -13
  27. package/lib/field/Group/Group.tsx +10 -8
  28. package/lib/field/Integer/Integer.tsx +5 -7
  29. package/lib/field/Location/Location.css +4 -0
  30. package/lib/field/Location/Location.tsx +258 -0
  31. package/lib/field/Location/config-ext.json +8 -0
  32. package/lib/field/Location/index.tsx +1 -0
  33. package/lib/field/Multiselect/utils.ts +1 -1
  34. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  35. package/lib/field/ObjectReference/index.tsx +1 -0
  36. package/lib/field/ObjectReference/utils.ts +111 -0
  37. package/lib/field/Percentage/Percentage.tsx +3 -7
  38. package/lib/field/Phone/Phone.tsx +7 -5
  39. package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
  40. package/lib/field/RichText/RichText.css +79 -0
  41. package/lib/field/RichText/RichText.tsx +3 -1
  42. package/lib/field/ScalarList/ScalarList.tsx +2 -3
  43. package/lib/field/SelectableCard/SelectableCard.tsx +189 -0
  44. package/lib/field/SelectableCard/index.tsx +1 -0
  45. package/lib/field/SelectableCard/utils.tsx +223 -0
  46. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  47. package/lib/field/SemanticLink/utils.ts +1 -1
  48. package/lib/field/TextArea/TextArea.tsx +5 -7
  49. package/lib/field/TextContent/TextContent.tsx +1 -2
  50. package/lib/field/TextInput/TextInput.tsx +5 -7
  51. package/lib/field/Time/Time.tsx +3 -7
  52. package/lib/field/URL/URL.tsx +5 -7
  53. package/lib/field/UserReference/UserReference.tsx +2 -3
  54. package/lib/helpers/attachmentShared.ts +6 -0
  55. package/lib/helpers/common-utils.ts +3 -4
  56. package/lib/helpers/data_page.ts +0 -1
  57. package/lib/helpers/field-group-utils.ts +1 -1
  58. package/lib/helpers/formatters/Currency.ts +9 -4
  59. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  60. package/lib/helpers/object-utils.ts +10 -0
  61. package/lib/helpers/simpleTableHelpers.ts +118 -6
  62. package/lib/helpers/utils.ts +8 -1
  63. package/lib/helpers/versionHelpers.ts +0 -1
  64. package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
  65. package/lib/infra/Assignment/Assignment.tsx +47 -31
  66. package/lib/infra/Assignment/useValidationBanner.ts +29 -0
  67. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  68. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +22 -102
  69. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
  70. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +12 -6
  71. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +8 -13
  72. package/lib/infra/Containers/container-helpers.ts +47 -1
  73. package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
  74. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  75. package/lib/infra/DeferLoad/DeferLoad.tsx +26 -13
  76. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  77. package/lib/infra/MultiStep/MultiStep.css +48 -70
  78. package/lib/infra/MultiStep/MultiStep.tsx +27 -53
  79. package/lib/infra/NavBar/NavBar.css +1 -1
  80. package/lib/infra/NavBar/NavBar.tsx +49 -34
  81. package/lib/infra/Reference/Reference.tsx +8 -4
  82. package/lib/infra/Region/Region.tsx +1 -1
  83. package/lib/infra/RootContainer/RootContainer.tsx +6 -8
  84. package/lib/infra/Stages/Stages.tsx +3 -4
  85. package/lib/infra/View/View.tsx +9 -9
  86. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
  87. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
  88. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
  89. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  90. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  91. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  92. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  93. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  94. package/lib/template/AdvancedSearch/index.tsx +1 -0
  95. package/lib/template/AppShell/AppShell.css +1 -5
  96. package/lib/template/AppShell/AppShell.tsx +16 -17
  97. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  98. package/lib/template/CaseSummary/CaseSummary.tsx +25 -43
  99. package/lib/template/CaseView/CaseView.tsx +28 -35
  100. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  101. package/lib/template/Confirmation/Confirmation.tsx +2 -3
  102. package/lib/template/DataReference/DataReference.tsx +312 -106
  103. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
  104. package/lib/template/DataReference/SearchForm.tsx +149 -0
  105. package/lib/template/DataReference/utils.ts +90 -0
  106. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  107. package/lib/template/DefaultForm/utils/index.ts +1 -3
  108. package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
  109. package/lib/template/DefaultPage/index.tsx +1 -0
  110. package/lib/template/Details/Details/Details.tsx +11 -11
  111. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  112. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  113. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  114. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
  115. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -6
  116. package/lib/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
  117. package/lib/template/HierarchicalForm/hooks.ts +224 -0
  118. package/lib/template/HierarchicalForm/index.tsx +1 -0
  119. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  120. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  121. package/lib/template/ListPage/ListPage.tsx +1 -1
  122. package/lib/template/ListView/ListView.tsx +342 -204
  123. package/lib/template/ListView/hooks.ts +1 -5
  124. package/lib/template/ListView/utils.ts +38 -5
  125. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +17 -2
  126. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  127. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  128. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  129. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  130. package/lib/template/ObjectPage/index.tsx +1 -0
  131. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  132. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  133. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  134. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  135. package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
  136. package/lib/template/SelfServiceCaseView/index.tsx +1 -0
  137. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
  138. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +45 -34
  139. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
  140. package/lib/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +179 -0
  141. package/lib/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
  142. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
  143. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  144. package/lib/template/SubTabs/tabUtils.ts +118 -1
  145. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  146. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  147. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  148. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  149. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  150. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  151. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  152. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  153. package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
  154. package/lib/template/utils.tsx +58 -0
  155. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  156. package/lib/widget/Attachment/Attachment.css +6 -8
  157. package/lib/widget/Attachment/Attachment.tsx +303 -225
  158. package/lib/widget/Attachment/Attachment.types.ts +96 -0
  159. package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
  160. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  161. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  162. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  163. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  164. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
  165. package/lib/widget/Followers/Followers.tsx +2 -4
  166. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  167. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  168. package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
  169. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  170. package/lib/widget/ToDo/ToDo.css +1 -13
  171. package/lib/widget/ToDo/ToDo.tsx +37 -36
  172. package/package.json +1 -1
  173. package/lib/helpers/attachmentHelpers.ts +0 -76
@@ -7,9 +7,9 @@ import {
7
7
  Drawer,
8
8
  List,
9
9
  ListItem,
10
+ ListItemButton,
10
11
  ListItemIcon,
11
12
  ListItemText,
12
- ListItemSecondaryAction,
13
13
  Collapse,
14
14
  Divider,
15
15
  IconButton,
@@ -36,13 +36,13 @@ import { logout } from '@pega/auth/lib/sdk-auth-manager';
36
36
 
37
37
  import { useNavBar } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
38
38
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
39
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
39
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
40
40
 
41
41
  import './NavBar.css';
42
42
 
43
43
  interface NavBarProps extends PConnProps {
44
44
  // If any, enter additional props that only exist on this component
45
- // eslint-disable-next-line react/no-unused-prop-types
45
+
46
46
  appName?: string;
47
47
  pages?: any[];
48
48
  caseTypes: any[];
@@ -93,7 +93,8 @@ const useStyles = makeStyles(theme => ({
93
93
  },
94
94
  appListLogo: {
95
95
  marginRight: theme.spacing(2),
96
- width: '3.6rem'
96
+ width: '3.6rem',
97
+ filter: 'var(--svg-color)'
97
98
  },
98
99
  appListIcon: {
99
100
  color: theme.palette.getContrastText(theme.palette.primary.light)
@@ -125,7 +126,6 @@ export default function NavBar(props: NavBarProps) {
125
126
  const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false);
126
127
  const [anchorEl, setAnchorEl] = useState(null);
127
128
  const localeUtils = PCore.getLocaleUtils();
128
- const localeReference = pConn.getValue('.pyLocaleReference');
129
129
 
130
130
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
131
131
  const localeCategory = 'AppShell';
@@ -133,20 +133,31 @@ export default function NavBar(props: NavBarProps) {
133
133
  const portalLogoImage = Utils.getIconPath(Utils.getSDKStaticConentUrl()).concat('pzpega-logo-mark.svg');
134
134
  const portalOperator = PCore.getEnvironmentInfo().getOperatorName();
135
135
  const portalApp = PCore.getEnvironmentInfo().getApplicationLabel();
136
-
136
+ // @ts-ignore
137
+ const localeReference = PCore.getLocaleUtils().getPortalLocaleReference() || pConn.getValue('.pyLocaleReference');
137
138
  useEffect(() => {
138
- setNavPages(JSON.parse(JSON.stringify(pages)));
139
+ const updatedPages = pages.map((page: any) => {
140
+ const destinationObject: any = {};
141
+ pConn.resolveConfigProps(
142
+ { defaultHeading: page.pyDefaultHeading || page.pyLabel, localeReference: page.pyLocalizationReference },
143
+ destinationObject
144
+ );
145
+ const name = localeUtils.getLocaleValue(destinationObject.defaultHeading, '', destinationObject.localeReference || localeReference);
146
+ return { ...page, name };
147
+ });
148
+ setNavPages(updatedPages);
139
149
  }, [pages]);
140
150
 
141
151
  function navPanelButtonClick(oPageData: any) {
142
152
  const { pyClassName, pyRuleName } = oPageData;
143
-
144
153
  pConn
145
154
  .getActionsApi()
146
155
  .showPage(pyRuleName, pyClassName)
147
156
  .then(() => {
148
- // eslint-disable-next-line no-console
149
157
  console.log(`${localizedVal('showPage completed', localeCategory)}`);
158
+ })
159
+ .catch(error => {
160
+ console.error('Failed to navigate to page from NavBar', error);
150
161
  });
151
162
  }
152
163
 
@@ -156,13 +167,14 @@ export default function NavBar(props: NavBarProps) {
156
167
  containerName: 'primary',
157
168
  flowType: sFlowType || 'pyStartCase'
158
169
  };
159
-
160
170
  pConn
161
171
  .getActionsApi()
162
172
  .createWork(sCaseType, actionInfo)
163
173
  .then(() => {
164
- // eslint-disable-next-line no-console
165
174
  console.log(`${localizedVal('createWork completed', localeCategory)}`);
175
+ })
176
+ .catch(error => {
177
+ console.error('Failed to create case from NavBar', error);
166
178
  });
167
179
  }
168
180
 
@@ -199,7 +211,14 @@ export default function NavBar(props: NavBarProps) {
199
211
  >
200
212
  {open ? (
201
213
  <List className={classes.appListItem}>
202
- <ListItem onClick={handleDrawerOpen}>
214
+ <ListItem
215
+ onClick={handleDrawerOpen}
216
+ secondaryAction={
217
+ <IconButton edge='end' onClick={handleDrawerOpen} size='large'>
218
+ <ChevronLeftIcon className={classes.appListIcon} />
219
+ </IconButton>
220
+ }
221
+ >
203
222
  <ListItemIcon>
204
223
  <img src={portalLogoImage} className={classes.appListLogo} />
205
224
  </ListItemIcon>
@@ -210,11 +229,6 @@ export default function NavBar(props: NavBarProps) {
210
229
  </Typography>
211
230
  }
212
231
  />
213
- <ListItemSecondaryAction>
214
- <IconButton edge='end' onClick={handleDrawerOpen} size='large'>
215
- <ChevronLeftIcon className={classes.appListIcon} />
216
- </IconButton>
217
- </ListItemSecondaryAction>
218
232
  </ListItem>
219
233
  </List>
220
234
  ) : (
@@ -223,17 +237,16 @@ export default function NavBar(props: NavBarProps) {
223
237
  </div>
224
238
  )}
225
239
  <List>
226
- <ListItem button onClick={handleCaseItemClick}>
240
+ <ListItemButton onClick={handleCaseItemClick}>
227
241
  <ListItemIcon>{bShowCaseTypes && open ? <ClearOutlinedIcon fontSize='large' /> : <AddIcon fontSize='large' />}</ListItemIcon>
228
242
  <ListItemText primary='Create' />
229
243
  {bShowCaseTypes ? <ExpandLess /> : <ExpandMore />}
230
- </ListItem>
244
+ </ListItemButton>
231
245
  </List>
232
246
  <Collapse in={bShowCaseTypes && open} timeout='auto' unmountOnExit className='scrollable'>
233
247
  <List component='div' disablePadding>
234
248
  {caseTypes.map(caseType => (
235
- <ListItem
236
- button
249
+ <ListItemButton
237
250
  className={classes.nested}
238
251
  onClick={() => navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)}
239
252
  key={caseType.pyLabel}
@@ -241,34 +254,36 @@ export default function NavBar(props: NavBarProps) {
241
254
  <ListItemIcon>
242
255
  <WorkOutlineIcon fontSize='large' />
243
256
  </ListItemIcon>
244
- <ListItemText primary={localeUtils.getLocaleValue(caseType.pyLabel, '', localeReference)} />
245
- </ListItem>
257
+ <ListItemText primary={localeUtils.getLocaleValue(caseType.pyLabel, '', localeUtils.getCaseLocaleReference(caseType.pyClassName))} />
258
+ </ListItemButton>
246
259
  ))}
247
260
  </List>
248
261
  </Collapse>
249
262
  <List>
250
263
  {navPages.map(page => (
251
- <ListItem button onClick={() => navPanelButtonClick(page)} key={page.pyLabel}>
264
+ <ListItemButton onClick={() => navPanelButtonClick(page)} key={page.pyLabel}>
252
265
  <ListItemIcon>{iconMap[page.pxPageViewIcon]}</ListItemIcon>
253
- <ListItemText primary={localeUtils.getLocaleValue(page.pyLabel, '', localeReference)} />
254
- </ListItem>
266
+ <ListItemText primary={page.name} />
267
+ </ListItemButton>
255
268
  ))}
256
269
  </List>
257
270
  <Divider />
258
271
  <List className='marginTopAuto'>
259
272
  <>
260
- <ListItem onClick={navPanelOperatorButtonClick}>
273
+ <ListItem
274
+ onClick={navPanelOperatorButtonClick}
275
+ secondaryAction={
276
+ open ? (
277
+ <IconButton edge='end' onClick={navPanelOperatorButtonClick} size='large'>
278
+ <ChevronRightIcon />
279
+ </IconButton>
280
+ ) : null
281
+ }
282
+ >
261
283
  <ListItemIcon id='person-icon'>
262
284
  <PersonOutlineIcon fontSize='large' />
263
285
  </ListItemIcon>
264
286
  <ListItemText primary={portalOperator} />
265
- {open && (
266
- <ListItemSecondaryAction>
267
- <IconButton edge='end' onClick={navPanelOperatorButtonClick} size='large'>
268
- <ChevronRightIcon />
269
- </IconButton>
270
- </ListItemSecondaryAction>
271
- )}
272
287
  </ListItem>
273
288
  <Menu
274
289
  anchorEl={anchorEl}
@@ -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 ReferenceProps extends PConnProps {
4
4
  // If any, enter additional props that only exist on this component
@@ -12,8 +12,7 @@ export default function Reference(props: ReferenceProps) {
12
12
  const { visibility = true, context = '', getPConnect, readOnly = false, displayMode = '' } = props;
13
13
 
14
14
  const pConnect = getPConnect();
15
- // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
16
- const referenceConfig = { ...pConnect.getComponentConfig() } || {};
15
+ const referenceConfig = { ...pConnect.getComponentConfig() };
17
16
 
18
17
  delete referenceConfig?.name;
19
18
  delete referenceConfig?.type;
@@ -34,11 +33,16 @@ export default function Reference(props: ReferenceProps) {
34
33
  }
35
34
  };
36
35
 
37
- // @ts-ignore - Argument of type 'null' is not assignable to parameter of type 'string'.
36
+ // @ts-expect-error - Argument of type 'null' is not assignable to parameter of type 'string'.
38
37
  const viewComponent: any = pConnect.createComponent(viewObject, null, null, {
39
38
  pageReference: context && context.startsWith('@CLASS') ? '' : context
40
39
  });
41
40
 
41
+ if (referenceConfig.inheritedProps && referenceConfig.inheritedProps.length > 0) {
42
+ const inheritedProps = pConnect.getInheritedProps();
43
+ referenceConfig.inheritedProps = Object.keys(inheritedProps).map(prop => ({ prop, value: inheritedProps[prop] }));
44
+ }
45
+
42
46
  viewComponent.props.getPConnect().setInheritedConfig({
43
47
  ...referenceConfig,
44
48
  readOnly,
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
2
 
3
3
  // Region does NOT have getPConnect. So, no need to extend from PConnProps
4
4
  interface RegionProps {
@@ -1,11 +1,11 @@
1
- import { Children, createElement, PropsWithChildren, useContext, useEffect, useMemo, useRef, useState } from 'react';
1
+ import { Children, createElement, type PropsWithChildren, useContext, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { Box, CircularProgress } from '@mui/material';
3
3
 
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
5
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
6
6
  import { LazyMap as LazyComponentMap } from '@pega/react-sdk-components/lib/components_map';
7
7
  import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
8
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
8
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
9
9
 
10
10
  interface RootContainerProps extends PConnProps {
11
11
  // If any, enter additional props that only exist on this component
@@ -15,11 +15,10 @@ interface RootContainerProps extends PConnProps {
15
15
  httpMessages: any[];
16
16
  }
17
17
 
18
- //
19
- // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
20
- // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
21
- // is totally at your own risk.
22
- //
18
+ /**
19
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
20
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
21
+ */
23
22
 
24
23
  const renderingModes = ['portal', 'view'];
25
24
 
@@ -196,7 +195,6 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
196
195
  );
197
196
  }
198
197
  if (renderingMode === 'noPortal') {
199
- // eslint-disable-next-line no-console
200
198
  console.log(`${localizedVal('RootContainer rendering in noPortal mode', localeCategory)}`);
201
199
 
202
200
  const theChildren = pConn.getChildren() as any[];
@@ -3,7 +3,7 @@ import DoubleArrowIcon from '@mui/icons-material/DoubleArrow';
3
3
  import DoneIcon from '@mui/icons-material/Done';
4
4
  import makeStyles from '@mui/styles/makeStyles';
5
5
 
6
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
8
8
  interface StagesProps extends PConnProps {
9
9
  // If any, enter additional props that only exist on this component
@@ -57,14 +57,13 @@ export default function Stages(props: StagesProps) {
57
57
 
58
58
  const { getPConnect, stages } = props;
59
59
  const pConn = getPConnect();
60
- const key = `${pConn.getCaseInfo().getClassName()}!CASE!${pConn.getCaseInfo().getName()}`.toUpperCase();
61
-
60
+ const localizationService = pConn.getLocalizationService();
62
61
  const filteredStages = getFilteredStages(stages);
63
62
  const currentStageID = pConn.getValue(PCore.getConstants().CASE_INFO.STAGEID, ''); // 2nd arg empty string until typedef allows optional
64
63
  const stagesObj = filteredStages.map((stage, index, arr) => {
65
64
  const theID = stage.ID || stage.id;
66
65
  return {
67
- name: PCore.getLocaleUtils().getLocaleValue(stage.name, undefined, key),
66
+ name: localizationService.getLocalizedText(stage.name),
68
67
  id: theID,
69
68
  complete: stage.visited_status === 'completed',
70
69
  current: theID === currentStageID,
@@ -1,8 +1,8 @@
1
- import { PropsWithChildren, useEffect } from 'react';
1
+ import { type PropsWithChildren, useEffect } from 'react';
2
2
 
3
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
4
  import { getAllFields } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
5
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
7
  // Need to import any templates that we might render
8
8
 
@@ -21,13 +21,12 @@ interface ViewProps extends PConnProps {
21
21
  type?: any;
22
22
  }
23
23
 
24
- //
25
- // WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
26
- // Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
27
- // is totally at your own risk.
28
- //
24
+ /**
25
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
26
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
27
+ */
29
28
 
30
- const FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide'];
29
+ const FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide', 'HierarchicalForm'];
31
30
  const NO_HEADER_TEMPLATES = [
32
31
  'SubTabs',
33
32
  'SimpleTable',
@@ -38,7 +37,8 @@ const NO_HEADER_TEMPLATES = [
38
37
  'WideNarrowDetails',
39
38
  'Confirmation',
40
39
  'DynamicTabs',
41
- 'DetailsSubTabs'
40
+ 'DetailsSubTabs',
41
+ 'ListView'
42
42
  ];
43
43
 
44
44
  export default function View(props: PropsWithChildren<ViewProps>) {
@@ -0,0 +1,86 @@
1
+ import { useContext, useState } from 'react';
2
+
3
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
+ import DataReferenceAdvancedSearchContext from '@pega/react-sdk-components/lib/components/template/DataReference/DataReferenceAdvancedSearchContext';
5
+ import { getFirstChildConfig } from '@pega/react-sdk-components/lib/components/template/DataReference/utils';
6
+
7
+ export default function AdvancedSearch(props) {
8
+ const { getPConnect, targetObjectClass, localeReference } = props;
9
+ const SearchGroups = getComponentFromMap('SearchGroups');
10
+ const { dataReferenceConfigToChild, isCreateNewReferenceEnabled, disableStartingFieldsForReference, pyID, searchSelectCacheKey } = useContext(
11
+ DataReferenceAdvancedSearchContext
12
+ ) as any;
13
+
14
+ const { selectionMode, value: singleSelectFieldValue, readonlyContextList: multiSelectField } = dataReferenceConfigToChild;
15
+
16
+ let isSelectionExist = false;
17
+ const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
18
+
19
+ if (selectionMode === MULTI) {
20
+ isSelectionExist = getPConnect().getValue(multiSelectField)?.length || false;
21
+ } else {
22
+ isSelectionExist = getPConnect().getValue(singleSelectFieldValue) || false;
23
+ }
24
+
25
+ const [showRecords, setShowRecords] = useState(isSelectionExist);
26
+
27
+ const pConn = getPConnect();
28
+ const rawViewMetadata = pConn.getRawMetadata();
29
+
30
+ const searchFieldsSet = new Set();
31
+ const searchFields: any = [];
32
+ rawViewMetadata.config.searchGroups.forEach(group => {
33
+ group.children.forEach(child => {
34
+ if (!searchFieldsSet.has(child.config.value) && !child.config.validator) {
35
+ searchFields.push(child);
36
+ searchFieldsSet.add(child.config.value);
37
+ }
38
+ });
39
+ });
40
+
41
+ const firstChildPConnect = getPConnect().getChildren()[0].getPConnect;
42
+ const [firstChildMeta] = rawViewMetadata.children;
43
+
44
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
45
+ const cache = PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey) ?? {};
46
+
47
+ const editableFieldComp = firstChildPConnect().createComponent({
48
+ type: firstChildMeta.type,
49
+ config: {
50
+ ...getFirstChildConfig({
51
+ firstChildMeta,
52
+ getPConnect,
53
+ rawViewMetadata,
54
+ contextClass: targetObjectClass,
55
+ dataReferenceConfigToChild,
56
+ isCreateNewReferenceEnabled,
57
+ disableStartingFieldsForReference,
58
+ pyID
59
+ }),
60
+ searchFields,
61
+ showRecords,
62
+ label: localizedVal('Search results', 'DataReference'),
63
+ searchSelectCacheKey,
64
+ cache
65
+ }
66
+ });
67
+
68
+ const { selectionList, dataRelationshipContext } = editableFieldComp.props.getPConnect().getConfigProps();
69
+ const editableField = selectionMode === MULTI ? selectionList.substring(1) : dataRelationshipContext;
70
+
71
+ const searchGroupsProps = {
72
+ getPConnect,
73
+ editableField,
74
+ localeReference,
75
+ setShowRecords,
76
+ searchSelectCacheKey,
77
+ cache
78
+ };
79
+
80
+ return (
81
+ <>
82
+ <SearchGroups {...searchGroupsProps} />
83
+ {editableFieldComp}
84
+ </>
85
+ );
86
+ }
@@ -0,0 +1,52 @@
1
+ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
2
+
3
+ const SKIP_CACHE_KEY = '';
4
+
5
+ const getComponentStateKey = (getPConnect, propertyName: string) => {
6
+ const pConnect = getPConnect();
7
+ const caseID = `.${Utils.getMappedKey('pyID')}`; // Enhance this later when use-case arrives for data objects using S&S.
8
+ const resolvedCaseID = pConnect.getValue(caseID);
9
+
10
+ if (!resolvedCaseID) {
11
+ return SKIP_CACHE_KEY;
12
+ }
13
+
14
+ return `Search-${resolvedCaseID}-${pConnect.getPageReference()}-${propertyName}-${pConnect.getCurrentView()}`;
15
+ };
16
+
17
+ const getComponentStateOptions = getPConnect => {
18
+ return { clearOnCancelForContext: getPConnect().getContextName() };
19
+ };
20
+
21
+ interface SearchCategory {
22
+ // tabId of search category selected
23
+ selectedCategory: string;
24
+ }
25
+
26
+ interface SearchGroup {
27
+ // searchFields can be any object based on what fields are authored.
28
+ searchFields: unknown;
29
+ activeGroupId: string;
30
+ }
31
+
32
+ const setComponentCache = ({
33
+ cacheKey,
34
+ state,
35
+ options
36
+ }: {
37
+ cacheKey: string;
38
+ state: SearchCategory | SearchGroup;
39
+ options: ReturnType<typeof getComponentStateOptions>;
40
+ }) => {
41
+ if (cacheKey !== SKIP_CACHE_KEY) {
42
+ (PCore.getNavigationUtils() as any).setComponentCache(cacheKey, state, options);
43
+ }
44
+ };
45
+
46
+ const componentCachePersistUtils = {
47
+ getComponentStateKey,
48
+ getComponentStateOptions,
49
+ setComponentCache
50
+ };
51
+
52
+ export default componentCachePersistUtils;