@sap/ux-specification 1.90.15 → 1.90.19
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/CHANGELOG.md +99 -11
- package/dist/documentation/runDocu-min.js +1 -1
- package/dist/documentation/styleDocu.css +4 -5
- package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
- package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
- package/dist/documentation/v2/v2-ListReport.html +1 -1
- package/dist/documentation/v2/v2-ObjectPage.html +1 -1
- package/dist/documentation/v2/v2-OverviewPage.html +1 -1
- package/dist/documentation/v4/v4-AnalyticalListPage.html +1 -1
- package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
- package/dist/documentation/v4/v4-ListReport.html +1 -1
- package/dist/documentation/v4/v4-ObjectPage.html +1 -1
- package/dist/index-min.js +1 -1
- package/dist/schemas/v2/AnalyticalListPageConfig.json +148 -40
- package/dist/schemas/v2/ListReportConfig.json +162 -32
- package/dist/schemas/v2/ObjectPageConfig.json +252 -56
- package/dist/schemas/v2/OverviewPageConfig.json +298 -196
- package/dist/schemas/v4/AnalyticalListPageConfig.json +46 -70
- package/dist/schemas/v4/ListReportConfig.json +46 -70
- package/dist/schemas/v4/ObjectPageConfig.json +49 -76
- package/dist/scripts/extractDocu.js +18 -8
- package/dist/scripts/extractDocu.js.map +1 -1
- package/dist/scripts/runDocu.js +105 -89
- package/dist/scripts/runDocu.js.map +1 -1
- package/dist/scripts/to-json-schema.js +31 -37
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/specification/v4/index-min.js +1 -1
- package/dist/src/api.js +9 -9
- package/dist/src/api.js.map +1 -1
- package/dist/src/apiTypes.d.ts +5 -2
- package/dist/src/specification/schemaAccess.js +1 -3
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/specification/v2/controls/Action.d.ts +71 -0
- package/dist/src/specification/v2/controls/{FormAction.js → Action.js} +1 -1
- package/dist/src/specification/v2/controls/Action.js.map +1 -0
- package/dist/src/specification/v2/controls/Card.d.ts +20 -72
- package/dist/src/specification/v2/controls/Card.js.map +1 -1
- package/dist/src/specification/v2/controls/FilterBar.d.ts +48 -6
- package/dist/src/specification/v2/controls/FilterBar.js +24 -0
- package/dist/src/specification/v2/controls/FilterBar.js.map +1 -1
- package/dist/src/specification/v2/controls/Footer.d.ts +20 -0
- package/dist/src/specification/v2/controls/{ObjectPageFooter.js → Footer.js} +1 -1
- package/dist/src/specification/v2/controls/Footer.js.map +1 -0
- package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +1 -2
- package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +1 -1
- package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +4 -0
- package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +1 -5
- package/dist/src/specification/v2/controls/Table.d.ts +13 -10
- package/dist/src/specification/v2/controls/Table.js.map +1 -1
- package/dist/src/specification/v2/controls/ToolBar.d.ts +1 -8
- package/dist/src/specification/v2/controls/index.d.ts +8 -10
- package/dist/src/specification/v2/controls/index.js +2 -2
- package/dist/src/specification/v2/controls/index.js.map +1 -1
- package/dist/src/specification/v2/pages/AnalyticalListPageConfig.d.ts +2 -1
- package/dist/src/specification/v2/pages/ListReportConfig.d.ts +3 -2
- package/dist/src/specification/v4/controls/ObjectPageFooter.d.ts +2 -2
- package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +7 -7
- package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +5 -6
- package/dist/src/specification/v4/controls/Table.d.ts +3 -7
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +51 -13
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js +6 -0
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js.map +1 -1
- package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.d.ts +2 -1
- package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/decoration/control.d.ts +11 -1
- package/dist/src/sync/common/decoration/control.js +29 -3
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/decoration/factory.js +2 -4
- package/dist/src/sync/common/decoration/factory.js.map +1 -1
- package/dist/src/sync/common/generate/index.d.ts +1 -0
- package/dist/src/sync/common/generate/index.js +1 -0
- package/dist/src/sync/common/generate/index.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +8 -0
- package/dist/src/sync/common/generate/objectPage.js +28 -12
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +67 -0
- package/dist/src/sync/common/generate/utils.js +221 -0
- package/dist/src/sync/common/generate/utils.js.map +1 -0
- package/dist/src/sync/common/i18n.json +2 -0
- package/dist/src/sync/common/import/utils.d.ts +8 -1
- package/dist/src/sync/common/import/utils.js +14 -3
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.js +19 -28
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +29 -15
- package/dist/src/sync/common/types.js +25 -1
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +6 -33
- package/dist/src/sync/common/utils.js +25 -131
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +29 -0
- package/dist/src/sync/v2/export/controls/Action.js +127 -0
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Card.d.ts +3 -7
- package/dist/src/sync/v2/export/controls/Card.js +15 -43
- package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts +7 -3
- package/dist/src/sync/v2/export/controls/FilterBar.js +36 -22
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.js +3 -2
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +244 -168
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +9 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +62 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +11 -29
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +2 -2
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +4 -4
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +3 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +15 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +9 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +61 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Table.d.ts +4 -4
- package/dist/src/sync/v2/export/controls/Table.js +16 -21
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts +18 -2
- package/dist/src/sync/v2/export/controls/TableColumn.js +126 -1
- package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ToolBar.d.ts +4 -0
- package/dist/src/sync/v2/export/controls/ToolBar.js +6 -0
- package/dist/src/sync/v2/export/controls/ToolBar.js.map +1 -0
- package/dist/src/sync/v2/export/controls/index.d.ts +12 -8
- package/dist/src/sync/v2/export/controls/index.js +12 -8
- package/dist/src/sync/v2/export/controls/index.js.map +1 -1
- package/dist/src/sync/v2/export/export.js +134 -111
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +3 -2
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.js +2 -5
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts +2 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +3 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ListReport.d.ts +3 -2
- package/dist/src/sync/v2/export/pages/ListReport.js +3 -0
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.d.ts +16 -21
- package/dist/src/sync/v2/export/view-controller-generator.js +20 -36
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +16 -8
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +8 -0
- package/dist/src/sync/v2/generate/listReport.js +26 -6
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts +1 -6
- package/dist/src/sync/v2/generate/objectPage.js +208 -126
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +16 -12
- package/dist/src/sync/v2/generate/utils.js +235 -98
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.d.ts +29 -4
- package/dist/src/sync/v2/import/common/index.js +330 -56
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/controls/table.js +3 -2
- package/dist/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +27 -5
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.d.ts +0 -5
- package/dist/src/sync/v2/import/pages/listReport.js +21 -100
- package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.d.ts +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +443 -303
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.d.ts +4 -6
- package/dist/src/sync/v2/import/utils.js +32 -11
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +28 -2
- package/dist/src/sync/v2/types.js +14 -0
- package/dist/src/sync/v2/types.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js +5 -1
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js +2 -2
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +4 -7
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js +3 -33
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.js +1 -1
- package/dist/src/sync/v4/export/controls/TableColumn.d.ts +3 -6
- package/dist/src/sync/v4/export/controls/TableColumn.js +3 -33
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ToolBar.d.ts +5 -1
- package/dist/src/sync/v4/export/controls/ToolBar.js +3 -0
- package/dist/src/sync/v4/export/controls/ToolBar.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +36 -25
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/pages/AnalyticalListPage.d.ts +2 -2
- package/dist/src/sync/v4/export/pages/ListReport.d.ts +2 -2
- package/dist/src/sync/v4/export/pages/ObjectPage.d.ts +2 -2
- package/dist/src/sync/v4/export/types.d.ts +4 -0
- package/dist/src/sync/v4/generate/generate.d.ts +4 -2
- package/dist/src/sync/v4/generate/generate.js +15 -6
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/listReport.d.ts +9 -7
- package/dist/src/sync/v4/generate/listReport.js +93 -22
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +111 -81
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +2 -2
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/pages/analyticalListPage.d.ts +2 -2
- package/dist/src/sync/v4/import/pages/analyticalListPage.js +0 -1
- package/dist/src/sync/v4/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.d.ts +4 -6
- package/dist/src/sync/v4/import/pages/listReport.js +57 -36
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +2 -2
- package/dist/src/sync/v4/import/pages/objectPage.js +21 -18
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.js +6 -5
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +15 -2
- package/dist/src/sync/v4/utils/utils.js +65 -26
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/test/unit/utils.test.d.ts +1 -1
- package/package.json +11 -10
- package/dist/src/specification/v2/controls/FormAction.d.ts +0 -27
- package/dist/src/specification/v2/controls/FormAction.js.map +0 -1
- package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +0 -11
- package/dist/src/specification/v2/controls/ObjectPageFooter.js.map +0 -1
- package/dist/src/specification/v2/controls/ObjectPageHeaderAction.d.ts +0 -27
- package/dist/src/specification/v2/controls/ObjectPageHeaderAction.js +0 -3
- package/dist/src/specification/v2/controls/ObjectPageHeaderAction.js.map +0 -1
- package/dist/test/test-utils/metadataParser.d.ts +0 -19
|
@@ -13,9 +13,71 @@ const sapUiPageV2_1 = require("../.../../../../../specification/v2/webapp/manife
|
|
|
13
13
|
const i18next_1 = __importDefault(require("i18next"));
|
|
14
14
|
const i18n_1 = require("../../../../i18n/i18n");
|
|
15
15
|
const common_2 = require("../../../../specification/common");
|
|
16
|
-
const listReport_1 = require("../pages/listReport");
|
|
17
16
|
const factory_1 = require("../../export/factory");
|
|
18
17
|
const types_1 = require("../../types");
|
|
18
|
+
const common_3 = require("../common");
|
|
19
|
+
/**
|
|
20
|
+
* Determines Facet ID from single string selector Id
|
|
21
|
+
* @param {string} selectorId Selector ID
|
|
22
|
+
* @returns {string} FacetID
|
|
23
|
+
*/
|
|
24
|
+
function getSingleSelectorIdPart(selectorIdParts, facetID) {
|
|
25
|
+
const lastIdParts = selectorIdParts[0].split('-');
|
|
26
|
+
const id = lastIdParts[lastIdParts.length - 1];
|
|
27
|
+
if (selectorIdParts[0].indexOf('::action::') >= 0 || selectorIdParts[0].startsWith('action::')) {
|
|
28
|
+
// Object Page ToolBar Actions
|
|
29
|
+
facetID =
|
|
30
|
+
lastIdParts[0].split('::action::')[0] ||
|
|
31
|
+
lastIdParts[0].split(`${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}::`)[1].split('::')[0];
|
|
32
|
+
facetID = `Action ID: ${facetID}`;
|
|
33
|
+
}
|
|
34
|
+
else if (selectorIdParts[0].indexOf("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) >= 0 ||
|
|
35
|
+
selectorIdParts[0].indexOf('UI.LineItem') >= 0 ||
|
|
36
|
+
selectorIdParts[0].indexOf('::Table') >= 0) {
|
|
37
|
+
facetID = lastIdParts[0]
|
|
38
|
+
.split('::Table')[0]
|
|
39
|
+
.split('::responsiveTable')[0]
|
|
40
|
+
.replace(/::/g, '/@');
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const idParts = id.split('::');
|
|
44
|
+
if (idParts.length > 1) {
|
|
45
|
+
facetID = idParts[0];
|
|
46
|
+
}
|
|
47
|
+
else if (lastIdParts[0].indexOf('::') > -1) {
|
|
48
|
+
facetID = lastIdParts[0].split('::')[0];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return facetID;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Determines Facet ID of flex change
|
|
55
|
+
* @param {string} selectorId Control ID of flex change
|
|
56
|
+
* @returns {string} FacetID
|
|
57
|
+
*/
|
|
58
|
+
function getFacetID(selectorId) {
|
|
59
|
+
let facetID;
|
|
60
|
+
const selectorIdParts = selectorId.split(':::');
|
|
61
|
+
if (selectorIdParts.length === 1) {
|
|
62
|
+
facetID = getSingleSelectorIdPart(selectorIdParts, facetID);
|
|
63
|
+
}
|
|
64
|
+
else if (selectorId.indexOf('sSmartTableId') >= 0) {
|
|
65
|
+
for (const element of selectorIdParts) {
|
|
66
|
+
if (element.startsWith('sSmartTableId')) {
|
|
67
|
+
facetID = element
|
|
68
|
+
.split('sSmartTableId::')[1]
|
|
69
|
+
.split('::Table')[0]
|
|
70
|
+
.split('/responsiveTable')[0]
|
|
71
|
+
.replace(`::${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`, `/@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
facetID = selectorIdParts[0];
|
|
78
|
+
}
|
|
79
|
+
return facetID;
|
|
80
|
+
}
|
|
19
81
|
/**
|
|
20
82
|
* Prepares the list of flex changes
|
|
21
83
|
* @param change - the flex change (UI Adaptation)
|
|
@@ -31,52 +93,12 @@ function prepareFlexChanges(changes, entitySet, logger) {
|
|
|
31
93
|
const change = common_1.parseChangeString(changeString);
|
|
32
94
|
if (change && ((_a = change.controlId) === null || _a === void 0 ? void 0 : _a.includes(sapUiPageV2_1.FE_TEMPLATE_V2_OBJECT_PAGE)) && ((_b = change.controlId) === null || _b === void 0 ? void 0 : _b.includes(entitySet))) {
|
|
33
95
|
let selectorId = change.controlId.split('--')[1].replace(/:3a:3a/g, '::');
|
|
34
|
-
const complexIdMatch =
|
|
96
|
+
const complexIdMatch = /.+DataField.+:::sSmartTableId::.+/;
|
|
35
97
|
if (complexIdMatch.exec(selectorId) !== null) {
|
|
36
98
|
selectorId = selectorId.split('template:::TableColumn:::')[1];
|
|
37
99
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
if (selectorIdParts.length === 1) {
|
|
41
|
-
const lastIdParts = selectorIdParts[0].split('-');
|
|
42
|
-
id = lastIdParts[lastIdParts.length - 1];
|
|
43
|
-
if (selectorIdParts[0].indexOf("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) >= 0 ||
|
|
44
|
-
selectorIdParts[0].indexOf('UI.LineItem') >= 0 ||
|
|
45
|
-
selectorIdParts[0].indexOf('::Table') >= 0) {
|
|
46
|
-
facetID = lastIdParts[0]
|
|
47
|
-
.split('::Table')[0]
|
|
48
|
-
.split('::responsiveTable')[0]
|
|
49
|
-
.replace(/::/g, '/@');
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
const idParts = id.split('::');
|
|
53
|
-
if (idParts.length > 1) {
|
|
54
|
-
facetID = idParts[0];
|
|
55
|
-
}
|
|
56
|
-
else if (lastIdParts[0].indexOf('::') > -1) {
|
|
57
|
-
facetID = lastIdParts[0].split('::')[0];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else if (selectorId.indexOf('sSmartTableId') >= 0) {
|
|
62
|
-
for (const element of selectorIdParts) {
|
|
63
|
-
if (element.startsWith('sSmartTableId')) {
|
|
64
|
-
facetID = element
|
|
65
|
-
.split('sSmartTableId::')[1]
|
|
66
|
-
.split('::Table')[0]
|
|
67
|
-
.split('/responsiveTable')[0]
|
|
68
|
-
.replace(`::${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`, `/@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
facetID = selectorIdParts[0];
|
|
75
|
-
}
|
|
76
|
-
selectorId = selectorId
|
|
77
|
-
.replace(/:2f/g, '/')
|
|
78
|
-
.replace(/:40/g, '@')
|
|
79
|
-
.replace(/:23/g, '#')
|
|
100
|
+
const facetID = getFacetID(selectorId);
|
|
101
|
+
selectorId = common_3.convertSelector(selectorId)
|
|
80
102
|
.replace(/:3a:3a/g, '::')
|
|
81
103
|
.replace(/\/@com.sap.vocabularies/g, '::com.sap.vocabularies');
|
|
82
104
|
if (result[selectorId] && result[selectorId].propertyId !== change.content.property) {
|
|
@@ -101,24 +123,152 @@ function prepareFlexChanges(changes, entitySet, logger) {
|
|
|
101
123
|
});
|
|
102
124
|
return result;
|
|
103
125
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Returns the type of a given section
|
|
128
|
+
* @param schemaSection - current section
|
|
129
|
+
* @returns {SectionTypeV2} - type of section, differentiated by level (Sub/Section)
|
|
130
|
+
*/
|
|
107
131
|
const getSectionType = (schemaSection) => {
|
|
132
|
+
var _a, _b, _c;
|
|
108
133
|
let reference;
|
|
109
134
|
if (schemaSection['$ref']) {
|
|
110
135
|
reference = schemaSection['$ref'].includes('<') ? schemaSection['$ref'].split('<')[0] : schemaSection['$ref'];
|
|
111
136
|
return reference.replace(common_1.DEFINITION_LINK_PREFIX, '');
|
|
112
137
|
}
|
|
113
|
-
else if (schemaSection['properties']['subsections']['$ref']) {
|
|
138
|
+
else if ((_b = (_a = schemaSection['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['$ref']) {
|
|
114
139
|
reference = schemaSection['properties']['subsections']['$ref'];
|
|
115
140
|
reference = reference.includes('<') ? reference.split('<')[0] : reference;
|
|
116
141
|
return reference.replace(common_1.DEFINITION_LINK_PREFIX, '');
|
|
117
142
|
}
|
|
118
|
-
else if (schemaSection['properties']['subsections']) {
|
|
143
|
+
else if ((_c = schemaSection['properties']) === null || _c === void 0 ? void 0 : _c['subsections']) {
|
|
119
144
|
return types_1.SectionTypeV2.SubSection;
|
|
120
145
|
}
|
|
121
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* Import of flex changes of a table to the config JSON of OP
|
|
149
|
+
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
150
|
+
* @param propertyKey - key of the current property in the app schema
|
|
151
|
+
* @param configPart - part of the configuration to be filled
|
|
152
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
153
|
+
* @param sectionTitle - title of the section (optional)
|
|
154
|
+
* @param sectionId - ID of the given section (optional)
|
|
155
|
+
*/
|
|
156
|
+
function importFlexChangesOfTable(flexChanges, propertyKey, configPart, importParameters, sectionTitle, sectionId) {
|
|
157
|
+
const unescapedId = sectionId === null || sectionId === void 0 ? void 0 : sectionId.replace(/::@com.sap.vocabularies/g, v2_1.VOCWITHSLASH);
|
|
158
|
+
for (const selector in flexChanges) {
|
|
159
|
+
const flexChange = flexChanges[selector];
|
|
160
|
+
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
161
|
+
const isTableColumn = propertyKey === 'columns' && flexChange.controlType === common_1.ControlType.TableColumn;
|
|
162
|
+
let facetIds;
|
|
163
|
+
if (sectionTitle) {
|
|
164
|
+
facetIds = [sectionTitle];
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
facetIds = [sectionId, unescapedId];
|
|
168
|
+
}
|
|
169
|
+
if ((propertyIdMatch || isTableColumn) && facetIds.indexOf(flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) > -1) {
|
|
170
|
+
table_1.addFlexForTable(configPart, flexChanges[selector], importParameters.jsonSchema);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Import of (regular) flex changes to the config JSON of OP
|
|
176
|
+
* @param schemaDefinition - current section of the app specific schema
|
|
177
|
+
* @param configPart - part of the configuration to be filled
|
|
178
|
+
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
179
|
+
* @param propertyKey - key of the current property in the app schema
|
|
180
|
+
* @param sectionTitle - title of the section (optional)
|
|
181
|
+
* @param actionId - ID of the given action (optional)
|
|
182
|
+
*/
|
|
183
|
+
function importFlexChanges(schemaDefinition, configPart, flexChanges, propertyKey, sectionTitle, actionId) {
|
|
184
|
+
var _a, _b;
|
|
185
|
+
for (const selector in flexChanges) {
|
|
186
|
+
const flexChange = flexChanges[selector];
|
|
187
|
+
const actionIdMatch = !actionId || new RegExp(`.*${actionId}\\d?$`).test(selector);
|
|
188
|
+
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
189
|
+
const schemaControlType = (_a = schemaDefinition['properties'][flexChange.propertyId]) === null || _a === void 0 ? void 0 : _a.controlType;
|
|
190
|
+
const controlTypeMatch = flexChange.controlType === schemaControlType;
|
|
191
|
+
if (
|
|
192
|
+
// Actions
|
|
193
|
+
(((_b = flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) === null || _b === void 0 ? void 0 : _b.includes(common_1.ActionTitlePrefix)) && !sectionTitle && actionIdMatch && propertyIdMatch) ||
|
|
194
|
+
(!sectionTitle && actionIdMatch && propertyIdMatch && controlTypeMatch) ||
|
|
195
|
+
// Sections
|
|
196
|
+
(selector.includes(sectionTitle) && actionIdMatch && propertyIdMatch && controlTypeMatch)) {
|
|
197
|
+
configPart[propertyKey] = flexChange.newValue;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Checks for deprecated properties and writes them to the log
|
|
203
|
+
* @param manifestSection - given section in the manifest
|
|
204
|
+
* @param deprecatedProperties - list of deperecated properties
|
|
205
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
206
|
+
* @param manifestPath - manifest path, as calcualted by the sync rule
|
|
207
|
+
*/
|
|
208
|
+
function checkDeprecatedProperties(manifestSection, deprecatedProperties, importParameters, manifestPath) {
|
|
209
|
+
if (manifestSection && deprecatedProperties) {
|
|
210
|
+
for (const key in manifestSection) {
|
|
211
|
+
const deprecated = deprecatedProperties[key];
|
|
212
|
+
if (deprecated) {
|
|
213
|
+
extensionLogger_1.log(importParameters.logger, {
|
|
214
|
+
severity: "warning" /* Warning */,
|
|
215
|
+
message: common_1.getTextForDeprecated(key, deprecated),
|
|
216
|
+
location: {
|
|
217
|
+
path: 'webapp/manifest.json/',
|
|
218
|
+
range: manifestPath.split('/')
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
delete deprecatedProperties[key];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Imports manifest settings to the object page config
|
|
228
|
+
* @param syncRule - sync rule for accessing the reflect-metadata
|
|
229
|
+
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
230
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
231
|
+
* @param configPart - part of the configuration to be filled
|
|
232
|
+
* @param propertyKey - key of the current property of the schema definition
|
|
233
|
+
* @param deprecatedProperties - list od deperecated properties
|
|
234
|
+
* @param sectionId - ID of the given section (optional)
|
|
235
|
+
* @param sectionTitle - title of the section (optional)
|
|
236
|
+
*/
|
|
237
|
+
function importManifestSetting(syncRule, pageKeys, importParameters, configPart, propertyKey, deprecatedProperties, sectionId, sectionTitle) {
|
|
238
|
+
const sectionIdInManifest = sectionId ? sectionId.replace(/\/@/g, '::').replace(/@com.sap/g, 'com.sap') : undefined;
|
|
239
|
+
let manifestPath;
|
|
240
|
+
let manifestSection;
|
|
241
|
+
if (sectionTitle) {
|
|
242
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionTitle);
|
|
243
|
+
if (Object.values(manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath)).length !== 0) {
|
|
244
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
248
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
253
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
254
|
+
}
|
|
255
|
+
const importHandler = syncRule.manifest.import;
|
|
256
|
+
if (importHandler && typeof importHandler === 'function') {
|
|
257
|
+
const value = importHandler(manifestSection, sectionId);
|
|
258
|
+
if (value !== undefined) {
|
|
259
|
+
configPart[propertyKey] = value;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
const manifestKey = syncRule.manifest.key || propertyKey;
|
|
264
|
+
if (manifestKey in manifestSection) {
|
|
265
|
+
configPart[propertyKey] = manifestSection[manifestKey];
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Check for deprecated properties.
|
|
269
|
+
checkDeprecatedProperties(manifestSection, deprecatedProperties, importParameters, manifestPath);
|
|
270
|
+
return manifestSection;
|
|
271
|
+
}
|
|
122
272
|
/**
|
|
123
273
|
* Transfers settings from manifest and flexChanges to object page config
|
|
124
274
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
@@ -127,129 +277,102 @@ const getSectionType = (schemaSection) => {
|
|
|
127
277
|
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
128
278
|
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
129
279
|
* @param sectionId - ID of the given section (optional)
|
|
130
|
-
* @param sectionTitle -
|
|
280
|
+
* @param sectionTitle - Facet ID of the given section mentioned in annotations (optional)
|
|
131
281
|
* @param actionId - ID of the given action (optional)
|
|
132
282
|
*/
|
|
133
283
|
function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefinition, pageKeys, flexChanges, sectionId, sectionTitle, actionId) {
|
|
134
|
-
var _a;
|
|
135
284
|
if (!schemaDefinition) {
|
|
136
285
|
return;
|
|
137
286
|
}
|
|
138
|
-
let deprecatedProperties =
|
|
139
|
-
let manifestSection = {};
|
|
287
|
+
let deprecatedProperties = {};
|
|
140
288
|
if (configPart === null || configPart === void 0 ? void 0 : configPart.getDeprecated) {
|
|
141
289
|
deprecatedProperties = configPart.getDeprecated();
|
|
142
290
|
}
|
|
143
|
-
const unescapedId = sectionId && sectionId.replace(/::@com.sap.vocabularies/g, v2_1.VOCWITHSLASH);
|
|
144
291
|
for (const propertyKey in schemaDefinition['properties'] || schemaDefinition) {
|
|
145
292
|
const syncRule = common_1.getReflectMetadata(configPart, propertyKey);
|
|
146
293
|
if (syncRule || propertyKey === 'columns') {
|
|
147
|
-
if (propertyKey === 'columns' || (syncRule
|
|
294
|
+
if (propertyKey === 'columns' || (syncRule === null || syncRule === void 0 ? void 0 : syncRule.flex)) {
|
|
148
295
|
if (sectionId) {
|
|
149
|
-
|
|
150
|
-
const flexChange = flexChanges[selector];
|
|
151
|
-
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
152
|
-
const isTableColumn = propertyKey === 'columns' && flexChange.controlType === common_1.ControlType.TableColumn;
|
|
153
|
-
const facetIds = [sectionId, unescapedId, sectionTitle];
|
|
154
|
-
if ((propertyIdMatch || isTableColumn) && facetIds.indexOf(flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) > -1) {
|
|
155
|
-
table_1.addFlexForTable(configPart, flexChanges[selector], importParameters.jsonSchema);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
296
|
+
importFlexChangesOfTable(flexChanges, propertyKey, configPart, importParameters, sectionTitle, sectionId);
|
|
158
297
|
}
|
|
159
298
|
else {
|
|
160
|
-
|
|
161
|
-
const flexChange = flexChanges[selector];
|
|
162
|
-
const actionIdMatch = !actionId || new RegExp(`.*${actionId}\\d?$`).test(selector);
|
|
163
|
-
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
164
|
-
const schemaControlType = (_a = schemaDefinition['properties'][flexChange.propertyId]) === null || _a === void 0 ? void 0 : _a.controlType;
|
|
165
|
-
const controlTypeMatch = flexChange.controlType === schemaControlType;
|
|
166
|
-
if (!flexChange.facetId && actionIdMatch && propertyIdMatch) {
|
|
167
|
-
addFlexToConfig(configPart, propertyKey, flexChange.newValue);
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
else if (flexChange.facetId === 'action' &&
|
|
171
|
-
!sectionTitle &&
|
|
172
|
-
actionIdMatch &&
|
|
173
|
-
propertyIdMatch) {
|
|
174
|
-
// Actions
|
|
175
|
-
addFlexToConfig(configPart, propertyKey, flexChange.newValue);
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
else if (!sectionTitle && actionIdMatch && propertyIdMatch && controlTypeMatch) {
|
|
179
|
-
addFlexToConfig(configPart, propertyKey, flexChange.newValue);
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
else if (selector.includes(sectionTitle) &&
|
|
183
|
-
actionIdMatch &&
|
|
184
|
-
propertyIdMatch &&
|
|
185
|
-
controlTypeMatch) {
|
|
186
|
-
// Sections
|
|
187
|
-
addFlexToConfig(configPart, propertyKey, flexChange.newValue);
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
299
|
+
importFlexChanges(schemaDefinition, configPart, flexChanges, propertyKey, sectionTitle, actionId);
|
|
191
300
|
}
|
|
192
301
|
}
|
|
193
302
|
else if (syncRule.manifest) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
303
|
+
importManifestSetting(syncRule, pageKeys, importParameters, configPart, propertyKey, deprecatedProperties, sectionId, sectionTitle);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* @param actionType - type of action
|
|
311
|
+
* @param configActionId - id of action in config
|
|
312
|
+
* @param {ActionTypeV2|string} importTypeId - type of action that was be initiated
|
|
313
|
+
* @returns {string} actionId - to be used for import of flex changes
|
|
314
|
+
*/
|
|
315
|
+
function getActionId(actionType, configActionId, importTypeId, facetId) {
|
|
316
|
+
if (actionType === types_1.ActionTypeV2.Form) {
|
|
317
|
+
return `${configActionId}::${facetId}::${importTypeId}`;
|
|
318
|
+
}
|
|
319
|
+
else if (actionType === types_1.ActionTypeV2.OPFooter) {
|
|
320
|
+
return `${configActionId}::Determining`;
|
|
321
|
+
}
|
|
322
|
+
else if (actionType === types_1.ActionTypeV2.OPToolBar) {
|
|
323
|
+
return configActionId.includes('sAction::')
|
|
324
|
+
? configActionId.split('sAction::')[1]
|
|
325
|
+
: configActionId.replace(':2f', '::');
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
return configActionId;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Fills the action of the configuration
|
|
333
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
334
|
+
* @param {object} actionProperties - current properties' list (of action)
|
|
335
|
+
* @param {object} configPart - the given part of the object page config
|
|
336
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
337
|
+
* @param {ActionTypeV2|string} importTypeId - type of action that should be initiated
|
|
338
|
+
*/
|
|
339
|
+
function fillActions(importParameters, actionProperties, configPart, configParameters, importTypeId, facetId) {
|
|
340
|
+
configPart['actions'] = {};
|
|
341
|
+
const actionType = importTypeId.split('::').pop();
|
|
342
|
+
if (configParameters.flexChanges.constructor === Object && Object.keys(configParameters.flexChanges).length !== 0) {
|
|
343
|
+
for (const actionProperty in actionProperties) {
|
|
344
|
+
const configActionId = actionProperty.replace(/@/g, '::');
|
|
345
|
+
const actionId = getActionId(actionType, configActionId, importTypeId, facetId);
|
|
346
|
+
configPart['actions'][configActionId] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, actionType);
|
|
347
|
+
if (actionId) {
|
|
348
|
+
transferSettingsAndFlexChanges(importParameters, configPart['actions'][configActionId], importParameters.jsonSchema['definitions'][actionType], configParameters.pageKeys, configParameters.flexChanges, undefined, undefined, actionId);
|
|
349
|
+
}
|
|
350
|
+
if (Object.keys(configPart['actions'][configActionId]).length === 0) {
|
|
351
|
+
delete configPart['actions'][configActionId];
|
|
229
352
|
}
|
|
230
353
|
}
|
|
231
354
|
}
|
|
355
|
+
if (Object.keys(configPart['actions']).length === 0) {
|
|
356
|
+
delete configPart['actions'];
|
|
357
|
+
}
|
|
232
358
|
}
|
|
233
359
|
/**
|
|
234
360
|
* Fills the fields of an object page form
|
|
361
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
235
362
|
* @param escapedId - current Id for config part
|
|
236
363
|
* @param fieldProperties - current properties' list (of fields)
|
|
237
364
|
* @param configPart - the given part of the object page config
|
|
238
|
-
* @param
|
|
239
|
-
* @param jsonSchema - app specific schema
|
|
240
|
-
* @param {MetadataInstanceInterface} factory - factory, for generating the access to reflect-metadata
|
|
241
|
-
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
242
|
-
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
365
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
243
366
|
*/
|
|
244
|
-
function fillFields(importParameters, escapedId, fieldProperties, configPart,
|
|
367
|
+
function fillFields(importParameters, escapedId, fieldProperties, configPart, configParameters) {
|
|
245
368
|
let fieldId;
|
|
246
369
|
configPart[escapedId]['form']['fields'] = {};
|
|
247
370
|
for (const fieldProperty in fieldProperties) {
|
|
248
371
|
fieldId = fieldProperty.includes('::')
|
|
249
372
|
? fieldProperty.split('::')[1] + '::GroupElement'
|
|
250
373
|
: fieldProperty + '::GroupElement';
|
|
251
|
-
configPart[escapedId]['form']['fields'][fieldProperty] = factory.createInstance(common_2.PageType.ObjectPage, 'Field');
|
|
252
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedId]['form']['fields'][fieldProperty], importParameters.jsonSchema['definitions']['Field'], pageKeys, flexChanges, undefined, undefined, fieldId);
|
|
374
|
+
configPart[escapedId]['form']['fields'][fieldProperty] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'Field');
|
|
375
|
+
transferSettingsAndFlexChanges(importParameters, configPart[escapedId]['form']['fields'][fieldProperty], importParameters.jsonSchema['definitions']['Field'], configParameters.pageKeys, configParameters.flexChanges, undefined, undefined, fieldId);
|
|
253
376
|
if (Object.keys(configPart[escapedId]['form']['fields'][fieldProperty]).length === 0) {
|
|
254
377
|
delete configPart[escapedId]['form']['fields'][fieldProperty];
|
|
255
378
|
}
|
|
@@ -259,193 +382,205 @@ function fillFields(importParameters, escapedId, fieldProperties, configPart, fa
|
|
|
259
382
|
}
|
|
260
383
|
}
|
|
261
384
|
/**
|
|
262
|
-
*
|
|
263
|
-
* @param {ImportObjectPageV2Parameters} importParameters
|
|
264
|
-
* @param
|
|
265
|
-
* @param
|
|
266
|
-
* @param {
|
|
267
|
-
* @param
|
|
268
|
-
* @param manifest - manifest.json of the app
|
|
269
|
-
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
270
|
-
* @param logger - Logger class for logging messages
|
|
271
|
-
* @param sectionId - ID of the current section
|
|
272
|
-
* @param sectionType - Section type (Sub/Section Table)
|
|
385
|
+
* Fills the table section of the object page config
|
|
386
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
387
|
+
* @param {SectionPartProperties} sectionPart - current properties' list
|
|
388
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
389
|
+
* @param {object} configPart - the given part of the object page config
|
|
390
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
273
391
|
*/
|
|
274
|
-
function fillTableInConfig(importParameters,
|
|
275
|
-
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
const manifestKey =
|
|
392
|
+
function fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
393
|
+
var _a, _b;
|
|
394
|
+
const sectionTitle = ((_a = sectionPart.schema['title']) === null || _a === void 0 ? void 0 : _a.startsWith(v2_1.FacetTitlePrefix)) ? sectionPart.schema['title'].split(v2_1.FacetTitlePrefix)[1]
|
|
395
|
+
: undefined;
|
|
396
|
+
const manifestKey = sectionTitle || sectionPart.id.replace('@com.sap', 'com.sap');
|
|
279
397
|
const manifestSection = manifestSettings && manifestSettings.sections && manifestSettings.sections[manifestKey];
|
|
280
|
-
if (manifestSection || flexChanges) {
|
|
281
|
-
const tableType = manifestSection
|
|
282
|
-
? manifestSection.tableSettings
|
|
283
|
-
? manifestSection.tableSettings.type
|
|
284
|
-
? manifestSection.tableSettings.type
|
|
285
|
-
: 'ResponsiveTable'
|
|
286
|
-
: 'ResponsiveTable'
|
|
287
|
-
: 'ResponsiveTable';
|
|
398
|
+
if (manifestSection || configParameters.flexChanges) {
|
|
399
|
+
const tableType = ((_b = manifestSection === null || manifestSection === void 0 ? void 0 : manifestSection.tableSettings) === null || _b === void 0 ? void 0 : _b.type) || 'ResponsiveTable';
|
|
288
400
|
//Instantiate metadata
|
|
289
|
-
const OPtable = factory.createInstance(common_2.PageType.ObjectPage, `ObjectPage${tableType}
|
|
290
|
-
|
|
291
|
-
|
|
401
|
+
const OPtable = configParameters.factory.createInstance(common_2.PageType.ObjectPage, `ObjectPage${tableType}`, {
|
|
402
|
+
toolBar: {}
|
|
403
|
+
});
|
|
404
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
405
|
+
table: {}
|
|
406
|
+
});
|
|
407
|
+
configPart[sectionPart.id]['table'] = OPtable;
|
|
292
408
|
let localJsonSchema;
|
|
293
409
|
const schemaDefinitions = importParameters.jsonSchema['definitions'];
|
|
294
410
|
if (tableType === 'TreeTable' || tableType === 'AnalyticalTable' || tableType === 'GridTable') {
|
|
295
|
-
localJsonSchema = schemaDefinitions[
|
|
411
|
+
localJsonSchema = schemaDefinitions[`ObjectPage${tableType}<${sectionPart.id}>`];
|
|
296
412
|
}
|
|
297
|
-
else {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
413
|
+
else if (schemaDefinitions[`ObjectPageResponsiveTableWithMultiSelect<${sectionPart.id}>`] &&
|
|
414
|
+
schemaDefinitions[`ObjectPageResponsiveTableWithInlineDelete<${sectionPart.id}>`]) {
|
|
415
|
+
localJsonSchema = JSON.parse(JSON.stringify(schemaDefinitions[`ObjectPageResponsiveTableWithMultiSelect<${sectionPart.id}>`]));
|
|
416
|
+
localJsonSchema['properties'] = Object.assign(Object.assign({}, localJsonSchema['properties']), schemaDefinitions[`ObjectPageResponsiveTableWithInlineDelete<${sectionPart.id}>`]['properties']);
|
|
417
|
+
}
|
|
418
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
419
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['table'], localJsonSchema, configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
420
|
+
const toolBarActions = JSON.parse(JSON.stringify(schemaDefinitions))[`Actions<${sectionPart.id}>`];
|
|
421
|
+
if (toolBarActions === null || toolBarActions === void 0 ? void 0 : toolBarActions['properties']) {
|
|
422
|
+
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.OPToolBar);
|
|
423
|
+
}
|
|
424
|
+
if (Object.keys(configPart[sectionPart.id]['table']['toolBar']).length === 0) {
|
|
425
|
+
delete configPart[sectionPart.id]['table']['toolBar'];
|
|
303
426
|
}
|
|
304
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
305
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId]['table'], localJsonSchema, pageKeys, flexChanges, sectionId, sectionTitle);
|
|
306
427
|
}
|
|
307
428
|
}
|
|
308
429
|
/**
|
|
309
430
|
* Fills custom columns in a V2 object page config JSON
|
|
310
|
-
* @param
|
|
311
|
-
* @param escapedSectionId - escaped version of the section ID
|
|
312
|
-
* @param sectionTitle - section
|
|
313
|
-
* @param configPart - the given part of the object page config
|
|
314
|
-
* @param manifest - manifest.json of the app
|
|
431
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
432
|
+
* @param {string} escapedSectionId - escaped version of the section ID
|
|
433
|
+
* @param {string} sectionTitle - title of current section, if available
|
|
434
|
+
* @param {object} configPart - the given part of the object page config
|
|
315
435
|
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
316
|
-
* @param {FileData[]} fragments - Array with XML fragments.
|
|
317
436
|
*/
|
|
318
|
-
function fillCustomColumnsInConfig(importParameters, escapedSectionId,
|
|
437
|
+
function fillCustomColumnsInConfig(importParameters, escapedSectionId, configPart, v2Page) {
|
|
319
438
|
const customColumnSchemaProp = importParameters.jsonSchema['definitions'][escapedSectionId].properties.custom;
|
|
320
439
|
const customColumnTarget = customColumnSchemaProp
|
|
321
|
-
?
|
|
440
|
+
? common_1.getTargetFromCustomColumnRef(customColumnSchemaProp.$ref)
|
|
322
441
|
: undefined;
|
|
323
442
|
if (customColumnTarget) {
|
|
324
443
|
const objectPageSectionData = {
|
|
325
|
-
key:
|
|
444
|
+
key: escapedSectionId.replace('@', ''),
|
|
326
445
|
target: customColumnTarget
|
|
327
446
|
};
|
|
328
|
-
|
|
447
|
+
common_3.addFragments(configPart[escapedSectionId], importParameters.manifest, v2Page, common_2.PageType.ObjectPage, importParameters.fragments, objectPageSectionData);
|
|
329
448
|
}
|
|
330
449
|
}
|
|
331
450
|
/**
|
|
332
|
-
* Fills the
|
|
451
|
+
* Fills the sections and subsections of the object page config (recursive function)
|
|
333
452
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
334
|
-
* @param
|
|
335
|
-
* @param
|
|
336
|
-
* @param
|
|
337
|
-
* @param {
|
|
338
|
-
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
339
|
-
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
453
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of chart section
|
|
454
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
455
|
+
* @param {object} configPart - the given part of the object page config
|
|
456
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
340
457
|
*/
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
delete configPart['actions'][configActionId];
|
|
353
|
-
}
|
|
354
|
-
}
|
|
458
|
+
function fillChartSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
459
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
460
|
+
const manifestKey = sectionPart.id.replace('@com.sap', 'com.sap');
|
|
461
|
+
const manifestSection = manifestSettings && manifestSettings.sections && manifestSettings.sections[manifestKey];
|
|
462
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
463
|
+
chart: {}
|
|
464
|
+
});
|
|
465
|
+
configPart[sectionPart.id]['chart'] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageChart');
|
|
466
|
+
if (manifestSection || configParameters.flexChanges) {
|
|
467
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
468
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['chart'], importParameters.jsonSchema['definitions']['ObjectPageChart'], configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
355
469
|
}
|
|
356
|
-
|
|
357
|
-
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Fills the form section of the object page config
|
|
473
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
474
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of form section
|
|
475
|
+
* @param {object} configPart - the given part of the object page config
|
|
476
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
477
|
+
*/
|
|
478
|
+
function fillFormSection(importParameters, sectionPart, configPart, configParameters) {
|
|
479
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
480
|
+
const formId = sectionPart.schema['properties']['form']['$ref'].split('SectionForm')[1];
|
|
481
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
482
|
+
form: {}
|
|
483
|
+
});
|
|
484
|
+
if (configParameters.flexChanges) {
|
|
485
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
486
|
+
}
|
|
487
|
+
const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
|
|
488
|
+
const formFacetId = sectionTitle || sectionPart.id.replace(/@/g, '::').replace(/::com/g, 'com');
|
|
489
|
+
if (formActions && formActions['properties']) {
|
|
490
|
+
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters, types_1.ActionTypeV2.Form, formFacetId);
|
|
491
|
+
}
|
|
492
|
+
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
493
|
+
if (formFields['properties']) {
|
|
494
|
+
fillFields(importParameters, sectionPart.id, formFields.properties, configPart, configParameters);
|
|
495
|
+
}
|
|
496
|
+
if (Object.keys(configPart[sectionPart.id]['form']).length === 0) {
|
|
497
|
+
delete configPart[sectionPart.id]['form'];
|
|
498
|
+
}
|
|
499
|
+
if (Object.keys(configPart[sectionPart.id]).length === 0) {
|
|
500
|
+
delete configPart[sectionPart.id];
|
|
358
501
|
}
|
|
359
502
|
}
|
|
360
503
|
/**
|
|
361
|
-
* Fills the
|
|
362
|
-
* @param {ImportObjectPageV2Parameters} importParameters
|
|
363
|
-
* @param
|
|
364
|
-
* @param manifestSettings - object page settings section of the manifest
|
|
365
|
-
* @param configPart - the given part of the object page config
|
|
366
|
-
* @param
|
|
367
|
-
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
368
|
-
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
369
|
-
* @param {ObjectPageConfig} objectPageConfig - page config object.
|
|
504
|
+
* Fills the subsection of the object page config
|
|
505
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
506
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of subsection
|
|
507
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
508
|
+
* @param {object} configPart - the given part of the object page config
|
|
509
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
370
510
|
*/
|
|
371
|
-
function
|
|
511
|
+
function fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
372
512
|
var _a, _b;
|
|
373
|
-
|
|
513
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
514
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
515
|
+
subsections: {}
|
|
516
|
+
});
|
|
517
|
+
if (configParameters.flexChanges) {
|
|
518
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
519
|
+
}
|
|
520
|
+
let currentSchemaSection;
|
|
521
|
+
if ((_b = (_a = sectionPart.schema['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
|
|
522
|
+
currentSchemaSection = sectionPart.schema['properties']['subsections']['properties'];
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
currentSchemaSection = sectionPart.schema['properties'];
|
|
526
|
+
}
|
|
527
|
+
fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[sectionPart.id]['subsections'], configParameters);
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Fills the sections and subsections of the object page config (recursive function)
|
|
531
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
532
|
+
* @param {object} sectionProperties - current properties' list (of sections or subsections)
|
|
533
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
534
|
+
* @param {object} configPart - the given part of the object page config
|
|
535
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig.
|
|
536
|
+
*/
|
|
537
|
+
function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, configParameters) {
|
|
374
538
|
for (const sectionId in sectionProperties) {
|
|
375
539
|
const escapedSectionId = sectionId.replace(/\/@/g, '::');
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
417
|
-
if (formFields['properties']) {
|
|
418
|
-
fillFields(importParameters, escapedSectionId, formFields.properties, configPart, factory, pageKeys, flexChanges);
|
|
419
|
-
}
|
|
420
|
-
if (Object.keys(configPart[escapedSectionId]['form']).length === 0) {
|
|
421
|
-
delete configPart[escapedSectionId]['form'];
|
|
422
|
-
}
|
|
423
|
-
if (Object.keys(configPart[escapedSectionId]).length === 0) {
|
|
424
|
-
delete configPart[escapedSectionId];
|
|
540
|
+
const sectionPart = {
|
|
541
|
+
id: escapedSectionId,
|
|
542
|
+
type: getSectionType(sectionProperties[sectionId]),
|
|
543
|
+
schema: sectionProperties[sectionId]
|
|
544
|
+
};
|
|
545
|
+
if (sectionPart.schema['$ref'] && sectionPart.type) {
|
|
546
|
+
switch (sectionPart.type) {
|
|
547
|
+
case types_1.SectionTypeV2.SectionTable:
|
|
548
|
+
case types_1.SectionTypeV2.SubSectionTable: {
|
|
549
|
+
sectionPart.schema =
|
|
550
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
551
|
+
fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
552
|
+
// Custom column ref
|
|
553
|
+
fillCustomColumnsInConfig(importParameters, escapedSectionId, configPart, configParameters.v2Page);
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
case types_1.SectionTypeV2.SectionChart:
|
|
557
|
+
case types_1.SectionTypeV2.SubSectionChart: {
|
|
558
|
+
// Section without subsections
|
|
559
|
+
sectionPart.schema =
|
|
560
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
561
|
+
fillChartSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
case types_1.SectionTypeV2.SectionForm:
|
|
565
|
+
case types_1.SectionTypeV2.SubSectionForm: {
|
|
566
|
+
sectionPart.schema =
|
|
567
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
568
|
+
fillFormSection(importParameters, sectionPart, configPart, configParameters);
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
case types_1.SectionTypeV2.Section:
|
|
572
|
+
case types_1.SectionTypeV2.SubSection: {
|
|
573
|
+
// Section with subsections
|
|
574
|
+
sectionPart.schema =
|
|
575
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
576
|
+
fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
425
579
|
}
|
|
426
580
|
}
|
|
427
|
-
else if (
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
getSectionType(schemaSection) === types_1.SectionTypeV2.SubSection))) {
|
|
431
|
-
// Section with subsections
|
|
432
|
-
const sectionType = getSectionType(schemaSection);
|
|
433
|
-
schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
|
|
434
|
-
const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
|
|
435
|
-
configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, {
|
|
436
|
-
subsections: {}
|
|
437
|
-
});
|
|
438
|
-
if (flexChanges) {
|
|
439
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
440
|
-
}
|
|
441
|
-
let currentSchemaSection;
|
|
442
|
-
if ((_b = (_a = schemaSection['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
|
|
443
|
-
currentSchemaSection = schemaSection['properties']['subsections']['properties'];
|
|
444
|
-
}
|
|
445
|
-
else {
|
|
446
|
-
currentSchemaSection = schemaSection['properties'];
|
|
447
|
-
}
|
|
448
|
-
fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[escapedSectionId]['subsections'], factory, pageKeys, flexChanges, v2Page, objectPageConfig);
|
|
581
|
+
else if (sectionPart.schema['properties'] && sectionPart.schema['properties']['subsections']) {
|
|
582
|
+
sectionPart.schema = importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
583
|
+
fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
449
584
|
}
|
|
450
585
|
}
|
|
451
586
|
}
|
|
@@ -458,23 +593,28 @@ function fillSectionsInConfig(importParameters, sectionProperties, manifestSetti
|
|
|
458
593
|
* @param {MetadataInstanceInterface} factory - factory, for generating the access to reflect-metadata
|
|
459
594
|
* @returns {ObjectPageConfig} - the object page configuration (JSON)
|
|
460
595
|
*/
|
|
461
|
-
function fillConfig(importParameters,
|
|
462
|
-
const objectPageConfig = factory.createPageInstance(common_2.PageType.ObjectPage);
|
|
463
|
-
const manifestSettings = v2Page.component.settings;
|
|
596
|
+
function fillConfig(importParameters, configParameters) {
|
|
597
|
+
const objectPageConfig = configParameters.factory.createPageInstance(common_2.PageType.ObjectPage);
|
|
598
|
+
const manifestSettings = configParameters.v2Page.component.settings;
|
|
464
599
|
// Transfer page information
|
|
465
|
-
transferSettingsAndFlexChanges(importParameters, objectPageConfig, importParameters.jsonSchema['properties'], pageKeys,
|
|
600
|
+
transferSettingsAndFlexChanges(importParameters, objectPageConfig, importParameters.jsonSchema['properties'], configParameters.pageKeys, configParameters.flexChanges);
|
|
466
601
|
// Transfer header information
|
|
467
|
-
objectPageConfig.header = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageHeader');
|
|
602
|
+
objectPageConfig.header = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageHeader');
|
|
468
603
|
transferSettingsAndFlexChanges(importParameters, objectPageConfig.header, importParameters.jsonSchema['definitions']['ObjectPageHeader']
|
|
469
604
|
? importParameters.jsonSchema['definitions']['ObjectPageHeader']
|
|
470
|
-
: importParameters.jsonSchema['definitions']['ObjectPageHeader<GenericActions>'], pageKeys,
|
|
605
|
+
: importParameters.jsonSchema['definitions']['ObjectPageHeader<GenericActions>'], configParameters.pageKeys, configParameters.flexChanges);
|
|
471
606
|
const headerAction = importParameters.jsonSchema['definitions']['HeaderActions'];
|
|
472
607
|
if (headerAction) {
|
|
473
|
-
fillActions(importParameters, headerAction.properties, objectPageConfig.header,
|
|
608
|
+
fillActions(importParameters, headerAction.properties, objectPageConfig.header, configParameters, types_1.ActionTypeV2.Header);
|
|
609
|
+
}
|
|
610
|
+
objectPageConfig.footer = {};
|
|
611
|
+
const footerAction = importParameters.jsonSchema['definitions']['FooterActions'];
|
|
612
|
+
if (footerAction) {
|
|
613
|
+
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.OPFooter);
|
|
474
614
|
}
|
|
475
615
|
// Transfer Layout information
|
|
476
|
-
objectPageConfig.layout = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|
|
477
|
-
transferSettingsAndFlexChanges(importParameters, objectPageConfig.layout, importParameters.jsonSchema['definitions']['ObjectPageLayout'], pageKeys,
|
|
616
|
+
objectPageConfig.layout = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|
|
617
|
+
transferSettingsAndFlexChanges(importParameters, objectPageConfig.layout, importParameters.jsonSchema['definitions']['ObjectPageLayout'], configParameters.pageKeys, configParameters.flexChanges);
|
|
478
618
|
if (Object.keys(objectPageConfig.layout).length === 0) {
|
|
479
619
|
delete objectPageConfig.layout;
|
|
480
620
|
}
|
|
@@ -482,7 +622,7 @@ function fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page,
|
|
|
482
622
|
objectPageConfig.sections = {};
|
|
483
623
|
const sections = importParameters.jsonSchema['definitions']['Sections'];
|
|
484
624
|
if (sections) {
|
|
485
|
-
fillSectionsInConfig(importParameters, sections.properties, manifestSettings, objectPageConfig.sections,
|
|
625
|
+
fillSectionsInConfig(importParameters, sections.properties, manifestSettings, objectPageConfig.sections, configParameters);
|
|
486
626
|
}
|
|
487
627
|
// Find custom sections
|
|
488
628
|
const customSections = utils_1.findCustomSectionExtensions(importParameters.manifest, importParameters.entitySet);
|
|
@@ -490,11 +630,11 @@ function fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page,
|
|
|
490
630
|
objectPageConfig.sections.custom = [];
|
|
491
631
|
for (const sectionId in customSections) {
|
|
492
632
|
const customSection = 'fragmentName' in customSections[sectionId]
|
|
493
|
-
? factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionFragment')
|
|
494
|
-
: factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionView');
|
|
633
|
+
? configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionFragment')
|
|
634
|
+
: configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionView');
|
|
495
635
|
transferSettingsAndFlexChanges(importParameters, customSection, importParameters.jsonSchema['definitions']['fragmentName' in customSections[sectionId]
|
|
496
636
|
? 'ObjectPageCustomSectionFragment'
|
|
497
|
-
: 'ObjectPageCustomSectionView'], pageKeys,
|
|
637
|
+
: 'ObjectPageCustomSectionView'], configParameters.pageKeys, configParameters.flexChanges, sectionId);
|
|
498
638
|
objectPageConfig.sections.custom.push(customSection);
|
|
499
639
|
}
|
|
500
640
|
}
|
|
@@ -549,7 +689,7 @@ function createObjectPageConfigV2(importParameters) {
|
|
|
549
689
|
const flexChangesForTransfer = prepareFlexChanges(importParameters.flex, entitySet);
|
|
550
690
|
const factory = new factory_1.MetadataInstanceFactoryV2();
|
|
551
691
|
//Fill config.json with manifest settings and flex changes
|
|
552
|
-
return fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page, factory);
|
|
692
|
+
return fillConfig(importParameters, { pageKeys, flexChanges: flexChangesForTransfer, v2Page, factory });
|
|
553
693
|
}
|
|
554
694
|
exports.createObjectPageConfigV2 = createObjectPageConfigV2;
|
|
555
695
|
//# sourceMappingURL=objectPage.js.map
|