@pega/dx-component-builder-sdk 0.8.5 → 0.8.7
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/package.json +1 -1
- package/src/constants.js +16 -0
- package/src/tasks/create/templates/Constellation/field/Text-Input/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +5 -1
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +5 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +5 -1
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +6 -2
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/SDK-React/template/PAGE/OneColumn.tsx.mustache +7 -6
- package/tests/assets/components/SDK-React/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
- package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +5 -3
- package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
- package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/tests/assets/components/SDK-React/create/override-sdk/field/AutoComplete/AutoComplete.tsx +29 -27
- package/tests/assets/components/SDK-React/create/override-sdk/field/Checkbox/Checkbox.tsx +25 -28
- package/tests/assets/components/SDK-React/create/override-sdk/field/Currency/Currency.tsx +16 -15
- package/tests/assets/components/SDK-React/create/override-sdk/field/Date/Date.tsx +16 -15
- package/tests/assets/components/SDK-React/create/override-sdk/field/DateTime/DateTime.tsx +19 -14
- package/tests/assets/components/SDK-React/create/override-sdk/field/Decimal/Decimal.tsx +18 -16
- package/tests/assets/components/SDK-React/create/override-sdk/field/Dropdown/Dropdown.tsx +22 -31
- package/tests/assets/components/SDK-React/create/override-sdk/field/Email/Email.tsx +11 -11
- package/tests/assets/components/SDK-React/create/override-sdk/field/Integer/Integer.tsx +9 -7
- package/tests/assets/components/SDK-React/create/override-sdk/field/Percentage/Percentage.tsx +9 -9
- package/tests/assets/components/SDK-React/create/override-sdk/field/Phone/Phone.tsx +13 -12
- package/tests/assets/components/SDK-React/create/override-sdk/field/RadioButtons/RadioButtons.tsx +18 -38
- package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/RichText.tsx +93 -0
- package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/index.tsx +1 -0
- package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/ScalarList.tsx +64 -0
- package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/config-ext.json +8 -0
- package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/index.tsx +1 -0
- package/tests/assets/components/SDK-React/create/override-sdk/field/SemanticLink/SemanticLink.tsx +19 -19
- package/tests/assets/components/SDK-React/create/override-sdk/field/TextArea/TextArea.tsx +8 -6
- package/tests/assets/components/SDK-React/create/override-sdk/field/TextInput/TextInput.tsx +8 -7
- package/tests/assets/components/SDK-React/create/override-sdk/field/Time/Time.tsx +16 -28
- package/tests/assets/components/SDK-React/create/override-sdk/field/URL/URL.tsx +10 -8
- package/tests/assets/components/SDK-React/create/override-sdk/field/UserReference/UserReference.tsx +29 -29
- package/tests/assets/components/SDK-React/create/override-sdk/infra/Assignment/Assignment.tsx +5 -2
- package/tests/assets/components/SDK-React/create/override-sdk/infra/AssignmentCard/AssignmentCard.tsx +4 -2
- package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +13 -13
- package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/filterUtils.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +172 -0
- package/tests/assets/components/SDK-React/create/override-sdk/infra/DeferLoad/index.tsx +1 -0
- package/tests/assets/components/SDK-React/create/override-sdk/infra/MultiStep/MultiStep.tsx +4 -3
- package/tests/assets/components/SDK-React/create/override-sdk/infra/NavBar/NavBar.tsx +2 -1
- package/tests/assets/components/SDK-React/create/override-sdk/infra/VerticalTabs/VerticalTabs.tsx +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/AppShell/AppShell.tsx +6 -4
- package/tests/assets/components/SDK-React/create/override-sdk/template/BannerPage/BannerPage.tsx +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/CaseSummary/CaseSummary.tsx +7 -2
- package/tests/assets/components/SDK-React/create/override-sdk/template/CaseView/CaseView.tsx +10 -13
- package/tests/assets/components/SDK-React/create/override-sdk/template/Confirmation/Confirmation.tsx +23 -44
- package/tests/assets/components/SDK-React/create/override-sdk/template/DataReference/DataReference.tsx +28 -49
- package/tests/assets/components/SDK-React/create/override-sdk/template/Details/Details.tsx +8 -4
- package/tests/assets/components/SDK-React/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +8 -4
- package/tests/assets/components/SDK-React/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +8 -4
- package/tests/assets/components/SDK-React/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +6 -2
- package/tests/assets/components/SDK-React/create/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +5 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/ListPage/ListPage.tsx +6 -3
- package/tests/assets/components/SDK-React/create/override-sdk/template/ListView/ListView.tsx +89 -93
- package/tests/assets/components/SDK-React/create/override-sdk/template/ListView/utils.ts +170 -23
- package/tests/assets/components/SDK-React/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +9 -9
- package/tests/assets/components/SDK-React/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +8 -4
- package/tests/assets/components/SDK-React/create/override-sdk/template/NarrowWidePage/NarrowWidePage.tsx +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/OneColumnPage/OneColumnPage.tsx +3 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +16 -11
- package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTable/SimpleTable.tsx +96 -13
- package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +6 -4
- package/tests/assets/components/SDK-React/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +22 -17
- package/tests/assets/components/SDK-React/create/override-sdk/template/TwoColumnPage/TwoColumnPage.tsx +3 -2
- package/tests/assets/components/SDK-React/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +8 -3
- package/tests/assets/components/SDK-React/create/override-sdk/template/WideNarrowPage/WideNarrowPage.tsx +4 -3
- package/tests/assets/components/SDK-React/create/override-sdk/widget/Attachment/Attachment.tsx +7 -3
- package/tests/assets/components/SDK-React/create/override-sdk/widget/FileUtility/FileUtility.tsx +8 -2
- package/tests/assets/components/SDK-React/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/widget/SummaryList/SummaryList.tsx +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/widget/ToDo/ToDo.tsx +53 -82
- package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/index.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +5 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +5 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +7 -6
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +5 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +29 -27
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Checkbox/Checkbox.tsx +25 -28
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Currency/Currency.tsx +16 -15
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Date/Date.tsx +16 -15
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/DateTime/DateTime.tsx +19 -14
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Decimal/Decimal.tsx +18 -16
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Dropdown/Dropdown.tsx +22 -31
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Email/Email.tsx +11 -11
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Integer/Integer.tsx +9 -7
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Percentage/Percentage.tsx +9 -9
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Phone/Phone.tsx +13 -12
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +18 -38
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/RichText.tsx +93 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/index.tsx +1 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/ScalarList/ScalarList.tsx +28 -30
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/ScalarList/config-ext.json +7 -22
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/SemanticLink/SemanticLink.tsx +19 -19
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/TextArea/TextArea.tsx +8 -6
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/TextInput/TextInput.tsx +8 -7
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Time/Time.tsx +16 -28
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/URL/URL.tsx +10 -8
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/UserReference/UserReference.tsx +29 -29
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/Assignment/Assignment.tsx +5 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/AssignmentCard/AssignmentCard.tsx +4 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +172 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DeferLoad/index.tsx +1 -0
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +4 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/VerticalTabs/VerticalTabs.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/AppShell/AppShell.tsx +6 -4
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/BannerPage/BannerPage.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +7 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseView/CaseView.tsx +6 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/Confirmation/Confirmation.tsx +23 -44
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DataReference/DataReference.tsx +27 -21
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/Details/Details.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +5 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListPage/ListPage.tsx +6 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListView/ListView.tsx +89 -93
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListView/utils.ts +170 -23
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +6 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWidePage/NarrowWidePage.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/OneColumnPage/OneColumnPage.tsx +3 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +16 -11
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTable/SimpleTable.tsx +96 -13
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +6 -4
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/TwoColumnPage/TwoColumnPage.tsx +3 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +8 -4
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowPage/WideNarrowPage.tsx +4 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/widget/Attachment/Attachment.tsx +7 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +8 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/widget/SummaryList/SummaryList.tsx +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/widget/ToDo/ToDo.tsx +53 -82
- package/tests/functional/localCreateBuildAllDeleteAllCustom.test.js +0 -1
- package/tests/functional/localCreateBuildDeleteCustom.test.js +1 -1
- package/tests/functional/localCreateBuildDeleteOverride.test.js +1 -1
- package/tests/functional/localCreatePublishAllDeleteAllCustom.test.js +5 -2
- package/tests/functional/localCreatePublishAllDeleteAllOverride.test.js +5 -6
- package/tests/functional/localCreatePublishDeleteOverride.test.js +1 -4
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import React, { useState, useEffect, createElement } from 'react';
|
|
2
|
+
import { Box, Card, CircularProgress } from '@material-ui/core';
|
|
3
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
|
|
5
|
+
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
6
|
+
|
|
7
|
+
// import type { PConnProps } from '../../../types/PConnProps';
|
|
8
|
+
|
|
9
|
+
// Can't use PConnProps until typedefs for showData are fixed
|
|
10
|
+
// interface DeferLoadProps extends PConnProps {
|
|
11
|
+
// // If any, enter additional props that only exist on this component
|
|
12
|
+
// name: string,
|
|
13
|
+
// isChildDeferLoad?: boolean,
|
|
14
|
+
// isTab: boolean
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
//
|
|
19
|
+
// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
20
|
+
// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
|
|
21
|
+
// is totally at your own risk.
|
|
22
|
+
//
|
|
23
|
+
|
|
24
|
+
const useStyles = makeStyles(theme => ({
|
|
25
|
+
root: {
|
|
26
|
+
paddingRight: theme.spacing(1),
|
|
27
|
+
paddingLeft: theme.spacing(1),
|
|
28
|
+
paddingTop: theme.spacing(1),
|
|
29
|
+
paddingBottom: theme.spacing(1),
|
|
30
|
+
marginRight: theme.spacing(1),
|
|
31
|
+
marginLeft: theme.spacing(1),
|
|
32
|
+
marginTop: theme.spacing(1),
|
|
33
|
+
marginBottom: theme.spacing(1)
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
export default function DeferLoad(props /* : DeferLoadProps */) {
|
|
38
|
+
const { getPConnect, name, deferLoadId, isTab } = props;
|
|
39
|
+
const [content, setContent] = useState<any>(null);
|
|
40
|
+
const [isLoading, setLoading] = useState(true);
|
|
41
|
+
const [currentLoadedAssignment, setCurrentLoadedAssignment] = useState("");
|
|
42
|
+
|
|
43
|
+
const classes = useStyles();
|
|
44
|
+
|
|
45
|
+
const pConnect = getPConnect();
|
|
46
|
+
const constants = PCore.getConstants();
|
|
47
|
+
|
|
48
|
+
const theRequestedAssignment = pConnect.getValue( PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL, ''); // 2nd arg empty string until typedef allows optional
|
|
49
|
+
if (theRequestedAssignment !== currentLoadedAssignment) {
|
|
50
|
+
// console.log(`DeferLoad: currentLoadedAssignment about to change from ${currentLoadedAssignment} to ${theRequestedAssignment}`);
|
|
51
|
+
setCurrentLoadedAssignment(theRequestedAssignment);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const { CASE, PAGE, DATA } = constants.RESOURCE_TYPES;
|
|
55
|
+
const loadViewCaseID =
|
|
56
|
+
pConnect.getValue(constants.PZINSKEY, '') || pConnect.getValue(constants.CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef allows optional
|
|
57
|
+
let containerName;
|
|
58
|
+
let containerItemData;
|
|
59
|
+
const targetName = pConnect.getTarget();
|
|
60
|
+
if (targetName) {
|
|
61
|
+
containerName = PCore.getContainerUtils().getActiveContainerItemName(targetName);
|
|
62
|
+
|
|
63
|
+
containerItemData = PCore.getContainerUtils().getContainerItemData(targetName, containerName);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const { resourceType = CASE } = containerItemData || {
|
|
67
|
+
resourceType: loadViewCaseID ? CASE : PAGE
|
|
68
|
+
};
|
|
69
|
+
const isContainerPreview = /preview_[0-9]*/g.test(pConnect.getContextName());
|
|
70
|
+
|
|
71
|
+
const getViewOptions = () => ({
|
|
72
|
+
viewContext: resourceType,
|
|
73
|
+
pageClass: loadViewCaseID ? '' : pConnect.getDataObject('').pyPortal.classID, // 2nd arg empty string until typedef allows optional
|
|
74
|
+
container: isContainerPreview ? 'preview' : null,
|
|
75
|
+
containerName: isContainerPreview ? 'preview' : null,
|
|
76
|
+
updateData: isContainerPreview
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const onResponse = data => {
|
|
80
|
+
setLoading(false);
|
|
81
|
+
if (deferLoadId) {
|
|
82
|
+
PCore.getDeferLoadManager().start(
|
|
83
|
+
name,
|
|
84
|
+
getPConnect().getCaseInfo().getKey(),
|
|
85
|
+
getPConnect().getPageReference().replace('caseInfo.content', ''),
|
|
86
|
+
getPConnect().getContextName(),
|
|
87
|
+
deferLoadId
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (data && !(data.type && data.type === 'error')) {
|
|
92
|
+
const config = {
|
|
93
|
+
meta: data,
|
|
94
|
+
options: {
|
|
95
|
+
context: pConnect.getContextName(),
|
|
96
|
+
pageReference: pConnect.getPageReference()
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const configObject = PCore.createPConnect(config);
|
|
100
|
+
configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
101
|
+
setContent(createElement(createPConnectComponent(), configObject));
|
|
102
|
+
if (deferLoadId) {
|
|
103
|
+
PCore.getDeferLoadManager().stop(deferLoadId, getPConnect().getContextName());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (resourceType === DATA) {
|
|
110
|
+
// Rendering defer loaded tabs in data context
|
|
111
|
+
if (containerName) {
|
|
112
|
+
const dataContext = PCore.getStoreValue('.dataContext', 'dataInfo', containerName);
|
|
113
|
+
const dataContextParameters = PCore.getStoreValue(
|
|
114
|
+
'.dataContextParameters',
|
|
115
|
+
'dataInfo',
|
|
116
|
+
containerName
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
getPConnect()
|
|
120
|
+
.getActionsApi()
|
|
121
|
+
.showData(name, dataContext, dataContextParameters, { // Need to wait for typedefs to be fixed for showData
|
|
122
|
+
skipSemanticUrl: true,
|
|
123
|
+
isDeferLoaded: true
|
|
124
|
+
})
|
|
125
|
+
.then(data => {
|
|
126
|
+
onResponse(data);
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
// eslint-disable-next-line no-console
|
|
130
|
+
console.error('Cannot load the defer loaded view without container information');
|
|
131
|
+
}
|
|
132
|
+
} else if (resourceType === PAGE) {
|
|
133
|
+
// Rendering defer loaded tabs in case/ page context
|
|
134
|
+
getPConnect()
|
|
135
|
+
.getActionsApi()
|
|
136
|
+
.loadView(encodeURI(loadViewCaseID), name, getViewOptions())
|
|
137
|
+
.then(data => {
|
|
138
|
+
onResponse(data);
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
getPConnect()
|
|
142
|
+
.getActionsApi()
|
|
143
|
+
.refreshCaseView(encodeURI(loadViewCaseID), name, '') // 3rd arg empty string until typedef allows optional
|
|
144
|
+
.then(data => {
|
|
145
|
+
onResponse(data.root);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}, [name, getPConnect, currentLoadedAssignment]);
|
|
149
|
+
/* TODO Cosmos need to handle for now added a wrapper div with pos relative */
|
|
150
|
+
let deferLoadContent;
|
|
151
|
+
if (isLoading) {
|
|
152
|
+
deferLoadContent = (
|
|
153
|
+
<div style={{ position: 'relative', height: '100px' }}>
|
|
154
|
+
<Box textAlign='center'>
|
|
155
|
+
<CircularProgress />
|
|
156
|
+
</Box>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
} else {
|
|
160
|
+
deferLoadContent = !isTab ? (
|
|
161
|
+
<div className={classes.root}>
|
|
162
|
+
<React.Fragment>{content}</React.Fragment>
|
|
163
|
+
</div>
|
|
164
|
+
) : (
|
|
165
|
+
<Card id='DeferLoad' className={classes.root}>
|
|
166
|
+
<React.Fragment>{content}</React.Fragment>
|
|
167
|
+
</Card>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return deferLoadContent;
|
|
172
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DeferLoad';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
3
|
import './MultiStep.css';
|
|
4
4
|
|
|
5
|
-
import AssignmentCard from '@pega/react-sdk-components/lib/components/infra/AssignmentCard';
|
|
6
|
-
|
|
7
5
|
// import { useConstellationContext } from "../../bridge/Context/StoreContext";
|
|
8
6
|
|
|
9
7
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
@@ -23,6 +21,9 @@ interface MultiStepProps extends PConnProps {
|
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
export default function MultiStep(props: MultiStepProps) {
|
|
24
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
25
|
+
const AssignmentCard = getComponentFromMap("AssignmentCard");
|
|
26
|
+
|
|
26
27
|
const { getPConnect, children, itemKey = '', actionButtons, onButtonPress} = props;
|
|
27
28
|
const { bIsVertical, arNavigationSteps } = props;
|
|
28
29
|
|
|
@@ -49,7 +49,8 @@ interface NavBarProps extends PConnProps {
|
|
|
49
49
|
|
|
50
50
|
const iconMap = {
|
|
51
51
|
'pi pi-headline': <HomeOutlinedIcon fontSize='large' />,
|
|
52
|
-
'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large'
|
|
52
|
+
'pi pi-flag-solid': <FlagOutlinedIcon fontSize='large' />,
|
|
53
|
+
'pi pi-home-solid': <HomeOutlinedIcon fontSize='large' />
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
const drawerWidth = 300;
|
package/tests/assets/components/SDK-React/create/override-sdk/infra/VerticalTabs/VerticalTabs.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
|
|
|
2
2
|
import { makeStyles } from '@material-ui/core/styles'
|
|
3
3
|
|
|
4
4
|
import Tabs from '@material-ui/core/Tabs';
|
|
5
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
|
|
7
7
|
// VerticalTabs does NOT have getPConnect. So, no need to extend from PConnProps
|
|
8
8
|
interface VerticalTabsProps {
|
|
@@ -37,6 +37,9 @@ const createCustomEvent = (eventName: string, additionalData: {[key: string]: st
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
export default function VerticalTabs(props: VerticalTabsProps) {
|
|
40
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
41
|
+
const LeftAlignVerticalTab = getComponentFromMap("LeftAlignVerticalTabs");
|
|
42
|
+
|
|
40
43
|
// Get a React warning when we use tabConfig as mixed case. So all lowercase tabconfig
|
|
41
44
|
const { tabconfig = [] } = props;
|
|
42
45
|
const classes = useStyles();
|
package/tests/assets/components/SDK-React/create/override-sdk/template/AppShell/AppShell.tsx
CHANGED
|
@@ -4,10 +4,7 @@ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
|
4
4
|
import Avatar from '@material-ui/core/Avatar';
|
|
5
5
|
import { NavContext } from '@pega/react-sdk-components/lib/components/helpers/reactContextHelpers';
|
|
6
6
|
import './AppShell.css';
|
|
7
|
-
|
|
8
|
-
// AppShell can emit NavBar or WssNavBar
|
|
9
|
-
import NavBar from '@pega/react-sdk-components/lib/components/infra/NavBar';
|
|
10
|
-
import WssNavBar from '@pega/react-sdk-components/lib/components/template/WssNavBar';
|
|
7
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
11
8
|
|
|
12
9
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
13
10
|
|
|
@@ -55,6 +52,10 @@ declare const PCore: any;
|
|
|
55
52
|
|
|
56
53
|
|
|
57
54
|
export default function AppShell(props:AppShellProps) {
|
|
55
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
56
|
+
const NavBar = getComponentFromMap("NavBar");
|
|
57
|
+
const WssNavBar = getComponentFromMap("WssNavBar");
|
|
58
|
+
|
|
58
59
|
const {
|
|
59
60
|
pages = [],
|
|
60
61
|
caseTypes = [],
|
|
@@ -66,6 +67,7 @@ export default function AppShell(props:AppShellProps) {
|
|
|
66
67
|
portalLogo,
|
|
67
68
|
navDisplayOptions
|
|
68
69
|
} = props;
|
|
70
|
+
|
|
69
71
|
const [open, setOpen] = useState(true);
|
|
70
72
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
71
73
|
const [activeTab, setActiveTab] = useState(!pages ? null : pages[0]?.pyRuleName);
|
package/tests/assets/components/SDK-React/create/override-sdk/template/BannerPage/BannerPage.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, Children } from 'react';
|
|
2
|
-
import Banner from '@pega/react-sdk-components/lib/components/designSystemExtension/Banner';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
4
|
|
|
5
5
|
// BannerPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
6
|
|
|
@@ -20,6 +20,9 @@ interface BannerPageProps {
|
|
|
20
20
|
* BannerPage template.
|
|
21
21
|
*/
|
|
22
22
|
export default function BannerPage(props: BannerPageProps) {
|
|
23
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
24
|
+
const Banner = getComponentFromMap('Banner');
|
|
25
|
+
|
|
23
26
|
const {
|
|
24
27
|
children,
|
|
25
28
|
layout = 'two-column',
|
package/tests/assets/components/SDK-React/create/override-sdk/template/CaseSummary/CaseSummary.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
3
|
|
|
3
|
-
import CaseSummaryFields from '@pega/react-sdk-components/lib/components/designSystemExtension/CaseSummaryFields';
|
|
4
4
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface CaseSummaryProps extends PConnProps {
|
|
@@ -10,10 +10,15 @@ interface CaseSummaryProps extends PConnProps {
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
export default function CaseSummary(props: CaseSummaryProps) {
|
|
13
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
14
|
+
const CaseSummaryFields = getComponentFromMap('CaseSummaryFields');
|
|
15
|
+
|
|
13
16
|
const { getPConnect, children } = props;
|
|
14
17
|
const thePConn = getPConnect();
|
|
15
18
|
const theConfigProps = thePConn.getConfigProps();
|
|
16
|
-
const { status, showStatus } = theConfigProps;
|
|
19
|
+
// const { status, showStatus } = theConfigProps;
|
|
20
|
+
const status = theConfigProps["status"];
|
|
21
|
+
const showStatus = theConfigProps["showStatus"];
|
|
17
22
|
|
|
18
23
|
// from Constellation DX Components
|
|
19
24
|
// get the primary and secondary fields with the raw data (which has the non-resolved property values)
|
package/tests/assets/components/SDK-React/create/override-sdk/template/CaseView/CaseView.tsx
CHANGED
|
@@ -9,9 +9,7 @@ import Button from '@material-ui/core/Button';
|
|
|
9
9
|
import Grid from '@material-ui/core/Grid';
|
|
10
10
|
|
|
11
11
|
import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext';
|
|
12
|
-
import
|
|
13
|
-
import VerticalTabs from '@pega/react-sdk-components/lib/components/infra/VerticalTabs/VerticalTabs';
|
|
14
|
-
import DeferLoad from '@pega/react-sdk-components/lib/components/infra/DeferLoad';
|
|
12
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
15
13
|
|
|
16
14
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
17
15
|
|
|
@@ -58,12 +56,19 @@ const useStyles = makeStyles(theme => ({
|
|
|
58
56
|
}));
|
|
59
57
|
|
|
60
58
|
export default function CaseView(props: CaseViewProps) {
|
|
59
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
60
|
+
const CaseViewActionsMenu = getComponentFromMap("CaseViewActionsMenu");
|
|
61
|
+
const VerticalTabs = getComponentFromMap("VerticalTabs");
|
|
62
|
+
const DeferLoad = getComponentFromMap("DeferLoad");
|
|
63
|
+
|
|
61
64
|
const {
|
|
62
65
|
getPConnect,
|
|
63
|
-
icon,
|
|
66
|
+
icon = '',
|
|
64
67
|
header,
|
|
65
68
|
subheader,
|
|
66
|
-
children,
|
|
69
|
+
children = [],
|
|
70
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
71
|
+
showIconInHeader = true,
|
|
67
72
|
caseInfo: {
|
|
68
73
|
availableActions = [],
|
|
69
74
|
availableProcesses = [],
|
|
@@ -288,11 +293,3 @@ export default function CaseView(props: CaseViewProps) {
|
|
|
288
293
|
|
|
289
294
|
return getContainerContents();
|
|
290
295
|
}
|
|
291
|
-
|
|
292
|
-
CaseView.defaultProps = {
|
|
293
|
-
icon: '',
|
|
294
|
-
children: [],
|
|
295
|
-
caseInfo: {},
|
|
296
|
-
showIconInHeader: true,
|
|
297
|
-
getPConnect: null
|
|
298
|
-
};
|
package/tests/assets/components/SDK-React/create/override-sdk/template/Confirmation/Confirmation.tsx
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
/* eslint-disable no-unused-vars */
|
|
3
3
|
/* eslint-disable no-nested-ternary */
|
|
4
|
-
import {
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { getToDoAssignments } from '@pega/react-sdk-components/lib/components/infra/Containers/FlowContainer/helpers';
|
|
7
|
-
import ToDo from '@pega/react-sdk-components/lib/components/widget/ToDo';
|
|
8
|
-
import Details from '@pega/react-sdk-components/lib/components/template/Details/Details';
|
|
4
|
+
import React, { useState } from 'react';
|
|
9
5
|
import { Button, Card, makeStyles } from '@material-ui/core';
|
|
6
|
+
import { getToDoAssignments } from '@pega/react-sdk-components/lib/components/infra/Containers/FlowContainer/helpers';
|
|
7
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
|
+
|
|
10
9
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
11
10
|
|
|
12
|
-
//
|
|
11
|
+
// Confirmation does NOT have getPConnect. So, no need to extend from PConnProps
|
|
13
12
|
|
|
14
13
|
interface ConfirmationProps extends PConnProps {
|
|
15
14
|
// If any, enter additional props that only exist on this component
|
|
16
|
-
children: Array<any
|
|
17
|
-
datasource: { source: any }
|
|
18
|
-
label: string
|
|
19
|
-
showLabel: boolean
|
|
20
|
-
showTasks: boolean
|
|
15
|
+
children: Array<any>;
|
|
16
|
+
datasource: { source: any };
|
|
17
|
+
label: string;
|
|
18
|
+
showLabel: boolean;
|
|
19
|
+
showTasks: boolean;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const useStyles = makeStyles(theme => ({
|
|
22
|
+
const useStyles = makeStyles((theme) => ({
|
|
26
23
|
root: {
|
|
27
24
|
paddingRight: theme.spacing(1),
|
|
28
25
|
paddingLeft: theme.spacing(1),
|
|
@@ -36,6 +33,10 @@ const useStyles = makeStyles(theme => ({
|
|
|
36
33
|
}));
|
|
37
34
|
|
|
38
35
|
export default function Confirmation(props: ConfirmationProps) {
|
|
36
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
37
|
+
const ToDo = getComponentFromMap('Todo'); // NOTE: ConstellationJS Engine uses "Todo" and not "ToDo"!!!
|
|
38
|
+
const Details = getComponentFromMap('Details');
|
|
39
|
+
|
|
39
40
|
const classes = useStyles();
|
|
40
41
|
const CONSTS = PCore.getConstants();
|
|
41
42
|
const [showConfirmView, setShowConfirmView] = useState(true);
|
|
@@ -43,20 +44,12 @@ export default function Confirmation(props: ConfirmationProps) {
|
|
|
43
44
|
// Get the inherited props from the parent to determine label settings
|
|
44
45
|
// Not using whatsNext at the moment, need to figure out the use of it
|
|
45
46
|
const whatsNext = datasource?.source;
|
|
46
|
-
const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : '';
|
|
47
|
-
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(
|
|
48
|
-
|
|
49
|
-
);
|
|
50
|
-
const rootInfo = PCore.getContainerUtils().getContainerItemData(
|
|
51
|
-
getPConnect().getTarget(),
|
|
52
|
-
activeContainerItemID
|
|
53
|
-
);
|
|
47
|
+
const items = whatsNext.length > 0 ? whatsNext.map((item) => item.label) : '';
|
|
48
|
+
const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget());
|
|
49
|
+
const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID);
|
|
54
50
|
const onConfirmViewClose = () => {
|
|
55
51
|
setShowConfirmView(false);
|
|
56
|
-
PCore.getPubSubUtils().publish(
|
|
57
|
-
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW,
|
|
58
|
-
rootInfo
|
|
59
|
-
);
|
|
52
|
+
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CLOSE_CONFIRM_VIEW, rootInfo);
|
|
60
53
|
};
|
|
61
54
|
const todoProps = { ...props, renderTodoInConfirm: true };
|
|
62
55
|
const toDoList = getToDoAssignments(getPConnect());
|
|
@@ -64,36 +57,22 @@ export default function Confirmation(props: ConfirmationProps) {
|
|
|
64
57
|
const showDetails = detailProps?.children?.[0]?.props?.getPConnect()?.getChildren()?.length > 0;
|
|
65
58
|
return showConfirmView ? (
|
|
66
59
|
<Card className={classes.root}>
|
|
67
|
-
<h2 id=
|
|
60
|
+
<h2 id="confirm-label">{props.showLabel ? props.label : ''}</h2>
|
|
68
61
|
{showDetails ? <Details {...detailProps} /> : undefined}
|
|
69
62
|
{showTasks ? (
|
|
70
63
|
toDoList && toDoList.length > 0 ? (
|
|
71
|
-
<ToDo
|
|
72
|
-
{...todoProps}
|
|
73
|
-
datasource={{ source: toDoList }}
|
|
74
|
-
getPConnect={getPConnect}
|
|
75
|
-
type={CONSTS.TODO}
|
|
76
|
-
headerText='Open Tasks'
|
|
77
|
-
isConfirm
|
|
78
|
-
/>
|
|
64
|
+
<ToDo {...todoProps} datasource={{ source: toDoList }} getPConnect={getPConnect} type={CONSTS.TODO} headerText="Open Tasks" isConfirm />
|
|
79
65
|
) : undefined
|
|
80
66
|
) : undefined}
|
|
81
67
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
82
|
-
<Button variant=
|
|
68
|
+
<Button variant="contained" color="primary" onClick={onConfirmViewClose}>
|
|
83
69
|
Done
|
|
84
70
|
</Button>
|
|
85
71
|
</div>
|
|
86
72
|
</Card>
|
|
87
73
|
) : toDoList && toDoList.length > 0 ? (
|
|
88
74
|
<Card className={classes.root}>
|
|
89
|
-
<ToDo
|
|
90
|
-
{...props}
|
|
91
|
-
datasource={{ source: toDoList }}
|
|
92
|
-
getPConnect={getPConnect}
|
|
93
|
-
type={CONSTS.TODO}
|
|
94
|
-
headerText='Tasks'
|
|
95
|
-
isConfirm
|
|
96
|
-
/>
|
|
75
|
+
<ToDo {...props} datasource={{ source: toDoList }} getPConnect={getPConnect} type={CONSTS.TODO} headerText="Tasks" isConfirm />
|
|
97
76
|
</Card>
|
|
98
77
|
) : null;
|
|
99
78
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
|
+
|
|
4
4
|
// import type { PConnProps } from '../../../types/PConnProps';
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// ReferenceProps can't be used until getComponentConfig() is NOT private
|
|
7
7
|
// interface DataReferenceProps extends PConnProps {
|
|
8
8
|
// // If any, enter additional props that only exist on this component
|
|
9
9
|
// children: Array<any>,
|
|
@@ -26,7 +26,11 @@ const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
|
26
26
|
declare const PCore: any;
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
export default function DataReference(props
|
|
29
|
+
export default function DataReference(props /*: DataReferenceProps */) {
|
|
30
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
31
|
+
const SingleReferenceReadonly = getComponentFromMap('SingleReferenceReadOnly');
|
|
32
|
+
const MultiReferenceReadonly = getComponentFromMap('MultiReferenceReadOnly');
|
|
33
|
+
|
|
30
34
|
const {
|
|
31
35
|
children,
|
|
32
36
|
getPConnect,
|
|
@@ -49,9 +53,9 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
49
53
|
propsToUse.label = '';
|
|
50
54
|
}
|
|
51
55
|
const rawViewMetadata = pConn.getRawMetadata();
|
|
52
|
-
const viewName = rawViewMetadata
|
|
53
|
-
const [firstChildMeta] = rawViewMetadata
|
|
54
|
-
const refList = rawViewMetadata
|
|
56
|
+
const viewName = rawViewMetadata["name"];
|
|
57
|
+
const [firstChildMeta] = rawViewMetadata["children"];
|
|
58
|
+
const refList = rawViewMetadata["config"].referenceList;
|
|
55
59
|
const canBeChangedInReviewMode = allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');
|
|
56
60
|
let propName;
|
|
57
61
|
const isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);
|
|
@@ -61,7 +65,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
61
65
|
useEffect(() => {
|
|
62
66
|
if (
|
|
63
67
|
firstChildMeta?.type === "Dropdown" &&
|
|
64
|
-
rawViewMetadata
|
|
68
|
+
rawViewMetadata["config"]?.parameters
|
|
65
69
|
) {
|
|
66
70
|
const { value, key, text } = firstChildMeta.config.datasource.fields;
|
|
67
71
|
PCore.getDataApiUtils()
|
|
@@ -101,14 +105,14 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
101
105
|
delete firstChildMeta.config.readOnly;
|
|
102
106
|
}
|
|
103
107
|
if (firstChildMeta?.type === 'Dropdown') {
|
|
104
|
-
firstChildMeta.config.datasource.source = rawViewMetadata
|
|
108
|
+
firstChildMeta.config.datasource.source = rawViewMetadata["config"]?.parameters
|
|
105
109
|
? dropDownDataSource
|
|
106
110
|
: '@DATASOURCE '.concat(refList).concat('.pxResults');
|
|
107
111
|
} else if (firstChildMeta?.type === 'AutoComplete') {
|
|
108
112
|
firstChildMeta.config.datasource = refList;
|
|
109
113
|
|
|
110
114
|
/* Insert the parameters to the component only if present */
|
|
111
|
-
if (rawViewMetadata
|
|
115
|
+
if (rawViewMetadata["config"]?.parameters) {
|
|
112
116
|
firstChildMeta.config.parameters = parameters;
|
|
113
117
|
}
|
|
114
118
|
}
|
|
@@ -187,8 +191,10 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
187
191
|
const recreatedFirstChild = useMemo(() => {
|
|
188
192
|
const { type, config } = firstChildMeta;
|
|
189
193
|
if (firstChildMeta?.type !== 'Region') {
|
|
190
|
-
pConn.clearErrorMessages({
|
|
191
|
-
property: propName
|
|
194
|
+
pConn.clearErrorMessages({ // Need to add empty string for category and context to match typdef
|
|
195
|
+
property: propName,
|
|
196
|
+
category: '',
|
|
197
|
+
context: ''
|
|
192
198
|
});
|
|
193
199
|
if (!canBeChangedInReviewMode && isDisplayModeEnabled && selectionMode === SELECTION_MODE.SINGLE) {
|
|
194
200
|
return (
|
|
@@ -203,7 +209,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
203
209
|
referenceType={referenceType}
|
|
204
210
|
hideLabel={hideLabel}
|
|
205
211
|
dataRelationshipContext={
|
|
206
|
-
rawViewMetadata
|
|
212
|
+
rawViewMetadata["config"].contextClass && rawViewMetadata["config"].name ? rawViewMetadata["config"].name : null
|
|
207
213
|
}
|
|
208
214
|
/>
|
|
209
215
|
);
|
|
@@ -223,7 +229,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
223
229
|
// In the case of a datasource with parameters you cannot load the dropdown before the parameters
|
|
224
230
|
if (
|
|
225
231
|
type === 'Dropdown' &&
|
|
226
|
-
rawViewMetadata
|
|
232
|
+
rawViewMetadata["config"]?.parameters &&
|
|
227
233
|
dropDownDataSource === null
|
|
228
234
|
) {
|
|
229
235
|
return null;
|
|
@@ -238,18 +244,19 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
238
244
|
disabled: propsToUse.disabled,
|
|
239
245
|
label: propsToUse.label,
|
|
240
246
|
viewName: getPConnect().getCurrentView(),
|
|
241
|
-
parameters: rawViewMetadata
|
|
247
|
+
parameters: rawViewMetadata["config"].parameters,
|
|
242
248
|
readOnly: false,
|
|
243
|
-
localeReference: rawViewMetadata
|
|
249
|
+
localeReference: rawViewMetadata["config"].localeReference,
|
|
244
250
|
...(selectionMode === SELECTION_MODE.SINGLE ? { referenceType } : ''),
|
|
245
251
|
dataRelationshipContext:
|
|
246
|
-
rawViewMetadata
|
|
247
|
-
? rawViewMetadata
|
|
252
|
+
rawViewMetadata["config"].contextClass && rawViewMetadata["config"].name
|
|
253
|
+
? rawViewMetadata["config"].name
|
|
248
254
|
: null,
|
|
249
255
|
hideLabel,
|
|
250
256
|
onRecordChange: handleSelection
|
|
251
|
-
}
|
|
252
|
-
}
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
|
|
253
260
|
}
|
|
254
261
|
}, [
|
|
255
262
|
firstChildMeta.config?.datasource?.source,
|
|
@@ -261,7 +268,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
261
268
|
|
|
262
269
|
// Only include the views region for rendering when it has content
|
|
263
270
|
if (firstChildMeta?.type !== 'Region') {
|
|
264
|
-
const viewsRegion = rawViewMetadata
|
|
271
|
+
const viewsRegion = rawViewMetadata["children"][1];
|
|
265
272
|
if (viewsRegion?.name === 'Views' && viewsRegion.children.length) {
|
|
266
273
|
childrenToRender = [recreatedFirstChild, ...children.slice(1)];
|
|
267
274
|
} else {
|
|
@@ -279,31 +286,3 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
279
286
|
</div>
|
|
280
287
|
);
|
|
281
288
|
}
|
|
282
|
-
|
|
283
|
-
// DataReference.defaultProps = {
|
|
284
|
-
// label: undefined,
|
|
285
|
-
// showLabel: undefined,
|
|
286
|
-
// displayMode: undefined,
|
|
287
|
-
// allowAndPersistChangesInReviewMode: false,
|
|
288
|
-
// referenceType: '',
|
|
289
|
-
// selectionMode: '',
|
|
290
|
-
// displayAs: '',
|
|
291
|
-
// ruleClass: '',
|
|
292
|
-
// parameters: undefined,
|
|
293
|
-
// hideLabel: false
|
|
294
|
-
// };
|
|
295
|
-
|
|
296
|
-
// DataReference.propTypes = {
|
|
297
|
-
// children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
298
|
-
// getPConnect: PropTypes.func.isRequired,
|
|
299
|
-
// label: PropTypes.string,
|
|
300
|
-
// showLabel: PropTypes.func,
|
|
301
|
-
// displayMode: PropTypes.string,
|
|
302
|
-
// allowAndPersistChangesInReviewMode: PropTypes.bool,
|
|
303
|
-
// referenceType: PropTypes.string,
|
|
304
|
-
// selectionMode: PropTypes.string,
|
|
305
|
-
// displayAs: PropTypes.string,
|
|
306
|
-
// ruleClass: PropTypes.string,
|
|
307
|
-
// parameters: PropTypes.arrayOf(PropTypes.string), // need to fix
|
|
308
|
-
// hideLabel: PropTypes.bool
|
|
309
|
-
// };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import React, { createElement } from 'react';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
4
|
-
import
|
|
4
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
+
|
|
5
6
|
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
// Can't use PConnProps until getPConnect().getChildren()
|
|
9
|
-
// and createComponent types are ok
|
|
9
|
+
// Can't use PConnProps until getPConnect().getChildren() type is ok
|
|
10
10
|
// interface DetailsProps extends PConnProps {
|
|
11
11
|
// // If any, enter additional props that only exist on this component
|
|
12
12
|
// }
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
export default function Details(props /* : DetailsProps */) {
|
|
16
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
17
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
18
|
+
|
|
16
19
|
const { label, showLabel, getPConnect, showHighlightedData } = props;
|
|
17
20
|
|
|
18
21
|
// Get the inherited props from the parent to determine label settings
|
|
@@ -45,7 +48,8 @@ export default function Details(props /* : DetailsProps */) {
|
|
|
45
48
|
field.config.displayAsStatus = true;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
return getPConnect().createComponent(field
|
|
51
|
+
return getPConnect().createComponent(field,
|
|
52
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
55
|
|