@pega/dx-component-builder-sdk 0.8.6 → 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/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/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 +1 -1
- package/tests/functional/localCreatePublishAllDeleteAllOverride.test.js +0 -5
- package/tests/functional/localCreatePublishDeleteOverride.test.js +1 -4
|
@@ -12,20 +12,19 @@ import DatePicker from 'react-datepicker';
|
|
|
12
12
|
|
|
13
13
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// }
|
|
15
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
16
|
+
|
|
17
|
+
interface DashboardFilterProps extends PConnProps {
|
|
18
|
+
// If any, enter additional props that only exist on this component
|
|
19
|
+
children?: Array<any>,
|
|
20
|
+
name: string,
|
|
21
|
+
filterProp: string,
|
|
22
|
+
type?: string,
|
|
23
|
+
metadata?: any
|
|
24
|
+
}
|
|
26
25
|
|
|
27
26
|
|
|
28
|
-
export default function DashboardFilter(props
|
|
27
|
+
export default function DashboardFilter(props: DashboardFilterProps) {
|
|
29
28
|
const { children = [], name, filterProp, type = '', metadata = null, getPConnect } = props;
|
|
30
29
|
const { current: filterId } = useRef(uuidv4());
|
|
31
30
|
|
|
@@ -109,7 +108,8 @@ export default function DashboardFilter(props /* : DashboardFilterProps */) {
|
|
|
109
108
|
metadata.config.onRecordChange = e => {
|
|
110
109
|
fireFilterChange(e.id);
|
|
111
110
|
};
|
|
112
|
-
return getPConnect().createComponent(metadata
|
|
111
|
+
return getPConnect().createComponent(metadata,
|
|
112
|
+
null, null, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
const onChange = dates => {
|
package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/filterUtils.tsx
CHANGED
|
@@ -91,7 +91,7 @@ export const createFilterComponent = (getPConnect, filterMeta, index) => {
|
|
|
91
91
|
metadata={filterMeta}
|
|
92
92
|
type={filterMeta.type}
|
|
93
93
|
>
|
|
94
|
-
{getPConnect().createComponent(filterMeta)}
|
|
94
|
+
{getPConnect().createComponent(filterMeta, '','', {})}
|
|
95
95
|
</DashboardFilter>
|
|
96
96
|
);
|
|
97
97
|
};
|
|
@@ -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
|
}
|