@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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormControl, FormLabel } from '@mui/material';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
3
|
|
|
3
4
|
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
4
5
|
// If any, enter additional props that only exist on this component
|
|
@@ -59,5 +60,12 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
59
60
|
{}
|
|
60
61
|
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
61
62
|
|
|
62
|
-
return
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<FormControl variant='standard' sx={{ display: 'flex', flexDirection: 'row' }}>
|
|
66
|
+
<FormLabel sx={{ marginRight: '2rem' }}>{label}</FormLabel>
|
|
67
|
+
{component}
|
|
68
|
+
</FormControl>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
63
71
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
1
|
+
import { Children, type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
2
|
import { Tab, Tabs } from '@mui/material';
|
|
3
3
|
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
4
|
|
|
5
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
6
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
|
|
8
8
|
interface SubTabsProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -19,7 +19,8 @@ export const getVisibleTabs = (allTabs, uuid) => {
|
|
|
19
19
|
const { name: viewName, deferLoadId = `${viewName}_${uuid}_${index}` } = config;
|
|
20
20
|
child.getPConnect().registerAdditionalProps({
|
|
21
21
|
deferLoadId,
|
|
22
|
-
isChildDeferLoad: true
|
|
22
|
+
isChildDeferLoad: true,
|
|
23
|
+
lastUpdateCaseTime: '@P caseInfo.lastUpdateTime'
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
index += 1;
|
|
@@ -66,3 +67,119 @@ export const tabClick = (id, availableTabs, currentTabId, setCurrentTabId, tabIt
|
|
|
66
67
|
PCore.getDeferLoadManager().activate(activeId, nextPConn?.getContextName());
|
|
67
68
|
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn?.getContextName());
|
|
68
69
|
};
|
|
70
|
+
|
|
71
|
+
export const searchtabsClick = (id, mainTabs, currentTabId, setCurrentTabId) => {
|
|
72
|
+
const currentTab = mainTabs.find(item => item.id === currentTabId && item.visibility());
|
|
73
|
+
const currentPConn = currentTab?.getPConnect();
|
|
74
|
+
const { deferLoadId } = currentPConn?.getConfigProps() ?? {};
|
|
75
|
+
PCore.getDeferLoadManager().deactivate(deferLoadId, currentPConn.getContextName());
|
|
76
|
+
|
|
77
|
+
setCurrentTabId(id);
|
|
78
|
+
const nextActiveTab = mainTabs.find(item => item.id === id && item.visibility());
|
|
79
|
+
if (mainTabs && nextActiveTab?.content === null) {
|
|
80
|
+
nextActiveTab.content = nextActiveTab.getPConnect().getComponent();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const nextPConn = nextActiveTab.getPConnect();
|
|
84
|
+
const { deferLoadId: activeId } = nextPConn.getConfigProps();
|
|
85
|
+
PCore.getDeferLoadManager().activate(activeId, nextPConn.getContextName());
|
|
86
|
+
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn.getContextName());
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const getTabLabel = tabPConnect => {
|
|
90
|
+
const config = tabPConnect.getConfigProps();
|
|
91
|
+
|
|
92
|
+
const label = config.inheritedProps?.find(obj => obj.prop === 'label')?.value;
|
|
93
|
+
|
|
94
|
+
if (label) {
|
|
95
|
+
return label;
|
|
96
|
+
}
|
|
97
|
+
if (config.label) {
|
|
98
|
+
return config.label;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (tabPConnect.getReferencedView()?.config?.label) {
|
|
102
|
+
return tabPConnect.getReferencedView()?.config?.label;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const getActiveTabId = (mainTabs, currentTabId) => {
|
|
109
|
+
let firstVisibleTabId = null;
|
|
110
|
+
let updatedActiveId = currentTabId;
|
|
111
|
+
let isCurrentTabFound = false;
|
|
112
|
+
|
|
113
|
+
if (!mainTabs?.length) {
|
|
114
|
+
return updatedActiveId;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (let i = 0; i < mainTabs.length; i += 1) {
|
|
118
|
+
const tab = mainTabs[i];
|
|
119
|
+
const tabConfig = tab.getPConnect().getConfigProps();
|
|
120
|
+
const tabId = tab?.id || `${tab.getPConnect().viewName}-${tabConfig.name || getTabLabel(tab.getPConnect())}-${i}`;
|
|
121
|
+
const isTabVisible = !Object.hasOwn(tabConfig, 'visibility') || tabConfig.visibility === true;
|
|
122
|
+
if (isTabVisible && !firstVisibleTabId) {
|
|
123
|
+
firstVisibleTabId = tabId;
|
|
124
|
+
if (isCurrentTabFound) {
|
|
125
|
+
updatedActiveId = firstVisibleTabId;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (tabId === currentTabId) {
|
|
130
|
+
isCurrentTabFound = true;
|
|
131
|
+
if (isTabVisible) {
|
|
132
|
+
break;
|
|
133
|
+
} else if (firstVisibleTabId) {
|
|
134
|
+
updatedActiveId = firstVisibleTabId;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return updatedActiveId;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param {*} deferLoadedTabs list of deferLoadedTabs
|
|
144
|
+
* @param {string} tabViewName (optional) if provided, tabId of the given tabView will be returned
|
|
145
|
+
* @returns {string} a tab id is returned
|
|
146
|
+
*/
|
|
147
|
+
export const getFirstVisibleTabId = (deferLoadedTabs, tabViewName) => {
|
|
148
|
+
let tabIndex = 0;
|
|
149
|
+
|
|
150
|
+
const viewName = deferLoadedTabs?.props?.getPConnect()?.options?.viewName;
|
|
151
|
+
|
|
152
|
+
const deferTabsChildren = deferLoadedTabs.props.getPConnect().getChildren();
|
|
153
|
+
if (tabViewName) {
|
|
154
|
+
const firstVisibleTab = deferTabsChildren?.find((item, index) => {
|
|
155
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
156
|
+
if (tabViewName === tabConfig.name) {
|
|
157
|
+
tabIndex = index;
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
});
|
|
162
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
163
|
+
|
|
164
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const firstVisibleTab = deferLoadedTabs.props
|
|
168
|
+
.getPConnect()
|
|
169
|
+
.getChildren()
|
|
170
|
+
?.find((item, index) => {
|
|
171
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
172
|
+
if (!('visibility' in tabConfig) || tabConfig.visibility === true) {
|
|
173
|
+
tabIndex = index;
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if (!firstVisibleTab) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
184
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
185
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import Grid2, { type GridSize } from '@mui/material/Grid2';
|
|
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
|
interface TwoColumnProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,6 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
|
23
23
|
const childrenToRender = children as ReactElement[];
|
|
24
24
|
|
|
25
25
|
if (childrenToRender.length !== 2) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
26
|
console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -43,13 +42,13 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
|
43
42
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
44
43
|
|
|
45
44
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
45
|
+
<Grid2 container spacing={1}>
|
|
46
|
+
<Grid2 size={{ xs: 12, md: aSize }} className={classes.colStyles}>
|
|
48
47
|
{childrenToRender[0]}
|
|
49
|
-
</
|
|
50
|
-
<
|
|
48
|
+
</Grid2>
|
|
49
|
+
<Grid2 size={{ xs: 12, md: bSize }} className={classes.colStyles}>
|
|
51
50
|
{childrenToRender[1]}
|
|
52
|
-
</
|
|
53
|
-
</
|
|
51
|
+
</Grid2>
|
|
52
|
+
</Grid2>
|
|
54
53
|
);
|
|
55
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
4
|
interface TwoColumnPageProps extends PConnProps {
|
|
5
5
|
// If any, enter additional props that only exist on this component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import Grid2, { type GridSize } from '@mui/material/Grid2';
|
|
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
|
interface TwoColumnTabProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,6 @@ export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>
|
|
|
23
23
|
const childrenToRender = children as ReactElement[];
|
|
24
24
|
|
|
25
25
|
if (childrenToRender.length !== 2) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
26
|
console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -43,13 +42,13 @@ export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>
|
|
|
43
42
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
44
43
|
|
|
45
44
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
45
|
+
<Grid2 container spacing={1}>
|
|
46
|
+
<Grid2 size={{ xs: 12, md: aSize }} className={classes.colStyles}>
|
|
48
47
|
{childrenToRender[0]}
|
|
49
|
-
</
|
|
50
|
-
<
|
|
48
|
+
</Grid2>
|
|
49
|
+
<Grid2 size={{ xs: 12, md: bSize }} className={classes.colStyles}>
|
|
51
50
|
{childrenToRender[1]}
|
|
52
|
-
</
|
|
53
|
-
</
|
|
51
|
+
</Grid2>
|
|
52
|
+
</Grid2>
|
|
54
53
|
);
|
|
55
54
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
import './WideNarrow.css';
|
|
4
4
|
|
|
5
5
|
interface WideNarrowProps extends PConnProps {
|
|
6
6
|
// If any, enter additional props that only exist on this component
|
|
7
7
|
a: any;
|
|
8
8
|
b: any;
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
title?: string;
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
cols?: string;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
icon?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import Grid2, { type GridSize } from '@mui/material/Grid2';
|
|
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';
|
|
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 WideNarrowDetailsProps extends PConnProps {
|
|
10
10
|
// If any, enter additional props that only exist on this component
|
|
@@ -36,7 +36,7 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
|
36
36
|
|
|
37
37
|
return createElement(createPConnectComponent(), {
|
|
38
38
|
...theConfigObject,
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
key: index.toString()
|
|
41
41
|
});
|
|
42
42
|
});
|
|
@@ -66,21 +66,21 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
|
66
66
|
return (
|
|
67
67
|
<FieldGroup name={theName}>
|
|
68
68
|
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
69
|
-
<
|
|
69
|
+
<Grid2 container spacing={1} style={{ padding: '0 0 1em' }}>
|
|
70
70
|
{highlightedDataArr.map((child, i) => (
|
|
71
|
-
<
|
|
71
|
+
<Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`hf-${i + 1}`}>
|
|
72
72
|
{child}
|
|
73
|
-
</
|
|
73
|
+
</Grid2>
|
|
74
74
|
))}
|
|
75
|
-
</
|
|
75
|
+
</Grid2>
|
|
76
76
|
)}
|
|
77
|
-
<
|
|
77
|
+
<Grid2 container spacing={1}>
|
|
78
78
|
{children?.map((child, i) => (
|
|
79
|
-
<
|
|
79
|
+
<Grid2 size={{ xs: COLUMN_WIDTHS[i] as GridSize }} key={`r-${i + 1}`}>
|
|
80
80
|
{child}
|
|
81
|
-
</
|
|
81
|
+
</Grid2>
|
|
82
82
|
))}
|
|
83
|
-
</
|
|
83
|
+
</Grid2>
|
|
84
84
|
</FieldGroup>
|
|
85
85
|
);
|
|
86
86
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
import './WideNarrowForm.css';
|
|
4
4
|
|
|
5
5
|
interface WideNarrowFormProps extends PConnProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children, PropsWithChildren } from 'react';
|
|
1
|
+
import { Children, type PropsWithChildren } from 'react';
|
|
2
2
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
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
|
|
|
5
5
|
interface WideNarrowPageProps extends PConnProps {
|
|
6
6
|
// If any, enter additional props that only exist on this component
|
|
@@ -8,7 +8,7 @@ import { IconButton, Menu, MenuItem, Typography, Button } from '@mui/material';
|
|
|
8
8
|
import Avatar from '@mui/material/Avatar';
|
|
9
9
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
10
10
|
import { logout } from '@pega/auth/lib/sdk-auth-manager';
|
|
11
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
11
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
12
|
import './WssNavBar.css';
|
|
13
13
|
|
|
14
14
|
interface WssNavBarProps extends PConnProps {
|
|
@@ -17,10 +17,10 @@ interface WssNavBarProps extends PConnProps {
|
|
|
17
17
|
navLinks: any[];
|
|
18
18
|
operator: { currentUserInitials: string };
|
|
19
19
|
navDisplayOptions: { alignment: string; position: string };
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
portalName: string;
|
|
22
22
|
imageSrc: string;
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
fullImageSrc: string;
|
|
25
25
|
appName: any;
|
|
26
26
|
}
|
|
@@ -36,10 +36,10 @@ const useStyles = makeStyles(theme => ({
|
|
|
36
36
|
marginRight: theme.spacing(2)
|
|
37
37
|
},
|
|
38
38
|
appListLogo: {
|
|
39
|
-
|
|
39
|
+
maxWidth: '100%',
|
|
40
|
+
height: '3rem'
|
|
40
41
|
},
|
|
41
42
|
appName: {
|
|
42
|
-
color: 'white',
|
|
43
43
|
marginLeft: theme.spacing(2),
|
|
44
44
|
marginRight: theme.spacing(4),
|
|
45
45
|
fontSize: '1.5rem'
|
|
@@ -85,7 +85,7 @@ export default function WssNavBar(props: WssNavBarProps) {
|
|
|
85
85
|
return (
|
|
86
86
|
<div id='NavBar' className='nav-bar'>
|
|
87
87
|
<AppBar position='static' color='primary'>
|
|
88
|
-
<Container maxWidth=
|
|
88
|
+
<Container maxWidth={false}>
|
|
89
89
|
<Toolbar disableGutters style={{ justifyContent: 'space-between' }}>
|
|
90
90
|
<Button id='appName' style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>
|
|
91
91
|
<img src={appInfo.imageSrc} className={classes.appListLogo} />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
|
|
4
|
+
export function prepareCaseSummaryData(caseSummaryRegion, portalSpecificVisibilityChecker?) {
|
|
5
|
+
const filterVisibleChildren = children => {
|
|
6
|
+
return children
|
|
7
|
+
?.getPConnect()
|
|
8
|
+
?.getChildren()
|
|
9
|
+
?.filter(child => {
|
|
10
|
+
const configProps = child.getPConnect().getConfigProps();
|
|
11
|
+
const defaultVisibilityCn = !('visibility' in configProps) || configProps.visibility === true;
|
|
12
|
+
return defaultVisibilityCn && (portalSpecificVisibilityChecker?.(configProps) ?? true);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const convertChildrenToSummaryData = children => {
|
|
16
|
+
return children?.map(childItem => {
|
|
17
|
+
const childPConnData = childItem.getPConnect().resolveConfigProps(childItem.getPConnect().getRawMetadata());
|
|
18
|
+
return childPConnData;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const summaryFieldChildren = caseSummaryRegion.props
|
|
23
|
+
.getPConnect()
|
|
24
|
+
.getChildren()[0]
|
|
25
|
+
?.getPConnect()
|
|
26
|
+
?.getReferencedViewPConnect()
|
|
27
|
+
?.getPConnect()
|
|
28
|
+
?.getChildren();
|
|
29
|
+
|
|
30
|
+
const primarySummaryFields =
|
|
31
|
+
summaryFieldChildren && summaryFieldChildren.length > 0
|
|
32
|
+
? convertChildrenToSummaryData(filterVisibleChildren(summaryFieldChildren[0]))
|
|
33
|
+
: undefined;
|
|
34
|
+
const secondarySummaryFields =
|
|
35
|
+
summaryFieldChildren && summaryFieldChildren.length > 1
|
|
36
|
+
? convertChildrenToSummaryData(filterVisibleChildren(summaryFieldChildren[1]))
|
|
37
|
+
: undefined;
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
primarySummaryFields,
|
|
41
|
+
secondarySummaryFields
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const filterUtilities = (utils: ReactNode) => {
|
|
46
|
+
let utilsMeta;
|
|
47
|
+
if (isValidElement(utils)) {
|
|
48
|
+
const pConnect = utils.props.getPConnect();
|
|
49
|
+
utilsMeta = pConnect.getRawMetadata?.();
|
|
50
|
+
if (!utilsMeta?.children?.length) return;
|
|
51
|
+
utilsMeta = {
|
|
52
|
+
...utilsMeta,
|
|
53
|
+
children: utilsMeta.children.filter((child: any) => child.config?.availableInChannel?.selfService === true)
|
|
54
|
+
};
|
|
55
|
+
return utilsMeta.children?.length ? pConnect.createComponent(utilsMeta) : undefined;
|
|
56
|
+
}
|
|
57
|
+
return utilsMeta;
|
|
58
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@mui/material';
|
|
2
2
|
import makeStyles from '@mui/styles/makeStyles';
|
|
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
|
|
|
5
5
|
interface AppAnnouncementProps extends PConnProps {
|
|
6
6
|
// If any, enter additional props that only exist on this component
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
flex-direction: row;
|
|
43
43
|
padding: 0.25rem 0rem 0.25rem 0.25rem;
|
|
44
44
|
margin-bottom: 0.5rem;
|
|
45
|
+
align-items: center;
|
|
46
|
+
border: 0.0625rem solid var(--utility-card-border-color);
|
|
47
|
+
border-radius: calc(0.25rem);
|
|
48
|
+
min-height: 3rem;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
.psdk-utility-card-icon {
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
.psdk-utility-card-svg-icon {
|
|
55
59
|
width: 2.5rem;
|
|
56
60
|
display: inline-block;
|
|
61
|
+
filter: var(--svg-color);
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
.psdk-utility-card-main {
|
|
@@ -71,14 +76,7 @@
|
|
|
71
76
|
.psdk-utility-card-action-svg-icon {
|
|
72
77
|
width: 1.4rem;
|
|
73
78
|
display: inline-block;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.psdk-utility-card {
|
|
77
|
-
display: flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
border: 0.0625rem solid rgb(207, 207, 207);
|
|
80
|
-
border-radius: calc(0.25rem);
|
|
81
|
-
min-height: 3rem;
|
|
79
|
+
filter: var(--svg-color);
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
.psdk-utility-button {
|