@pega/react-sdk-overrides 0.24.4 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -2
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +59 -32
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +5 -5
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +6 -6
- package/lib/designSystemExtension/Operator/Operator.tsx +16 -12
- package/lib/designSystemExtension/Pulse/Pulse.tsx +3 -3
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
- package/lib/field/AutoComplete/AutoComplete.tsx +5 -5
- package/lib/field/CancelAlert/CancelAlert.tsx +5 -8
- package/lib/field/Checkbox/Checkbox.tsx +5 -5
- package/lib/field/Currency/Currency.tsx +12 -9
- package/lib/field/Date/Date.tsx +29 -48
- package/lib/field/DateTime/DateTime.tsx +37 -39
- package/lib/field/Decimal/Decimal.tsx +12 -9
- package/lib/field/Dropdown/Dropdown.tsx +34 -27
- package/lib/field/Email/Email.tsx +39 -20
- package/lib/field/Group/Group.tsx +4 -4
- package/lib/field/Integer/Integer.tsx +27 -15
- package/lib/field/Multiselect/Multiselect.tsx +8 -14
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/Percentage/Percentage.tsx +11 -11
- package/lib/field/Phone/Phone.tsx +13 -10
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +4 -7
- package/lib/field/RichText/RichText.tsx +2 -2
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/ScalarList/ScalarList.tsx +4 -5
- package/lib/field/SemanticLink/SemanticLink.tsx +5 -5
- package/lib/field/TextArea/TextArea.tsx +30 -14
- package/lib/field/TextContent/TextContent.tsx +2 -2
- package/lib/field/TextInput/TextInput.tsx +7 -9
- package/lib/field/Time/Time.tsx +30 -27
- package/lib/field/URL/URL.tsx +29 -12
- package/lib/field/UserReference/UserReference.tsx +4 -6
- package/lib/helpers/common-utils.ts +24 -1
- package/lib/helpers/field-group-utils.ts +3 -3
- package/lib/helpers/formatters/Currency.ts +11 -16
- package/lib/helpers/formatters/common.ts +2 -1
- package/lib/helpers/formatters/index.ts +2 -4
- package/lib/helpers/simpleTableHelpers.ts +1 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
- package/lib/infra/Assignment/Assignment.tsx +14 -14
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +17 -29
- package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +10 -5
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +9 -9
- package/lib/infra/Containers/SimpleView/helper.ts +1 -1
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +2 -2
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +6 -8
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
- package/lib/infra/DeferLoad/DeferLoad.tsx +9 -9
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/lib/infra/MultiStep/MultiStep.tsx +17 -16
- package/lib/infra/NavBar/NavBar.css +1 -0
- package/lib/infra/NavBar/NavBar.tsx +49 -38
- package/lib/infra/Reference/Reference.tsx +1 -1
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +7 -8
- package/lib/infra/Stages/Stages.tsx +5 -5
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
- package/lib/infra/View/View.tsx +38 -4
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +87 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +58 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +245 -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.tsx +62 -12
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/CaseSummary/CaseSummary.tsx +2 -2
- package/lib/template/CaseView/CaseView.tsx +12 -11
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +8 -8
- package/lib/template/Confirmation/Confirmation.tsx +5 -4
- package/lib/template/DataReference/DataReference.tsx +318 -108
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.js +10 -0
- package/lib/template/DataReference/SearchForm.tsx +148 -0
- package/lib/template/DataReference/utils.js +90 -0
- package/lib/template/DefaultForm/DefaultForm.tsx +2 -2
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/Details/Details/Details.tsx +3 -3
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +5 -5
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +3 -3
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +3 -3
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +5 -5
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +11 -6
- package/lib/template/InlineDashboard/InlineDashboard.tsx +4 -4
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/template/ListPage/ListPage.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +201 -95
- package/lib/template/ListView/utils.ts +38 -6
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +3 -3
- 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 +4 -4
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +2 -3
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +1 -3
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +112 -88
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +3 -5
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/lib/template/SubTabs/SubTabs.tsx +4 -4
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +10 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +3 -3
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.tsx +10 -10
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +3 -3
- package/lib/widget/Attachment/Attachment.css +1 -0
- package/lib/widget/Attachment/Attachment.tsx +8 -10
- package/lib/widget/CaseHistory/CaseHistory.tsx +13 -11
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +6 -5
- package/lib/widget/Followers/Followers.tsx +4 -4
- package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/lib/widget/SummaryItem/SummaryItem.tsx +5 -4
- package/lib/widget/SummaryList/SummaryList.tsx +1 -1
- package/lib/widget/ToDo/ToDo.tsx +102 -40
- package/package.json +1 -1
- /package/lib/infra/Containers/{helpers.ts → container-helpers.ts} +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const isSelfReferencedProperty = (param, referenceProp) => {
|
|
2
|
+
const [, parentPropName] = param.split('.');
|
|
3
|
+
const referencePropParent = referenceProp?.split('.').pop();
|
|
4
|
+
return parentPropName === referencePropParent;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function getFieldMeta(getPConnect, dataRelationshipContext) {
|
|
8
|
+
const pConn = getPConnect();
|
|
9
|
+
const { selectionMode, selectionList } = pConn.getConfigProps();
|
|
10
|
+
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
11
|
+
|
|
12
|
+
const isMultiSelectMode = selectionMode === MULTI;
|
|
13
|
+
|
|
14
|
+
const pageReference = pConn.getPageReference();
|
|
15
|
+
let referenceProp = isMultiSelectMode ? selectionList.substring(1) : pageReference.substring(pageReference.lastIndexOf('.') + 1);
|
|
16
|
+
// Replace here to use the context name instead
|
|
17
|
+
let contextPageReference = null;
|
|
18
|
+
if (dataRelationshipContext !== null && selectionMode === 'single') {
|
|
19
|
+
referenceProp = dataRelationshipContext;
|
|
20
|
+
contextPageReference = pageReference.concat('.').concat(referenceProp);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const fieldMetadata =
|
|
24
|
+
(isMultiSelectMode ? pConn.getFieldMetadata(`${referenceProp}`) : pConn.getCurrentPageFieldMetadata(contextPageReference)) ?? {};
|
|
25
|
+
const { datasource: { parameters: fieldParameters = {} } = {} } = fieldMetadata;
|
|
26
|
+
const compositeKeys = [];
|
|
27
|
+
Object.values(fieldParameters).forEach(param => {
|
|
28
|
+
if (isSelfReferencedProperty(param, referenceProp)) compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return { compositeKeys, fieldMetadata };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* returns array of self-referenced properties of the datasource
|
|
36
|
+
* Ex: returns ["@P .DataRef.pyGUID", "@P .DataRef.customerID"]
|
|
37
|
+
*/
|
|
38
|
+
const getCompositeKeys = (pConnect, property) => {
|
|
39
|
+
const fieldMetadata = pConnect.getFieldMetadata(property) || {};
|
|
40
|
+
const { datasource: { parameters: fieldParameters = {} } = {} } = fieldMetadata;
|
|
41
|
+
const compositeKeys = [];
|
|
42
|
+
Object.values(fieldParameters).forEach(param => {
|
|
43
|
+
if (isSelfReferencedProperty(param, property)) {
|
|
44
|
+
compositeKeys.push(param);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return compositeKeys;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const getFirstChildConfig = ({
|
|
51
|
+
firstChildMeta,
|
|
52
|
+
getPConnect,
|
|
53
|
+
rawViewMetadata,
|
|
54
|
+
contextClass,
|
|
55
|
+
dataReferenceConfigToChild,
|
|
56
|
+
isCreateNewReferenceEnabled,
|
|
57
|
+
disableStartingFieldsForReference,
|
|
58
|
+
pyID
|
|
59
|
+
}) => {
|
|
60
|
+
const config = {
|
|
61
|
+
...firstChildMeta.config,
|
|
62
|
+
...dataReferenceConfigToChild
|
|
63
|
+
};
|
|
64
|
+
const compositeKeys = getCompositeKeys(getPConnect(), dataReferenceConfigToChild?.dataRelationshipContext);
|
|
65
|
+
return {
|
|
66
|
+
...config,
|
|
67
|
+
viewName: getPConnect().getCurrentView(),
|
|
68
|
+
referenceList: config.referenceList ?? rawViewMetadata.config.referenceList,
|
|
69
|
+
parameters: rawViewMetadata.config.parameters,
|
|
70
|
+
localeReference: rawViewMetadata.config.localeReference,
|
|
71
|
+
contextClass: config.contextClass || rawViewMetadata?.config?.contextClass || rawViewMetadata?.config?.targetObjectClass,
|
|
72
|
+
allowAddingNewRecords: firstChildMeta.type === 'SimpleTableSelect' && isCreateNewReferenceEnabled ? true : undefined,
|
|
73
|
+
actions: firstChildMeta.type === 'SimpleTableSelect' &&
|
|
74
|
+
isCreateNewReferenceEnabled && [
|
|
75
|
+
{
|
|
76
|
+
action: 'ADD_CASE',
|
|
77
|
+
config: {
|
|
78
|
+
label: '@L Add',
|
|
79
|
+
caseType: contextClass,
|
|
80
|
+
inputFields: disableStartingFieldsForReference
|
|
81
|
+
? {}
|
|
82
|
+
: {
|
|
83
|
+
[`.pyAddCaseContextPage.${pyID}`]: `@P .${pyID}`
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
compositeKeys
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createElement, PropsWithChildren } from 'react';
|
|
1
|
+
import { createElement, type PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
3
|
import { getInstructions } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import connectToState from '@pega/react-sdk-components/lib/components/helpers/state-utils';
|
|
6
6
|
|
|
7
7
|
import { getKeyForMappedField, mapStateToProps } from './utils';
|
|
8
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
9
|
|
|
10
10
|
import './DefaultForm.css';
|
|
11
11
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
|
|
3
1
|
export const mapStateToProps: any = (_, ownProps) => {
|
|
4
2
|
const { getPConnect } = ownProps;
|
|
5
3
|
|
|
@@ -24,5 +22,5 @@ export const getKeyForMappedField = field => {
|
|
|
24
22
|
return JSON.stringify(pConnect.meta);
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
return
|
|
25
|
+
return crypto.randomUUID();
|
|
28
26
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
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 DetailsProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,7 @@ export default function Details(props: DetailsProps) {
|
|
|
23
23
|
|
|
24
24
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
25
25
|
// in a readonly (display) mode instead of a editable
|
|
26
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
26
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
27
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
28
28
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
29
|
createElement(createPConnectComponent(), {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
-
import { Tab, Tabs
|
|
3
|
-
import { TabContext, TabPanel } from '@
|
|
1
|
+
import { Children, type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
import { Tab, Tabs } from '@mui/material';
|
|
3
|
+
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
4
|
|
|
5
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/react-sdk-components/lib/components/template/SubTabs/tabUtils';
|
|
6
|
-
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 DetailsSubTabsProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -39,7 +39,7 @@ export default function DetailsSubTabs(props: PropsWithChildren<DetailsSubTabsPr
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<>
|
|
42
|
-
{propsToUse.showLabel && <
|
|
42
|
+
{propsToUse.showLabel && <h3>{propsToUse.label}</h3>}
|
|
43
43
|
<TabContext value={currentTabId.toString()}>
|
|
44
44
|
<Tabs onChange={handleTabClick} value={currentTabId}>
|
|
45
45
|
{tabItems.map((tab: any) => (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
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 DetailsThreeColumnProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,7 @@ export default function DetailsThreeColumn(props: DetailsThreeColumnProps) {
|
|
|
23
23
|
|
|
24
24
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
25
25
|
// in a readonly (display) mode instead of a editable
|
|
26
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
26
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
27
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
28
28
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
29
|
createElement(createPConnectComponent(), {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import Grid from '@material
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
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 DetailsTwoColumnProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,7 @@ export default function DetailsTwoColumn(props: DetailsTwoColumnProps) {
|
|
|
23
23
|
|
|
24
24
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
25
25
|
// in a readonly (display) mode instead of a editable
|
|
26
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
26
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
27
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
28
28
|
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
29
|
createElement(createPConnectComponent(), {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { Children, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TabContext, TabPanel } from '@
|
|
2
|
+
import { Tab, Tabs } from '@mui/material';
|
|
3
|
+
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
5
|
|
|
5
6
|
import { buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
6
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
8
|
|
|
8
9
|
const useStyles = makeStyles(() => ({
|
|
9
10
|
tab: {
|
|
@@ -25,12 +26,11 @@ function DynamicTabs(props: DynamicTabsProps) {
|
|
|
25
26
|
// Get the inherited props from the parent to determine label settings
|
|
26
27
|
const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() };
|
|
27
28
|
const defaultTabIndex = 0;
|
|
28
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'.
|
|
29
29
|
const { tablabel } = pConnect.getComponentConfig();
|
|
30
30
|
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
31
31
|
const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
32
32
|
const memoisedTabViews = useMemo(() => {
|
|
33
|
-
pConnect.setInheritedProp('displayMode', '
|
|
33
|
+
pConnect.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
34
34
|
pConnect.setInheritedProp('readOnly', true);
|
|
35
35
|
|
|
36
36
|
return (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { useLayoutEffect, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
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 FieldGroupTemplateProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -37,9 +37,16 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
37
37
|
const resolvedList = getReferenceList(pConn);
|
|
38
38
|
pConn.setReferenceList(resolvedList);
|
|
39
39
|
const pageReference = `${pConn.getPageReference()}${resolvedList}`;
|
|
40
|
-
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === '
|
|
40
|
+
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
|
|
41
41
|
const HEADING = heading ?? 'Row';
|
|
42
42
|
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
if (!isReadonlyMode) {
|
|
45
|
+
// @ts-ignore - Expected 3 arguments, but got 1
|
|
46
|
+
pConn.getListActions().initDefaultPageInstructions(resolvedList);
|
|
47
|
+
}
|
|
48
|
+
}, [referenceList?.length]);
|
|
49
|
+
|
|
43
50
|
const getDynamicHeaderProp = (item, index) => {
|
|
44
51
|
if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)]) {
|
|
45
52
|
return item[heading.substring(1)];
|
|
@@ -51,7 +58,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
51
58
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
52
59
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
53
60
|
} else {
|
|
54
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
55
61
|
pConn.getListActions().insert({}, referenceList.length);
|
|
56
62
|
}
|
|
57
63
|
};
|
|
@@ -64,7 +70,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
64
70
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
65
71
|
pConn.getListActions().deleteEntry(index, pageReference);
|
|
66
72
|
} else {
|
|
67
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
68
73
|
pConn.getListActions().deleteEntry(index);
|
|
69
74
|
}
|
|
70
75
|
};
|
|
@@ -89,7 +94,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
89
94
|
);
|
|
90
95
|
}
|
|
91
96
|
|
|
92
|
-
pConn.setInheritedProp('displayMode', '
|
|
97
|
+
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
93
98
|
const memoisedReadOnlyList = useMemo(() => {
|
|
94
99
|
return referenceList.map((item, index) => {
|
|
95
100
|
const key = item[heading] || `field-group-row-${index}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Grid, Typography } from '@material
|
|
3
|
-
import
|
|
4
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid, Typography } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface InlineDashboardProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useMemo, Children, useEffect, useState, PropsWithChildren } from 'react';
|
|
1
|
+
import { useMemo, Children, useEffect, useState, type PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
3
|
import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
|
|
7
7
|
interface InlineDashboardPageProps extends PConnProps {
|
|
8
8
|
// If any, enter additional props that only exist on this component
|
|
@@ -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 ListPageProps extends PConnProps {
|
|
5
5
|
// If any, enter additional props that only exist on this component
|