@pega/react-sdk-overrides 24.2.11 → 25.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +175 -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 +37 -30
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +17 -96
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +7 -6
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +4 -5
- 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 +2 -4
- 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 +43 -32
- package/lib/infra/Reference/Reference.tsx +3 -4
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +2 -3
- package/lib/infra/Stages/Stages.tsx +3 -4
- package/lib/infra/View/View.tsx +4 -3
- 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 -1
- package/lib/template/AppShell/AppShell.tsx +16 -17
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/CaseSummary/CaseSummary.tsx +28 -41
- 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 +2 -3
- 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 +278 -198
- package/lib/template/ListView/hooks.ts +1 -5
- package/lib/template/ListView/utils.ts +38 -5
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- 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/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 +145 -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 +36 -33
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
- 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
package/lib/helpers/utils.ts
CHANGED
|
@@ -48,7 +48,6 @@ export class Utils {
|
|
|
48
48
|
// eslint-disable-next-line no-case-declarations
|
|
49
49
|
const dataPage = configProps.datasource;
|
|
50
50
|
if (typeof dataPage === 'string' && dataObject[dataPage]) {
|
|
51
|
-
// eslint-disable-next-line no-alert
|
|
52
51
|
alert('need to handle data page');
|
|
53
52
|
} else {
|
|
54
53
|
let listSourceItems = configProps.listOutput;
|
|
@@ -337,6 +336,14 @@ export class Utils {
|
|
|
337
336
|
static isObject(objValue) {
|
|
338
337
|
return objValue && typeof objValue === 'object' && objValue.constructor === Object;
|
|
339
338
|
}
|
|
339
|
+
|
|
340
|
+
static getMappedKey(key) {
|
|
341
|
+
const mappedKey = PCore.getEnvironmentInfo().getKeyMapping(key);
|
|
342
|
+
if (!mappedKey) {
|
|
343
|
+
return key;
|
|
344
|
+
}
|
|
345
|
+
return mappedKey;
|
|
346
|
+
}
|
|
340
347
|
}
|
|
341
348
|
|
|
342
349
|
export default Utils;
|
|
@@ -10,6 +10,5 @@ export const sdkVersion = '8.7';
|
|
|
10
10
|
export function compareSdkPCoreVersions() {
|
|
11
11
|
// const theConstellationVersion = PCore.getPCoreVersion();
|
|
12
12
|
|
|
13
|
-
// eslint-disable-next-line no-console
|
|
14
13
|
console.warn(`Using Constellation version ${PCore.getPCoreVersion()}. Ensure this is the same version as your Infinity server.`);
|
|
15
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import makeStyles from '@mui/styles/makeStyles';
|
|
2
2
|
import Button from '@mui/material/Button';
|
|
3
|
-
import {
|
|
3
|
+
import { Grid2, Divider } from '@mui/material';
|
|
4
4
|
|
|
5
5
|
// ActionButtons does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
6
|
interface ActionButtonsProps {
|
|
@@ -10,13 +10,18 @@ interface ActionButtonsProps {
|
|
|
10
10
|
onButtonPress: any;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const useStyles = makeStyles(
|
|
14
|
-
button: {
|
|
15
|
-
padding: '0px 5px'
|
|
16
|
-
},
|
|
13
|
+
const useStyles = makeStyles(theme => ({
|
|
17
14
|
divider: {
|
|
18
15
|
marginTop: '10px',
|
|
19
16
|
marginBottom: '10px'
|
|
17
|
+
},
|
|
18
|
+
secondaryButton: {
|
|
19
|
+
backgroundColor: theme.actionButtons.secondary.backgroundColor,
|
|
20
|
+
color: theme.actionButtons.secondary.color
|
|
21
|
+
},
|
|
22
|
+
primaryButton: {
|
|
23
|
+
backgroundColor: theme.actionButtons.primary.backgroundColor,
|
|
24
|
+
color: theme.actionButtons.primary.color
|
|
20
25
|
}
|
|
21
26
|
}));
|
|
22
27
|
|
|
@@ -33,42 +38,44 @@ export default function ActionButtons(props: ActionButtonsProps) {
|
|
|
33
38
|
return (
|
|
34
39
|
<>
|
|
35
40
|
<Divider className={classes.divider} />
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
41
|
+
<Grid2 container spacing={4} justifyContent='space-between'>
|
|
42
|
+
<Grid2>
|
|
43
|
+
<Grid2 container spacing={1}>
|
|
39
44
|
{arSecondaryButtons.map(sButton => (
|
|
40
|
-
<
|
|
45
|
+
<Grid2 key={sButton.name}>
|
|
41
46
|
<Button
|
|
42
|
-
|
|
47
|
+
className={classes.secondaryButton}
|
|
43
48
|
color='secondary'
|
|
49
|
+
variant='contained'
|
|
44
50
|
onClick={() => {
|
|
45
51
|
_onButtonPress(sButton.jsAction, 'secondary');
|
|
46
52
|
}}
|
|
47
53
|
>
|
|
48
54
|
{localizedVal(sButton.name, localeCategory)}
|
|
49
55
|
</Button>
|
|
50
|
-
</
|
|
56
|
+
</Grid2>
|
|
51
57
|
))}
|
|
52
|
-
</
|
|
53
|
-
</
|
|
54
|
-
<
|
|
55
|
-
<
|
|
58
|
+
</Grid2>
|
|
59
|
+
</Grid2>
|
|
60
|
+
<Grid2>
|
|
61
|
+
<Grid2 container spacing={1}>
|
|
56
62
|
{arMainButtons.map(mButton => (
|
|
57
|
-
<
|
|
63
|
+
<Grid2 key={mButton.name}>
|
|
58
64
|
<Button
|
|
59
|
-
|
|
65
|
+
className={classes.primaryButton}
|
|
60
66
|
color='primary'
|
|
67
|
+
variant='contained'
|
|
61
68
|
onClick={() => {
|
|
62
69
|
_onButtonPress(mButton.jsAction, 'primary');
|
|
63
70
|
}}
|
|
64
71
|
>
|
|
65
72
|
{localizedVal(mButton.name, localeCategory)}
|
|
66
73
|
</Button>
|
|
67
|
-
</
|
|
74
|
+
</Grid2>
|
|
68
75
|
))}
|
|
69
|
-
</
|
|
70
|
-
</
|
|
71
|
-
</
|
|
76
|
+
</Grid2>
|
|
77
|
+
</Grid2>
|
|
78
|
+
</Grid2>
|
|
72
79
|
</>
|
|
73
80
|
);
|
|
74
81
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useEffect, useState } from 'react';
|
|
1
|
+
import React, { type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
2
|
import Snackbar from '@mui/material/Snackbar';
|
|
3
3
|
import IconButton from '@mui/material/IconButton';
|
|
4
4
|
import CloseIcon from '@mui/icons-material/Close';
|
|
@@ -6,14 +6,14 @@ import CloseIcon from '@mui/icons-material/Close';
|
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import { useFocusFirstField, useScrolltoTop } from '@pega/react-sdk-components/lib/hooks';
|
|
8
8
|
|
|
9
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
10
|
|
|
11
11
|
interface AssignmentProps extends PConnProps {
|
|
12
12
|
// If any, enter additional props that only exist on this component
|
|
13
13
|
itemKey: string;
|
|
14
14
|
isInModal: boolean;
|
|
15
15
|
banners: any[];
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
actionButtons: any[];
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -33,8 +33,8 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
33
33
|
|
|
34
34
|
const actionsAPI = thePConn.getActionsApi();
|
|
35
35
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
36
|
+
const localizationService = thePConn.getLocalizationService();
|
|
36
37
|
const localeCategory = 'Assignment';
|
|
37
|
-
const localeReference = `${getPConnect().getCaseInfo().getClassName()}!CASE!${getPConnect().getCaseInfo().getName()}`.toUpperCase();
|
|
38
38
|
|
|
39
39
|
// store off bound functions to above pointers
|
|
40
40
|
const finishAssignment = actionsAPI.finishAssignment.bind(actionsAPI);
|
|
@@ -76,7 +76,7 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
76
76
|
function getStepsInfo(steps, formedSteps: any = []) {
|
|
77
77
|
steps.forEach(step => {
|
|
78
78
|
if (step.name) {
|
|
79
|
-
step.name =
|
|
79
|
+
step.name = localizationService.getLocalizedText(step.name);
|
|
80
80
|
}
|
|
81
81
|
if (step.steps) {
|
|
82
82
|
formedSteps = getStepsInfo(step.steps, formedSteps);
|
|
@@ -97,43 +97,50 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
|
|
|
97
97
|
const oWorkItem = firstChild.props.getPConnect();
|
|
98
98
|
const oWorkData = oWorkItem.getDataObject();
|
|
99
99
|
const oData: any = thePConn.getDataObject(''); // 1st arg empty string until typedefs allow it to be optional
|
|
100
|
+
const caseInfo = oData?.caseInfo;
|
|
101
|
+
if (!oWorkData?.caseInfo || oWorkData.caseInfo.assignments === null || !caseInfo) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
// Set action buttons
|
|
106
|
+
if (caseInfo.actionButtons) {
|
|
107
|
+
setActionButtons(caseInfo.actionButtons);
|
|
108
|
+
}
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
// Handle navigation setup
|
|
111
|
+
const navigation = caseInfo.navigation;
|
|
112
|
+
if (!navigation) {
|
|
113
|
+
setHasNavigation(false);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
107
116
|
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
const isStandardTemplate = navigation.template?.toLowerCase() === 'standard';
|
|
118
|
+
const hasSingleStep = navigation.steps?.length === 1;
|
|
119
|
+
const shouldHideNavigation = isStandardTemplate || hasSingleStep;
|
|
110
120
|
|
|
111
|
-
|
|
112
|
-
(oCaseInfo.navigation.template && oCaseInfo.navigation.template.toLowerCase() === 'standard') ||
|
|
113
|
-
oCaseInfo?.navigation?.steps?.length === 1
|
|
114
|
-
) {
|
|
115
|
-
setHasNavigation(false);
|
|
116
|
-
} else if (oCaseInfo.navigation.template && oCaseInfo.navigation.template.toLowerCase() === 'vertical') {
|
|
117
|
-
setIsVertical(true);
|
|
118
|
-
} else {
|
|
119
|
-
setIsVertical(false);
|
|
120
|
-
}
|
|
121
|
+
setHasNavigation(!shouldHideNavigation);
|
|
121
122
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
setArNavigationSteps(formedSteps);
|
|
126
|
-
}
|
|
123
|
+
if (shouldHideNavigation) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
// set vertical navigation
|
|
128
|
+
const isVerticalTemplate = navigation.template?.toLowerCase() === 'vertical';
|
|
129
|
+
setIsVertical(isVerticalTemplate);
|
|
130
|
+
|
|
131
|
+
if (navigation.steps) {
|
|
132
|
+
const steps = JSON.parse(JSON.stringify(navigation.steps));
|
|
133
|
+
const formedSteps = getStepsInfo(steps);
|
|
134
|
+
setArNavigationSteps(formedSteps);
|
|
130
135
|
}
|
|
136
|
+
|
|
137
|
+
setArCurrentStepIndicies(findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0));
|
|
131
138
|
}
|
|
132
139
|
}, [children]);
|
|
133
140
|
|
|
134
141
|
function showToast(message: string) {
|
|
135
142
|
const theMessage = `Assignment: ${message}`;
|
|
136
|
-
|
|
143
|
+
|
|
137
144
|
console.error(theMessage);
|
|
138
145
|
setSnackbarMessage(message);
|
|
139
146
|
setShowSnackbar(true);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PropsWithChildren, useEffect, useState } from 'react';
|
|
1
|
+
import { type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
5
|
|
|
6
6
|
interface AssignmentCardProps extends PConnProps {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-nested-ternary */
|
|
2
|
-
|
|
3
1
|
import { useState, useEffect, useContext } from 'react';
|
|
4
2
|
import makeStyles from '@mui/styles/makeStyles';
|
|
5
3
|
import { Alert, Card, CardHeader, Avatar, Typography } from '@mui/material';
|
|
@@ -11,7 +9,7 @@ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpe
|
|
|
11
9
|
import { withSimpleViewContainerRenderer } from '@pega/react-sdk-components/lib/components/infra/Containers/SimpleView/SimpleView';
|
|
12
10
|
|
|
13
11
|
import { addContainerItem, getToDoAssignments, showBanner, hasContainerItems } from './helpers';
|
|
14
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
15
13
|
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
16
14
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
17
15
|
|
|
@@ -58,7 +56,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
58
56
|
const AlertBanner = getComponentFromMap('AlertBanner');
|
|
59
57
|
|
|
60
58
|
const pCoreConstants = PCore.getConstants();
|
|
61
|
-
const PCoreVersion = PCore.getPCoreVersion();
|
|
62
59
|
const { TODO } = pCoreConstants;
|
|
63
60
|
const todo_headerText = 'To do';
|
|
64
61
|
|
|
@@ -78,6 +75,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
78
75
|
const getPConnect = getPConnectOfActiveContainerItem || getPConnectOfFlowContainer;
|
|
79
76
|
const thePConn = getPConnect();
|
|
80
77
|
const containerName = assignmentNames && assignmentNames.length > 0 ? assignmentNames[0] : '';
|
|
78
|
+
const bShowBanner = showBanner(getPConnect);
|
|
81
79
|
// const [init, setInit] = useState(true);
|
|
82
80
|
// const [fcState, setFCState] = useState({ hasError: false });
|
|
83
81
|
|
|
@@ -98,13 +96,12 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
98
96
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
99
97
|
const localeCategory = 'Messages';
|
|
100
98
|
|
|
101
|
-
const key =
|
|
99
|
+
const key = getPConnect()?.getCaseLocaleReference();
|
|
102
100
|
const classes = useStyles();
|
|
103
101
|
|
|
104
102
|
function getBuildName(): string {
|
|
105
103
|
const ourPConn = getPConnect();
|
|
106
104
|
|
|
107
|
-
// let { getPConnect, name } = this.pConn$.pConn;
|
|
108
105
|
const context = ourPConn.getContextName();
|
|
109
106
|
let viewContainerName = ourPConn.getContainerName();
|
|
110
107
|
|
|
@@ -113,7 +110,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
113
110
|
}
|
|
114
111
|
|
|
115
112
|
function getTodoVisibility() {
|
|
116
|
-
const caseViewMode = getPConnect().getValue('context_data.caseViewMode'
|
|
113
|
+
const caseViewMode = getPConnect().getValue('context_data.caseViewMode');
|
|
117
114
|
if (caseViewMode && caseViewMode === 'review') {
|
|
118
115
|
return true;
|
|
119
116
|
}
|
|
@@ -123,16 +120,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
123
120
|
function initComponent() {
|
|
124
121
|
const ourPConn = getPConnect();
|
|
125
122
|
|
|
126
|
-
// debugging/investigation help
|
|
127
|
-
// console.log(`${ourPConn.getComponentName()}: children update for main draw`);
|
|
128
|
-
|
|
129
|
-
// const oData = ourPConn.getDataObject();
|
|
130
|
-
|
|
131
|
-
// const activeActionLabel = "";
|
|
132
|
-
// const child0_getPConnect = arNewChildren[0].getPConnect();
|
|
133
|
-
|
|
134
|
-
// this.templateName$ = this.configProps$["template"];
|
|
135
|
-
|
|
136
123
|
// debugger;
|
|
137
124
|
setShowTodo(getTodoVisibility());
|
|
138
125
|
|
|
@@ -148,7 +135,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
148
135
|
}, []);
|
|
149
136
|
|
|
150
137
|
useEffect(() => {
|
|
151
|
-
// @ts-
|
|
138
|
+
// @ts-expect-error - Property 'getMetadata' is private and only accessible within class 'C11nEnv'
|
|
152
139
|
if (isInitialized && pConnectOfFlowContainer.getMetadata().children && !hasItems) {
|
|
153
140
|
// ensuring not to add container items, if container already has items
|
|
154
141
|
// because during multi doc mode, we will have container items already in store
|
|
@@ -156,63 +143,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
156
143
|
}
|
|
157
144
|
}, [isInitialized, hasItems]);
|
|
158
145
|
|
|
159
|
-
function isCaseWideLocalAction() {
|
|
160
|
-
const ourPConn = getPConnect();
|
|
161
|
-
|
|
162
|
-
const actionID = ourPConn.getValue(pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
163
|
-
const caseActions = ourPConn.getValue(pCoreConstants.CASE_INFO.AVAILABLEACTIONS, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
164
|
-
let bCaseWideAction = false;
|
|
165
|
-
if (caseActions && actionID) {
|
|
166
|
-
const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
|
|
167
|
-
if (actionObj) {
|
|
168
|
-
bCaseWideAction = actionObj.type === 'Case';
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return bCaseWideAction;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function hasChildCaseAssignments() {
|
|
175
|
-
const ourPConn = getPConnect();
|
|
176
|
-
|
|
177
|
-
const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
178
|
-
// const allAssignments = [];
|
|
179
|
-
return !!(childCases && childCases.length > 0);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function hasAssignments() {
|
|
183
|
-
const ourPConn = getPConnect();
|
|
184
|
-
|
|
185
|
-
let bHasAssignments = false;
|
|
186
|
-
const assignmentsList: any[] = ourPConn.getValue(pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
187
|
-
const isEmbedded = window.location.href.includes('embedded');
|
|
188
|
-
let bAssignmentsForThisOperator = false;
|
|
189
|
-
// 8.7 includes assignments in Assignments List that may be assigned to
|
|
190
|
-
// a different operator. So, see if there are any assignments for
|
|
191
|
-
// the current operator
|
|
192
|
-
if (PCoreVersion?.includes('8.7') || isEmbedded) {
|
|
193
|
-
const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
194
|
-
for (const assignment of assignmentsList) {
|
|
195
|
-
if (assignment.assigneeInfo.ID === thisOperator) {
|
|
196
|
-
bAssignmentsForThisOperator = true;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
} else {
|
|
200
|
-
bAssignmentsForThisOperator = true;
|
|
201
|
-
}
|
|
202
|
-
// Bail out if there isn't an assignmentsList
|
|
203
|
-
if (!assignmentsList) {
|
|
204
|
-
return bHasAssignments;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const bHasChildCaseAssignments = hasChildCaseAssignments();
|
|
208
|
-
|
|
209
|
-
if (bAssignmentsForThisOperator || bHasChildCaseAssignments || isCaseWideLocalAction()) {
|
|
210
|
-
bHasAssignments = true;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return bHasAssignments;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
146
|
// From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...
|
|
217
147
|
useEffect(() => {
|
|
218
148
|
setBuildName(getBuildName());
|
|
@@ -222,29 +152,21 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
222
152
|
|
|
223
153
|
let loadingInfo: any;
|
|
224
154
|
try {
|
|
225
|
-
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
156
|
+
loadingInfo = thePConn.getLoadingStatus();
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
226
158
|
} catch (ex) {
|
|
227
|
-
// eslint-disable-next-line no-console
|
|
228
159
|
console.error(`${thePConn.getComponentName()}: loadingInfo catch block`);
|
|
229
160
|
}
|
|
230
161
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
if (!loadingInfo) {
|
|
234
|
-
// turn off spinner
|
|
235
|
-
// this.psService.sendMessage(false);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const caseViewMode = thePConn.getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
|
|
162
|
+
const caseViewMode = thePConn.getValue('context_data.caseViewMode');
|
|
239
163
|
const { CASE_INFO: CASE_CONSTS } = pCoreConstants;
|
|
240
164
|
if (caseViewMode && caseViewMode === 'review') {
|
|
241
165
|
setTimeout(() => {
|
|
242
166
|
// updated for 8.7 - 30-Mar-2022
|
|
243
167
|
const todoAssignments = getToDoAssignments(thePConn);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
setTodoDatasource({ source: todoAssignments });
|
|
247
|
-
}
|
|
168
|
+
setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID));
|
|
169
|
+
setTodoDatasource({ source: todoAssignments });
|
|
248
170
|
setShowTodo(true);
|
|
249
171
|
setShowTodoList(false);
|
|
250
172
|
}, 100);
|
|
@@ -255,11 +177,12 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
255
177
|
}
|
|
256
178
|
|
|
257
179
|
// if have caseMessage show message and end
|
|
258
|
-
const theCaseMessages = localizedVal(thePConn.getValue('caseMessages'
|
|
180
|
+
const theCaseMessages = localizedVal(thePConn.getValue('caseMessages'), localeCategory);
|
|
181
|
+
|
|
182
|
+
const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), itemKey);
|
|
183
|
+
const bConfirmView = rootInfo && bShowBanner;
|
|
259
184
|
|
|
260
|
-
|
|
261
|
-
// Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
|
|
262
|
-
if (!hasAssignments()) {
|
|
185
|
+
if (bConfirmView) {
|
|
263
186
|
// Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.
|
|
264
187
|
// So, if we get here and caseMessages$ is empty, use default value in DX API response
|
|
265
188
|
setCaseMessages(theCaseMessages || localizedVal('Thank you! The next step in this case has been routed appropriately.', localeCategory));
|
|
@@ -279,8 +202,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
279
202
|
const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0].urgency : '';
|
|
280
203
|
const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName() || '');
|
|
281
204
|
|
|
282
|
-
const bShowBanner = showBanner(getPConnect);
|
|
283
|
-
|
|
284
205
|
const displayPageMessages = () => {
|
|
285
206
|
let hasBanner = false;
|
|
286
207
|
const messages = pageMessages ? pageMessages.map(msg => localizedVal(msg.message, 'Messages')) : pageMessages;
|
|
@@ -297,7 +218,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
|
|
|
297
218
|
<CardHeader
|
|
298
219
|
id='assignment-header'
|
|
299
220
|
title={<Typography variant='h6'>{localizedVal(containerName, undefined, key)}</Typography>}
|
|
300
|
-
subheader={`${localizedVal('
|
|
221
|
+
subheader={`${localizedVal('In', 'Todo')} ${caseId} \u2022 ${localizedVal('Priority', 'Todo')} ${urgency}`}
|
|
301
222
|
avatar={<Avatar className={`${classes.avatar} psdk-avatar`}>{operatorInitials}</Avatar>}
|
|
302
223
|
/>
|
|
303
224
|
{displayPageMessages()}
|
package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import Button from '@mui/material/Button';
|
|
3
3
|
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
const useStyles = makeStyles((/* theme */) => ({
|
|
7
7
|
button: {
|
|
@@ -53,7 +53,6 @@ function ListViewActionButtons(props: ListViewActionButtonsProps) {
|
|
|
53
53
|
closeActionsDialog();
|
|
54
54
|
})
|
|
55
55
|
.catch(err => {
|
|
56
|
-
// eslint-disable-next-line no-console
|
|
57
56
|
console.log(err);
|
|
58
57
|
})
|
|
59
58
|
.finally(() => {
|
|
@@ -11,7 +11,7 @@ import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react
|
|
|
11
11
|
// Need to get correct implementation from component map for Assignment and CancelAlert
|
|
12
12
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
13
13
|
import { getBanners } from '@pega/react-sdk-components/lib/components/helpers/case-utils';
|
|
14
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
14
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
15
15
|
|
|
16
16
|
interface ModalViewContainerProps extends PConnProps {
|
|
17
17
|
// If any, enter additional props that only exist on this component
|
|
@@ -43,7 +43,7 @@ function getKeyAndLatestItem(routinginfo, pConn, options) {
|
|
|
43
43
|
if (PCore.getContainerUtils().hasContainerItems(buildName(pConn, containerName))) {
|
|
44
44
|
const { accessedOrder, items } = routinginfo;
|
|
45
45
|
let key;
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
for (let i = accessedOrder.length - 1; i >= 0; i--) {
|
|
48
48
|
const tempkey = accessedOrder[i];
|
|
49
49
|
if ((acTertiary && items[tempkey].acTertiary) || (!acTertiary && !items[tempkey].acTertiary)) {
|
|
@@ -96,6 +96,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
96
96
|
marginBottom: theme.spacing(0)
|
|
97
97
|
},
|
|
98
98
|
dlgContent: {
|
|
99
|
+
paddingTop: `${theme.spacing(1)} !important`,
|
|
99
100
|
marginLeft: theme.spacing(2),
|
|
100
101
|
marginRight: theme.spacing(2),
|
|
101
102
|
marginTop: theme.spacing(0),
|
|
@@ -130,7 +131,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
|
|
|
130
131
|
const [cancelAlertProps, setCancelAlertProps] = useState({});
|
|
131
132
|
const [isMultiRecordData, setMultiRecordData] = useState(false);
|
|
132
133
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
133
|
-
const localeCategory = '
|
|
134
|
+
const localeCategory = 'ModalContainer';
|
|
134
135
|
|
|
135
136
|
const ERROR_WHILE_RENDERING = 'ERROR_WHILE_RENDERING';
|
|
136
137
|
|
|
@@ -216,7 +217,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
|
|
|
216
217
|
ERROR_WHILE_RENDERING,
|
|
217
218
|
error => {
|
|
218
219
|
// setError(true);
|
|
219
|
-
|
|
220
|
+
|
|
220
221
|
console.error(error);
|
|
221
222
|
},
|
|
222
223
|
`${ERROR_WHILE_RENDERING}-mc-${getPConnect().getContextName()}`,
|
|
@@ -254,7 +255,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
|
|
|
254
255
|
const headingValue =
|
|
255
256
|
isDataObject || isMultiRecord
|
|
256
257
|
? getModalHeading(dataObjectAction)
|
|
257
|
-
: determineModalHeaderByAction(actionName, caseTypeName, ID,
|
|
258
|
+
: determineModalHeaderByAction(actionName, caseTypeName, ID, pConnect?.getCaseLocaleReference());
|
|
258
259
|
|
|
259
260
|
let arChildrenAsReact: any[] = [];
|
|
260
261
|
|
|
@@ -309,7 +310,7 @@ export default function ModalViewContainer(props: ModalViewContainerProps) {
|
|
|
309
310
|
|
|
310
311
|
return (
|
|
311
312
|
<>
|
|
312
|
-
<Dialog open={bShowModal} aria-labelledby='form-dialog-title'>
|
|
313
|
+
<Dialog open={bShowModal} aria-labelledby='form-dialog-title' maxWidth={false}>
|
|
313
314
|
<DialogTitle id='form-dialog-title' className={`${classes.dlgTitle} psdk-dialog-title`}>
|
|
314
315
|
{title}
|
|
315
316
|
</DialogTitle>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
2
|
import React, { createElement, useContext, useEffect, useState } from 'react';
|
|
2
3
|
import { Box, CircularProgress } from '@mui/material';
|
|
3
4
|
|
|
4
5
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
6
|
import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
|
|
6
7
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
7
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import { configureBrowserBookmark } from '@pega/react-sdk-components/lib/components/infra/Containers/container-helpers';
|
|
8
10
|
|
|
9
11
|
interface ViewContainerProps extends PConnProps {
|
|
10
12
|
// If any, enter additional props that only exist on this component
|
|
@@ -131,10 +133,7 @@ export default function ViewContainer(props: ViewContainerProps) {
|
|
|
131
133
|
|
|
132
134
|
if (!displayOnlyFA) {
|
|
133
135
|
// configureForBrowserBookmark not applicable in Embedded mode
|
|
134
|
-
|
|
135
|
-
...objectForAddContainer,
|
|
136
|
-
defaultViewLabel
|
|
137
|
-
});
|
|
136
|
+
configureBrowserBookmark(pConn);
|
|
138
137
|
}
|
|
139
138
|
}, []);
|
|
140
139
|
|
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
2
1
|
export const isContainerInitialized = pConnect => {
|
|
3
2
|
const context = pConnect.getContextName();
|
|
4
3
|
const containerName = pConnect.getContainerName();
|
|
5
4
|
return PCore.getContainerUtils().isContainerInitialized(context, containerName);
|
|
6
5
|
};
|
|
6
|
+
|
|
7
|
+
export const configureBrowserBookmark = pConnect => {
|
|
8
|
+
const context = pConnect.getContextName();
|
|
9
|
+
const containerName = pConnect.getContainerName();
|
|
10
|
+
const envInfo = PCore.getEnvironmentInfo();
|
|
11
|
+
const { APP } = PCore.getConstants();
|
|
12
|
+
|
|
13
|
+
const navPages = pConnect.getValue('pyPortal.pyPrimaryNavPages');
|
|
14
|
+
let ruleName = '';
|
|
15
|
+
let className = '';
|
|
16
|
+
let defaultViewLabel = '';
|
|
17
|
+
|
|
18
|
+
const isNextGenLandingPageRouting = (envInfo?.environmentInfoObject as any)?.pyExecutionRuntimeName === (APP as any).INFINITY_RUNTIME;
|
|
19
|
+
|
|
20
|
+
if (Array.isArray(navPages) && navPages.length > 0) {
|
|
21
|
+
const firstNavPage = navPages[0];
|
|
22
|
+
const nestedNavPage = firstNavPage.NavigationPages?.[0];
|
|
23
|
+
|
|
24
|
+
if (isNextGenLandingPageRouting) {
|
|
25
|
+
if (nestedNavPage?.pyRuleName) {
|
|
26
|
+
ruleName = nestedNavPage.pyRuleName;
|
|
27
|
+
className = nestedNavPage.pyClassName || '';
|
|
28
|
+
} else if (firstNavPage?.pyRuleName) {
|
|
29
|
+
ruleName = firstNavPage.pyRuleName;
|
|
30
|
+
className = firstNavPage.pyClassName || '';
|
|
31
|
+
} else if (nestedNavPage?.pyLabel) {
|
|
32
|
+
defaultViewLabel = nestedNavPage.pyLabel;
|
|
33
|
+
} else if (firstNavPage?.pyLabel) {
|
|
34
|
+
defaultViewLabel = firstNavPage.pyLabel;
|
|
35
|
+
}
|
|
36
|
+
} else if (nestedNavPage?.pyLabel) {
|
|
37
|
+
defaultViewLabel = nestedNavPage.pyLabel;
|
|
38
|
+
} else if (firstNavPage?.pyLabel) {
|
|
39
|
+
defaultViewLabel = firstNavPage.pyLabel;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
PCore.configureForBrowserBookmark({
|
|
44
|
+
context,
|
|
45
|
+
containerName,
|
|
46
|
+
acName: containerName,
|
|
47
|
+
semanticURL: '',
|
|
48
|
+
defaultViewLabel,
|
|
49
|
+
ruleName,
|
|
50
|
+
className
|
|
51
|
+
});
|
|
52
|
+
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { forwardRef, PropsWithChildren, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import { forwardRef, type PropsWithChildren, useEffect, useRef, useState } from 'react';
|
|
3
2
|
import { TextField } from '@mui/material';
|
|
4
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
5
3
|
import { debounce } from 'throttle-debounce';
|
|
6
4
|
import DatePicker from 'react-datepicker';
|
|
7
5
|
|
|
8
6
|
import { createFilter, combineFilters, getFormattedDate, getFilterExpression } from './filterUtils';
|
|
9
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
8
|
|
|
11
9
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
12
10
|
|
|
@@ -20,7 +18,7 @@ interface DashboardFilterProps extends PConnProps {
|
|
|
20
18
|
|
|
21
19
|
export default function DashboardFilter(props: PropsWithChildren<DashboardFilterProps>) {
|
|
22
20
|
const { children, name, filterProp, type = '', metadata = null, getPConnect } = props;
|
|
23
|
-
const { current: filterId } = useRef(
|
|
21
|
+
const { current: filterId } = useRef(crypto.randomUUID());
|
|
24
22
|
|
|
25
23
|
const [startDate, setStartDate] = useState(null);
|
|
26
24
|
const [endDate, setEndDate] = useState(null);
|
|
@@ -110,7 +108,6 @@ export default function DashboardFilter(props: PropsWithChildren<DashboardFilter
|
|
|
110
108
|
|
|
111
109
|
const label = metadata.config.label.substring(3);
|
|
112
110
|
|
|
113
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
114
111
|
const CustomDateInput = forwardRef<HTMLInputElement, TextProps>(({ value, onClick }, ref: any) => (
|
|
115
112
|
<TextField label={label} variant='outlined' fullWidth value={value} size='small' onClick={onClick} ref={ref}>
|
|
116
113
|
{value}
|