@pega/dx-component-builder-sdk 0.8.2 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/constants.js +0 -1
- package/src/tasks/bundle/builderAngular/webpack.config.js +1 -2
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +28 -25
- package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS/mock.stories.js.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/mock.stories.js.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +9 -10
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.jsx.mustache +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/field/AutoComplete/AutoComplete.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/field/Checkbox/Checkbox.tsx +27 -25
- package/tests/assets/components/SDK-React/create/override-sdk/field/Currency/Currency.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/field/Date/Date.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/field/DateTime/DateTime.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/field/Decimal/Decimal.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/field/Dropdown/Dropdown.tsx +15 -14
- package/tests/assets/components/SDK-React/create/override-sdk/field/RadioButtons/RadioButtons.tsx +9 -8
- package/tests/assets/components/SDK-React/create/override-sdk/field/TextInput/TextInput.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/infra/Assignment/Assignment.tsx +18 -15
- package/tests/assets/components/SDK-React/create/override-sdk/infra/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/AppShell/AppShell.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/CaseSummary/CaseSummary.tsx +3 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +13 -11
- package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTable/SimpleTable.tsx +9 -9
- package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +1 -1
- package/tests/assets/components/SDK-React/create/override-sdk/widget/Attachment/Attachment.tsx +2 -2
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +28 -25
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/demo.stories.jsx +1 -0
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyDetails/mock.stories.js +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +9 -10
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/mock.stories.js +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.jsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Checkbox/Checkbox.tsx +27 -25
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Currency/Currency.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Date/Date.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/DateTime/DateTime.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Decimal/Decimal.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/Dropdown/Dropdown.tsx +15 -14
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +9 -8
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/ScalarList/ScalarList.tsx +2 -2
- 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/TextInput/TextInput.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/Assignment/Assignment.tsx +18 -15
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DashboardFilter/filterUtils.tsx +2 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/infra/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/AppShell/AppShell.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +3 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DataReference/DataReference.tsx +36 -34
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +13 -11
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTable/SimpleTable.tsx +9 -9
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +1 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +3 -3
- package/tests/assets/components/SDK-React/createAll/override-sdk/widget/Attachment/Attachment.tsx +2 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect } from 'react';
|
|
2
2
|
import SingleReferenceReadonly from '@pega/react-sdk-components/lib/components/template/SingleReferenceReadOnly';
|
|
3
3
|
import MultiReferenceReadonly from '@pega/react-sdk-components/lib/components/template/MultiReferenceReadOnly';
|
|
4
|
-
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
// ReferenceProps can't be used until getComponentConfig() is NOT private
|
|
7
|
+
interface DataReferenceProps extends PConnProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
children: Array<any>,
|
|
10
|
+
label: string,
|
|
11
|
+
showLabel: any,
|
|
12
|
+
displayMode: string,
|
|
13
|
+
allowAndPersistChangesInReviewMode: boolean,
|
|
14
|
+
referenceType: string,
|
|
15
|
+
selectionMode: string,
|
|
16
|
+
displayAs: string,
|
|
17
|
+
ruleClass: string,
|
|
18
|
+
parameters: Array<string>, // need to fix
|
|
19
|
+
hideLabel: boolean
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
@@ -26,7 +26,7 @@ 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
30
|
const {
|
|
31
31
|
children,
|
|
32
32
|
getPConnect,
|
|
@@ -49,9 +49,9 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
49
49
|
propsToUse.label = '';
|
|
50
50
|
}
|
|
51
51
|
const rawViewMetadata = pConn.getRawMetadata();
|
|
52
|
-
const viewName = rawViewMetadata
|
|
53
|
-
const [firstChildMeta] = rawViewMetadata
|
|
54
|
-
const refList = rawViewMetadata
|
|
52
|
+
const viewName = rawViewMetadata["name"];
|
|
53
|
+
const [firstChildMeta] = rawViewMetadata["children"];
|
|
54
|
+
const refList = rawViewMetadata["config"].referenceList;
|
|
55
55
|
const canBeChangedInReviewMode = allowAndPersistChangesInReviewMode && (displayAs === 'autocomplete' || displayAs === 'dropdown');
|
|
56
56
|
let propName;
|
|
57
57
|
const isDisplayModeEnabled = ['LABELS_LEFT', 'STACKED_LARGE_VAL'].includes(displayMode);
|
|
@@ -61,7 +61,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
if (
|
|
63
63
|
firstChildMeta?.type === "Dropdown" &&
|
|
64
|
-
rawViewMetadata
|
|
64
|
+
rawViewMetadata["config"]?.parameters
|
|
65
65
|
) {
|
|
66
66
|
const { value, key, text } = firstChildMeta.config.datasource.fields;
|
|
67
67
|
PCore.getDataApiUtils()
|
|
@@ -101,14 +101,14 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
101
101
|
delete firstChildMeta.config.readOnly;
|
|
102
102
|
}
|
|
103
103
|
if (firstChildMeta?.type === 'Dropdown') {
|
|
104
|
-
firstChildMeta.config.datasource.source = rawViewMetadata
|
|
104
|
+
firstChildMeta.config.datasource.source = rawViewMetadata["config"]?.parameters
|
|
105
105
|
? dropDownDataSource
|
|
106
106
|
: '@DATASOURCE '.concat(refList).concat('.pxResults');
|
|
107
107
|
} else if (firstChildMeta?.type === 'AutoComplete') {
|
|
108
108
|
firstChildMeta.config.datasource = refList;
|
|
109
109
|
|
|
110
110
|
/* Insert the parameters to the component only if present */
|
|
111
|
-
if (rawViewMetadata
|
|
111
|
+
if (rawViewMetadata["config"]?.parameters) {
|
|
112
112
|
firstChildMeta.config.parameters = parameters;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -187,8 +187,10 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
187
187
|
const recreatedFirstChild = useMemo(() => {
|
|
188
188
|
const { type, config } = firstChildMeta;
|
|
189
189
|
if (firstChildMeta?.type !== 'Region') {
|
|
190
|
-
pConn.clearErrorMessages({
|
|
191
|
-
property: propName
|
|
190
|
+
pConn.clearErrorMessages({ // Need to add empty string for category and context to match typdef
|
|
191
|
+
property: propName,
|
|
192
|
+
category: '',
|
|
193
|
+
context: ''
|
|
192
194
|
});
|
|
193
195
|
if (!canBeChangedInReviewMode && isDisplayModeEnabled && selectionMode === SELECTION_MODE.SINGLE) {
|
|
194
196
|
return (
|
|
@@ -203,7 +205,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
203
205
|
referenceType={referenceType}
|
|
204
206
|
hideLabel={hideLabel}
|
|
205
207
|
dataRelationshipContext={
|
|
206
|
-
rawViewMetadata
|
|
208
|
+
rawViewMetadata["config"].contextClass && rawViewMetadata["config"].name ? rawViewMetadata["config"].name : null
|
|
207
209
|
}
|
|
208
210
|
/>
|
|
209
211
|
);
|
|
@@ -223,7 +225,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
223
225
|
// In the case of a datasource with parameters you cannot load the dropdown before the parameters
|
|
224
226
|
if (
|
|
225
227
|
type === 'Dropdown' &&
|
|
226
|
-
rawViewMetadata
|
|
228
|
+
rawViewMetadata["config"]?.parameters &&
|
|
227
229
|
dropDownDataSource === null
|
|
228
230
|
) {
|
|
229
231
|
return null;
|
|
@@ -238,19 +240,19 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
238
240
|
disabled: propsToUse.disabled,
|
|
239
241
|
label: propsToUse.label,
|
|
240
242
|
viewName: getPConnect().getCurrentView(),
|
|
241
|
-
parameters: rawViewMetadata
|
|
243
|
+
parameters: rawViewMetadata["config"].parameters,
|
|
242
244
|
readOnly: false,
|
|
243
|
-
localeReference: rawViewMetadata
|
|
245
|
+
localeReference: rawViewMetadata["config"].localeReference,
|
|
244
246
|
...(selectionMode === SELECTION_MODE.SINGLE ? { referenceType } : ''),
|
|
245
247
|
dataRelationshipContext:
|
|
246
|
-
rawViewMetadata
|
|
247
|
-
? rawViewMetadata
|
|
248
|
+
rawViewMetadata["config"].contextClass && rawViewMetadata["config"].name
|
|
249
|
+
? rawViewMetadata["config"].name
|
|
248
250
|
: null,
|
|
249
251
|
hideLabel,
|
|
250
252
|
onRecordChange: handleSelection
|
|
251
|
-
}
|
|
253
|
+
},
|
|
252
254
|
},
|
|
253
|
-
|
|
255
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
|
|
254
256
|
}
|
|
255
257
|
}, [
|
|
256
258
|
firstChildMeta.config?.datasource?.source,
|
|
@@ -262,7 +264,7 @@ export default function DataReference(props /* : DataReferenceProps */) {
|
|
|
262
264
|
|
|
263
265
|
// Only include the views region for rendering when it has content
|
|
264
266
|
if (firstChildMeta?.type !== 'Region') {
|
|
265
|
-
const viewsRegion = rawViewMetadata
|
|
267
|
+
const viewsRegion = rawViewMetadata["children"][1];
|
|
266
268
|
if (viewsRegion?.name === 'Views' && viewsRegion.children.length) {
|
|
267
269
|
childrenToRender = [recreatedFirstChild, ...children.slice(1)];
|
|
268
270
|
} else {
|
package/tests/assets/components/SDK-React/createAll/override-sdk/template/Details/Details.tsx
CHANGED
|
@@ -45,7 +45,7 @@ export default function Details(props /* : DetailsProps */) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
return getPConnect().createComponent(field,
|
|
48
|
-
'','', {}); // 2nd, 3rd, and 4th args empty string/object until typedef marked correctly as optional
|
|
48
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -47,7 +47,7 @@ export default function DetailsThreeColumn(props /* : DetailsThreeColumnProps */
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return getPConnect().createComponent(field,
|
|
50
|
-
|
|
50
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -48,7 +48,7 @@ export default function DetailsTwoColumn(props /* : DetailsTwoColumnProps */) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return getPConnect().createComponent(field,
|
|
51
|
-
|
|
51
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -23,7 +23,7 @@ export default function InlineDashboardPage(props: InlineDashboardPageProps) {
|
|
|
23
23
|
return Children.toArray(children);
|
|
24
24
|
}, [children]);
|
|
25
25
|
|
|
26
|
-
const allFilters = getPConnect().getRawMetadata()
|
|
26
|
+
const allFilters = getPConnect().getRawMetadata()["children"][1];
|
|
27
27
|
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
setFilterComponents(buildFilterComponents(getPConnect, allFilters));
|
|
@@ -29,7 +29,7 @@ export default function MultiReferenceReadOnly(props: MultiReferenceReadOnlyProp
|
|
|
29
29
|
hideLabel
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<React.Fragment>{component}</React.Fragment>
|
|
@@ -50,7 +50,7 @@ export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */)
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
return getPConnect().createComponent(field,
|
|
53
|
-
|
|
53
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -6,16 +6,18 @@ import ListView from '@pega/react-sdk-components/lib/components/template/ListVie
|
|
|
6
6
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
7
7
|
import './PromotedFilters.css';
|
|
8
8
|
|
|
9
|
-
import type { PConnProps } from '
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
// import type { PConnProps } from '../../../types/PConnProps';
|
|
10
|
+
|
|
11
|
+
// Can't use PromotedFilterProps until getContainerManager() knows about addTransientItem
|
|
12
|
+
// Currently just expects "object"
|
|
13
|
+
// interface PromotedFilterProps extends PConnProps {
|
|
14
|
+
// // If any, enter additional props that only exist on this component
|
|
15
|
+
// viewName: string,
|
|
16
|
+
// filters: Array<any>,
|
|
17
|
+
// listViewProps: any,
|
|
18
|
+
// pageClass: string,
|
|
19
|
+
// parameters?: object
|
|
20
|
+
// }
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
const localeCategory = 'SimpleTable';
|
|
@@ -65,7 +67,7 @@ function isValidInput(input) {
|
|
|
65
67
|
return Object.values(input).findIndex((v) => v) >= 0;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
export default function PromotedFilters(props: PromotedFilterProps) {
|
|
70
|
+
export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
69
71
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
70
72
|
const { getPConnect, viewName, filters, listViewProps, pageClass, parameters } = props;
|
|
71
73
|
const [initTable, setInitTable] = useState(false);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import FieldGroupTemplate from '@pega/react-sdk-components/lib/components/template/FieldGroupTemplate';
|
|
3
3
|
import SimpleTableManual from '@pega/react-sdk-components/lib/components/template/SimpleTable/SimpleTableManual';
|
|
4
|
-
import type { PConnProps } from '
|
|
5
|
-
|
|
6
|
-
interface SimpleTableProps extends PConnProps {
|
|
7
|
-
// If any, enter additional props that only exist on this component
|
|
8
|
-
multiRecordDisplayAs: string,
|
|
9
|
-
allowTableEdit: boolean,
|
|
10
|
-
contextClass: any
|
|
11
|
-
}
|
|
4
|
+
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
12
5
|
|
|
6
|
+
// Can't use SimpleTableProps until getComponentConfig() and getFieldMetadata() are NOT private
|
|
7
|
+
// interface SimpleTableProps extends PConnProps {
|
|
8
|
+
// // If any, enter additional props that only exist on this component
|
|
9
|
+
// multiRecordDisplayAs: string,
|
|
10
|
+
// allowTableEdit: boolean,
|
|
11
|
+
// contextClass: any
|
|
12
|
+
// }
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
export default function SimpleTable(props: SimpleTableProps) {
|
|
15
|
+
export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
16
16
|
const { getPConnect, multiRecordDisplayAs, allowTableEdit } = props;
|
|
17
17
|
|
|
18
18
|
let { contextClass } = props;
|
|
@@ -150,7 +150,7 @@ export default function SimpleTableManual(props: SimpleTableManualProps) {
|
|
|
150
150
|
// config.datasource (ex: "@ASSOCIATED .DeclarantChoice")
|
|
151
151
|
// Neither of these appear in the resolved props
|
|
152
152
|
|
|
153
|
-
const rawConfig = rawMetadata?.config;
|
|
153
|
+
const rawConfig = rawMetadata?.["config"];
|
|
154
154
|
const rawFields =
|
|
155
155
|
rawConfig?.children?.[0]?.children || rawConfig?.presets?.[0].children?.[0]?.children;
|
|
156
156
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
|
-
// Need to fix an error noted in comment below before typedefs will work correctly
|
|
5
4
|
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
6
5
|
// If any, enter additional props that only exist on this component
|
|
7
6
|
config: any,
|
|
@@ -56,7 +55,7 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
56
55
|
dataRelationshipContext
|
|
57
56
|
}
|
|
58
57
|
},
|
|
59
|
-
|
|
58
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
60
59
|
|
|
61
60
|
return (
|
|
62
61
|
<React.Fragment>{component}</React.Fragment>
|
|
@@ -5,7 +5,7 @@ import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react
|
|
|
5
5
|
import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
|
|
6
6
|
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
7
7
|
|
|
8
|
-
// Can't use PConnProps until
|
|
8
|
+
// Can't use PConnProps until PConnect.getChildren() type is ok
|
|
9
9
|
// interface WideNarrowDetailsProps extends PConnProps {
|
|
10
10
|
// // If any, enter additional props that only exist on this component
|
|
11
11
|
// showLabel?: boolean,
|
|
@@ -43,7 +43,7 @@ export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */)
|
|
|
43
43
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
44
44
|
let highlightedDataArr = [];
|
|
45
45
|
if (showHighlightedData) {
|
|
46
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata()
|
|
46
|
+
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
47
47
|
highlightedDataArr = highlightedData.map(field => {
|
|
48
48
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
49
49
|
|
|
@@ -54,7 +54,7 @@ export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */)
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
return getPConnect().createComponent(field,
|
|
57
|
-
|
|
57
|
+
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
|
package/tests/assets/components/SDK-React/createAll/override-sdk/widget/Attachment/Attachment.tsx
CHANGED
|
@@ -44,7 +44,7 @@ export default function Attachment(props /* :AttachmentProps */) {
|
|
|
44
44
|
categoryName = value.pyCategoryName;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
let valueRef = pConn.getStateProps()
|
|
47
|
+
let valueRef = pConn.getStateProps()["value"];
|
|
48
48
|
valueRef = valueRef.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
49
49
|
const [file, setFile] = useState(fileTemp);
|
|
50
50
|
|
|
@@ -254,7 +254,7 @@ export default function Attachment(props /* :AttachmentProps */) {
|
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
|
-
const fieldName = pConn.getStateProps()
|
|
257
|
+
const fieldName = pConn.getStateProps()["value"];
|
|
258
258
|
const context = pConn.getContextName();
|
|
259
259
|
|
|
260
260
|
PCore.getMessageManager().clearMessages({
|