@pega/react-sdk-overrides 24.1.10 → 24.2.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.tsx +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +11 -2
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +4 -4
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +6 -6
- package/lib/designSystemExtension/Operator/Operator.tsx +6 -5
- package/lib/designSystemExtension/Pulse/Pulse.tsx +2 -2
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
- package/lib/field/AutoComplete/AutoComplete.tsx +4 -4
- package/lib/field/CancelAlert/CancelAlert.tsx +4 -7
- package/lib/field/Checkbox/Checkbox.tsx +4 -4
- package/lib/field/Currency/Currency.tsx +10 -7
- package/lib/field/Date/Date.tsx +27 -42
- package/lib/field/DateTime/DateTime.tsx +39 -36
- package/lib/field/Decimal/Decimal.tsx +9 -4
- package/lib/field/Dropdown/Dropdown.tsx +29 -22
- package/lib/field/Email/Email.tsx +29 -8
- package/lib/field/Group/Group.tsx +2 -2
- package/lib/field/Integer/Integer.tsx +22 -8
- package/lib/field/Multiselect/Multiselect.tsx +8 -14
- package/lib/field/Percentage/Percentage.tsx +8 -4
- package/lib/field/Phone/Phone.tsx +6 -5
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +3 -6
- package/lib/field/RichText/RichText.tsx +1 -1
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/ScalarList/ScalarList.tsx +3 -4
- package/lib/field/SemanticLink/SemanticLink.tsx +4 -4
- package/lib/field/TextArea/TextArea.tsx +26 -8
- package/lib/field/TextContent/TextContent.tsx +1 -1
- package/lib/field/TextInput/TextInput.tsx +2 -2
- package/lib/field/Time/Time.tsx +28 -21
- package/lib/field/URL/URL.tsx +26 -7
- package/lib/field/UserReference/UserReference.tsx +3 -5
- package/lib/helpers/common-utils.ts +24 -1
- package/lib/helpers/field-group-utils.ts +2 -2
- package/lib/helpers/formatters/Currency.ts +11 -16
- package/lib/helpers/formatters/common.ts +2 -1
- package/lib/helpers/formatters/index.ts +2 -4
- package/lib/helpers/simpleTableHelpers.ts +1 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
- package/lib/infra/Assignment/Assignment.tsx +12 -12
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +16 -28
- package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +9 -4
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +8 -8
- package/lib/infra/Containers/SimpleView/helper.ts +1 -1
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +1 -1
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -4
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
- package/lib/infra/DeferLoad/DeferLoad.tsx +8 -8
- package/lib/infra/MultiStep/MultiStep.tsx +15 -14
- package/lib/infra/NavBar/NavBar.css +1 -0
- package/lib/infra/NavBar/NavBar.tsx +25 -17
- package/lib/infra/RootContainer/RootContainer.tsx +5 -6
- package/lib/infra/Stages/Stages.tsx +4 -4
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
- package/lib/infra/View/View.tsx +37 -3
- package/lib/template/AppShell/AppShell.tsx +60 -10
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/CaseView/CaseView.tsx +10 -9
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +7 -7
- package/lib/template/Confirmation/Confirmation.tsx +3 -2
- package/lib/template/DataReference/DataReference.tsx +2 -2
- package/lib/template/Details/Details/Details.tsx +2 -2
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +3 -3
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +2 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +2 -2
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +4 -4
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -5
- package/lib/template/InlineDashboard/InlineDashboard.tsx +2 -2
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/template/ListView/ListView.tsx +79 -70
- package/lib/template/ListView/utils.ts +1 -2
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +2 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +0 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +110 -86
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +2 -4
- package/lib/template/SubTabs/SubTabs.tsx +2 -2
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +2 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.tsx +9 -9
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +2 -2
- package/lib/widget/Attachment/Attachment.css +1 -0
- package/lib/widget/Attachment/Attachment.tsx +7 -9
- package/lib/widget/CaseHistory/CaseHistory.tsx +12 -10
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -1
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +5 -4
- package/lib/widget/Followers/Followers.tsx +2 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +0 -1
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/lib/widget/SummaryItem/SummaryItem.tsx +4 -3
- package/lib/widget/ToDo/ToDo.tsx +92 -22
- package/package.json +1 -1
- /package/lib/infra/Containers/{helpers.ts → container-helpers.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-nested-ternary */
|
|
2
2
|
import { PropsWithChildren, useState } from 'react';
|
|
3
|
-
import { Button, Card
|
|
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';
|
|
@@ -40,7 +41,7 @@ export default function Confirmation(props: PropsWithChildren<ConfirmationProps>
|
|
|
40
41
|
// Not using whatsNext at the moment, need to figure out the use of it
|
|
41
42
|
// const whatsNext = datasource?.source;
|
|
42
43
|
// const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';
|
|
43
|
-
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget());
|
|
44
|
+
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget() || '');
|
|
44
45
|
const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID);
|
|
45
46
|
const onConfirmViewClose = () => {
|
|
46
47
|
setShowConfirmView(false);
|
|
@@ -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 = ['
|
|
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 */
|
|
@@ -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 => (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
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', '
|
|
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(), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
-
import { Tab, Tabs
|
|
3
|
-
import { TabContext, TabPanel } from '@
|
|
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 && <
|
|
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) => (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
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 DetailsThreeColumn(props: DetailsThreeColumnProps) {
|
|
|
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', '
|
|
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(), {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
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 DetailsTwoColumn(props: DetailsTwoColumnProps) {
|
|
|
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', '
|
|
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(), {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Children, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TabContext, TabPanel } from '@
|
|
2
|
+
import { Tab, Tabs } from '@mui/material';
|
|
3
|
+
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
5
|
|
|
5
6
|
import { buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
6
7
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
@@ -25,12 +26,11 @@ function DynamicTabs(props: DynamicTabsProps) {
|
|
|
25
26
|
// Get the inherited props from the parent to determine label settings
|
|
26
27
|
const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() };
|
|
27
28
|
const defaultTabIndex = 0;
|
|
28
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
|
|
29
29
|
const { tablabel } = pConnect.getComponentConfig();
|
|
30
30
|
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
31
31
|
const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
32
32
|
const memoisedTabViews = useMemo(() => {
|
|
33
|
-
pConnect.setInheritedProp('displayMode', '
|
|
33
|
+
pConnect.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
34
34
|
pConnect.setInheritedProp('readOnly', true);
|
|
35
35
|
|
|
36
36
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { useLayoutEffect, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -37,9 +37,16 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
37
37
|
const resolvedList = getReferenceList(pConn);
|
|
38
38
|
pConn.setReferenceList(resolvedList);
|
|
39
39
|
const pageReference = `${pConn.getPageReference()}${resolvedList}`;
|
|
40
|
-
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === '
|
|
40
|
+
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
|
|
41
41
|
const HEADING = heading ?? 'Row';
|
|
42
42
|
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
if (!isReadonlyMode) {
|
|
45
|
+
// @ts-ignore - Expected 3 arguments, but got 1
|
|
46
|
+
pConn.getListActions().initDefaultPageInstructions(resolvedList);
|
|
47
|
+
}
|
|
48
|
+
}, [referenceList?.length]);
|
|
49
|
+
|
|
43
50
|
const getDynamicHeaderProp = (item, index) => {
|
|
44
51
|
if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)]) {
|
|
45
52
|
return item[heading.substring(1)];
|
|
@@ -51,7 +58,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
51
58
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
52
59
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
53
60
|
} else {
|
|
54
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
55
61
|
pConn.getListActions().insert({}, referenceList.length);
|
|
56
62
|
}
|
|
57
63
|
};
|
|
@@ -64,7 +70,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
64
70
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
65
71
|
pConn.getListActions().deleteEntry(index, pageReference);
|
|
66
72
|
} else {
|
|
67
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
68
73
|
pConn.getListActions().deleteEntry(index);
|
|
69
74
|
}
|
|
70
75
|
};
|
|
@@ -89,7 +94,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
89
94
|
);
|
|
90
95
|
}
|
|
91
96
|
|
|
92
|
-
pConn.setInheritedProp('displayMode', '
|
|
97
|
+
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
93
98
|
const memoisedReadOnlyList = useMemo(() => {
|
|
94
99
|
return referenceList.map((item, index) => {
|
|
95
100
|
const key = item[heading] || `field-group-row-${index}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid, Typography } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Grid, Typography } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface InlineDashboardProps extends PConnProps {
|
|
@@ -4,43 +4,46 @@
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
5
5
|
|
|
6
6
|
import React, { useState, useEffect, useRef } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
7
|
+
import { Theme } from '@mui/material/styles';
|
|
8
|
+
import createStyles from '@mui/styles/createStyles';
|
|
9
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
10
|
+
import Table from '@mui/material/Table';
|
|
11
|
+
import TableBody from '@mui/material/TableBody';
|
|
12
|
+
import TableCell from '@mui/material/TableCell';
|
|
13
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
14
|
+
import TableHead from '@mui/material/TableHead';
|
|
15
|
+
import TablePagination from '@mui/material/TablePagination';
|
|
16
|
+
import TableRow from '@mui/material/TableRow';
|
|
17
|
+
import TableSortLabel from '@mui/material/TableSortLabel';
|
|
18
|
+
import Paper from '@mui/material/Paper';
|
|
19
|
+
import MoreIcon from '@mui/icons-material/MoreVert';
|
|
20
|
+
import FilterListIcon from '@mui/icons-material/FilterList';
|
|
21
|
+
import SubjectIcon from '@mui/icons-material/Subject';
|
|
22
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
23
|
+
import TextField from '@mui/material/TextField';
|
|
24
|
+
import Grid from '@mui/material/Grid';
|
|
25
|
+
import Menu from '@mui/material/Menu';
|
|
26
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
27
|
+
import Dialog from '@mui/material/Dialog';
|
|
28
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
29
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
30
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
31
|
+
import Select from '@mui/material/Select';
|
|
32
|
+
import Button from '@mui/material/Button';
|
|
33
|
+
import Link from '@mui/material/Link';
|
|
34
|
+
import Typography from '@mui/material/Typography';
|
|
35
|
+
import Snackbar from '@mui/material/Snackbar';
|
|
36
|
+
import IconButton from '@mui/material/IconButton';
|
|
37
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
38
|
+
import { Radio } from '@mui/material';
|
|
39
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
38
40
|
|
|
39
41
|
import { filterData } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
|
|
40
42
|
|
|
41
43
|
import './ListView.css';
|
|
42
44
|
import { getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
|
|
43
45
|
import { getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
|
|
46
|
+
import { getGenericFieldsLocalizedValue } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
44
47
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
45
48
|
|
|
46
49
|
import useInit from './hooks';
|
|
@@ -107,7 +110,6 @@ export default function ListView(props: ListViewProps) {
|
|
|
107
110
|
});
|
|
108
111
|
|
|
109
112
|
const thePConn = getPConnect();
|
|
110
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
|
|
111
113
|
const componentConfig = thePConn.getComponentConfig();
|
|
112
114
|
const resolvedConfigProps: any = thePConn.getConfigProps() as ListViewProps;
|
|
113
115
|
|
|
@@ -220,11 +222,12 @@ export default function ListView(props: ListViewProps) {
|
|
|
220
222
|
|
|
221
223
|
type Order = 'asc' | 'desc';
|
|
222
224
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
interface Comparator<T> {
|
|
226
|
+
(a: T, b: T): number;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function getComparator<T, Key extends keyof T>(theOrder: Order, orderedBy: Key): Comparator<T> {
|
|
230
|
+
return theOrder === 'desc' ? (a: T, b: T) => descendingComparator(a, b, orderedBy) : (a: T, b: T) => -descendingComparator(a, b, orderedBy);
|
|
228
231
|
}
|
|
229
232
|
|
|
230
233
|
function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
|
|
@@ -640,7 +643,6 @@ export default function ListView(props: ListViewProps) {
|
|
|
640
643
|
|
|
641
644
|
thePConn
|
|
642
645
|
.getActionsApi()
|
|
643
|
-
// @ts-ignore
|
|
644
646
|
.openAssignment(pzInsKey, pxRefObjectClass, options)
|
|
645
647
|
.then(() => {
|
|
646
648
|
// console.log("openAssignment successful");
|
|
@@ -670,7 +672,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
670
672
|
}
|
|
671
673
|
}
|
|
672
674
|
|
|
673
|
-
function handleSnackbarClose(event: React.SyntheticEvent |
|
|
675
|
+
function handleSnackbarClose(event: React.SyntheticEvent<any> | Event, reason?: string) {
|
|
674
676
|
if (reason === 'clickaway') {
|
|
675
677
|
return;
|
|
676
678
|
}
|
|
@@ -873,7 +875,6 @@ export default function ListView(props: ListViewProps) {
|
|
|
873
875
|
pzInsKey = row[`${associationCategory}:pzInsKey`];
|
|
874
876
|
}
|
|
875
877
|
if (column.isAssignmentLink) {
|
|
876
|
-
// @ts-ignore
|
|
877
878
|
thePConn.getActionsApi().openAssignment(pzInsKey, pxObjClass, {
|
|
878
879
|
containerName: 'primary',
|
|
879
880
|
channelName: ''
|
|
@@ -1032,33 +1033,35 @@ export default function ListView(props: ListViewProps) {
|
|
|
1032
1033
|
</TableRow>
|
|
1033
1034
|
</TableHead>
|
|
1034
1035
|
<TableBody>
|
|
1035
|
-
{
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
{
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
{
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1036
|
+
{arRows &&
|
|
1037
|
+
stableSort(arRows, getComparator(order, orderBy))
|
|
1038
|
+
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1039
|
+
.map(row => {
|
|
1040
|
+
return (
|
|
1041
|
+
<TableRow key={row.pxRefObjectInsName || row.pyID}>
|
|
1042
|
+
{arColumns.map(column => {
|
|
1043
|
+
const value = row[column.id];
|
|
1044
|
+
return (
|
|
1045
|
+
<TableCell key={column.id} align={column.align} className={classes.cell}>
|
|
1046
|
+
{_showButton(column.id, row) || column.displayAsLink ? (
|
|
1047
|
+
<Link
|
|
1048
|
+
component='button'
|
|
1049
|
+
onClick={() => {
|
|
1050
|
+
_listViewClick(row, column);
|
|
1051
|
+
}}
|
|
1052
|
+
underline='hover'
|
|
1053
|
+
>
|
|
1054
|
+
{column.format && typeof value === 'number' ? column.format(value) : value}
|
|
1055
|
+
</Link>
|
|
1056
|
+
) : (
|
|
1057
|
+
<>{column.format && typeof value === 'number' ? column.format(value) : value || '---'}</>
|
|
1058
|
+
)}
|
|
1059
|
+
</TableCell>
|
|
1060
|
+
);
|
|
1061
|
+
})}
|
|
1062
|
+
</TableRow>
|
|
1063
|
+
);
|
|
1064
|
+
})}
|
|
1062
1065
|
</TableBody>
|
|
1063
1066
|
</Table>
|
|
1064
1067
|
</TableContainer>
|
|
@@ -1127,7 +1130,9 @@ export default function ListView(props: ListViewProps) {
|
|
|
1127
1130
|
})}
|
|
1128
1131
|
</TableBody>
|
|
1129
1132
|
</Table>
|
|
1130
|
-
{arRows && arRows.length === 0 &&
|
|
1133
|
+
{arRows && arRows.length === 0 && (
|
|
1134
|
+
<div className='no-records'>{getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.')}</div>
|
|
1135
|
+
)}
|
|
1131
1136
|
</TableContainer>
|
|
1132
1137
|
)}
|
|
1133
1138
|
</>
|
|
@@ -1158,7 +1163,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1158
1163
|
<DialogContent>
|
|
1159
1164
|
{containsDateOrTime ? (
|
|
1160
1165
|
<>
|
|
1161
|
-
<Select value={displayDialogDateFilter} onChange={_dialogDateFilter} fullWidth>
|
|
1166
|
+
<Select variant='standard' value={displayDialogDateFilter} onChange={_dialogDateFilter} fullWidth>
|
|
1162
1167
|
<MenuItem value='notequal'>is not equal to</MenuItem>
|
|
1163
1168
|
<MenuItem value='after'>after</MenuItem>
|
|
1164
1169
|
<MenuItem value='before'>before</MenuItem>
|
|
@@ -1167,6 +1172,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1167
1172
|
</Select>
|
|
1168
1173
|
{filterType === 'Date' && (
|
|
1169
1174
|
<TextField
|
|
1175
|
+
variant='standard'
|
|
1170
1176
|
autoFocus
|
|
1171
1177
|
margin='dense'
|
|
1172
1178
|
id='containsFilter'
|
|
@@ -1178,6 +1184,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1178
1184
|
)}
|
|
1179
1185
|
{filterType === 'DateTime' && (
|
|
1180
1186
|
<TextField
|
|
1187
|
+
variant='standard'
|
|
1181
1188
|
autoFocus
|
|
1182
1189
|
margin='dense'
|
|
1183
1190
|
id='containsFilter'
|
|
@@ -1189,6 +1196,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1189
1196
|
)}
|
|
1190
1197
|
{filterType === 'Time' && (
|
|
1191
1198
|
<TextField
|
|
1199
|
+
variant='standard'
|
|
1192
1200
|
autoFocus
|
|
1193
1201
|
margin='dense'
|
|
1194
1202
|
id='containsFilter'
|
|
@@ -1201,12 +1209,13 @@ export default function ListView(props: ListViewProps) {
|
|
|
1201
1209
|
</>
|
|
1202
1210
|
) : (
|
|
1203
1211
|
<>
|
|
1204
|
-
<Select fullWidth onChange={_dialogContainsFilter} value={displayDialogContainsFilter}>
|
|
1212
|
+
<Select variant='standard' fullWidth onChange={_dialogContainsFilter} value={displayDialogContainsFilter}>
|
|
1205
1213
|
<MenuItem value='contains'>Contains</MenuItem>
|
|
1206
1214
|
<MenuItem value='equals'>Equals</MenuItem>
|
|
1207
1215
|
<MenuItem value='startswith'>Starts with</MenuItem>
|
|
1208
1216
|
</Select>
|
|
1209
1217
|
<TextField
|
|
1218
|
+
variant='standard'
|
|
1210
1219
|
autoFocus
|
|
1211
1220
|
margin='dense'
|
|
1212
1221
|
id='containsFilter'
|
|
@@ -202,7 +202,6 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) {
|
|
|
202
202
|
if (value.includes('[')) {
|
|
203
203
|
value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
|
|
204
204
|
}
|
|
205
|
-
// @ts-ignore - Expected 3 arguments, but got 2.
|
|
206
205
|
const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
|
|
207
206
|
meta.fieldID = field;
|
|
208
207
|
configEmbeddedFieldsMeta.push(meta);
|
|
@@ -678,7 +677,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
678
677
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
679
678
|
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
|
|
680
679
|
if (compositeKeys.length) {
|
|
681
|
-
otherContext
|
|
680
|
+
otherContext?.setCompositeKeys(compositeKeys);
|
|
682
681
|
}
|
|
683
682
|
if (otherContext) {
|
|
684
683
|
otherContext.fetchRowActionDetails = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid, { GridSize } from '@material
|
|
2
|
+
import Grid, { GridSize } 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';
|
|
@@ -26,7 +26,7 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
|
|
|
26
26
|
|
|
27
27
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
28
28
|
// in a readonly (display) mode instead of a editable
|
|
29
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
29
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
30
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
31
31
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
32
32
|
createElement(createPConnectComponent(), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Grid } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface OneColumnProps extends PConnProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState, createElement } from 'react';
|
|
2
|
-
import Button from '@material
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
@@ -87,7 +87,6 @@ export default function PromotedFilters(props: PromotedFilterProps) {
|
|
|
87
87
|
};
|
|
88
88
|
return getPConnect().getContainerManager().addTransientItem({
|
|
89
89
|
id: viewName,
|
|
90
|
-
// @ts-ignore - Property 'coreHeaders' is missing in type '{ classID: string; }' but required in type '{ coreHeaders: any; }'.
|
|
91
90
|
data: filtersWithClassID
|
|
92
91
|
});
|
|
93
92
|
}, []);
|
|
@@ -50,11 +50,9 @@ export default function SimpleTable(props: SimpleTableProps) {
|
|
|
50
50
|
|
|
51
51
|
let { contextClass } = props;
|
|
52
52
|
if (!contextClass) {
|
|
53
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
|
|
54
53
|
let listName = getPConnect().getComponentConfig().referenceList;
|
|
55
54
|
listName = PCore.getAnnotationUtils().getPropertyName(listName);
|
|
56
55
|
// was... contextClass = getPConnect().getFieldMetadata(listName)?.pageClass;
|
|
57
|
-
// @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
|
|
58
56
|
const theFieldMetadata = getPConnect().getFieldMetadata(listName);
|
|
59
57
|
if (theFieldMetadata) {
|
|
60
58
|
contextClass = theFieldMetadata.pageClass;
|