@pega/react-sdk-overrides 23.1.12 → 24.2.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 (99) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +1 -1
  2. package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
  3. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  4. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +13 -4
  5. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
  6. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +4 -4
  7. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
  8. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +5 -5
  9. package/lib/designSystemExtension/Operator/Operator.tsx +6 -5
  10. package/lib/designSystemExtension/Pulse/Pulse.tsx +2 -2
  11. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
  12. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
  13. package/lib/field/AutoComplete/AutoComplete.tsx +4 -4
  14. package/lib/field/CancelAlert/CancelAlert.tsx +5 -3
  15. package/lib/field/Checkbox/Checkbox.tsx +4 -4
  16. package/lib/field/Currency/Currency.tsx +37 -27
  17. package/lib/field/Date/Date.tsx +23 -42
  18. package/lib/field/DateTime/DateTime.tsx +29 -34
  19. package/lib/field/Decimal/Decimal.tsx +34 -20
  20. package/lib/field/Dropdown/Dropdown.tsx +3 -3
  21. package/lib/field/Email/Email.tsx +29 -8
  22. package/lib/field/Group/Group.tsx +2 -2
  23. package/lib/field/Integer/Integer.tsx +22 -8
  24. package/lib/field/{MultiSelect → Multiselect}/Multiselect.tsx +9 -15
  25. package/lib/field/Percentage/Percentage.tsx +34 -19
  26. package/lib/field/Phone/Phone.tsx +22 -12
  27. package/lib/field/Phone/config-ext.json +8 -0
  28. package/lib/field/RadioButtons/RadioButtons.tsx +3 -3
  29. package/lib/field/RichText/RichText.tsx +1 -1
  30. package/lib/field/RichText/config-ext.json +10 -0
  31. package/lib/field/ScalarList/ScalarList.tsx +4 -2
  32. package/lib/field/SemanticLink/SemanticLink.tsx +4 -4
  33. package/lib/field/TextArea/TextArea.tsx +26 -8
  34. package/lib/field/TextContent/TextContent.tsx +1 -1
  35. package/lib/field/TextInput/TextInput.tsx +2 -2
  36. package/lib/field/Time/Time.tsx +27 -20
  37. package/lib/field/URL/URL.tsx +26 -7
  38. package/lib/field/UserReference/UserReference.tsx +12 -2
  39. package/lib/helpers/common-utils.ts +1 -5
  40. package/lib/helpers/field-group-utils.ts +2 -2
  41. package/lib/helpers/simpleTableHelpers.ts +1 -1
  42. package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
  43. package/lib/infra/Assignment/Assignment.tsx +38 -7
  44. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +16 -13
  45. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +7 -4
  46. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
  47. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
  48. package/lib/infra/DashboardFilter/DashboardFilter.tsx +2 -2
  49. package/lib/infra/DashboardFilter/filterUtils.tsx +2 -1
  50. package/lib/infra/DeferLoad/DeferLoad.tsx +8 -4
  51. package/lib/infra/MultiStep/MultiStep.tsx +17 -9
  52. package/lib/infra/NavBar/NavBar.css +1 -0
  53. package/lib/infra/NavBar/NavBar.tsx +27 -19
  54. package/lib/infra/RootContainer/RootContainer.tsx +5 -6
  55. package/lib/infra/Stages/Stages.tsx +4 -4
  56. package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
  57. package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
  58. package/lib/infra/View/View.tsx +37 -3
  59. package/lib/template/AppShell/AppShell.tsx +55 -5
  60. package/lib/template/BannerPage/config-ext.json +9 -0
  61. package/lib/template/CaseView/CaseView.tsx +7 -6
  62. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +8 -8
  63. package/lib/template/Confirmation/Confirmation.tsx +2 -1
  64. package/lib/template/DataReference/DataReference.tsx +3 -3
  65. package/lib/template/DefaultForm/utils/index.ts +2 -7
  66. package/lib/template/Details/Details/Details.tsx +3 -3
  67. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +3 -3
  68. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +3 -3
  69. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +3 -3
  70. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +4 -3
  71. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -3
  72. package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
  73. package/lib/template/InlineDashboardPage/config-ext.json +9 -0
  74. package/lib/template/ListView/ListView.tsx +88 -91
  75. package/lib/template/ListView/utils.ts +1 -1
  76. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  77. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +3 -3
  78. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +2 -2
  79. package/lib/template/PromotedFilters/PromotedFilters.tsx +2 -1
  80. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +46 -30
  81. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  82. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  83. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +2 -2
  84. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +2 -2
  85. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +3 -3
  86. package/lib/template/WssNavBar/WssNavBar.tsx +9 -9
  87. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +2 -2
  88. package/lib/widget/Attachment/Attachment.tsx +8 -4
  89. package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
  90. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
  91. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +5 -4
  92. package/lib/widget/Followers/Followers.tsx +2 -2
  93. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -0
  94. package/lib/widget/QuickCreate/config-ext.json +9 -0
  95. package/lib/widget/SummaryItem/SummaryItem.tsx +3 -2
  96. package/lib/widget/ToDo/ToDo.tsx +91 -21
  97. package/package.json +1 -1
  98. /package/lib/field/{MultiSelect → Multiselect}/index.tsx +0 -0
  99. /package/lib/field/{MultiSelect → Multiselect}/utils.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect, createElement } from 'react';
2
- import { Box, Card, CircularProgress } from '@material-ui/core';
3
- import { makeStyles } from '@material-ui/core/styles';
2
+ import { Box, Card, CircularProgress } from '@mui/material';
3
+ import makeStyles from '@mui/styles/makeStyles';
4
4
 
5
5
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
6
6
 
@@ -95,7 +95,7 @@ export default function DeferLoad(props: DeferLoadProps) {
95
95
  }
96
96
  };
97
97
  const configObject = PCore.createPConnect(config);
98
- configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
98
+ configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
99
99
  setContent(createElement(createPConnectComponent(), configObject));
100
100
  if (deferLoadId) {
101
101
  PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
@@ -137,8 +137,12 @@ export default function DeferLoad(props: DeferLoadProps) {
137
137
  getPConnect()
138
138
  .getActionsApi()
139
139
  .refreshCaseView(encodeURI(loadViewCaseID), name, '') // 3rd arg empty string until typedef allows optional
140
- .then(data => {
140
+ .then((data: any) => {
141
141
  onResponse(data.root);
142
+ })
143
+ .catch(error => {
144
+ // eslint-disable-next-line no-console
145
+ console.log(`deferload: ${error}`);
142
146
  });
143
147
  }
144
148
  }, [name, getPConnect, currentLoadedAssignment]);
@@ -11,7 +11,7 @@ interface MultiStepProps extends PConnProps {
11
11
  actionButtons: any[];
12
12
  onButtonPress: any;
13
13
  bIsVertical: boolean;
14
- arNavigationSteps: any[];
14
+ arNavigationSteps: any;
15
15
  }
16
16
 
17
17
  export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
@@ -21,6 +21,12 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
21
21
  const { getPConnect, children, itemKey = '', actionButtons, onButtonPress } = props;
22
22
  const { bIsVertical, arNavigationSteps } = props;
23
23
 
24
+ let currentStep = arNavigationSteps.find(({ visited_status: vs }) => vs === 'current');
25
+ if (!currentStep) {
26
+ const lastActiveStepIndex = arNavigationSteps.findLastIndex(({ visited_status: vs }) => vs === 'success');
27
+ currentStep = arNavigationSteps[lastActiveStepIndex >= 0 ? lastActiveStepIndex : 0];
28
+ }
29
+
24
30
  // const svgCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
25
31
  // const svgNotCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
26
32
 
@@ -48,16 +54,16 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
48
54
  return 'psdk-vertical-step-body';
49
55
  }
50
56
 
51
- function _getHIconClass(status): string {
52
- if (status === 'current') {
57
+ function _getHIconClass(step): string {
58
+ if (step.ID === currentStep?.ID) {
53
59
  return 'psdk-horizontal-step-icon-selected';
54
60
  }
55
61
 
56
62
  return 'psdk-horizontal-step-icon';
57
63
  }
58
64
 
59
- function _getHLabelClass(status): string {
60
- if (status === 'current') {
65
+ function _getHLabelClass(step): string {
66
+ if (step.ID === currentStep?.ID) {
61
67
  return 'psdk-horizontal-step-label-selected';
62
68
  }
63
69
 
@@ -138,13 +144,15 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
138
144
  return (
139
145
  <React.Fragment key={mainStep.actionID}>
140
146
  <div className='psdk-horizontal-step-header'>
141
- <div className={_getHIconClass(mainStep.visited_status)}>
147
+ <div className={_getHIconClass(mainStep)}>
142
148
  <div className='psdk-horizontal-step-icon-content'>
143
149
  <span>{index + 1}</span>
144
150
  </div>
145
151
  </div>
146
- <div className={_getHLabelClass(mainStep.visited_status)}>
147
- <div className='psdk-horizontal-step-text-label'>{mainStep.name}</div>
152
+ <div className={_getHLabelClass(mainStep)}>
153
+ <div className='psdk-horizontal-step-text-label' id='selected-label'>
154
+ {mainStep.name}
155
+ </div>
148
156
  </div>
149
157
  </div>
150
158
  {_showHLine(index) && <div className='psdk-horizontal-step-line' />}
@@ -174,7 +182,7 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
174
182
  ))}
175
183
  </ul>
176
184
  )}
177
- {!mainStep?.steps && mainStep.visited_status === 'current' && (
185
+ {!mainStep?.steps && mainStep.ID === currentStep?.ID && (
178
186
  <AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
179
187
  {children}
180
188
  </AssignmentCard>
@@ -165,4 +165,5 @@
165
165
 
166
166
  .scrollable {
167
167
  overflow-y: scroll !important;
168
+ min-height: 200px !important;
168
169
  }
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { makeStyles, useTheme } from '@material-ui/core/styles';
2
+ import { useTheme } from '@mui/material/styles';
3
+ import makeStyles from '@mui/styles/makeStyles';
3
4
  import clsx from 'clsx';
4
5
 
5
6
  import {
@@ -15,19 +16,22 @@ import {
15
16
  Menu,
16
17
  MenuItem,
17
18
  Typography
18
- } from '@material-ui/core';
19
- import PersonOutlineIcon from '@material-ui/icons/PersonOutlineOutlined';
20
- import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
21
- import ChevronRightIcon from '@material-ui/icons/ChevronRight';
22
- import FlagOutlinedIcon from '@material-ui/icons/FlagOutlined';
23
- import HomeOutlinedIcon from '@material-ui/icons/HomeOutlined';
24
- import ExpandLess from '@material-ui/icons/ExpandLess';
25
- import ExpandMore from '@material-ui/icons/ExpandMore';
26
- import AddIcon from '@material-ui/icons/Add';
27
- import WorkOutlineIcon from '@material-ui/icons/WorkOutline';
28
- import ClearOutlinedIcon from '@material-ui/icons/ClearOutlined';
29
- import ArrowBackIcon from '@material-ui/icons/ArrowBack';
30
- import useMediaQuery from '@material-ui/core/useMediaQuery';
19
+ } from '@mui/material';
20
+ import PersonOutlineIcon from '@mui/icons-material/PersonOutlineOutlined';
21
+ import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
22
+ import ChevronRightIcon from '@mui/icons-material/ChevronRight';
23
+ import FlagOutlinedIcon from '@mui/icons-material/FlagOutlined';
24
+ import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined';
25
+ import TabletAndroidOutlineIcon from '@mui/icons-material/TabletAndroidOutlined';
26
+ import AirportShuttleOutlinedIcon from '@mui/icons-material/AirportShuttleOutlined';
27
+ import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
28
+ import ExpandLess from '@mui/icons-material/ExpandLess';
29
+ import ExpandMore from '@mui/icons-material/ExpandMore';
30
+ import AddIcon from '@mui/icons-material/Add';
31
+ import WorkOutlineIcon from '@mui/icons-material/WorkOutline';
32
+ import ClearOutlinedIcon from '@mui/icons-material/ClearOutlined';
33
+ import ArrowBackIcon from '@mui/icons-material/ArrowBack';
34
+ import useMediaQuery from '@mui/material/useMediaQuery';
31
35
  import { logout } from '@pega/auth/lib/sdk-auth-manager';
32
36
 
33
37
  import { useNavBar } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
@@ -48,7 +52,11 @@ interface NavBarProps extends PConnProps {
48
52
  const iconMap = {
49
53
  'pi pi-headline': <HomeOutlinedIcon fontSize='large' />,
50
54
  'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />,
51
- 'pi pi-home-solid': <HomeOutlinedIcon fontSize='large' />
55
+ 'pi pi-home-solid': <HomeOutlinedIcon fontSize='large' />,
56
+ 'pi pi-tablet': <TabletAndroidOutlineIcon fontSize='large' />,
57
+ 'pi pi-ambulance': <AirportShuttleOutlinedIcon fontSize='large' />,
58
+ 'pi pi-ink-solid': <EditOutlinedIcon fontSize='large' />,
59
+ 'pi pi-columns': <HomeOutlinedIcon fontSize='large' />
52
60
  };
53
61
 
54
62
  const drawerWidth = 300;
@@ -203,7 +211,7 @@ export default function NavBar(props: NavBarProps) {
203
211
  }
204
212
  />
205
213
  <ListItemSecondaryAction>
206
- <IconButton edge='end' onClick={handleDrawerOpen}>
214
+ <IconButton edge='end' onClick={handleDrawerOpen} size='large'>
207
215
  <ChevronLeftIcon className={classes.appListIcon} />
208
216
  </IconButton>
209
217
  </ListItemSecondaryAction>
@@ -249,14 +257,14 @@ export default function NavBar(props: NavBarProps) {
249
257
  <Divider />
250
258
  <List className='marginTopAuto'>
251
259
  <>
252
- <ListItem onClick={navPanelOperatorButtonClick} style={{ cursor: 'pointer' }}>
253
- <ListItemIcon>
260
+ <ListItem onClick={navPanelOperatorButtonClick}>
261
+ <ListItemIcon id='person-icon'>
254
262
  <PersonOutlineIcon fontSize='large' />
255
263
  </ListItemIcon>
256
264
  <ListItemText primary={portalOperator} />
257
265
  {open && (
258
266
  <ListItemSecondaryAction>
259
- <IconButton edge='end' onClick={navPanelOperatorButtonClick}>
267
+ <IconButton edge='end' onClick={navPanelOperatorButtonClick} size='large'>
260
268
  <ChevronRightIcon />
261
269
  </IconButton>
262
270
  </ListItemSecondaryAction>
@@ -1,6 +1,5 @@
1
1
  import { Children, createElement, PropsWithChildren, useContext, useEffect, useMemo, useRef, useState } from 'react';
2
- import isEqual from 'lodash.isequal';
3
- import { Box, CircularProgress } from '@material-ui/core';
2
+ import { Box, CircularProgress } from '@mui/material';
4
3
 
5
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
6
5
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
@@ -54,6 +53,7 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
54
53
  const pConn = getPConnect();
55
54
 
56
55
  const options = { context: 'app' };
56
+ const rootView = useRef(null);
57
57
 
58
58
  const [componentName, setComponentName] = useState('');
59
59
 
@@ -146,7 +146,6 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
146
146
  return noPortalContent;
147
147
  }
148
148
 
149
- let rootView: any;
150
149
  let rootViewConfig: any = null;
151
150
 
152
151
  useEffect(() => {
@@ -180,8 +179,8 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
180
179
  }
181
180
  };
182
181
 
183
- if (!isEqual(currentRootConfig, prevRootConfig)) {
184
- rootView = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig));
182
+ if (!PCore.isDeepEqual(currentRootConfig, prevRootConfig)) {
183
+ rootView.current = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig)) as any;
185
184
  }
186
185
 
187
186
  // debugging/investigation help
@@ -189,7 +188,7 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
189
188
 
190
189
  return (
191
190
  <div id='ModalManager'>
192
- {rootView}
191
+ {rootView.current}
193
192
  {MemoizedModalViewContainer}
194
193
  <div id='MemoizedPreviewViewContainer' />
195
194
  <div id='ReAuthMessageModal' />
@@ -1,7 +1,7 @@
1
- import { Breadcrumbs, Card, Typography } from '@material-ui/core';
2
- import DoubleArrowIcon from '@material-ui/icons/DoubleArrow';
3
- import DoneIcon from '@material-ui/icons/Done';
4
- import { makeStyles } from '@material-ui/core/styles';
1
+ import { Breadcrumbs, Card, Typography } from '@mui/material';
2
+ import DoubleArrowIcon from '@mui/icons-material/DoubleArrow';
3
+ import DoneIcon from '@mui/icons-material/Done';
4
+ import makeStyles from '@mui/styles/makeStyles';
5
5
 
6
6
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
7
 
@@ -1,5 +1,5 @@
1
- import { withStyles } from '@material-ui/core/styles';
2
- import { Tab, Divider } from '@material-ui/core';
1
+ import withStyles from '@mui/styles/withStyles';
2
+ import { Tab, Divider } from '@mui/material';
3
3
 
4
4
  // LeftAlignVerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
5
5
 
@@ -18,7 +18,8 @@ interface LeftAlignVerticalTabsProps {
18
18
  const LeftAlignVerticalTabs: any = withStyles((/* theme */) => ({
19
19
  root: {
20
20
  width: '100%',
21
- maxWidth: '100%'
21
+ maxWidth: '100%',
22
+ alignItems: 'flex-start'
22
23
  },
23
24
  wrapper: {
24
25
  display: 'block',
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { makeStyles } from '@material-ui/core/styles';
3
- import Tabs from '@material-ui/core/Tabs';
2
+ import makeStyles from '@mui/styles/makeStyles';
3
+ import Tabs from '@mui/material/Tabs';
4
4
 
5
5
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
6
 
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { 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';
@@ -18,6 +18,7 @@ interface ViewProps extends PConnProps {
18
18
  visibility?: boolean;
19
19
  name?: string;
20
20
  bInForm?: boolean;
21
+ type?: any;
21
22
  }
22
23
 
23
24
  //
@@ -36,12 +37,14 @@ const NO_HEADER_TEMPLATES = [
36
37
  'NarrowWideDetails',
37
38
  'WideNarrowDetails',
38
39
  'Confirmation',
39
- 'DynamicTabs'
40
+ 'DynamicTabs',
41
+ 'DetailsSubTabs'
40
42
  ];
41
43
 
42
44
  export default function View(props: PropsWithChildren<ViewProps>) {
43
- const { children, template, getPConnect, mode, visibility, name: pageName } = props;
45
+ const { children, template, getPConnect, mode, visibility, name: pageName, type, title } = props;
44
46
  let { label = '', showLabel = false } = props;
47
+ const { PAGE_TYPES: { PAGE, LANDINGPAGE, LISTPAGE } = {}, MODAL } = PCore.getConstants();
45
48
 
46
49
  // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
47
50
  // Putting this logic here instead of copy/paste in every Form template index.js
@@ -49,12 +52,43 @@ export default function View(props: PropsWithChildren<ViewProps>) {
49
52
  const inheritedProps: any = getPConnect().getInheritedProps(); // try to remove any when getInheritedProps typedefs are fixed
50
53
  label = inheritedProps.label || label;
51
54
  showLabel = inheritedProps.showLabel || showLabel;
55
+ const localeUtils = PCore.getLocaleUtils();
52
56
 
53
57
  const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible
54
58
  if (isEmbeddedDataView && showLabel === undefined) {
55
59
  showLabel = true;
56
60
  }
57
61
 
62
+ useEffect(() => {
63
+ // Get the localized application label
64
+ let applicationLabel = PCore.getEnvironmentInfo().getApplicationLabel();
65
+ applicationLabel = localeUtils.getLocaleValue(`${applicationLabel}`, '', '');
66
+ const caseInfo = getPConnect().getCaseInfo();
67
+ const isAssignmentInCreateStage = caseInfo && caseInfo.isAssignmentInCreateStage();
68
+ const isRenderingInModal = getPConnect().getContainerName().includes(MODAL);
69
+ const isRenderingInPreviewPanel = getPConnect().getContainerName().includes('preview');
70
+
71
+ /* If assignment is in create stage and rendering in modal don't update the title.
72
+ Title will be updated on completion of create stage and when the assignment is rendered inline to the page.
73
+ */
74
+ const canUpdateTitle =
75
+ !isRenderingInPreviewPanel &&
76
+ (type === PAGE || type === LANDINGPAGE || type === LISTPAGE) &&
77
+ !(isRenderingInModal && isAssignmentInCreateStage) &&
78
+ PCore.getEnvironmentInfo().getRenderingMode() === 'FULL_PORTAL';
79
+ // Incase of home route title is same as applicationLabel so setting to empty to just show applicationLabel
80
+ let titleVar = title === applicationLabel ? '' : title;
81
+
82
+ if (canUpdateTitle) {
83
+ if (caseInfo) {
84
+ const name = caseInfo.getName();
85
+ const id = caseInfo.getBusinessID();
86
+ titleVar = name && id ? `${name} (${id})` : titleVar;
87
+ }
88
+ document.title = titleVar ? `${titleVar} - ${applicationLabel}` : applicationLabel;
89
+ }
90
+ }, [type, title, getPConnect, PAGE, LANDINGPAGE, LISTPAGE]);
91
+
58
92
  const key = `${getPConnect().getContextName()}_${getPConnect().getPageReference()}_${pageName}`;
59
93
  // As long as the template is defined in the dependencies of the view
60
94
  // it will be loaded, otherwise fall back to single column
@@ -1,6 +1,6 @@
1
1
  import { PropsWithChildren, useEffect, useState } from 'react';
2
- import { makeStyles } from '@material-ui/core/styles';
3
- import Avatar from '@material-ui/core/Avatar';
2
+ import makeStyles from '@mui/styles/makeStyles';
3
+ import Avatar from '@mui/material/Avatar';
4
4
 
5
5
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
6
6
  import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
@@ -24,6 +24,8 @@ interface AppShellProps extends PConnProps {
24
24
  portalName: string;
25
25
  portalLogo: string;
26
26
  navDisplayOptions: { alignment: string; position: string };
27
+ httpMessages: string[];
28
+ pageMessages: string[];
27
29
  }
28
30
 
29
31
  const useStyles = makeStyles(theme => ({
@@ -49,8 +51,21 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
49
51
  // Get emitted components from map (so we can get any override that may exist)
50
52
  const NavBar = getComponentFromMap('NavBar');
51
53
  const WssNavBar = getComponentFromMap('WssNavBar');
54
+ const AlertBanner = getComponentFromMap('AlertBanner');
52
55
 
53
- const { pages = [], caseTypes = [], showAppName, children = [], getPConnect, portalTemplate, portalName, portalLogo, navDisplayOptions } = props;
56
+ const {
57
+ pages = [],
58
+ caseTypes = [],
59
+ showAppName,
60
+ children = [],
61
+ getPConnect,
62
+ httpMessages = [],
63
+ pageMessages = [],
64
+ portalTemplate,
65
+ portalName,
66
+ portalLogo,
67
+ navDisplayOptions
68
+ } = props;
54
69
 
55
70
  const [open, setOpen] = useState(true);
56
71
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -75,6 +90,15 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
75
90
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
76
91
  const [mapChildren, setMapChildren] = useState([]);
77
92
 
93
+ const messages = [...httpMessages, ...pageMessages];
94
+
95
+ const hasBanner = messages && messages.length ? messages.length > 0 : false;
96
+ let banners: any = null;
97
+ banners = hasBanner && (
98
+ <div style={{ display: 'flex', flexDirection: 'column', padding: '1em 0' }}>
99
+ <AlertBanner id='AppShell' variant='urgent' messages={messages} />
100
+ </div>
101
+ );
78
102
  // Initial setting of appName and mapChildren
79
103
  useEffect(() => {
80
104
  setAppName(PCore.getEnvironmentInfo().getApplicationName());
@@ -92,6 +116,25 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
92
116
  setMapChildren(tempMap);
93
117
  }, []);
94
118
 
119
+ useEffect(() => {
120
+ // @ts-ignore
121
+ const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
122
+ if (caseTypesAvailableToCreateDP) {
123
+ const portalID = pConn.getValue('.pyOwner');
124
+ PCore.getDataPageUtils()
125
+ .getPageDataAsync(caseTypesAvailableToCreateDP, pConn.getContextName(), {
126
+ PortalName: portalID
127
+ })
128
+ .then(response => {
129
+ if (response?.pyCaseTypesAvailableToCreate) {
130
+ pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
131
+ skipDirtyValidation: true
132
+ });
133
+ }
134
+ });
135
+ }
136
+ }, []);
137
+
95
138
  const [iconURL, setIconURL] = useState('');
96
139
  const [fullIconURL, setFullIconURL] = useState('');
97
140
  useEffect(() => {
@@ -187,7 +230,10 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
187
230
  operator={getOperator()}
188
231
  navDisplayOptions={navDisplayOptions}
189
232
  />
190
- <div className={classes.wsscontent}>{children}</div>
233
+ <div className={classes.wsscontent}>
234
+ {banners}
235
+ {children}
236
+ </div>
191
237
  </div>
192
238
  );
193
239
  }
@@ -203,7 +249,11 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
203
249
  pages={pages}
204
250
  caseTypes={caseTypes}
205
251
  />
206
- <div className={classes.content}>{children}</div>
252
+
253
+ <div className={classes.content}>
254
+ {banners}
255
+ {children}
256
+ </div>
207
257
  </div>
208
258
  </NavContext.Provider>
209
259
  );
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "BannerPage",
3
+ "label": "Banner",
4
+ "description": "Banner Page Template",
5
+ "type": "Template",
6
+ "subtype": "PAGE",
7
+ "icon": "BannerPage.svg",
8
+ "properties": []
9
+ }
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable react/jsx-boolean-value */
2
2
 
3
3
  import { PropsWithChildren, ReactElement, useContext, useEffect, useState } from 'react';
4
- import { Avatar, Card, CardHeader, Divider, Typography } from '@material-ui/core';
5
- import { makeStyles } from '@material-ui/core/styles';
6
- import Box from '@material-ui/core/Box';
7
- import Button from '@material-ui/core/Button';
8
- import Grid from '@material-ui/core/Grid';
4
+ import { Avatar, Card, CardHeader, Divider, Typography } from '@mui/material';
5
+ import makeStyles from '@mui/styles/makeStyles';
6
+ import Box from '@mui/material/Box';
7
+ import Button from '@mui/material/Button';
8
+ import Grid from '@mui/material/Grid';
9
9
 
10
10
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
11
11
  import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
@@ -186,6 +186,7 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
186
186
  <Box>
187
187
  {editAction && (
188
188
  <Button
189
+ id='edit'
189
190
  onClick={() => {
190
191
  _editClick();
191
192
  }}
@@ -217,7 +218,7 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
217
218
  <CardHeader
218
219
  className={classes.caseViewHeader}
219
220
  title={
220
- <Typography variant='h6' component='div'>
221
+ <Typography variant='h6' component='div' id='case-name'>
221
222
  {PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)}
222
223
  </Typography>
223
224
  }
@@ -1,12 +1,12 @@
1
1
  import React, { useState } from 'react';
2
- import Button from '@material-ui/core/Button';
3
- import Menu from '@material-ui/core/Menu';
4
- import MenuItem from '@material-ui/core/MenuItem';
2
+ import Button from '@mui/material/Button';
3
+ import Menu from '@mui/material/Menu';
4
+ import MenuItem from '@mui/material/MenuItem';
5
5
 
6
6
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
- import Snackbar from '@material-ui/core/Snackbar';
8
- import IconButton from '@material-ui/core/IconButton';
9
- import CloseIcon from '@material-ui/icons/Close';
7
+ import Snackbar from '@mui/material/Snackbar';
8
+ import IconButton from '@mui/material/IconButton';
9
+ import CloseIcon from '@mui/icons-material/Close';
10
10
 
11
11
  interface CaseViewActionsMenuProps extends PConnProps {
12
12
  // If any, enter additional props that only exist on this component
@@ -44,7 +44,7 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
44
44
  setShowSnackbar(true);
45
45
  }
46
46
 
47
- function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {
47
+ function handleSnackbarClose(event: React.SyntheticEvent<any> | Event, reason?: string) {
48
48
  if (reason === 'clickaway') {
49
49
  return;
50
50
  }
@@ -95,7 +95,7 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
95
95
 
96
96
  return (
97
97
  <>
98
- <Button aria-controls='simple-menu' aria-haspopup='true' onClick={handleClick}>
98
+ <Button id='actions-menu' aria-controls='simple-menu' aria-haspopup='true' onClick={handleClick}>
99
99
  {localizedVal('Actions...', localeCategory)}
100
100
  </Button>
101
101
  <Menu id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable no-nested-ternary */
2
2
  import { PropsWithChildren, useState } from 'react';
3
- import { Button, Card, makeStyles } from '@material-ui/core';
3
+ import { Button, Card } from '@mui/material';
4
+ import makeStyles from '@mui/styles/makeStyles';
4
5
 
5
6
  import { getToDoAssignments } from '@pega/react-sdk-components/lib/components/infra/Containers/FlowContainer/helpers';
6
7
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
@@ -52,7 +52,7 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
52
52
  const refList = rawViewMetadata.config.referenceList;
53
53
  const canBeChangedInReviewMode = allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');
54
54
  let propName;
55
- const isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);
55
+ const isDisplayModeEnabled = ['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode);
56
56
  let firstChildPConnect;
57
57
 
58
58
  /* Only for dropdown when it has param use data api to get the data back and add it to datasource */
@@ -128,7 +128,7 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
128
128
  const refreshOptions = { autoDetectRefresh: true };
129
129
  if (canBeChangedInReviewMode && pConn.getValue('__currentPageTabViewName', '')) {
130
130
  // 2nd arg empty string until typedef marked correctly
131
- getPConnect().getActionsApi().refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName', ''), null, refreshOptions); // 2nd arg empty string until typedef marked correctly
131
+ getPConnect().getActionsApi().refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName', ''), '', refreshOptions); // 2nd arg empty string until typedef marked correctly
132
132
  PCore.getDeferLoadManager().refreshActiveComponents(pConn.getContextName());
133
133
  } else {
134
134
  const pgRef = pConn.getPageReference().replace('caseInfo.content', '');
@@ -251,7 +251,7 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
251
251
  }
252
252
 
253
253
  return childrenToRender.length === 1 ? (
254
- childrenToRender[0] ?? null
254
+ (childrenToRender[0] ?? null)
255
255
  ) : (
256
256
  <div>
257
257
  {childrenToRender.map(child => (
@@ -20,13 +20,8 @@ export const getKeyForMappedField = field => {
20
20
 
21
21
  const pConnect = field?.getPConnect?.();
22
22
 
23
- if (pConnect?.meta?.type && pConnect?.meta?.config?.name) {
24
- return `${pConnect.meta.type}_${pConnect.meta.config.name}`;
25
- }
26
-
27
- // Using label as a fallback if name is not defined.
28
- if (pConnect?.meta?.type && pConnect?.meta?.config?.label) {
29
- return `${pConnect.meta.type}_${pConnect.meta.config.label}`;
23
+ if (pConnect?.meta) {
24
+ return JSON.stringify(pConnect.meta);
30
25
  }
31
26
 
32
27
  return uuidv4();
@@ -1,5 +1,5 @@
1
1
  import { createElement } from 'react';
2
- import Grid from '@material-ui/core/Grid';
2
+ import Grid from '@mui/material/Grid';
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';
@@ -23,7 +23,7 @@ export default function Details(props: DetailsProps) {
23
23
 
24
24
  // Set display mode prop and re-create the children so this part of the dom tree renders
25
25
  // in a readonly (display) mode instead of a editable
26
- getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
26
+ getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
27
27
  getPConnect().setInheritedProp('readOnly', true);
28
28
  const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
29
29
  createElement(createPConnectComponent(), {
@@ -46,7 +46,7 @@ export default function Details(props: DetailsProps) {
46
46
  field.config.displayAsStatus = true;
47
47
  }
48
48
 
49
- return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
49
+ return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
50
50
  });
51
51
  }
52
52
 
@@ -1,6 +1,6 @@
1
1
  import { Children, PropsWithChildren, useEffect, useState } from 'react';
2
- import { Tab, Tabs, TextField } from '@material-ui/core';
3
- import { TabContext, TabPanel } from '@material-ui/lab';
2
+ import { Tab, Tabs } from '@mui/material';
3
+ import { TabContext, TabPanel } from '@mui/lab';
4
4
 
5
5
  import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/react-sdk-components/lib/components/template/SubTabs/tabUtils';
6
6
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
@@ -39,7 +39,7 @@ export default function DetailsSubTabs(props: PropsWithChildren<DetailsSubTabsPr
39
39
 
40
40
  return (
41
41
  <>
42
- {propsToUse.showLabel && <TextField>{propsToUse.label}</TextField>}
42
+ {propsToUse.showLabel && <h3>{propsToUse.label}</h3>}
43
43
  <TabContext value={currentTabId.toString()}>
44
44
  <Tabs onChange={handleTabClick} value={currentTabId}>
45
45
  {tabItems.map((tab: any) => (