@pega/dx-component-builder-sdk 0.23.6 → 0.23.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/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 +10 -6
- 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 +17 -25
- 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 +16 -35
- package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/RichText.tsx +95 -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 +73 -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 +2 -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 +4 -1
- 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 +43 -64
- 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 +4 -1
- package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTable/SimpleTable.tsx +88 -5
- 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 -18
- 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 +5 -1
- 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 +10 -6
- 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 +17 -25
- 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 +16 -35
- package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/RichText.tsx +95 -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 +25 -18
- 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 +4 -1
- 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 +6 -2
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/Details/Details.tsx +5 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +5 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +5 -1
- 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 +5 -1
- 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 +4 -1
- package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTable/SimpleTable.tsx +88 -5
- 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 +5 -1
- 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 +5 -1
- 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 +1 -1
- package/tests/functional/localCreateBuildDeleteOverride.test.js +2 -1
- package/tests/functional/localCreatePublishAllDeleteAllCustom.test.js +1 -2
- package/tests/functional/localCreatePublishAllDeleteAllOverride.test.js +0 -4
- package/tests/functional/localCreatePublishDeleteOverride.test.js +2 -5
|
@@ -13,13 +13,49 @@ export const formatConstants = {
|
|
|
13
13
|
WorkLink: 'WorkLink',
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
class DataApi {
|
|
17
|
+
mappedPropertyToOriginalProperty: any;
|
|
18
|
+
originalPropertyToMappedProperty: any;
|
|
19
|
+
constructor() {
|
|
20
|
+
;
|
|
21
|
+
this.originalPropertyToMappedProperty = {};
|
|
22
|
+
this.mappedPropertyToOriginalProperty = {};
|
|
23
|
+
this.setPropertyMaps = this.setPropertyMaps.bind(this);
|
|
24
|
+
this.getMappedProperty = this.getMappedProperty.bind(this);
|
|
25
|
+
this.getOriginalProperty = this.getOriginalProperty.bind(this);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
setPropertyMaps(originalToMappedPropertyObj = {}, mappedToOriginalPropertyObj = {}) {
|
|
29
|
+
this.originalPropertyToMappedProperty = {
|
|
30
|
+
...this.originalPropertyToMappedProperty,
|
|
31
|
+
...originalToMappedPropertyObj
|
|
32
|
+
};
|
|
33
|
+
this.mappedPropertyToOriginalProperty = {
|
|
34
|
+
...this.mappedPropertyToOriginalProperty,
|
|
35
|
+
...mappedToOriginalPropertyObj
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getMappedProperty(propertyName) {
|
|
40
|
+
return this.originalPropertyToMappedProperty[propertyName] ?? propertyName;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getOriginalProperty(propertyName) {
|
|
44
|
+
return this.mappedPropertyToOriginalProperty[propertyName] ?? propertyName;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
16
48
|
export async function getContext(componentConfig) {
|
|
17
49
|
const {
|
|
18
50
|
promisesArray = [], // array of promises which can be invoked paralelly,
|
|
19
51
|
} = componentConfig;
|
|
20
52
|
const promisesResponseArray = await Promise.all(promisesArray);
|
|
53
|
+
const dataApi = new DataApi();
|
|
21
54
|
return {
|
|
22
55
|
promisesResponseArray,
|
|
56
|
+
setPropertyMaps: dataApi.setPropertyMaps,
|
|
57
|
+
getMappedProperty: dataApi.getMappedProperty,
|
|
58
|
+
getOriginalProperty: dataApi.getOriginalProperty,
|
|
23
59
|
};
|
|
24
60
|
}
|
|
25
61
|
|
|
@@ -34,7 +70,7 @@ export async function getContext(componentConfig) {
|
|
|
34
70
|
* getFieldNameFromEmbeddedFieldName('!P!Organisation:Name') return 'Organisation.Name'
|
|
35
71
|
* getFieldNameFromEmbeddedFieldName('!PL!Employees:Name') return 'Employees.Name'
|
|
36
72
|
*/
|
|
37
|
-
|
|
73
|
+
export function getFieldNameFromEmbeddedFieldName(propertyName) {
|
|
38
74
|
let value = propertyName;
|
|
39
75
|
if (value.startsWith(PAGE) || value.startsWith(PAGELIST)) {
|
|
40
76
|
value = value.substring(value.lastIndexOf('!') + 1);
|
|
@@ -49,7 +85,7 @@ export async function getContext(componentConfig) {
|
|
|
49
85
|
* @ignore
|
|
50
86
|
* @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
|
|
51
87
|
*/
|
|
52
|
-
|
|
88
|
+
export function updateMetaEmbeddedFieldID(metaFields) {
|
|
53
89
|
return metaFields.forEach((metaField) => {
|
|
54
90
|
if (metaField.fieldID?.startsWith(PAGE) || metaField.fieldID?.startsWith(PAGELIST)) {
|
|
55
91
|
metaField.fieldID = getFieldNameFromEmbeddedFieldName(metaField.fieldID);
|
|
@@ -65,6 +101,94 @@ export const isEmbeddedField = (field) => {
|
|
|
65
101
|
return field?.indexOf('.') > 0;
|
|
66
102
|
};
|
|
67
103
|
|
|
104
|
+
/**
|
|
105
|
+
* [isPageListProperty]
|
|
106
|
+
* Description - checking if propertyName is pageList or not
|
|
107
|
+
* @ignore
|
|
108
|
+
* @param {string} propertyName PropertyName
|
|
109
|
+
* @returns {boolean} true if property is pageList else false
|
|
110
|
+
*
|
|
111
|
+
* @example <caption>Example for isPageListProperty </caption>
|
|
112
|
+
* isPageListProperty('!PL!Employees.Name') return true
|
|
113
|
+
* isPageListProperty('!P!Employees.Name') return false
|
|
114
|
+
* isPageListProperty('Name') return false
|
|
115
|
+
*/
|
|
116
|
+
export function isPageListProperty(propertyName) {
|
|
117
|
+
return propertyName.startsWith(PAGELIST);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const isPageListInPath = (propertyName, currentClassID) => {
|
|
121
|
+
if (!propertyName.includes('.')) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const [first, ...rest] = propertyName.split('.');
|
|
125
|
+
const metadata = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
|
|
126
|
+
if (metadata?.type === 'Page List') {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
return isPageListInPath(rest.join('.'), metadata?.pageClass);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* [getEmbeddedFieldName]
|
|
134
|
+
* Description - converting normal field name to embedded field starting with !P! or !PL!
|
|
135
|
+
* @ignore
|
|
136
|
+
* @param {string} propertyName Field name
|
|
137
|
+
* @param {string} classID classID of datapage
|
|
138
|
+
* @returns {string} returns converted string with !P! or !PL! and :
|
|
139
|
+
*
|
|
140
|
+
* @example <caption>Example for getEmbeddedFieldName </caption>
|
|
141
|
+
* For page property, getEmbeddedFieldName('Organisation.Name') return '!P!Organisation:Name'
|
|
142
|
+
* For pageList property, getEmbeddedFieldName('Employees.Name') return '!PL!Employees:Name'
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
export function getEmbeddedFieldName(propertyName, classID) {
|
|
146
|
+
let value = propertyName;
|
|
147
|
+
if (isPageListInPath(value, classID)) {
|
|
148
|
+
value = `!PL!${value.replace(/\./g, ':')}`;
|
|
149
|
+
} else {
|
|
150
|
+
value = `!P!${value.replace(/\./g, ':')}`;
|
|
151
|
+
}
|
|
152
|
+
return value;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* [preparePropertyMaps]
|
|
157
|
+
* Description - preparing maps for property names and set it in dataApi context
|
|
158
|
+
* @ignore
|
|
159
|
+
* @param {Array} fields fields array
|
|
160
|
+
* @param {string} classID classID of datapage
|
|
161
|
+
* @param {string} context dataApi context
|
|
162
|
+
* @returns {boolean} true if pageListProperty is present
|
|
163
|
+
*/
|
|
164
|
+
export function preparePropertyMaps(fields, classID, context) {
|
|
165
|
+
const { setPropertyMaps } = context;
|
|
166
|
+
const maps = fields.reduce(
|
|
167
|
+
(acc, field) => {
|
|
168
|
+
let { value } = field.config;
|
|
169
|
+
if (value.startsWith('@')) {
|
|
170
|
+
value = value.substring(value.indexOf(' ') + 1);
|
|
171
|
+
if (value[0] === '.') value = value.substring(1);
|
|
172
|
+
}
|
|
173
|
+
let name = value;
|
|
174
|
+
// Preparing name for embedded property
|
|
175
|
+
if (isEmbeddedField(name)) {
|
|
176
|
+
name = getEmbeddedFieldName(name, classID);
|
|
177
|
+
}
|
|
178
|
+
if (isPageListProperty(name) && !acc[2]) {
|
|
179
|
+
acc[2] = true;
|
|
180
|
+
}
|
|
181
|
+
acc[0][value] = name;
|
|
182
|
+
acc[1][name] = value;
|
|
183
|
+
|
|
184
|
+
return acc;
|
|
185
|
+
},
|
|
186
|
+
[{}, {}, false]
|
|
187
|
+
);
|
|
188
|
+
setPropertyMaps(maps[0], maps[1]);
|
|
189
|
+
return maps[2];
|
|
190
|
+
}
|
|
191
|
+
|
|
68
192
|
/**
|
|
69
193
|
* [getConfigEmbeddedFieldsMeta]
|
|
70
194
|
* Description - Get the metadata for configured embedded fields
|
|
@@ -74,7 +198,7 @@ export const isEmbeddedField = (field) => {
|
|
|
74
198
|
* @returns {Array} Metadata of configured embedded fields
|
|
75
199
|
*/
|
|
76
200
|
export function getConfigEmbeddedFieldsMeta(configFields, classID) {
|
|
77
|
-
const configEmbeddedFieldsMeta:Array<any> = [];
|
|
201
|
+
const configEmbeddedFieldsMeta: Array<any> = [];
|
|
78
202
|
configFields.forEach((field) => {
|
|
79
203
|
let value = field;
|
|
80
204
|
if (isEmbeddedField(value)) {
|
|
@@ -117,7 +241,7 @@ const oldToNewFieldTypeMapping = {
|
|
|
117
241
|
* @ignore
|
|
118
242
|
* @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
|
|
119
243
|
*/
|
|
120
|
-
|
|
244
|
+
function updateFieldType(metaFields) {
|
|
121
245
|
metaFields.forEach((metaField) => {
|
|
122
246
|
if (metaField.type) metaField.type = oldToNewFieldTypeMapping[metaField.type] || metaField.type;
|
|
123
247
|
});
|
|
@@ -143,7 +267,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
143
267
|
* @param {string} classID Class ID from the response
|
|
144
268
|
* @returns {Array} List of fields with updated meta objects.
|
|
145
269
|
*/
|
|
146
|
-
|
|
270
|
+
function generateViewMetaData(rawFields, classID, showField) {
|
|
147
271
|
return rawFields.map((item) => getDefaultViewMeta(item, classID, showField));
|
|
148
272
|
}
|
|
149
273
|
|
|
@@ -157,7 +281,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
157
281
|
* @param {string} classID Class ID from the response
|
|
158
282
|
* @returns {Array} List of all fields with their meta updated.
|
|
159
283
|
*/
|
|
160
|
-
|
|
284
|
+
function getConfigFields(configFields, primaryFields, metaFields, classID) {
|
|
161
285
|
const presetConfigFields = configFields;
|
|
162
286
|
const primaryFieldsViewIndex = presetConfigFields.findIndex((field) => field.config.value === 'pyPrimaryFields');
|
|
163
287
|
if (!primaryFields || !primaryFields.length) {
|
|
@@ -174,9 +298,9 @@ function getPresetMetaAttribute(attribute) {
|
|
|
174
298
|
(primaryField) =>
|
|
175
299
|
!presetConfigFields.some((presetConfigField) => presetConfigField.config.value.split('.')[1] === primaryField)
|
|
176
300
|
);
|
|
177
|
-
const uncommonFieldsRawMeta:Array<any> = [];
|
|
301
|
+
const uncommonFieldsRawMeta: Array<any> = [];
|
|
178
302
|
uncommonFieldsList.forEach((uncommonField) => {
|
|
179
|
-
const uncommonFieldMeta= metaFields.find((metaField) => metaField.fieldID === uncommonField);
|
|
303
|
+
const uncommonFieldMeta = metaFields.find((metaField) => metaField.fieldID === uncommonField);
|
|
180
304
|
if (uncommonFieldMeta) uncommonFieldsRawMeta.push(uncommonFieldMeta);
|
|
181
305
|
});
|
|
182
306
|
const uncommonFieldsConfigMeta = generateViewMetaData(uncommonFieldsRawMeta, classID, true);
|
|
@@ -198,7 +322,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
198
322
|
* @param {Array} metaFields List of all metafields
|
|
199
323
|
* @returns {object} Table config object
|
|
200
324
|
*/
|
|
201
|
-
|
|
325
|
+
export function getTableConfigFromPresetMeta(
|
|
202
326
|
presetMeta,
|
|
203
327
|
isMetaWithPresets,
|
|
204
328
|
getPConnect,
|
|
@@ -283,7 +407,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
283
407
|
* @param {object} response -
|
|
284
408
|
* @returns {Set} Set of columns from the report response
|
|
285
409
|
*/
|
|
286
|
-
|
|
410
|
+
function getReportColumns(response) {
|
|
287
411
|
const {
|
|
288
412
|
data: { data: reportColumns }
|
|
289
413
|
} = response;
|
|
@@ -307,7 +431,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
307
431
|
* config.value - Raw value
|
|
308
432
|
* @returns {string} value - Value with out any annotations or "."
|
|
309
433
|
*/
|
|
310
|
-
|
|
434
|
+
function getConfigFieldValue(config) {
|
|
311
435
|
let { value } = config;
|
|
312
436
|
if (value.startsWith('@')) {
|
|
313
437
|
value = value.substring(value.indexOf(' ') + 1);
|
|
@@ -342,7 +466,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
342
466
|
* @param {string} fieldID Filter
|
|
343
467
|
* @returns {object} config with its field value equal to fieldID, which means an authored field
|
|
344
468
|
*/
|
|
345
|
-
|
|
469
|
+
function findAuthoredField(configFields, fieldID) {
|
|
346
470
|
return configFields.find((configField) => {
|
|
347
471
|
const val = getConfigFieldValue(configField.config);
|
|
348
472
|
return val === fieldID;
|
|
@@ -357,7 +481,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
357
481
|
* @param {object} item Field item to copy displayAs and category information
|
|
358
482
|
* @param {string} classId classID from the response
|
|
359
483
|
*/
|
|
360
|
-
|
|
484
|
+
function findAndUpdateAuthoredFieldConfig(configFields, item, classId) {
|
|
361
485
|
const authoredField = findAuthoredField(configFields, item.fieldID);
|
|
362
486
|
if (authoredField?.config) {
|
|
363
487
|
if (item.displayAs) {
|
|
@@ -389,7 +513,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
389
513
|
* @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
|
|
390
514
|
* @returns {boolean} true If the field is an extra field else false.
|
|
391
515
|
*/
|
|
392
|
-
|
|
516
|
+
function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classId, showDynamicFields) {
|
|
393
517
|
// Is the field already present in authoring metadata?
|
|
394
518
|
// Mutates config fields to copy displayAs and category information
|
|
395
519
|
if (configFieldSet.has(item.fieldID)) {
|
|
@@ -413,7 +537,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
413
537
|
* @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
|
|
414
538
|
* @returns {Array} List of extra fields with their meta updated.
|
|
415
539
|
*/
|
|
416
|
-
|
|
540
|
+
function prepareExtraFields(
|
|
417
541
|
metaFields,
|
|
418
542
|
configFields,
|
|
419
543
|
configFieldSet,
|
|
@@ -446,8 +570,8 @@ function populateRenderingOptions(name, config, field) {
|
|
|
446
570
|
}
|
|
447
571
|
}
|
|
448
572
|
export function initializeColumns(
|
|
449
|
-
fields:Array<any> = [],
|
|
450
|
-
getMappedProperty:any = null
|
|
573
|
+
fields: Array<any> = [],
|
|
574
|
+
getMappedProperty: any = null
|
|
451
575
|
) {
|
|
452
576
|
return fields.map((field, originalColIndex) => {
|
|
453
577
|
let name = field.config.value;
|
|
@@ -497,9 +621,9 @@ export const getItemKey = (fields) => {
|
|
|
497
621
|
};
|
|
498
622
|
|
|
499
623
|
export function preparePatchQueryFields(fields, isDataObject = false, classID = '') {
|
|
500
|
-
const queryFields:Array<any> = [];
|
|
624
|
+
const queryFields: Array<any> = [];
|
|
501
625
|
fields.forEach((field) => {
|
|
502
|
-
const patchFields:Array<any> = [];
|
|
626
|
+
const patchFields: Array<any> = [];
|
|
503
627
|
if (field.cellRenderer === 'WorkLink') {
|
|
504
628
|
if (field.customObject && field.customObject.isAssignmentLink) {
|
|
505
629
|
const associationName = field.name.includes(':') ? `${field.name.split(':')[0]}:` : '';
|
|
@@ -532,6 +656,23 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
|
|
|
532
656
|
return queryFields;
|
|
533
657
|
}
|
|
534
658
|
|
|
659
|
+
/**
|
|
660
|
+
* Update the renderer type for the properties of type Page.
|
|
661
|
+
*/
|
|
662
|
+
export function updatePageFieldsConfig(configFields, parentClassID) {
|
|
663
|
+
return configFields.forEach((item) => {
|
|
664
|
+
const {
|
|
665
|
+
type,
|
|
666
|
+
config: { value }
|
|
667
|
+
} = item;
|
|
668
|
+
const propertyName = PCore.getAnnotationUtils().getPropertyName(value);
|
|
669
|
+
if (isEmbeddedField(value) && !isPageListInPath(propertyName, parentClassID)) {
|
|
670
|
+
item.config.componentType = type;
|
|
671
|
+
item.type = 'PagePropertyRenderer';
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
|
|
535
676
|
export const readContextResponse = async (context, params) => {
|
|
536
677
|
const {
|
|
537
678
|
getPConnect,
|
|
@@ -544,7 +685,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
544
685
|
} = params;
|
|
545
686
|
const { promisesResponseArray, apiContext: otherContext } = context;
|
|
546
687
|
// eslint-disable-next-line sonarjs/no-unused-collection
|
|
547
|
-
const listOfComponents:Array<any> = [];
|
|
688
|
+
const listOfComponents: Array<any> = [];
|
|
548
689
|
const {
|
|
549
690
|
data: { fields: metaFields, classID, isQueryable }
|
|
550
691
|
} = promisesResponseArray[0];
|
|
@@ -564,7 +705,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
564
705
|
|
|
565
706
|
|
|
566
707
|
if (isDataObject) {
|
|
567
|
-
const compositeKeys:Array<any> = [];
|
|
708
|
+
const compositeKeys: Array<any> = [];
|
|
568
709
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
569
710
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
570
711
|
dataPageKeys?.forEach((item) =>
|
|
@@ -619,13 +760,19 @@ export const readContextResponse = async (context, params) => {
|
|
|
619
760
|
showDynamicFields
|
|
620
761
|
);
|
|
621
762
|
|
|
763
|
+
if (isQueryable) {
|
|
764
|
+
updatePageFieldsConfig(configFields, classID);
|
|
765
|
+
preparePropertyMaps([...configFields, ...extraFields], classID, context);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
const { getMappedProperty } = context;
|
|
622
769
|
|
|
623
770
|
fields = initializeColumns(
|
|
624
|
-
[...configFields, ...extraFields],
|
|
771
|
+
[...configFields, ...extraFields], getMappedProperty
|
|
625
772
|
);
|
|
626
773
|
const patchQueryFields = preparePatchQueryFields(fields, isDataObject, classID);
|
|
627
774
|
const itemKey = getItemKey(fields);
|
|
628
|
-
tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable}
|
|
775
|
+
tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable };
|
|
629
776
|
});
|
|
630
777
|
const meta = tableConfig;
|
|
631
778
|
setListContext({
|
|
@@ -2,7 +2,8 @@ import React, { createElement } from 'react';
|
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import { GridSize } from '@material-ui/core/Grid';
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
6
7
|
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
7
8
|
|
|
8
9
|
// Can't use PConnProps until getPConnect().getChildren() type is ok
|
|
@@ -17,6 +18,9 @@ import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemEx
|
|
|
17
18
|
const COLUMN_WIDTHS = [4, 8];
|
|
18
19
|
|
|
19
20
|
export default function NarrowWideDetails(props /* : NarrowWideDetailsProps */) {
|
|
21
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
22
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
23
|
+
|
|
20
24
|
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
21
25
|
|
|
22
26
|
// Get the inherited props from the parent to determine label settings
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Children } from "react";
|
|
2
2
|
// import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
|
|
3
|
-
import
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
// NarrowWidePage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
@@ -18,6 +18,9 @@ interface NarrowWidePageProps {
|
|
|
18
18
|
* to the Cosmos template.
|
|
19
19
|
*/
|
|
20
20
|
export default function NarrowWidePage(props: NarrowWidePageProps) {
|
|
21
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
22
|
+
const NarrowWide = getComponentFromMap('NarrowWide');
|
|
23
|
+
|
|
21
24
|
const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
|
|
22
25
|
const childArray = Children.toArray(children);
|
|
23
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
3
|
|
|
4
4
|
// OneColumnPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
5
5
|
interface OneColumnPageProps{
|
|
@@ -13,6 +13,8 @@ interface OneColumnPageProps{
|
|
|
13
13
|
* and mapping to the TwoColumn template.
|
|
14
14
|
*/
|
|
15
15
|
export default function OneColumnPage(props: OneColumnPageProps) {
|
|
16
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
17
|
+
const OneColumn = getComponentFromMap('OneColumn');
|
|
16
18
|
|
|
17
19
|
return (
|
|
18
20
|
<OneColumn
|
|
@@ -2,8 +2,8 @@ import React, { useCallback, useMemo, useState, createElement, Fragment } from '
|
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
|
-
import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
|
|
6
5
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
6
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import './PromotedFilters.css';
|
|
8
8
|
|
|
9
9
|
// import type { PConnProps } from '../../../types/PConnProps';
|
|
@@ -68,6 +68,9 @@ function isValidInput(input) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
71
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
72
|
+
const ListView = getComponentFromMap('ListView');
|
|
73
|
+
|
|
71
74
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
72
75
|
const { getPConnect, viewName, filters, listViewProps, pageClass, parameters } = props;
|
|
73
76
|
const [initTable, setInitTable] = useState(false);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
3
|
+
import { buildMetaForListView, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
|
|
4
|
+
import { useRef } from 'react';
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
4
7
|
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
5
8
|
|
|
6
9
|
// Can't use SimpleTableProps until getComponentConfig() and getFieldMetadata() are NOT private
|
|
@@ -10,10 +13,30 @@ import SimpleTableManual from '@pega/react-sdk-components/lib/components/templat
|
|
|
10
13
|
// allowTableEdit: boolean,
|
|
11
14
|
// contextClass: any
|
|
12
15
|
// }
|
|
13
|
-
|
|
16
|
+
declare const PCore: any;
|
|
14
17
|
|
|
15
18
|
export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
16
|
-
|
|
19
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
+
const ListView = getComponentFromMap('ListView');
|
|
21
|
+
const FieldGroupTemplate = getComponentFromMap('FieldGroupTemplate');
|
|
22
|
+
const SimpleTableManual = getComponentFromMap('SimpleTableManual');
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
getPConnect,
|
|
26
|
+
multiRecordDisplayAs,
|
|
27
|
+
allowTableEdit,
|
|
28
|
+
label: labelProp,
|
|
29
|
+
propertyLabel,
|
|
30
|
+
displayMode,
|
|
31
|
+
fieldMetadata,
|
|
32
|
+
hideLabel,
|
|
33
|
+
parameters,
|
|
34
|
+
isDataObject,
|
|
35
|
+
type,
|
|
36
|
+
ruleClass,
|
|
37
|
+
authorContext,
|
|
38
|
+
name
|
|
39
|
+
} = props;
|
|
17
40
|
|
|
18
41
|
let { contextClass } = props;
|
|
19
42
|
if (!contextClass) {
|
|
@@ -30,8 +53,68 @@ export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
|
30
53
|
if (multiRecordDisplayAs === 'fieldGroup') {
|
|
31
54
|
const fieldGroupProps = { ...props, contextClass };
|
|
32
55
|
return <FieldGroupTemplate {...fieldGroupProps} />;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const label = labelProp || propertyLabel;
|
|
59
|
+
const propsToUse = { label, ...getPConnect().getInheritedProps() };
|
|
60
|
+
const isDisplayModeEnabled = displayMode === 'DISPLAY_ONLY';
|
|
61
|
+
|
|
62
|
+
if (
|
|
63
|
+
fieldMetadata &&
|
|
64
|
+
fieldMetadata.type === 'Page List' &&
|
|
65
|
+
fieldMetadata.dataRetrievalType === 'refer'
|
|
66
|
+
) {
|
|
67
|
+
const {
|
|
68
|
+
children: [{ children: rawFields }],
|
|
69
|
+
parameters: rawParams
|
|
70
|
+
} = getPConnect().getRawMetadata().config;
|
|
71
|
+
if (isDisplayModeEnabled && hideLabel) {
|
|
72
|
+
propsToUse.label = '';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const metaForListView = buildMetaForListView(
|
|
76
|
+
fieldMetadata,
|
|
77
|
+
rawFields,
|
|
78
|
+
type,
|
|
79
|
+
ruleClass,
|
|
80
|
+
name,
|
|
81
|
+
propsToUse.label,
|
|
82
|
+
isDataObject,
|
|
83
|
+
parameters // resolved params
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const metaForPConnect = JSON.parse(JSON.stringify(metaForListView));
|
|
87
|
+
metaForPConnect.config.parameters =
|
|
88
|
+
rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
|
|
89
|
+
|
|
90
|
+
const { referenceListStr: referenceList } = getContext(getPConnect());
|
|
91
|
+
let requiredContextForQueryInDisplayMode = {};
|
|
92
|
+
if (isDisplayModeEnabled) {
|
|
93
|
+
requiredContextForQueryInDisplayMode = {
|
|
94
|
+
referenceList
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const options = {
|
|
98
|
+
context: getPConnect().getContextName(),
|
|
99
|
+
pageReference: getPConnect().getPageReference(),
|
|
100
|
+
...requiredContextForQueryInDisplayMode
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const refToPConnect = useRef(
|
|
104
|
+
PCore.createPConnect({ meta: metaForPConnect, options }).getPConnect
|
|
105
|
+
).current; // getPConnect should be created only once.
|
|
106
|
+
/* BUG-637178 : need to send context */
|
|
107
|
+
const listViewProps = {
|
|
108
|
+
...metaForListView.config,
|
|
109
|
+
getPConnect: refToPConnect,
|
|
110
|
+
displayMode,
|
|
111
|
+
fieldName: authorContext,
|
|
112
|
+
bInForm: true
|
|
113
|
+
};
|
|
114
|
+
const listViewComponent = <ListView {...listViewProps} />;
|
|
115
|
+
return listViewComponent;
|
|
33
116
|
} else {
|
|
34
|
-
const simpleTableManualProps = {...props, contextClass
|
|
117
|
+
const simpleTableManualProps = { ...props, contextClass };
|
|
35
118
|
if (allowTableEdit === false) {
|
|
36
119
|
simpleTableManualProps.hideAddRow = true;
|
|
37
120
|
simpleTableManualProps.hideDeleteRow = true;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import SimpleTable from '@pega/react-sdk-components/lib/components/template/SimpleTable/SimpleTable';
|
|
4
|
-
|
|
5
|
-
import PromotedFilters from '@pega/react-sdk-components/lib/components/template/PromotedFilters';
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
3
|
|
|
7
4
|
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
8
5
|
|
|
@@ -31,6 +28,11 @@ const isSelfReferencedProperty = (param, referenceProp) => {
|
|
|
31
28
|
* @param {*} props - props
|
|
32
29
|
*/
|
|
33
30
|
export default function SimpleTableSelect(props /* : SimpleTableSelectProps */) {
|
|
31
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
32
|
+
const ListView = getComponentFromMap('ListView');
|
|
33
|
+
const SimpleTable = getComponentFromMap('SimpleTable');
|
|
34
|
+
const PromotedFilters = getComponentFromMap('PromotedFilters');
|
|
35
|
+
|
|
34
36
|
const { label, getPConnect, renderMode = '', showLabel = true, viewName = '', parameters, dataRelationshipContext = null } = props;
|
|
35
37
|
|
|
36
38
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import TwoColumn from '@pega/react-sdk-components/lib/components/template/TwoColumn/TwoColumn';
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
3
|
|
|
5
4
|
// TwoColumnPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
5
|
interface TwoColumnPageProps{
|
|
@@ -14,6 +13,8 @@ interface TwoColumnPageProps{
|
|
|
14
13
|
* and mapping to the TwoColumn template.
|
|
15
14
|
*/
|
|
16
15
|
export default function TwoColumnPage(props: TwoColumnPageProps) {
|
|
16
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
17
|
+
const TwoColumn = getComponentFromMap('TwoColumn');
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
20
|
<TwoColumn
|
|
@@ -2,7 +2,8 @@ import React, { createElement } from 'react';
|
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import { GridSize } from '@material-ui/core/Grid';
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
6
7
|
// import type { PConnProps } from '../../../../types/PConnProps';
|
|
7
8
|
|
|
8
9
|
// Can't use PConnProps until PConnect.getChildren() type is ok
|
|
@@ -16,6 +17,9 @@ import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemEx
|
|
|
16
17
|
const COLUMN_WIDTHS = [8, 4];
|
|
17
18
|
|
|
18
19
|
export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */) {
|
|
20
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
21
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
22
|
+
|
|
19
23
|
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
20
24
|
|
|
21
25
|
// Get the inherited props from the parent to determine label settings
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { Children } from "react";
|
|
2
|
-
|
|
3
|
-
// import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
|
|
4
|
-
import WideNarrow from '@pega/react-sdk-components/lib/components/template/WideNarrow/WideNarrow';
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
3
|
|
|
6
4
|
// WideNarrowPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
7
5
|
interface WideNarrowPageProps {
|
|
@@ -18,6 +16,9 @@ interface WideNarrowPageProps {
|
|
|
18
16
|
* to the Cosmos template.
|
|
19
17
|
*/
|
|
20
18
|
export default function WideNarrowPage(props: WideNarrowPageProps) {
|
|
19
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
+
const WideNarrow = getComponentFromMap('WideNarrow');
|
|
21
|
+
|
|
21
22
|
const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
|
|
22
23
|
const childArray = Children.toArray(children);
|
|
23
24
|
|
package/tests/assets/components/SDK-React/createAll/override-sdk/widget/Attachment/Attachment.tsx
CHANGED
|
@@ -4,9 +4,10 @@ import { Button } from '@material-ui/core';
|
|
|
4
4
|
import React, { useState, useEffect } from 'react';
|
|
5
5
|
import { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize, getIconForAttachment } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
|
|
6
6
|
import './Attachment.css';
|
|
7
|
-
import SummaryList from '@pega/react-sdk-components/lib/components/widget/SummaryList'
|
|
8
7
|
import { CircularProgress } from "@material-ui/core";
|
|
9
8
|
import download from "downloadjs";
|
|
9
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
10
|
+
|
|
10
11
|
// import type { PConnProps } from '../../../types/PConnProps';
|
|
11
12
|
|
|
12
13
|
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 2 errors)
|
|
@@ -27,6 +28,9 @@ function getCurrentAttachmentsList(key, context) {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export default function Attachment(props /* :AttachmentProps */) {
|
|
31
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
32
|
+
const SummaryList = getComponentFromMap('SummaryList');
|
|
33
|
+
|
|
30
34
|
const PCoreVersion = PCore.getPCoreVersion();
|
|
31
35
|
const {value, getPConnect, label, validatemessage} = props;
|
|
32
36
|
/* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */
|