@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
|
@@ -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
|
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
// Can't use PConnProps until getPConnect().getChildren()
|
|
8
|
-
// and createComponent types are ok
|
|
8
|
+
// Can't use PConnProps until getPConnect().getChildren() type is ok
|
|
9
9
|
// interface DetailsThreeColumnProps extends PConnProps {
|
|
10
10
|
// // If any, enter additional props that only exist on this component
|
|
11
11
|
// showLabel: boolean,
|
|
@@ -15,6 +15,9 @@ import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemEx
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
export default function DetailsThreeColumn(props /* : DetailsThreeColumnProps */) {
|
|
18
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
19
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
20
|
+
|
|
18
21
|
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
19
22
|
|
|
20
23
|
// Get the inherited props from the parent to determine label settings
|
|
@@ -47,7 +50,8 @@ export default function DetailsThreeColumn(props /* : DetailsThreeColumnProps */
|
|
|
47
50
|
field.config.displayAsStatus = true;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
return getPConnect().createComponent(field
|
|
53
|
+
return getPConnect().createComponent(field,
|
|
54
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
|
|
51
55
|
});
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -1,12 +1,12 @@
|
|
|
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 DetailsTwoColumnProps extends PConnProps {
|
|
11
11
|
// // If any, enter additional props that only exist on this component
|
|
12
12
|
// showLabel: boolean,
|
|
@@ -16,6 +16,9 @@ import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemEx
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
export default function DetailsTwoColumn(props /* : DetailsTwoColumnProps */) {
|
|
19
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
21
|
+
|
|
19
22
|
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
20
23
|
|
|
21
24
|
// Get the inherited props from the parent to determine label settings
|
|
@@ -48,7 +51,8 @@ export default function DetailsTwoColumn(props /* : DetailsTwoColumnProps */) {
|
|
|
48
51
|
field.config.displayAsStatus = true;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
return getPConnect().createComponent(field
|
|
54
|
+
return getPConnect().createComponent(field,
|
|
55
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
58
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
|
|
4
|
-
import FieldGroupList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroupList';
|
|
5
3
|
import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
4
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
+
|
|
6
6
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
|
|
8
8
|
interface FieldGroupTemplateProps extends PConnProps {
|
|
@@ -19,6 +19,10 @@ interface FieldGroupTemplateProps extends PConnProps {
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
22
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
23
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
24
|
+
const FieldGroupList = getComponentFromMap('FieldGroupList');
|
|
25
|
+
|
|
22
26
|
const {
|
|
23
27
|
referenceList = [],
|
|
24
28
|
renderMode,
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { useMemo, Children, useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
|
|
5
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
6
7
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
8
|
|
|
8
9
|
|
|
@@ -16,6 +17,9 @@ interface InlineDashboardPageProps extends PConnProps {
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
export default function InlineDashboardPage(props: InlineDashboardPageProps) {
|
|
20
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
21
|
+
const InlineDashboard = getComponentFromMap("InlineDashboard");
|
|
22
|
+
|
|
19
23
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
20
24
|
const { children, getPConnect, icon = '', filterPosition = 'block-start' } = props;
|
|
21
25
|
const [filterComponents, setFilterComponents] = useState([]);
|
package/tests/assets/components/SDK-React/create/override-sdk/template/ListPage/ListPage.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
3
|
|
|
5
4
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
5
|
|
|
@@ -11,8 +10,12 @@ interface ListPageProps extends PConnProps {
|
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
export default function ListPage(props: ListPageProps) {
|
|
13
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
14
|
+
const ListView = getComponentFromMap('ListView');
|
|
14
15
|
|
|
16
|
+
// special case for ListView - add in a prop
|
|
17
|
+
const listViewProps = {...props, bInForm: false};
|
|
15
18
|
return (
|
|
16
|
-
<ListView {...
|
|
19
|
+
<ListView {...listViewProps}></ListView>
|
|
17
20
|
)
|
|
18
21
|
}
|