@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
|
@@ -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
|
|
@@ -15,14 +17,10 @@ interface ViewContainerProps extends PConnProps {
|
|
|
15
17
|
limit?: number;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
23
|
-
// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
|
|
24
|
-
// is totally at your own risk.
|
|
25
|
-
//
|
|
20
|
+
/**
|
|
21
|
+
* 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.
|
|
22
|
+
* 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.
|
|
23
|
+
*/
|
|
26
24
|
|
|
27
25
|
export default function ViewContainer(props: ViewContainerProps) {
|
|
28
26
|
// const { getPConnect, children, routingInfo, name } = props;
|
|
@@ -131,10 +129,7 @@ export default function ViewContainer(props: ViewContainerProps) {
|
|
|
131
129
|
|
|
132
130
|
if (!displayOnlyFA) {
|
|
133
131
|
// configureForBrowserBookmark not applicable in Embedded mode
|
|
134
|
-
|
|
135
|
-
...objectForAddContainer,
|
|
136
|
-
defaultViewLabel
|
|
137
|
-
});
|
|
132
|
+
configureBrowserBookmark(pConn);
|
|
138
133
|
}
|
|
139
134
|
}, []);
|
|
140
135
|
|
|
@@ -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}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/* eslint-disable prefer-template */
|
|
2
1
|
/** This file contains various utility methods to generate filter components, regionLayout data, filter expressions, etc. */
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { Grid2, Link } from '@mui/material';
|
|
5
4
|
|
|
6
5
|
import DashboardFilter from './DashboardFilter';
|
|
7
6
|
|
|
@@ -77,7 +76,7 @@ export const buildFilterComponents = (getPConnect, allFilters) => {
|
|
|
77
76
|
const filterComponents = allFilters.children.map((filter, index) => createFilterComponent(getPConnect, filter, index));
|
|
78
77
|
if (filterComponents && filterComponents.length > 0) {
|
|
79
78
|
filterComponents.push(
|
|
80
|
-
<
|
|
79
|
+
<Grid2 style={{ display: 'flex', alignItems: 'center' }}>
|
|
81
80
|
<Link
|
|
82
81
|
style={{ cursor: 'pointer' }}
|
|
83
82
|
onClick={() => {
|
|
@@ -87,7 +86,7 @@ export const buildFilterComponents = (getPConnect, allFilters) => {
|
|
|
87
86
|
>
|
|
88
87
|
Clear All
|
|
89
88
|
</Link>
|
|
90
|
-
</
|
|
89
|
+
</Grid2>
|
|
91
90
|
);
|
|
92
91
|
}
|
|
93
92
|
return filterComponents;
|
|
@@ -4,7 +4,7 @@ import makeStyles from '@mui/styles/makeStyles';
|
|
|
4
4
|
|
|
5
5
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
6
6
|
|
|
7
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
8
|
|
|
9
9
|
interface DeferLoadProps extends PConnProps {
|
|
10
10
|
// If any, enter additional props that only exist on this component
|
|
@@ -13,13 +13,13 @@ interface DeferLoadProps extends PConnProps {
|
|
|
13
13
|
isTab: boolean;
|
|
14
14
|
deferLoadId: string;
|
|
15
15
|
lastUpdateCaseTime: any;
|
|
16
|
+
template?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
19
|
+
/**
|
|
20
|
+
* 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.
|
|
21
|
+
* 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.
|
|
22
|
+
*/
|
|
23
23
|
|
|
24
24
|
const useStyles = makeStyles(theme => ({
|
|
25
25
|
root: {
|
|
@@ -35,7 +35,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
35
35
|
}));
|
|
36
36
|
|
|
37
37
|
export default function DeferLoad(props: DeferLoadProps) {
|
|
38
|
-
const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime } = props;
|
|
38
|
+
const { getPConnect, name, deferLoadId, isTab, lastUpdateCaseTime, template } = props;
|
|
39
39
|
const [content, setContent] = useState<any>(null);
|
|
40
40
|
const [isLoading, setLoading] = useState(true);
|
|
41
41
|
const [currentLoadedAssignment, setCurrentLoadedAssignment] = useState('');
|
|
@@ -75,7 +75,7 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
75
75
|
updateData: isContainerPreview
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
const onResponse = data => {
|
|
78
|
+
const onResponse = (data: any, isEditable = false) => {
|
|
79
79
|
setLoading(false);
|
|
80
80
|
if (deferLoadId) {
|
|
81
81
|
PCore.getDeferLoadManager().start(
|
|
@@ -92,11 +92,16 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
92
92
|
meta: data,
|
|
93
93
|
options: {
|
|
94
94
|
context: pConnect.getContextName(),
|
|
95
|
-
pageReference: pConnect.getPageReference()
|
|
95
|
+
pageReference: pConnect.getPageReference(),
|
|
96
|
+
target: pConnect.getTarget(),
|
|
97
|
+
hasForm: true,
|
|
98
|
+
viewName: (pConnect as any).viewName
|
|
96
99
|
}
|
|
97
100
|
};
|
|
98
101
|
const configObject = PCore.createPConnect(config);
|
|
99
|
-
|
|
102
|
+
if (!isEditable) {
|
|
103
|
+
configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
104
|
+
}
|
|
100
105
|
setContent(createElement(createPConnectComponent(), configObject));
|
|
101
106
|
if (deferLoadId) {
|
|
102
107
|
PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
|
|
@@ -115,14 +120,13 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
115
120
|
.getActionsApi()
|
|
116
121
|
.showData(name, dataContext, dataContextParameters, {
|
|
117
122
|
skipSemanticUrl: true,
|
|
118
|
-
// @ts-
|
|
123
|
+
// @ts-expect-error
|
|
119
124
|
isDeferLoaded: true
|
|
120
125
|
})
|
|
121
126
|
.then(data => {
|
|
122
127
|
onResponse(data);
|
|
123
128
|
});
|
|
124
129
|
} else {
|
|
125
|
-
// eslint-disable-next-line no-console
|
|
126
130
|
console.error('Cannot load the defer loaded view without container information');
|
|
127
131
|
}
|
|
128
132
|
} else if (resourceType === PAGE) {
|
|
@@ -133,6 +137,16 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
133
137
|
.then(data => {
|
|
134
138
|
onResponse(data);
|
|
135
139
|
});
|
|
140
|
+
} else if (template === 'HierarchicalForm') {
|
|
141
|
+
const root = {
|
|
142
|
+
config: {
|
|
143
|
+
context: pConnect.getPageReference(),
|
|
144
|
+
name,
|
|
145
|
+
type: 'view'
|
|
146
|
+
},
|
|
147
|
+
type: 'reference'
|
|
148
|
+
};
|
|
149
|
+
onResponse(root, true);
|
|
136
150
|
} else {
|
|
137
151
|
getPConnect()
|
|
138
152
|
.getActionsApi()
|
|
@@ -141,7 +155,6 @@ export default function DeferLoad(props: DeferLoadProps) {
|
|
|
141
155
|
onResponse(data.root);
|
|
142
156
|
})
|
|
143
157
|
.catch(error => {
|
|
144
|
-
// eslint-disable-next-line no-console
|
|
145
158
|
console.log(`deferload: ${error}`);
|
|
146
159
|
});
|
|
147
160
|
}
|
|
@@ -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 ErrorBoundaryProps extends PConnProps {
|
|
4
4
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,6 @@ export default function ErrorBoundary(props: ErrorBoundaryProps) {
|
|
|
23
23
|
const pConn = getPConnect();
|
|
24
24
|
|
|
25
25
|
if (!isInternalError) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
26
|
console.error(`
|
|
28
27
|
${localizedVal('Unable to load the component', localeCategory)} ${pConn.getComponentName()}
|
|
29
28
|
${localizedVal('This might be due to the view metadata getting corrupted or the component file missing.', localeCategory)}
|
|
@@ -37,7 +36,6 @@ export default function ErrorBoundary(props: ErrorBoundaryProps) {
|
|
|
37
36
|
|
|
38
37
|
if (pConn.getContainerName() === WORK_AREA || pConn.isInsideList() === true || pConn.getContainerName() === 'modal') {
|
|
39
38
|
const { publish } = PCore.getPubSubUtils();
|
|
40
|
-
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
41
39
|
publish(ERROR_WHILE_RENDERING);
|
|
42
40
|
return null;
|
|
43
41
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
.psdk-current-svg-icon {
|
|
19
19
|
width: 1rem;
|
|
20
|
-
filter: var(--
|
|
20
|
+
filter: var(--svg-color);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.psdk-not-current-svg-icon {
|
|
@@ -40,7 +40,7 @@ mat-horizontal-stepper {
|
|
|
40
40
|
|
|
41
41
|
.psdk-sub-step-not-current {
|
|
42
42
|
padding-left: 0.625rem;
|
|
43
|
-
color:
|
|
43
|
+
color: var(--step-label-color);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.psdk-flow-container-top {
|
|
@@ -79,36 +79,37 @@ mat-horizontal-stepper {
|
|
|
79
79
|
|
|
80
80
|
.psdk-vertical-step-icon {
|
|
81
81
|
margin-right: 12px;
|
|
82
|
-
background-color: var(--app-neutral-color);
|
|
83
|
-
color: #fff;
|
|
84
82
|
border-radius: 50%;
|
|
85
83
|
height: 24px;
|
|
86
84
|
width: 24px;
|
|
87
|
-
flex-shrink: 0;
|
|
88
85
|
position: relative;
|
|
89
86
|
}
|
|
90
87
|
|
|
88
|
+
.success .psdk-vertical-step-icon {
|
|
89
|
+
background-color: var(--stepper-completed-bg-color);
|
|
90
|
+
color: var(--app-text-color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.future .psdk-vertical-step-icon {
|
|
94
|
+
color: var(--app-neutral-color);
|
|
95
|
+
border: 1px solid var(--app-neutral-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.current .psdk-vertical-step-icon {
|
|
99
|
+
background-color: var(--app-primary-color);
|
|
100
|
+
color: var(--app-text-color);
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
91
104
|
.psdk-vertical-step-icon-content {
|
|
92
105
|
position: absolute;
|
|
93
106
|
top: 50%;
|
|
94
107
|
left: 50%;
|
|
95
108
|
transform: translate(-50%, -50%);
|
|
96
|
-
color: #fff;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.psdk-vertical-step-icon-selected {
|
|
100
|
-
margin-right: 12px;
|
|
101
|
-
background-color: var(--app-primary-color);
|
|
102
|
-
color: #fff;
|
|
103
|
-
border-radius: 50%;
|
|
104
|
-
height: 24px;
|
|
105
|
-
width: 24px;
|
|
106
|
-
flex-shrink: 0;
|
|
107
|
-
position: relative;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.psdk-vertical-step-label {
|
|
111
|
-
color:
|
|
112
|
+
color: var(--step-label-color);
|
|
112
113
|
display: inline-block;
|
|
113
114
|
white-space: nowrap;
|
|
114
115
|
overflow: hidden;
|
|
@@ -119,16 +120,8 @@ mat-horizontal-stepper {
|
|
|
119
120
|
font-weight: 500;
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
.psdk-vertical-step-label
|
|
123
|
-
color:
|
|
124
|
-
display: inline-block;
|
|
125
|
-
white-space: nowrap;
|
|
126
|
-
overflow: hidden;
|
|
127
|
-
text-overflow: ellipsis;
|
|
128
|
-
min-width: 50px;
|
|
129
|
-
vertical-align: middle;
|
|
130
|
-
font-size: 14px;
|
|
131
|
-
font-weight: 500;
|
|
123
|
+
.current .psdk-vertical-step-label {
|
|
124
|
+
color: var(--text-primary-color);
|
|
132
125
|
}
|
|
133
126
|
|
|
134
127
|
.psdk-vertical-step-body {
|
|
@@ -150,7 +143,7 @@ mat-horizontal-stepper {
|
|
|
150
143
|
border-left-style: solid;
|
|
151
144
|
top: -16px;
|
|
152
145
|
bottom: -16px;
|
|
153
|
-
border-left-color:
|
|
146
|
+
border-left-color: var(--app-neutral-color);
|
|
154
147
|
}
|
|
155
148
|
|
|
156
149
|
.psdk-horizontal-stepper {
|
|
@@ -162,33 +155,39 @@ mat-horizontal-stepper {
|
|
|
162
155
|
white-space: nowrap;
|
|
163
156
|
display: flex;
|
|
164
157
|
align-items: center;
|
|
165
|
-
text-align: left;
|
|
166
158
|
}
|
|
167
159
|
|
|
168
160
|
.psdk-horizontal-step-header {
|
|
169
|
-
overflow: hidden;
|
|
170
161
|
outline: none;
|
|
171
162
|
cursor: pointer;
|
|
172
163
|
position: relative;
|
|
173
164
|
box-sizing: content-box;
|
|
174
165
|
display: flex;
|
|
175
166
|
height: 72px;
|
|
176
|
-
overflow: hidden;
|
|
177
167
|
align-items: center;
|
|
178
|
-
padding: 0 24px;
|
|
179
168
|
}
|
|
180
169
|
|
|
181
170
|
.psdk-horizontal-step-icon {
|
|
182
|
-
|
|
183
|
-
color: #fff;
|
|
171
|
+
color: white;
|
|
184
172
|
border-radius: 50%;
|
|
185
173
|
height: 24px;
|
|
186
174
|
width: 24px;
|
|
187
|
-
flex-shrink: 0;
|
|
188
175
|
position: relative;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.future .psdk-horizontal-step-icon {
|
|
179
|
+
color: var(--app-neutral-color);
|
|
180
|
+
border: 1px solid var(--app-neutral-color);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.current .psdk-horizontal-step-icon {
|
|
184
|
+
color: var(--app-text-color);
|
|
185
|
+
background-color: var(--app-primary-color);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.success .psdk-horizontal-step-icon {
|
|
189
|
+
color: var(--app-text-color);
|
|
190
|
+
background-color: var(--stepper-completed-bg-color);
|
|
192
191
|
}
|
|
193
192
|
|
|
194
193
|
.psdk-horizontal-step-icon-content {
|
|
@@ -199,45 +198,24 @@ mat-horizontal-stepper {
|
|
|
199
198
|
transform: translate(-50%, -50%);
|
|
200
199
|
}
|
|
201
200
|
|
|
202
|
-
.psdk-horizontal-step-icon-selected {
|
|
203
|
-
background-color: var(--app-primary-color);
|
|
204
|
-
color: #fff;
|
|
205
|
-
border-radius: 50%;
|
|
206
|
-
height: 24px;
|
|
207
|
-
width: 24px;
|
|
208
|
-
flex-shrink: 0;
|
|
209
|
-
position: relative;
|
|
210
|
-
display: block;
|
|
211
|
-
margin-right: 8px;
|
|
212
|
-
flex: none;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
201
|
.psdk-horizontal-step-label {
|
|
216
|
-
color:
|
|
217
|
-
display: inline-block;
|
|
218
|
-
min-width: 50px;
|
|
219
|
-
vertical-align: middle;
|
|
202
|
+
color: var(--text-secondary-color);
|
|
220
203
|
font-size: 14px;
|
|
221
204
|
font-weight: 500;
|
|
222
205
|
white-space: initial;
|
|
223
206
|
}
|
|
224
207
|
|
|
225
|
-
.psdk-horizontal-step-label
|
|
226
|
-
color:
|
|
227
|
-
|
|
228
|
-
min-width: 50px;
|
|
229
|
-
vertical-align: middle;
|
|
230
|
-
font-size: 14px;
|
|
231
|
-
font-weight: 500;
|
|
232
|
-
white-space: initial;
|
|
208
|
+
.current .psdk-horizontal-step-label {
|
|
209
|
+
color: var(--text-primary-color);
|
|
210
|
+
margin-left: 8px;
|
|
233
211
|
}
|
|
234
212
|
|
|
235
|
-
.
|
|
236
|
-
border-top-color: rgba(0, 0, 0, 0.12);
|
|
237
|
-
border-top-width: 1px;
|
|
238
|
-
border-top-style: solid;
|
|
213
|
+
.flex-auto {
|
|
239
214
|
flex: auto;
|
|
240
|
-
|
|
241
|
-
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.psdk-horizontal-step-line {
|
|
218
|
+
border-top: 1px solid var(--app-neutral-color);
|
|
242
219
|
min-width: 32px;
|
|
220
|
+
margin: 0px 8px;
|
|
243
221
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
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
|
import './MultiStep.css';
|
|
7
7
|
|
|
@@ -27,51 +27,27 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
27
27
|
currentStep = arNavigationSteps[lastActiveStepIndex >= 0 ? lastActiveStepIndex : 0];
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
// const svgCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
|
|
31
|
-
// const svgNotCurrent = Utils.getImageSrc("circle-solid", Utils.getSDKStaticConentUrl());
|
|
32
|
-
|
|
33
|
-
function _getVIconClass(status): string {
|
|
34
|
-
if (status === 'current') {
|
|
35
|
-
return 'psdk-vertical-step-icon-selected';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return 'psdk-vertical-step-icon';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _getVLabelClass(status): string {
|
|
42
|
-
if (status === 'current') {
|
|
43
|
-
return 'psdk-vertical-step-label-selected';
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return 'psdk-vertical-step-label';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
30
|
function _getVBodyClass(index: number): string {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
31
|
+
const baseClass = 'psdk-vertical-step-body';
|
|
32
|
+
const isNotLastStep = index < arNavigationSteps.length - 1;
|
|
53
33
|
|
|
54
|
-
return
|
|
34
|
+
return isNotLastStep ? `${baseClass} psdk-vertical-step-line` : baseClass;
|
|
55
35
|
}
|
|
56
36
|
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return 'psdk-horizontal-step-icon';
|
|
63
|
-
}
|
|
37
|
+
function _getAutoFlexClass(currentStep): string {
|
|
38
|
+
const currentStepIndex = arNavigationSteps.findIndex(step => step.ID === currentStep?.ID);
|
|
39
|
+
const totalSteps = arNavigationSteps.length;
|
|
40
|
+
const lastStep = arNavigationSteps[totalSteps - 1];
|
|
64
41
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
42
|
+
// Apply flex-auto class if current step is active OR if current step is second-to-last and the last step is active
|
|
43
|
+
const isCurrentStepActive = currentStep.visited_status === 'current';
|
|
44
|
+
const isSecondToLastWithActiveLastStep = currentStepIndex === totalSteps - 2 && lastStep?.visited_status === 'current';
|
|
69
45
|
|
|
70
|
-
return '
|
|
46
|
+
return isCurrentStepActive || isSecondToLastWithActiveLastStep ? 'flex-auto' : '';
|
|
71
47
|
}
|
|
72
48
|
|
|
73
|
-
function
|
|
74
|
-
return index
|
|
49
|
+
function isLastStep(index: number): boolean {
|
|
50
|
+
return index === arNavigationSteps.length - 1;
|
|
75
51
|
}
|
|
76
52
|
|
|
77
53
|
function buttonPress(sAction: string, sButtonType: string) {
|
|
@@ -86,13 +62,13 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
86
62
|
return (
|
|
87
63
|
<React.Fragment key={mainStep.actionID}>
|
|
88
64
|
<div className='psdk-vertical-step'>
|
|
89
|
-
<div className=
|
|
90
|
-
<div className={
|
|
65
|
+
<div className={`psdk-vertical-step-header ${mainStep.visited_status}`}>
|
|
66
|
+
<div className={`psdk-vertical-step-icon`}>
|
|
91
67
|
<div className='psdk-vertical-step-icon-content'>
|
|
92
68
|
<span>{index + 1}</span>
|
|
93
69
|
</div>
|
|
94
70
|
</div>
|
|
95
|
-
<div className={
|
|
71
|
+
<div className='psdk-vertical-step-label'>{mainStep.visited_status === 'current' && mainStep.name}</div>
|
|
96
72
|
</div>
|
|
97
73
|
<div className={_getVBodyClass(index)}>
|
|
98
74
|
{mainStep?.steps && (
|
|
@@ -122,9 +98,11 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
122
98
|
</ul>
|
|
123
99
|
)}
|
|
124
100
|
{!mainStep?.steps && mainStep.visited_status === 'current' && (
|
|
125
|
-
<
|
|
126
|
-
{
|
|
127
|
-
|
|
101
|
+
<div style={{ paddingLeft: 20 }}>
|
|
102
|
+
<AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
|
|
103
|
+
{children}
|
|
104
|
+
</AssignmentCard>
|
|
105
|
+
</div>
|
|
128
106
|
)}
|
|
129
107
|
</div>
|
|
130
108
|
</div>
|
|
@@ -138,19 +116,15 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
|
|
|
138
116
|
{arNavigationSteps.map((mainStep, index) => {
|
|
139
117
|
return (
|
|
140
118
|
<React.Fragment key={mainStep.actionID}>
|
|
141
|
-
<div className=
|
|
142
|
-
<div className=
|
|
119
|
+
<div className={`psdk-horizontal-step-header ${mainStep.visited_status}`}>
|
|
120
|
+
<div className='psdk-horizontal-step-icon'>
|
|
143
121
|
<div className='psdk-horizontal-step-icon-content'>
|
|
144
122
|
<span>{index + 1}</span>
|
|
145
123
|
</div>
|
|
146
124
|
</div>
|
|
147
|
-
<div className={
|
|
148
|
-
<div className='psdk-horizontal-step-text-label' id='selected-label'>
|
|
149
|
-
{mainStep.name}
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
125
|
+
<div className='psdk-horizontal-step-label'>{mainStep.visited_status === 'current' && mainStep.name}</div>
|
|
152
126
|
</div>
|
|
153
|
-
{
|
|
127
|
+
{!isLastStep(index) && <div className={`psdk-horizontal-step-line ${_getAutoFlexClass(mainStep)}`} />}
|
|
154
128
|
</React.Fragment>
|
|
155
129
|
);
|
|
156
130
|
})}
|