@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.
- package/lib/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
- package/lib/designSystemExtension/Banner/Banner.css +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
- package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
- package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
- package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
- package/lib/field/CancelAlert/CancelAlert.css +4 -4
- package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
- package/lib/field/Checkbox/Checkbox.tsx +97 -4
- package/lib/field/Currency/Currency.tsx +3 -3
- package/lib/field/Currency/currency-utils.ts +1 -2
- package/lib/field/Date/Date.tsx +3 -7
- package/lib/field/DateTime/DateTime.tsx +3 -8
- package/lib/field/Decimal/Decimal.tsx +3 -5
- package/lib/field/Dropdown/Dropdown.tsx +5 -7
- package/lib/field/Email/Email.tsx +11 -13
- package/lib/field/Group/Group.tsx +10 -8
- package/lib/field/Integer/Integer.tsx +5 -7
- package/lib/field/Location/Location.css +4 -0
- package/lib/field/Location/Location.tsx +258 -0
- package/lib/field/Location/config-ext.json +8 -0
- package/lib/field/Location/index.tsx +1 -0
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
- package/lib/field/ObjectReference/index.tsx +1 -0
- package/lib/field/ObjectReference/utils.ts +111 -0
- package/lib/field/Percentage/Percentage.tsx +3 -7
- package/lib/field/Phone/Phone.tsx +7 -5
- package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
- package/lib/field/RichText/RichText.css +79 -0
- package/lib/field/RichText/RichText.tsx +3 -1
- package/lib/field/ScalarList/ScalarList.tsx +2 -3
- package/lib/field/SelectableCard/SelectableCard.tsx +189 -0
- package/lib/field/SelectableCard/index.tsx +1 -0
- package/lib/field/SelectableCard/utils.tsx +223 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
- package/lib/field/SemanticLink/utils.ts +1 -1
- package/lib/field/TextArea/TextArea.tsx +5 -7
- package/lib/field/TextContent/TextContent.tsx +1 -2
- package/lib/field/TextInput/TextInput.tsx +5 -7
- package/lib/field/Time/Time.tsx +3 -7
- package/lib/field/URL/URL.tsx +5 -7
- package/lib/field/UserReference/UserReference.tsx +2 -3
- package/lib/helpers/attachmentShared.ts +6 -0
- package/lib/helpers/common-utils.ts +3 -4
- package/lib/helpers/data_page.ts +0 -1
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +9 -4
- package/lib/helpers/formatters/CurrencyMap.ts +0 -2
- package/lib/helpers/object-utils.ts +10 -0
- package/lib/helpers/simpleTableHelpers.ts +118 -6
- package/lib/helpers/utils.ts +8 -1
- package/lib/helpers/versionHelpers.ts +0 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
- package/lib/infra/Assignment/Assignment.tsx +47 -31
- package/lib/infra/Assignment/useValidationBanner.ts +29 -0
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +22 -102
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +12 -6
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +8 -13
- package/lib/infra/Containers/container-helpers.ts +47 -1
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
- package/lib/infra/DeferLoad/DeferLoad.tsx +26 -13
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
- package/lib/infra/MultiStep/MultiStep.css +48 -70
- package/lib/infra/MultiStep/MultiStep.tsx +27 -53
- package/lib/infra/NavBar/NavBar.css +1 -1
- package/lib/infra/NavBar/NavBar.tsx +49 -34
- package/lib/infra/Reference/Reference.tsx +8 -4
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +6 -8
- package/lib/infra/Stages/Stages.tsx +3 -4
- package/lib/infra/View/View.tsx +9 -9
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
- package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/lib/template/AdvancedSearch/config-ext.json +9 -0
- package/lib/template/AdvancedSearch/index.tsx +1 -0
- package/lib/template/AppShell/AppShell.css +1 -5
- package/lib/template/AppShell/AppShell.tsx +16 -17
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/CaseSummary/CaseSummary.tsx +25 -43
- package/lib/template/CaseView/CaseView.tsx +28 -35
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/lib/template/Confirmation/Confirmation.tsx +2 -3
- package/lib/template/DataReference/DataReference.tsx +312 -106
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/lib/template/DataReference/SearchForm.tsx +149 -0
- package/lib/template/DataReference/utils.ts +90 -0
- package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
- package/lib/template/DefaultPage/index.tsx +1 -0
- package/lib/template/Details/Details/Details.tsx +11 -11
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -6
- package/lib/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
- package/lib/template/HierarchicalForm/hooks.ts +224 -0
- package/lib/template/HierarchicalForm/index.tsx +1 -0
- package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
- package/lib/template/ListPage/ListPage.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +342 -204
- package/lib/template/ListView/hooks.ts +1 -5
- package/lib/template/ListView/utils.ts +38 -5
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +17 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
- package/lib/template/ObjectPage/index.tsx +1 -0
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
- package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
- package/lib/template/SelfServiceCaseView/index.tsx +1 -0
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +45 -34
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
- package/lib/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +179 -0
- package/lib/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
- package/lib/template/SubTabs/SubTabs.tsx +2 -2
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.css +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
- package/lib/template/utils.tsx +58 -0
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
- package/lib/widget/Attachment/Attachment.css +6 -8
- package/lib/widget/Attachment/Attachment.tsx +303 -225
- package/lib/widget/Attachment/Attachment.types.ts +96 -0
- package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
- package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
- package/lib/widget/Followers/Followers.tsx +2 -4
- package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
- package/lib/widget/SummaryItem/SummaryItem.css +9 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
- package/lib/widget/SummaryList/SummaryList.tsx +1 -1
- package/lib/widget/ToDo/ToDo.css +1 -13
- package/lib/widget/ToDo/ToDo.tsx +37 -36
- package/package.json +1 -1
- 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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
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, '',
|
|
245
|
-
</
|
|
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
|
-
<
|
|
264
|
+
<ListItemButton onClick={() => navPanelButtonClick(page)} key={page.pyLabel}>
|
|
252
265
|
<ListItemIcon>{iconMap[page.pxPageViewIcon]}</ListItemIcon>
|
|
253
|
-
<ListItemText primary={
|
|
254
|
-
</
|
|
266
|
+
<ListItemText primary={page.name} />
|
|
267
|
+
</ListItemButton>
|
|
255
268
|
))}
|
|
256
269
|
</List>
|
|
257
270
|
<Divider />
|
|
258
271
|
<List className='marginTopAuto'>
|
|
259
272
|
<>
|
|
260
|
-
<ListItem
|
|
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
|
-
|
|
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-
|
|
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,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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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:
|
|
66
|
+
name: localizationService.getLocalizedText(stage.name),
|
|
68
67
|
id: theID,
|
|
69
68
|
complete: stage.visited_status === 'completed',
|
|
70
69
|
current: theID === currentStageID,
|
package/lib/infra/View/View.tsx
CHANGED
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|