@pega/react-sdk-overrides 0.23.25 → 0.23.27
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/LICENSE +201 -0
- package/README.md +17 -0
- package/SECURITY.md +10 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +39 -0
- package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/lib/designSystemExtension/Banner/Banner.css +4 -0
- package/lib/designSystemExtension/Banner/Banner.tsx +33 -16
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +13 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
- package/lib/designSystemExtension/Operator/Operator.tsx +106 -87
- package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
- package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +6 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
- package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +21 -15
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +29 -19
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +27 -38
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +10 -18
- package/lib/field/Date/Date.tsx +33 -15
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +22 -11
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +64 -17
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +154 -18
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +16 -7
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +37 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +15 -6
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/Percentage/Percentage.tsx +14 -6
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +17 -7
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +55 -24
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +96 -0
- package/lib/field/RichText/index.tsx +1 -0
- package/lib/field/ScalarList/ScalarList.tsx +63 -0
- package/lib/field/ScalarList/config-ext.json +7 -0
- package/lib/field/ScalarList/index.tsx +1 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -10
- package/lib/field/TextArea/TextArea.tsx +15 -5
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +9 -2
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +41 -10
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +21 -18
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +23 -6
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +52 -58
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +16 -11
- package/lib/helpers/case-utils.tsx +99 -0
- package/lib/helpers/common-utils.ts +8 -0
- package/lib/helpers/data_page.ts +3 -6
- package/lib/helpers/date-format-utils.ts +29 -19
- package/lib/helpers/{event-utils.js → event-utils.ts} +4 -4
- package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +9 -10
- package/lib/helpers/formatters/Boolean.ts +21 -0
- package/lib/helpers/formatters/{Currency.js → Currency.ts} +22 -27
- package/lib/helpers/formatters/CurrencyMap.ts +915 -0
- package/lib/helpers/formatters/{Date.js → Date.ts} +20 -26
- package/lib/helpers/formatters/{common.js → common.ts} +3 -4
- package/lib/helpers/formatters/{index.js → index.ts} +22 -22
- package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +2 -2
- package/lib/helpers/simpleTableHelpers.ts +65 -85
- package/lib/helpers/state-utils.tsx +43 -0
- package/lib/helpers/template-utils.ts +4 -8
- package/lib/helpers/utils.ts +16 -8
- package/lib/helpers/versionHelpers.ts +1 -5
- package/lib/infra/ActionButtons/ActionButtons.tsx +46 -42
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -84
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +98 -232
- package/lib/infra/Containers/FlowContainer/helpers.ts +138 -0
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +66 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +105 -70
- package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
- package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
- package/lib/infra/Containers/SimpleView/helper.ts +125 -0
- package/lib/infra/Containers/SimpleView/index.tsx +1 -0
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +49 -64
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +26 -51
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -40
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -31
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +25 -38
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +180 -216
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +28 -43
- package/lib/infra/Reference/Reference.tsx +16 -22
- package/lib/infra/Region/Region.tsx +9 -9
- package/lib/infra/RootContainer/RootContainer.tsx +82 -125
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +38 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
- package/lib/infra/View/View.tsx +34 -65
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +51 -69
- package/lib/template/BannerPage/BannerPage.tsx +26 -33
- package/lib/template/CaseSummary/CaseSummary.tsx +23 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +122 -114
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +46 -35
- package/lib/template/Confirmation/Confirmation.tsx +25 -53
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +112 -140
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +26 -20
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/DefaultForm/utils/index.ts +33 -0
- package/lib/template/Details/Details/Details.tsx +24 -28
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
- package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/lib/template/Details/DynamicTabs/config.json +36 -0
- package/lib/template/Details/DynamicTabs/index.tsx +1 -0
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -34
- package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
- package/lib/template/ListPage/ListPage.tsx +12 -16
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +1 -3
- package/lib/template/ListView/ListView.tsx +245 -306
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/{hooks.js → hooks.ts} +24 -24
- package/lib/template/ListView/{utils.js → utils.ts} +202 -91
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -30
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
- package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +17 -19
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +44 -34
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +115 -14
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +171 -100
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +34 -40
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
- package/lib/template/SubTabs/SubTabs.tsx +26 -45
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -7
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
- package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +29 -27
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
- package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +16 -18
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
- package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +33 -17
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +75 -4
- package/lib/widget/Attachment/Attachment.tsx +370 -388
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +324 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +27 -25
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +24 -16
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +62 -54
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +15 -4
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +80 -116
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -483
- package/lib/helpers/authManager.js +0 -631
- package/lib/helpers/config_access.js +0 -268
- package/lib/helpers/formatters/Boolean.js +0 -38
- package/lib/helpers/formatters/CurrencyMap.js +0 -908
- package/lib/infra/Containers/FlowContainer/helpers.js +0 -147
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
|
|
2
3
|
import { getContext, readContextResponse } from './utils';
|
|
3
4
|
|
|
4
5
|
export default function useInit(props) {
|
|
5
|
-
const PCore = window.PCore;
|
|
6
6
|
const {
|
|
7
7
|
referenceList,
|
|
8
8
|
getPConnect,
|
|
@@ -27,21 +27,22 @@ export default function useInit(props) {
|
|
|
27
27
|
|
|
28
28
|
(async function init() {
|
|
29
29
|
// promise to fetch metadata
|
|
30
|
-
|
|
30
|
+
// @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
|
|
31
|
+
const metaDataPromise: Promise<any> = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
|
|
31
32
|
|
|
32
33
|
const promisesArray = [metaDataPromise];
|
|
33
34
|
|
|
34
35
|
// promise to fetch report configured columns
|
|
35
|
-
const reportColumnsPromise =
|
|
36
|
-
.getFieldsForDataSource(referenceList, false, getPConnect().getContextName())
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
36
|
+
const reportColumnsPromise = (
|
|
37
|
+
PCore.getAnalyticsUtils().getFieldsForDataSource(referenceList, false, getPConnect().getContextName()) as Promise<any>
|
|
38
|
+
).catch(() => {
|
|
39
|
+
return Promise.resolve({
|
|
40
|
+
data: { data: [] }
|
|
41
41
|
});
|
|
42
|
+
});
|
|
42
43
|
promisesArray.push(reportColumnsPromise);
|
|
43
44
|
|
|
44
|
-
const fetchEditDetails = async
|
|
45
|
+
const fetchEditDetails = async metadata => {
|
|
45
46
|
const {
|
|
46
47
|
data: { isQueryable }
|
|
47
48
|
} = metadata;
|
|
@@ -62,7 +63,7 @@ export default function useInit(props) {
|
|
|
62
63
|
return Promise.resolve();
|
|
63
64
|
};
|
|
64
65
|
|
|
65
|
-
const editPromise = metaDataPromise.then(
|
|
66
|
+
const editPromise = metaDataPromise.then(metadata => fetchEditDetails(metadata));
|
|
66
67
|
promisesArray.push(editPromise);
|
|
67
68
|
getContext({
|
|
68
69
|
tableSource: referenceList,
|
|
@@ -74,20 +75,19 @@ export default function useInit(props) {
|
|
|
74
75
|
isSearchable,
|
|
75
76
|
isCacheable: true,
|
|
76
77
|
xRayUid
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
78
|
+
}).then(async context => {
|
|
79
|
+
if (isCompStillMounted) {
|
|
80
|
+
return readContextResponse(context, {
|
|
81
|
+
...props,
|
|
82
|
+
editing,
|
|
83
|
+
selectionCountThreshold,
|
|
84
|
+
ref,
|
|
85
|
+
selectionMode,
|
|
86
|
+
xRayUid,
|
|
87
|
+
cosmosTableRef
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
91
|
})();
|
|
92
92
|
|
|
93
93
|
return () => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
1
|
import getDefaultViewMeta from './DefaultViewMeta';
|
|
3
2
|
|
|
4
3
|
const USER_REFERENCE = 'UserReference';
|
|
@@ -8,16 +7,51 @@ const PAGELIST = '!PL!';
|
|
|
8
7
|
export const formatConstants = {
|
|
9
8
|
WorkStatus: 'WorkStatus',
|
|
10
9
|
Integer: 'Integer',
|
|
11
|
-
WorkLink: 'WorkLink'
|
|
10
|
+
WorkLink: 'WorkLink'
|
|
12
11
|
};
|
|
13
12
|
|
|
13
|
+
class DataApi {
|
|
14
|
+
mappedPropertyToOriginalProperty: any;
|
|
15
|
+
originalPropertyToMappedProperty: any;
|
|
16
|
+
constructor() {
|
|
17
|
+
this.originalPropertyToMappedProperty = {};
|
|
18
|
+
this.mappedPropertyToOriginalProperty = {};
|
|
19
|
+
this.setPropertyMaps = this.setPropertyMaps.bind(this);
|
|
20
|
+
this.getMappedProperty = this.getMappedProperty.bind(this);
|
|
21
|
+
this.getOriginalProperty = this.getOriginalProperty.bind(this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
setPropertyMaps(originalToMappedPropertyObj = {}, mappedToOriginalPropertyObj = {}) {
|
|
25
|
+
this.originalPropertyToMappedProperty = {
|
|
26
|
+
...this.originalPropertyToMappedProperty,
|
|
27
|
+
...originalToMappedPropertyObj
|
|
28
|
+
};
|
|
29
|
+
this.mappedPropertyToOriginalProperty = {
|
|
30
|
+
...this.mappedPropertyToOriginalProperty,
|
|
31
|
+
...mappedToOriginalPropertyObj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getMappedProperty(propertyName) {
|
|
36
|
+
return this.originalPropertyToMappedProperty[propertyName] ?? propertyName;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getOriginalProperty(propertyName) {
|
|
40
|
+
return this.mappedPropertyToOriginalProperty[propertyName] ?? propertyName;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
14
44
|
export async function getContext(componentConfig) {
|
|
15
45
|
const {
|
|
16
|
-
promisesArray = []
|
|
46
|
+
promisesArray = [] // array of promises which can be invoked paralelly,
|
|
17
47
|
} = componentConfig;
|
|
18
48
|
const promisesResponseArray = await Promise.all(promisesArray);
|
|
49
|
+
const dataApi = new DataApi();
|
|
19
50
|
return {
|
|
20
51
|
promisesResponseArray,
|
|
52
|
+
setPropertyMaps: dataApi.setPropertyMaps,
|
|
53
|
+
getMappedProperty: dataApi.getMappedProperty,
|
|
54
|
+
getOriginalProperty: dataApi.getOriginalProperty
|
|
21
55
|
};
|
|
22
56
|
}
|
|
23
57
|
|
|
@@ -32,7 +66,7 @@ export async function getContext(componentConfig) {
|
|
|
32
66
|
* getFieldNameFromEmbeddedFieldName('!P!Organisation:Name') return 'Organisation.Name'
|
|
33
67
|
* getFieldNameFromEmbeddedFieldName('!PL!Employees:Name') return 'Employees.Name'
|
|
34
68
|
*/
|
|
35
|
-
|
|
69
|
+
export function getFieldNameFromEmbeddedFieldName(propertyName) {
|
|
36
70
|
let value = propertyName;
|
|
37
71
|
if (value.startsWith(PAGE) || value.startsWith(PAGELIST)) {
|
|
38
72
|
value = value.substring(value.lastIndexOf('!') + 1);
|
|
@@ -47,15 +81,15 @@ export async function getContext(componentConfig) {
|
|
|
47
81
|
* @ignore
|
|
48
82
|
* @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
|
|
49
83
|
*/
|
|
50
|
-
|
|
51
|
-
return metaFields.forEach(
|
|
84
|
+
export function updateMetaEmbeddedFieldID(metaFields) {
|
|
85
|
+
return metaFields.forEach(metaField => {
|
|
52
86
|
if (metaField.fieldID?.startsWith(PAGE) || metaField.fieldID?.startsWith(PAGELIST)) {
|
|
53
87
|
metaField.fieldID = getFieldNameFromEmbeddedFieldName(metaField.fieldID);
|
|
54
88
|
}
|
|
55
89
|
});
|
|
56
90
|
}
|
|
57
91
|
|
|
58
|
-
export const isEmbeddedField =
|
|
92
|
+
export const isEmbeddedField = field => {
|
|
59
93
|
if (field?.startsWith('@')) {
|
|
60
94
|
field = field.substring(field.indexOf(' ') + 1);
|
|
61
95
|
if (field[0] === '.') field = field.substring(1);
|
|
@@ -63,6 +97,94 @@ export const isEmbeddedField = (field) => {
|
|
|
63
97
|
return field?.indexOf('.') > 0;
|
|
64
98
|
};
|
|
65
99
|
|
|
100
|
+
/**
|
|
101
|
+
* [isPageListProperty]
|
|
102
|
+
* Description - checking if propertyName is pageList or not
|
|
103
|
+
* @ignore
|
|
104
|
+
* @param {string} propertyName PropertyName
|
|
105
|
+
* @returns {boolean} true if property is pageList else false
|
|
106
|
+
*
|
|
107
|
+
* @example <caption>Example for isPageListProperty </caption>
|
|
108
|
+
* isPageListProperty('!PL!Employees.Name') return true
|
|
109
|
+
* isPageListProperty('!P!Employees.Name') return false
|
|
110
|
+
* isPageListProperty('Name') return false
|
|
111
|
+
*/
|
|
112
|
+
export function isPageListProperty(propertyName) {
|
|
113
|
+
return propertyName.startsWith(PAGELIST);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const isPageListInPath = (propertyName, currentClassID) => {
|
|
117
|
+
if (!propertyName.includes('.')) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
const [first, ...rest] = propertyName.split('.');
|
|
121
|
+
const metadata: any = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
|
|
122
|
+
if (metadata?.type === 'Page List') {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
return isPageListInPath(rest.join('.'), metadata?.pageClass);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* [getEmbeddedFieldName]
|
|
130
|
+
* Description - converting normal field name to embedded field starting with !P! or !PL!
|
|
131
|
+
* @ignore
|
|
132
|
+
* @param {string} propertyName Field name
|
|
133
|
+
* @param {string} classID classID of datapage
|
|
134
|
+
* @returns {string} returns converted string with !P! or !PL! and :
|
|
135
|
+
*
|
|
136
|
+
* @example <caption>Example for getEmbeddedFieldName </caption>
|
|
137
|
+
* For page property, getEmbeddedFieldName('Organisation.Name') return '!P!Organisation:Name'
|
|
138
|
+
* For pageList property, getEmbeddedFieldName('Employees.Name') return '!PL!Employees:Name'
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
export function getEmbeddedFieldName(propertyName, classID) {
|
|
142
|
+
let value = propertyName;
|
|
143
|
+
if (isPageListInPath(value, classID)) {
|
|
144
|
+
value = `!PL!${value.replace(/\./g, ':')}`;
|
|
145
|
+
} else {
|
|
146
|
+
value = `!P!${value.replace(/\./g, ':')}`;
|
|
147
|
+
}
|
|
148
|
+
return value;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* [preparePropertyMaps]
|
|
153
|
+
* Description - preparing maps for property names and set it in dataApi context
|
|
154
|
+
* @ignore
|
|
155
|
+
* @param {Array} fields fields array
|
|
156
|
+
* @param {string} classID classID of datapage
|
|
157
|
+
* @param {string} context dataApi context
|
|
158
|
+
* @returns {boolean} true if pageListProperty is present
|
|
159
|
+
*/
|
|
160
|
+
export function preparePropertyMaps(fields, classID, context) {
|
|
161
|
+
const { setPropertyMaps } = context;
|
|
162
|
+
const maps = fields.reduce(
|
|
163
|
+
(acc, field) => {
|
|
164
|
+
let { value } = field.config;
|
|
165
|
+
if (value.startsWith('@')) {
|
|
166
|
+
value = value.substring(value.indexOf(' ') + 1);
|
|
167
|
+
if (value[0] === '.') value = value.substring(1);
|
|
168
|
+
}
|
|
169
|
+
let name = value;
|
|
170
|
+
// Preparing name for embedded property
|
|
171
|
+
if (isEmbeddedField(name)) {
|
|
172
|
+
name = getEmbeddedFieldName(name, classID);
|
|
173
|
+
}
|
|
174
|
+
if (isPageListProperty(name) && !acc[2]) {
|
|
175
|
+
acc[2] = true;
|
|
176
|
+
}
|
|
177
|
+
acc[0][value] = name;
|
|
178
|
+
acc[1][name] = value;
|
|
179
|
+
|
|
180
|
+
return acc;
|
|
181
|
+
},
|
|
182
|
+
[{}, {}, false]
|
|
183
|
+
);
|
|
184
|
+
setPropertyMaps(maps[0], maps[1]);
|
|
185
|
+
return maps[2];
|
|
186
|
+
}
|
|
187
|
+
|
|
66
188
|
/**
|
|
67
189
|
* [getConfigEmbeddedFieldsMeta]
|
|
68
190
|
* Description - Get the metadata for configured embedded fields
|
|
@@ -72,15 +194,16 @@ export const isEmbeddedField = (field) => {
|
|
|
72
194
|
* @returns {Array} Metadata of configured embedded fields
|
|
73
195
|
*/
|
|
74
196
|
export function getConfigEmbeddedFieldsMeta(configFields, classID) {
|
|
75
|
-
const configEmbeddedFieldsMeta = [];
|
|
76
|
-
configFields.forEach(
|
|
197
|
+
const configEmbeddedFieldsMeta: any[] = [];
|
|
198
|
+
configFields.forEach(field => {
|
|
77
199
|
let value = field;
|
|
78
200
|
if (isEmbeddedField(value)) {
|
|
79
201
|
// conversion Page.PageList[].property => Page.PageList.property
|
|
80
202
|
if (value.includes('[')) {
|
|
81
203
|
value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
|
|
82
204
|
}
|
|
83
|
-
|
|
205
|
+
// @ts-ignore - Expected 3 arguments, but got 2.
|
|
206
|
+
const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
|
|
84
207
|
meta.fieldID = field;
|
|
85
208
|
configEmbeddedFieldsMeta.push(meta);
|
|
86
209
|
}
|
|
@@ -97,8 +220,8 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) {
|
|
|
97
220
|
*/
|
|
98
221
|
export function mergeConfigEmbeddedFieldsMeta(configEmbeddedFieldsMeta, metaFields) {
|
|
99
222
|
const mergedMetaFields = [...metaFields];
|
|
100
|
-
configEmbeddedFieldsMeta.forEach(
|
|
101
|
-
const fieldMeta = metaFields.find(
|
|
223
|
+
configEmbeddedFieldsMeta.forEach(configFieldMeta => {
|
|
224
|
+
const fieldMeta = metaFields.find(metaField => metaField.fieldID === configFieldMeta.fieldID);
|
|
102
225
|
if (!fieldMeta) mergedMetaFields.push(configFieldMeta);
|
|
103
226
|
});
|
|
104
227
|
return mergedMetaFields;
|
|
@@ -115,8 +238,8 @@ const oldToNewFieldTypeMapping = {
|
|
|
115
238
|
* @ignore
|
|
116
239
|
* @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
|
|
117
240
|
*/
|
|
118
|
-
|
|
119
|
-
metaFields.forEach(
|
|
241
|
+
function updateFieldType(metaFields) {
|
|
242
|
+
metaFields.forEach(metaField => {
|
|
120
243
|
if (metaField.type) metaField.type = oldToNewFieldTypeMapping[metaField.type] || metaField.type;
|
|
121
244
|
});
|
|
122
245
|
}
|
|
@@ -141,8 +264,8 @@ function getPresetMetaAttribute(attribute) {
|
|
|
141
264
|
* @param {string} classID Class ID from the response
|
|
142
265
|
* @returns {Array} List of fields with updated meta objects.
|
|
143
266
|
*/
|
|
144
|
-
|
|
145
|
-
return rawFields.map(
|
|
267
|
+
function generateViewMetaData(rawFields, classID, showField) {
|
|
268
|
+
return rawFields.map(item => getDefaultViewMeta(item, classID, showField));
|
|
146
269
|
}
|
|
147
270
|
|
|
148
271
|
/**
|
|
@@ -155,9 +278,9 @@ function getPresetMetaAttribute(attribute) {
|
|
|
155
278
|
* @param {string} classID Class ID from the response
|
|
156
279
|
* @returns {Array} List of all fields with their meta updated.
|
|
157
280
|
*/
|
|
158
|
-
|
|
281
|
+
function getConfigFields(configFields, primaryFields, metaFields, classID) {
|
|
159
282
|
const presetConfigFields = configFields;
|
|
160
|
-
const primaryFieldsViewIndex = presetConfigFields.findIndex(
|
|
283
|
+
const primaryFieldsViewIndex = presetConfigFields.findIndex(field => field.config.value === 'pyPrimaryFields');
|
|
161
284
|
if (!primaryFields || !primaryFields.length) {
|
|
162
285
|
if (primaryFieldsViewIndex < 0) return presetConfigFields;
|
|
163
286
|
|
|
@@ -169,12 +292,11 @@ function getPresetMetaAttribute(attribute) {
|
|
|
169
292
|
if (primaryFieldsViewIndex > -1) {
|
|
170
293
|
// list of uncommon fields - non overlap of primary fields grouped view and independent entity columns of primary type
|
|
171
294
|
const uncommonFieldsList = primaryFields.filter(
|
|
172
|
-
(primaryField)
|
|
173
|
-
!presetConfigFields.some((presetConfigField) => presetConfigField.config.value.split('.')[1] === primaryField)
|
|
295
|
+
primaryField => !presetConfigFields.some(presetConfigField => presetConfigField.config.value.split('.')[1] === primaryField)
|
|
174
296
|
);
|
|
175
|
-
const uncommonFieldsRawMeta = [];
|
|
176
|
-
uncommonFieldsList.forEach(
|
|
177
|
-
const uncommonFieldMeta = metaFields.find(
|
|
297
|
+
const uncommonFieldsRawMeta: any[] = [];
|
|
298
|
+
uncommonFieldsList.forEach(uncommonField => {
|
|
299
|
+
const uncommonFieldMeta = metaFields.find(metaField => metaField.fieldID === uncommonField);
|
|
178
300
|
if (uncommonFieldMeta) uncommonFieldsRawMeta.push(uncommonFieldMeta);
|
|
179
301
|
});
|
|
180
302
|
const uncommonFieldsConfigMeta = generateViewMetaData(uncommonFieldsRawMeta, classID, true);
|
|
@@ -196,14 +318,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
196
318
|
* @param {Array} metaFields List of all metafields
|
|
197
319
|
* @returns {object} Table config object
|
|
198
320
|
*/
|
|
199
|
-
|
|
200
|
-
presetMeta,
|
|
201
|
-
isMetaWithPresets,
|
|
202
|
-
getPConnect,
|
|
203
|
-
classID,
|
|
204
|
-
primaryFields,
|
|
205
|
-
metaFields
|
|
206
|
-
) {
|
|
321
|
+
export function getTableConfigFromPresetMeta(presetMeta, isMetaWithPresets, getPConnect, classID, primaryFields, metaFields) {
|
|
207
322
|
let presetId;
|
|
208
323
|
let presetName;
|
|
209
324
|
let cardHeader;
|
|
@@ -228,7 +343,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
228
343
|
[fieldsMeta] = presetMeta.children;
|
|
229
344
|
if (
|
|
230
345
|
presetMeta.timelineTitle &&
|
|
231
|
-
!fieldsMeta.children.find(
|
|
346
|
+
!fieldsMeta.children.find(fieldMeta => {
|
|
232
347
|
return fieldMeta?.config?.value === presetMeta.timelineTitle?.config?.value;
|
|
233
348
|
})
|
|
234
349
|
) {
|
|
@@ -237,7 +352,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
237
352
|
}
|
|
238
353
|
if (
|
|
239
354
|
presetMeta.timelineDate &&
|
|
240
|
-
!fieldsMeta.children.find(
|
|
355
|
+
!fieldsMeta.children.find(fieldMeta => {
|
|
241
356
|
return fieldMeta?.config?.value === presetMeta.timelineDate?.config?.value;
|
|
242
357
|
})
|
|
243
358
|
) {
|
|
@@ -251,7 +366,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
251
366
|
fieldsMeta
|
|
252
367
|
.getPConnect()
|
|
253
368
|
.getChildren()
|
|
254
|
-
?.map(
|
|
369
|
+
?.map(child => {
|
|
255
370
|
return child.getPConnect().getRawMetadata();
|
|
256
371
|
}),
|
|
257
372
|
primaryFields,
|
|
@@ -281,12 +396,12 @@ function getPresetMetaAttribute(attribute) {
|
|
|
281
396
|
* @param {object} response -
|
|
282
397
|
* @returns {Set} Set of columns from the report response
|
|
283
398
|
*/
|
|
284
|
-
|
|
399
|
+
function getReportColumns(response) {
|
|
285
400
|
const {
|
|
286
401
|
data: { data: reportColumns }
|
|
287
402
|
} = response;
|
|
288
403
|
const reportColumnsSet = new Set();
|
|
289
|
-
reportColumns?.forEach(
|
|
404
|
+
reportColumns?.forEach(item => {
|
|
290
405
|
let val = item.pyFieldName;
|
|
291
406
|
// Remove '.' from index 0 only, if '.' is present
|
|
292
407
|
if (val[0] === '.') {
|
|
@@ -305,7 +420,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
305
420
|
* config.value - Raw value
|
|
306
421
|
* @returns {string} value - Value with out any annotations or "."
|
|
307
422
|
*/
|
|
308
|
-
|
|
423
|
+
function getConfigFieldValue(config) {
|
|
309
424
|
let { value } = config;
|
|
310
425
|
if (value.startsWith('@')) {
|
|
311
426
|
value = value.substring(value.indexOf(' ') + 1);
|
|
@@ -324,7 +439,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
324
439
|
*/
|
|
325
440
|
function prepareConfigFields(configFields, pushToComponentsList) {
|
|
326
441
|
const configFieldSet = new Set();
|
|
327
|
-
configFields.forEach(
|
|
442
|
+
configFields.forEach(item => {
|
|
328
443
|
pushToComponentsList(item.type);
|
|
329
444
|
const val = getConfigFieldValue(item.config);
|
|
330
445
|
configFieldSet.add(val);
|
|
@@ -340,8 +455,8 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
340
455
|
* @param {string} fieldID Filter
|
|
341
456
|
* @returns {object} config with its field value equal to fieldID, which means an authored field
|
|
342
457
|
*/
|
|
343
|
-
|
|
344
|
-
return configFields.find(
|
|
458
|
+
function findAuthoredField(configFields, fieldID) {
|
|
459
|
+
return configFields.find(configField => {
|
|
345
460
|
const val = getConfigFieldValue(configField.config);
|
|
346
461
|
return val === fieldID;
|
|
347
462
|
});
|
|
@@ -355,7 +470,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
355
470
|
* @param {object} item Field item to copy displayAs and category information
|
|
356
471
|
* @param {string} classId classID from the response
|
|
357
472
|
*/
|
|
358
|
-
|
|
473
|
+
function findAndUpdateAuthoredFieldConfig(configFields, item, classId) {
|
|
359
474
|
const authoredField = findAuthoredField(configFields, item.fieldID);
|
|
360
475
|
if (authoredField?.config) {
|
|
361
476
|
if (item.displayAs) {
|
|
@@ -387,7 +502,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
387
502
|
* @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
|
|
388
503
|
* @returns {boolean} true If the field is an extra field else false.
|
|
389
504
|
*/
|
|
390
|
-
|
|
505
|
+
function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classId, showDynamicFields) {
|
|
391
506
|
// Is the field already present in authoring metadata?
|
|
392
507
|
// Mutates config fields to copy displayAs and category information
|
|
393
508
|
if (configFieldSet.has(item.fieldID)) {
|
|
@@ -411,16 +526,9 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
411
526
|
* @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
|
|
412
527
|
* @returns {Array} List of extra fields with their meta updated.
|
|
413
528
|
*/
|
|
414
|
-
|
|
415
|
-
metaFields,
|
|
416
|
-
configFields,
|
|
417
|
-
configFieldSet,
|
|
418
|
-
reportColumnsSet,
|
|
419
|
-
classID,
|
|
420
|
-
showDynamicFields
|
|
421
|
-
) {
|
|
529
|
+
function prepareExtraFields(metaFields, configFields, configFieldSet, reportColumnsSet, classID, showDynamicFields) {
|
|
422
530
|
// Filter all the extra fields
|
|
423
|
-
const extraFileds = metaFields.filter(
|
|
531
|
+
const extraFileds = metaFields.filter(item => {
|
|
424
532
|
return isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classID, showDynamicFields);
|
|
425
533
|
});
|
|
426
534
|
return generateViewMetaData(extraFileds, classID, false);
|
|
@@ -443,10 +551,7 @@ function populateRenderingOptions(name, config, field) {
|
|
|
443
551
|
config.cellRenderer = formatConstants.Integer;
|
|
444
552
|
}
|
|
445
553
|
}
|
|
446
|
-
export function initializeColumns(
|
|
447
|
-
fields = [],
|
|
448
|
-
getMappedProperty
|
|
449
|
-
) {
|
|
554
|
+
export function initializeColumns(fields: any[] = [], getMappedProperty: any = null) {
|
|
450
555
|
return fields.map((field, originalColIndex) => {
|
|
451
556
|
let name = field.config.value;
|
|
452
557
|
|
|
@@ -475,7 +580,7 @@ export function initializeColumns(
|
|
|
475
580
|
fieldType: field.config.fieldType,
|
|
476
581
|
meta: {
|
|
477
582
|
...field
|
|
478
|
-
}
|
|
583
|
+
}
|
|
479
584
|
};
|
|
480
585
|
|
|
481
586
|
populateRenderingOptions(name, config, field);
|
|
@@ -484,9 +589,9 @@ export function initializeColumns(
|
|
|
484
589
|
});
|
|
485
590
|
}
|
|
486
591
|
|
|
487
|
-
export const getItemKey =
|
|
592
|
+
export const getItemKey = fields => {
|
|
488
593
|
let itemKey;
|
|
489
|
-
if (fields.findIndex(
|
|
594
|
+
if (fields.findIndex(field => field.id === 'pyGUID') > -1) {
|
|
490
595
|
itemKey = 'pyGUID';
|
|
491
596
|
} else {
|
|
492
597
|
itemKey = 'pzInsKey';
|
|
@@ -495,9 +600,9 @@ export const getItemKey = (fields) => {
|
|
|
495
600
|
};
|
|
496
601
|
|
|
497
602
|
export function preparePatchQueryFields(fields, isDataObject = false, classID = '') {
|
|
498
|
-
const queryFields = [];
|
|
499
|
-
fields.forEach(
|
|
500
|
-
const patchFields = [];
|
|
603
|
+
const queryFields: any[] = [];
|
|
604
|
+
fields.forEach(field => {
|
|
605
|
+
const patchFields: any[] = [];
|
|
501
606
|
if (field.cellRenderer === 'WorkLink') {
|
|
502
607
|
if (field.customObject && field.customObject.isAssignmentLink) {
|
|
503
608
|
const associationName = field.name.includes(':') ? `${field.name.split(':')[0]}:` : '';
|
|
@@ -511,17 +616,15 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
|
|
|
511
616
|
} else if (isDataObject) {
|
|
512
617
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
513
618
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
514
|
-
dataPageKeys?.forEach((item)
|
|
515
|
-
item.isAlternateKeyStorage ? patchFields.push(item.linkedField) : patchFields.push(item.keyName)
|
|
516
|
-
);
|
|
619
|
+
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? patchFields.push(item.linkedField) : patchFields.push(item.keyName)));
|
|
517
620
|
} else {
|
|
518
621
|
patchFields.push('pyID');
|
|
519
622
|
patchFields.push('pzInsKey');
|
|
520
623
|
patchFields.push('pxObjClass');
|
|
521
624
|
}
|
|
522
625
|
}
|
|
523
|
-
patchFields.forEach(
|
|
524
|
-
if (!queryFields.find(
|
|
626
|
+
patchFields.forEach(k => {
|
|
627
|
+
if (!queryFields.find(q => q === k)) {
|
|
525
628
|
queryFields.push(k);
|
|
526
629
|
}
|
|
527
630
|
});
|
|
@@ -530,19 +633,28 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
|
|
|
530
633
|
return queryFields;
|
|
531
634
|
}
|
|
532
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Update the renderer type for the properties of type Page.
|
|
638
|
+
*/
|
|
639
|
+
export function updatePageFieldsConfig(configFields, parentClassID) {
|
|
640
|
+
return configFields.forEach(item => {
|
|
641
|
+
const {
|
|
642
|
+
type,
|
|
643
|
+
config: { value }
|
|
644
|
+
} = item;
|
|
645
|
+
const propertyName = PCore.getAnnotationUtils().getPropertyName(value);
|
|
646
|
+
if (isEmbeddedField(value) && !isPageListInPath(propertyName, parentClassID)) {
|
|
647
|
+
item.config.componentType = type;
|
|
648
|
+
item.type = 'PagePropertyRenderer';
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
|
|
533
653
|
export const readContextResponse = async (context, params) => {
|
|
534
|
-
const {
|
|
535
|
-
getPConnect,
|
|
536
|
-
apiContext,
|
|
537
|
-
setListContext,
|
|
538
|
-
children,
|
|
539
|
-
showDynamicFields,
|
|
540
|
-
referenceList,
|
|
541
|
-
isDataObject
|
|
542
|
-
} = params;
|
|
654
|
+
const { getPConnect, apiContext, setListContext, children, showDynamicFields, referenceList, isDataObject } = params;
|
|
543
655
|
const { promisesResponseArray, apiContext: otherContext } = context;
|
|
544
656
|
// eslint-disable-next-line sonarjs/no-unused-collection
|
|
545
|
-
const listOfComponents = [];
|
|
657
|
+
const listOfComponents: any[] = [];
|
|
546
658
|
const {
|
|
547
659
|
data: { fields: metaFields, classID, isQueryable }
|
|
548
660
|
} = promisesResponseArray[0];
|
|
@@ -551,7 +663,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
551
663
|
} = promisesResponseArray[0];
|
|
552
664
|
// When list is configured with Include all class fields configuration, provide support for Primary fields column
|
|
553
665
|
if (showDynamicFields) {
|
|
554
|
-
const sourceMetadata = PCore.getMetadataUtils().getDataPageMetadata(referenceList);
|
|
666
|
+
const sourceMetadata: any = PCore.getMetadataUtils().getDataPageMetadata(referenceList);
|
|
555
667
|
if (sourceMetadata?.primaryFields) {
|
|
556
668
|
primaryFields = sourceMetadata.primaryFields;
|
|
557
669
|
}
|
|
@@ -560,14 +672,11 @@ export const readContextResponse = async (context, params) => {
|
|
|
560
672
|
}
|
|
561
673
|
updateFieldType(metaFields);
|
|
562
674
|
|
|
563
|
-
|
|
564
675
|
if (isDataObject) {
|
|
565
|
-
const compositeKeys = [];
|
|
676
|
+
const compositeKeys: any[] = [];
|
|
566
677
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
567
678
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
568
|
-
dataPageKeys?.forEach((item)
|
|
569
|
-
item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)
|
|
570
|
-
);
|
|
679
|
+
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
|
|
571
680
|
if (compositeKeys.length) {
|
|
572
681
|
otherContext.setCompositeKeys(compositeKeys);
|
|
573
682
|
}
|
|
@@ -583,9 +692,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
583
692
|
let fields;
|
|
584
693
|
let tableConfig;
|
|
585
694
|
childrenIterator?.forEach((presetMeta, index) => {
|
|
586
|
-
const {
|
|
587
|
-
configFields
|
|
588
|
-
} = getTableConfigFromPresetMeta(
|
|
695
|
+
const { configFields } = getTableConfigFromPresetMeta(
|
|
589
696
|
{ ...presetMeta, label: resolvedPresets[index].label },
|
|
590
697
|
isMetaWithPresets,
|
|
591
698
|
getPConnect,
|
|
@@ -593,7 +700,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
593
700
|
primaryFields,
|
|
594
701
|
metaFields
|
|
595
702
|
);
|
|
596
|
-
const pushToComponentsList =
|
|
703
|
+
const pushToComponentsList = fieldType => {
|
|
597
704
|
listOfComponents.push(fieldType);
|
|
598
705
|
};
|
|
599
706
|
// read report columns response - in case of nonqueryable ignore the response and rely only on the fields configured at authoing time in presets
|
|
@@ -617,20 +724,24 @@ export const readContextResponse = async (context, params) => {
|
|
|
617
724
|
showDynamicFields
|
|
618
725
|
);
|
|
619
726
|
|
|
727
|
+
if (isQueryable) {
|
|
728
|
+
updatePageFieldsConfig(configFields, classID);
|
|
729
|
+
preparePropertyMaps([...configFields, ...extraFields], classID, context);
|
|
730
|
+
}
|
|
620
731
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
);
|
|
732
|
+
const { getMappedProperty } = context;
|
|
733
|
+
|
|
734
|
+
fields = initializeColumns([...configFields, ...extraFields], getMappedProperty);
|
|
624
735
|
const patchQueryFields = preparePatchQueryFields(fields, isDataObject, classID);
|
|
625
736
|
const itemKey = getItemKey(fields);
|
|
626
|
-
tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable}
|
|
737
|
+
tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable };
|
|
627
738
|
});
|
|
628
739
|
const meta = tableConfig;
|
|
629
740
|
setListContext({
|
|
630
741
|
meta,
|
|
631
742
|
presets: presetArray,
|
|
632
743
|
apiContext: {
|
|
633
|
-
...apiContext
|
|
744
|
+
...apiContext
|
|
634
745
|
}
|
|
635
746
|
});
|
|
636
747
|
};
|