@sap/ux-specification 1.90.14 → 1.90.18
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 +98 -12
- 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 +42 -42
- package/dist/schemas/v2/ListReportConfig.json +59 -37
- package/dist/schemas/v2/ObjectPageConfig.json +200 -58
- package/dist/schemas/v2/OverviewPageConfig.json +258 -196
- package/dist/schemas/v4/AnalyticalListPageConfig.json +21 -2
- package/dist/schemas/v4/ListReportConfig.json +21 -2
- package/dist/schemas/v4/ObjectPageConfig.json +0 -20
- 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 +11 -2
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/src/specification/v2/controls/Action.d.ts +54 -0
- package/dist/src/specification/v2/controls/{ObjectPageHeaderAction.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 +16 -6
- package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +2 -2
- package/dist/src/specification/v2/controls/{ObjectPageHeaderAction.d.ts → ObjectPageFooterAction.d.ts} +8 -7
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.js +3 -0
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.js.map +1 -0
- package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +1 -2
- package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +3 -6
- package/dist/src/specification/v2/controls/ObjectPageHeader.js +0 -5
- package/dist/src/specification/v2/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +7 -2
- package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +1 -5
- package/dist/src/specification/v2/controls/Table.d.ts +8 -24
- package/dist/src/specification/v2/controls/Table.js +0 -15
- package/dist/src/specification/v2/controls/Table.js.map +1 -1
- package/dist/src/specification/v2/controls/ToolBar.d.ts +2 -2
- package/dist/src/specification/v2/controls/index.d.ts +8 -9
- package/dist/src/specification/v2/controls/index.js +2 -4
- package/dist/src/specification/v2/controls/index.js.map +1 -1
- package/dist/src/specification/v2/pages/ListReportConfig.d.ts +2 -2
- package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +2 -2
- package/dist/src/specification/v4/controls/Table.d.ts +3 -2
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +8 -19
- 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/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.js +22 -17
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +66 -0
- package/dist/src/sync/common/generate/utils.js +205 -0
- package/dist/src/sync/common/generate/utils.js.map +1 -0
- package/dist/src/sync/common/importProject.js +8 -8
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +3 -30
- package/dist/src/sync/common/utils.js +15 -113
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +14 -0
- package/dist/src/sync/v2/export/controls/Action.js +74 -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 +34 -11
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.d.ts +8 -7
- package/dist/src/sync/v2/export/controls/FormAction.js +15 -53
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +5 -4
- 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/ObjectPageHeader.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +5 -4
- 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/ObjectPageTable.d.ts +5 -2
- 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 +59 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Table.d.ts +6 -5
- 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 +3 -2
- 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 +1 -1
- 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/pages/ListReport.d.ts +2 -2
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +6 -3
- 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 +18 -3
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts +0 -1
- package/dist/src/sync/v2/generate/objectPage.js +204 -122
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +3 -3
- package/dist/src/sync/v2/generate/utils.js +22 -14
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.d.ts +8 -1
- package/dist/src/sync/v2/import/common/index.js +107 -43
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.js +33 -2
- 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 +305 -240
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.d.ts +1 -1
- package/dist/src/sync/v2/import/utils.js +2 -2
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +21 -2
- package/dist/src/sync/v2/types.js +7 -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 +3 -2
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js +3 -10
- 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 -1
- package/dist/src/sync/v4/export/controls/TableColumn.js +5 -2
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +21 -14
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/types.d.ts +1 -0
- package/dist/src/sync/v4/generate/listReport.d.ts +2 -1
- package/dist/src/sync/v4/generate/listReport.js +47 -1
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +100 -50
- 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/listReport.d.ts +1 -3
- package/dist/src/sync/v4/import/pages/listReport.js +27 -17
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.js +10 -12
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +1 -8
- package/dist/src/sync/v4/utils/utils.js +31 -53
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +19 -17
- package/dist/src/specification/v2/controls/FormAction.d.ts +0 -43
- package/dist/src/specification/v2/controls/FormAction.js +0 -20
- package/dist/src/specification/v2/controls/FormAction.js.map +0 -1
- package/dist/src/specification/v2/controls/ObjectPageHeaderAction.js.map +0 -1
|
@@ -16,6 +16,66 @@ const common_2 = require("../../../../specification/common");
|
|
|
16
16
|
const listReport_1 = require("../pages/listReport");
|
|
17
17
|
const factory_1 = require("../../export/factory");
|
|
18
18
|
const types_1 = require("../../types");
|
|
19
|
+
const common_3 = require("../common");
|
|
20
|
+
/**
|
|
21
|
+
* Determines Facet ID from single string selector Id
|
|
22
|
+
* @param {string} selectorId Selector ID
|
|
23
|
+
* @returns {string} FacetID
|
|
24
|
+
*/
|
|
25
|
+
function getSingleSelectorIdPart(selectorIdParts, facetID) {
|
|
26
|
+
const lastIdParts = selectorIdParts[0].split('-');
|
|
27
|
+
const id = lastIdParts[lastIdParts.length - 1];
|
|
28
|
+
if (selectorIdParts[0].indexOf("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) >= 0 && selectorIdParts[0].indexOf('action') >= 0) {
|
|
29
|
+
// Object Page ToolBar Actions
|
|
30
|
+
facetID = lastIdParts[0].split(`${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}::`)[1].split('::')[0];
|
|
31
|
+
}
|
|
32
|
+
else if (selectorIdParts[0].indexOf("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) >= 0 ||
|
|
33
|
+
selectorIdParts[0].indexOf('UI.LineItem') >= 0 ||
|
|
34
|
+
selectorIdParts[0].indexOf('::Table') >= 0) {
|
|
35
|
+
facetID = lastIdParts[0]
|
|
36
|
+
.split('::Table')[0]
|
|
37
|
+
.split('::responsiveTable')[0]
|
|
38
|
+
.replace(/::/g, '/@');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const idParts = id.split('::');
|
|
42
|
+
if (idParts.length > 1) {
|
|
43
|
+
facetID = idParts[0];
|
|
44
|
+
}
|
|
45
|
+
else if (lastIdParts[0].indexOf('::') > -1) {
|
|
46
|
+
facetID = lastIdParts[0].split('::')[0];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return facetID;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Determines Facet ID of flex change
|
|
53
|
+
* @param {string} selectorId Control ID of flex change
|
|
54
|
+
* @returns {string} FacetID
|
|
55
|
+
*/
|
|
56
|
+
function getFacetID(selectorId) {
|
|
57
|
+
let facetID;
|
|
58
|
+
const selectorIdParts = selectorId.split(':::');
|
|
59
|
+
if (selectorIdParts.length === 1) {
|
|
60
|
+
facetID = getSingleSelectorIdPart(selectorIdParts, facetID);
|
|
61
|
+
}
|
|
62
|
+
else if (selectorId.indexOf('sSmartTableId') >= 0) {
|
|
63
|
+
for (const element of selectorIdParts) {
|
|
64
|
+
if (element.startsWith('sSmartTableId')) {
|
|
65
|
+
facetID = element
|
|
66
|
+
.split('sSmartTableId::')[1]
|
|
67
|
+
.split('::Table')[0]
|
|
68
|
+
.split('/responsiveTable')[0]
|
|
69
|
+
.replace(`::${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`, `/@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
facetID = selectorIdParts[0];
|
|
76
|
+
}
|
|
77
|
+
return facetID;
|
|
78
|
+
}
|
|
19
79
|
/**
|
|
20
80
|
* Prepares the list of flex changes
|
|
21
81
|
* @param change - the flex change (UI Adaptation)
|
|
@@ -35,48 +95,8 @@ function prepareFlexChanges(changes, entitySet, logger) {
|
|
|
35
95
|
if (complexIdMatch.exec(selectorId) !== null) {
|
|
36
96
|
selectorId = selectorId.split('template:::TableColumn:::')[1];
|
|
37
97
|
}
|
|
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, '#')
|
|
98
|
+
const facetID = getFacetID(selectorId);
|
|
99
|
+
selectorId = common_3.convertSelector(selectorId)
|
|
80
100
|
.replace(/:3a:3a/g, '::')
|
|
81
101
|
.replace(/\/@com.sap.vocabularies/g, '::com.sap.vocabularies');
|
|
82
102
|
if (result[selectorId] && result[selectorId].propertyId !== change.content.property) {
|
|
@@ -105,17 +125,18 @@ const addFlexToConfig = (config, propertyKey, flexChange) => {
|
|
|
105
125
|
config[propertyKey] = flexChange;
|
|
106
126
|
};
|
|
107
127
|
const getSectionType = (schemaSection) => {
|
|
128
|
+
var _a, _b, _c;
|
|
108
129
|
let reference;
|
|
109
130
|
if (schemaSection['$ref']) {
|
|
110
131
|
reference = schemaSection['$ref'].includes('<') ? schemaSection['$ref'].split('<')[0] : schemaSection['$ref'];
|
|
111
132
|
return reference.replace(common_1.DEFINITION_LINK_PREFIX, '');
|
|
112
133
|
}
|
|
113
|
-
else if (schemaSection['properties']['subsections']['$ref']) {
|
|
134
|
+
else if ((_b = (_a = schemaSection['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['$ref']) {
|
|
114
135
|
reference = schemaSection['properties']['subsections']['$ref'];
|
|
115
136
|
reference = reference.includes('<') ? reference.split('<')[0] : reference;
|
|
116
137
|
return reference.replace(common_1.DEFINITION_LINK_PREFIX, '');
|
|
117
138
|
}
|
|
118
|
-
else if (schemaSection['properties']['subsections']) {
|
|
139
|
+
else if ((_c = schemaSection['properties']) === null || _c === void 0 ? void 0 : _c['subsections']) {
|
|
119
140
|
return types_1.SectionTypeV2.SubSection;
|
|
120
141
|
}
|
|
121
142
|
};
|
|
@@ -127,7 +148,6 @@ const getSectionType = (schemaSection) => {
|
|
|
127
148
|
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
128
149
|
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
129
150
|
* @param sectionId - ID of the given section (optional)
|
|
130
|
-
* @param sectionTitle - title of the section (optional)
|
|
131
151
|
* @param actionId - ID of the given action (optional)
|
|
132
152
|
*/
|
|
133
153
|
function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefinition, pageKeys, flexChanges, sectionId, sectionTitle, actionId) {
|
|
@@ -163,29 +183,13 @@ function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefi
|
|
|
163
183
|
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
164
184
|
const schemaControlType = (_a = schemaDefinition['properties'][flexChange.propertyId]) === null || _a === void 0 ? void 0 : _a.controlType;
|
|
165
185
|
const controlTypeMatch = flexChange.controlType === schemaControlType;
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
|
|
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
|
+
if (
|
|
187
|
+
// Actions
|
|
188
|
+
(flexChange.facetId === 'action' && !sectionTitle && actionIdMatch && propertyIdMatch) ||
|
|
189
|
+
(!sectionTitle && actionIdMatch && propertyIdMatch && controlTypeMatch) ||
|
|
186
190
|
// Sections
|
|
191
|
+
(selector.includes(sectionTitle) && actionIdMatch && propertyIdMatch && controlTypeMatch)) {
|
|
187
192
|
addFlexToConfig(configPart, propertyKey, flexChange.newValue);
|
|
188
|
-
break;
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
195
|
}
|
|
@@ -194,8 +198,21 @@ function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefi
|
|
|
194
198
|
const sectionIdInManifest = sectionId
|
|
195
199
|
? sectionId.replace(/\/@/g, '::').replace(/@com.sap/g, 'com.sap')
|
|
196
200
|
: undefined;
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
let path;
|
|
202
|
+
if (sectionTitle) {
|
|
203
|
+
path = syncRule.manifest.path(pageKeys, {}, sectionTitle);
|
|
204
|
+
if (Object.values(manifest_1.getManifestSectionByPathV2(importParameters.manifest, path)).length !== 0) {
|
|
205
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
path = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
209
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
path = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
214
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
|
|
215
|
+
}
|
|
199
216
|
const importHandler = syncRule.manifest.import;
|
|
200
217
|
if (importHandler && typeof importHandler === 'function') {
|
|
201
218
|
const value = importHandler(manifestSection, sectionId);
|
|
@@ -230,26 +247,59 @@ function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefi
|
|
|
230
247
|
}
|
|
231
248
|
}
|
|
232
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Fills the action of the configuration
|
|
252
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
253
|
+
* @param {object} actionProperties - current properties' list (of action)
|
|
254
|
+
* @param {object} configPart - the given part of the object page config
|
|
255
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
256
|
+
* @param {ActionTypeV2|string} importTypeId - type of action that should be initiated
|
|
257
|
+
*/
|
|
258
|
+
function fillActions(importParameters, actionProperties, configPart, configParameters, importTypeId) {
|
|
259
|
+
let actionId, configActionId;
|
|
260
|
+
configPart['actions'] = {};
|
|
261
|
+
importTypeId = importTypeId.replace(/@/g, '::');
|
|
262
|
+
const actionType = importTypeId.split('::').pop();
|
|
263
|
+
if (configParameters.flexChanges.constructor === Object && Object.keys(configParameters.flexChanges).length !== 0) {
|
|
264
|
+
for (const actionProperty in actionProperties) {
|
|
265
|
+
configActionId = actionProperty.replace(/@/g, '::');
|
|
266
|
+
if (actionType === types_1.ActionTypeV2.Form) {
|
|
267
|
+
actionId = `${configActionId}${importTypeId}`;
|
|
268
|
+
}
|
|
269
|
+
else if (actionType === types_1.ActionTypeV2.Footer) {
|
|
270
|
+
actionId = `${configActionId}::Determining`;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
actionId = configActionId;
|
|
274
|
+
}
|
|
275
|
+
configPart['actions'][configActionId] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, actionType);
|
|
276
|
+
transferSettingsAndFlexChanges(importParameters, configPart['actions'][configActionId], importParameters.jsonSchema['definitions'][actionType], configParameters.pageKeys, configParameters.flexChanges, undefined, undefined, actionId);
|
|
277
|
+
if (Object.keys(configPart['actions'][configActionId]).length === 0) {
|
|
278
|
+
delete configPart['actions'][configActionId];
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (Object.keys(configPart['actions']).length === 0) {
|
|
283
|
+
delete configPart['actions'];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
233
286
|
/**
|
|
234
287
|
* Fills the fields of an object page form
|
|
288
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
235
289
|
* @param escapedId - current Id for config part
|
|
236
290
|
* @param fieldProperties - current properties' list (of fields)
|
|
237
291
|
* @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)
|
|
292
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
243
293
|
*/
|
|
244
|
-
function fillFields(importParameters, escapedId, fieldProperties, configPart,
|
|
294
|
+
function fillFields(importParameters, escapedId, fieldProperties, configPart, configParameters) {
|
|
245
295
|
let fieldId;
|
|
246
296
|
configPart[escapedId]['form']['fields'] = {};
|
|
247
297
|
for (const fieldProperty in fieldProperties) {
|
|
248
298
|
fieldId = fieldProperty.includes('::')
|
|
249
299
|
? fieldProperty.split('::')[1] + '::GroupElement'
|
|
250
300
|
: 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);
|
|
301
|
+
configPart[escapedId]['form']['fields'][fieldProperty] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'Field');
|
|
302
|
+
transferSettingsAndFlexChanges(importParameters, configPart[escapedId]['form']['fields'][fieldProperty], importParameters.jsonSchema['definitions']['Field'], configParameters.pageKeys, configParameters.flexChanges, undefined, undefined, fieldId);
|
|
253
303
|
if (Object.keys(configPart[escapedId]['form']['fields'][fieldProperty]).length === 0) {
|
|
254
304
|
delete configPart[escapedId]['form']['fields'][fieldProperty];
|
|
255
305
|
}
|
|
@@ -259,61 +309,57 @@ function fillFields(importParameters, escapedId, fieldProperties, configPart, fa
|
|
|
259
309
|
}
|
|
260
310
|
}
|
|
261
311
|
/**
|
|
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)
|
|
312
|
+
* Fills the table section of the object page config
|
|
313
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
314
|
+
* @param {SectionPartProperties} sectionPart - current properties' list
|
|
315
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
316
|
+
* @param {object} configPart - the given part of the object page config
|
|
317
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
273
318
|
*/
|
|
274
|
-
function fillTableInConfig(importParameters,
|
|
275
|
-
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
const manifestKey =
|
|
319
|
+
function fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
320
|
+
var _a, _b;
|
|
321
|
+
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]
|
|
322
|
+
: undefined;
|
|
323
|
+
const manifestKey = sectionTitle || sectionPart.id.replace('@com.sap', 'com.sap');
|
|
279
324
|
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';
|
|
325
|
+
if (manifestSection || configParameters.flexChanges) {
|
|
326
|
+
const tableType = ((_b = manifestSection === null || manifestSection === void 0 ? void 0 : manifestSection.tableSettings) === null || _b === void 0 ? void 0 : _b.type) || 'ResponsiveTable';
|
|
288
327
|
//Instantiate metadata
|
|
289
|
-
const OPtable = factory.createInstance(common_2.PageType.ObjectPage, `ObjectPage${tableType}
|
|
290
|
-
|
|
291
|
-
|
|
328
|
+
const OPtable = configParameters.factory.createInstance(common_2.PageType.ObjectPage, `ObjectPage${tableType}`, {
|
|
329
|
+
toolBar: {}
|
|
330
|
+
});
|
|
331
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
332
|
+
table: {}
|
|
333
|
+
});
|
|
334
|
+
configPart[sectionPart.id]['table'] = OPtable;
|
|
292
335
|
let localJsonSchema;
|
|
293
336
|
const schemaDefinitions = importParameters.jsonSchema['definitions'];
|
|
294
337
|
if (tableType === 'TreeTable' || tableType === 'AnalyticalTable' || tableType === 'GridTable') {
|
|
295
|
-
localJsonSchema = schemaDefinitions[
|
|
338
|
+
localJsonSchema = schemaDefinitions[`ObjectPage${tableType}<${sectionPart.id}>`];
|
|
296
339
|
}
|
|
297
|
-
else {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
340
|
+
else if (schemaDefinitions[`ObjectPageResponsiveTableWithMultiSelect<${sectionPart.id}>`] &&
|
|
341
|
+
schemaDefinitions[`ObjectPageResponsiveTableWithInlineDelete<${sectionPart.id}>`]) {
|
|
342
|
+
localJsonSchema = JSON.parse(JSON.stringify(schemaDefinitions[`ObjectPageResponsiveTableWithMultiSelect<${sectionPart.id}>`]));
|
|
343
|
+
localJsonSchema['properties'] = Object.assign(Object.assign({}, localJsonSchema['properties']), schemaDefinitions[`ObjectPageResponsiveTableWithInlineDelete<${sectionPart.id}>`]['properties']);
|
|
344
|
+
}
|
|
345
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
346
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['table'], localJsonSchema, configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
347
|
+
const toolBarActions = JSON.parse(JSON.stringify(schemaDefinitions))[`Actions<${sectionPart.id}>`];
|
|
348
|
+
if (toolBarActions === null || toolBarActions === void 0 ? void 0 : toolBarActions['properties']) {
|
|
349
|
+
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.ToolBar);
|
|
350
|
+
}
|
|
351
|
+
if (Object.keys(configPart[sectionPart.id]['table']['toolBar']).length === 0) {
|
|
352
|
+
delete configPart[sectionPart.id]['table']['toolBar'];
|
|
303
353
|
}
|
|
304
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
305
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId]['table'], localJsonSchema, pageKeys, flexChanges, sectionId, sectionTitle);
|
|
306
354
|
}
|
|
307
355
|
}
|
|
308
356
|
/**
|
|
309
357
|
* 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
|
|
358
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
359
|
+
* @param {string} escapedSectionId - escaped version of the section ID
|
|
360
|
+
* @param {string} sectionTitle - title of current section, if available
|
|
361
|
+
* @param {object} configPart - the given part of the object page config
|
|
315
362
|
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
316
|
-
* @param {FileData[]} fragments - Array with XML fragments.
|
|
317
363
|
*/
|
|
318
364
|
function fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTitle, configPart, v2Page) {
|
|
319
365
|
const customColumnSchemaProp = importParameters.jsonSchema['definitions'][escapedSectionId].properties.custom;
|
|
@@ -331,122 +377,136 @@ function fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTi
|
|
|
331
377
|
/**
|
|
332
378
|
* Fills the sections and subsections of the object page config (recursive function)
|
|
333
379
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
334
|
-
* @param
|
|
335
|
-
* @param manifestSettings - object page settings section of the manifest
|
|
336
|
-
* @param configPart - the given part of the object page config
|
|
337
|
-
* @param
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
380
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of chart section
|
|
381
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
382
|
+
* @param {object} configPart - the given part of the object page config
|
|
383
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
384
|
+
*/
|
|
385
|
+
function fillChartSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
386
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
387
|
+
const manifestKey = sectionPart.id.replace('@com.sap', 'com.sap');
|
|
388
|
+
const manifestSection = manifestSettings && manifestSettings.sections && manifestSettings.sections[manifestKey];
|
|
389
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
390
|
+
chart: {}
|
|
391
|
+
});
|
|
392
|
+
configPart[sectionPart.id]['chart'] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageChart');
|
|
393
|
+
if (manifestSection || configParameters.flexChanges) {
|
|
394
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
395
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['chart'], importParameters.jsonSchema['definitions']['ObjectPageChart'], configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Fills the form section of the object page config
|
|
400
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
401
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of form section
|
|
402
|
+
* @param {object} configPart - the given part of the object page config
|
|
403
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
341
404
|
*/
|
|
342
|
-
function
|
|
405
|
+
function fillFormSection(importParameters, sectionPart, configPart, configParameters) {
|
|
406
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
407
|
+
const formId = sectionPart.schema['properties']['form']['$ref'].split('SectionForm')[1];
|
|
408
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
409
|
+
form: {}
|
|
410
|
+
});
|
|
411
|
+
if (configParameters.flexChanges) {
|
|
412
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
413
|
+
}
|
|
414
|
+
const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
|
|
415
|
+
if (formActions && formActions['properties']) {
|
|
416
|
+
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters, `${sectionPart.id}::${types_1.ActionTypeV2.Form}`);
|
|
417
|
+
}
|
|
418
|
+
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
419
|
+
if (formFields['properties']) {
|
|
420
|
+
fillFields(importParameters, sectionPart.id, formFields.properties, configPart, configParameters);
|
|
421
|
+
}
|
|
422
|
+
if (Object.keys(configPart[sectionPart.id]['form']).length === 0) {
|
|
423
|
+
delete configPart[sectionPart.id]['form'];
|
|
424
|
+
}
|
|
425
|
+
if (Object.keys(configPart[sectionPart.id]).length === 0) {
|
|
426
|
+
delete configPart[sectionPart.id];
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Fills the subsection of the object page config
|
|
431
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
432
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of subsection
|
|
433
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
434
|
+
* @param {object} configPart - the given part of the object page config
|
|
435
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
436
|
+
*/
|
|
437
|
+
function fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
343
438
|
var _a, _b;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTitle, configPart, v2Page);
|
|
355
|
-
}
|
|
356
|
-
else if (schemaSection['$ref'] &&
|
|
357
|
-
(getSectionType(schemaSection) === types_1.SectionTypeV2.SectionChart ||
|
|
358
|
-
getSectionType(schemaSection) === types_1.SectionTypeV2.SubSectionChart)) {
|
|
359
|
-
// Section without subsections
|
|
360
|
-
const sectionType = getSectionType(schemaSection);
|
|
361
|
-
schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
|
|
362
|
-
const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
|
|
363
|
-
const manifestKey = escapedSectionId.replace('@com.sap', 'com.sap');
|
|
364
|
-
const manifestSection = manifestSettings && manifestSettings.sections && manifestSettings.sections[manifestKey];
|
|
365
|
-
configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, { chart: {} });
|
|
366
|
-
configPart[escapedSectionId]['chart'] = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageChart');
|
|
367
|
-
if (manifestSection || flexChanges) {
|
|
368
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
369
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId]['chart'], importParameters.jsonSchema['definitions']['ObjectPageChart'], pageKeys, flexChanges, sectionId, sectionTitle);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
else if (schemaSection['$ref'] &&
|
|
373
|
-
(getSectionType(schemaSection) === types_1.SectionTypeV2.SectionForm ||
|
|
374
|
-
getSectionType(schemaSection) === types_1.SectionTypeV2.SubSectionForm)) {
|
|
375
|
-
const sectionType = getSectionType(schemaSection);
|
|
376
|
-
schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
|
|
377
|
-
const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
|
|
378
|
-
const formId = schemaSection['properties']['form']['$ref'].split('SectionForm')[1];
|
|
379
|
-
configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, { form: {} });
|
|
380
|
-
if (flexChanges) {
|
|
381
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
382
|
-
}
|
|
383
|
-
const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
|
|
384
|
-
if (formActions['properties']) {
|
|
385
|
-
fillActions(importParameters, formActions.properties, configPart[escapedSectionId]['form'], factory, pageKeys, flexChanges, `${escapedSectionId}::FormAction`);
|
|
386
|
-
}
|
|
387
|
-
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
388
|
-
if (formFields['properties']) {
|
|
389
|
-
fillFields(importParameters, escapedSectionId, formFields.properties, configPart, factory, pageKeys, flexChanges);
|
|
390
|
-
}
|
|
391
|
-
if (Object.keys(configPart[escapedSectionId]['form']).length === 0) {
|
|
392
|
-
delete configPart[escapedSectionId]['form'];
|
|
393
|
-
}
|
|
394
|
-
if (Object.keys(configPart[escapedSectionId]).length === 0) {
|
|
395
|
-
delete configPart[escapedSectionId];
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
else if ((schemaSection['properties'] && schemaSection['properties']['subsections']) ||
|
|
399
|
-
(schemaSection['$ref'] &&
|
|
400
|
-
(getSectionType(schemaSection) === types_1.SectionTypeV2.Section ||
|
|
401
|
-
getSectionType(schemaSection) === types_1.SectionTypeV2.SubSection))) {
|
|
402
|
-
// Section with subsections
|
|
403
|
-
const sectionType = getSectionType(schemaSection);
|
|
404
|
-
schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
|
|
405
|
-
const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
|
|
406
|
-
configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, {
|
|
407
|
-
subsections: {}
|
|
408
|
-
});
|
|
409
|
-
if (flexChanges) {
|
|
410
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
411
|
-
}
|
|
412
|
-
let currentSchemaSection;
|
|
413
|
-
if ((_b = (_a = schemaSection['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
|
|
414
|
-
currentSchemaSection = schemaSection['properties']['subsections']['properties'];
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
currentSchemaSection = schemaSection['properties'];
|
|
418
|
-
}
|
|
419
|
-
fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[escapedSectionId]['subsections'], factory, pageKeys, flexChanges, v2Page, objectPageConfig);
|
|
420
|
-
}
|
|
439
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
440
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
441
|
+
subsections: {}
|
|
442
|
+
});
|
|
443
|
+
if (configParameters.flexChanges) {
|
|
444
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
445
|
+
}
|
|
446
|
+
let currentSchemaSection;
|
|
447
|
+
if ((_b = (_a = sectionPart.schema['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
|
|
448
|
+
currentSchemaSection = sectionPart.schema['properties']['subsections']['properties'];
|
|
421
449
|
}
|
|
450
|
+
else {
|
|
451
|
+
currentSchemaSection = sectionPart.schema['properties'];
|
|
452
|
+
}
|
|
453
|
+
fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[sectionPart.id]['subsections'], configParameters);
|
|
422
454
|
}
|
|
423
455
|
/**
|
|
424
|
-
*
|
|
425
|
-
* @param {ImportObjectPageV2Parameters} importParameters
|
|
426
|
-
* @param
|
|
427
|
-
* @param
|
|
428
|
-
* @param
|
|
429
|
-
* @param {
|
|
430
|
-
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
431
|
-
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
456
|
+
* Fills the sections and subsections of the object page config (recursive function)
|
|
457
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
458
|
+
* @param {object} sectionProperties - current properties' list (of sections or subsections)
|
|
459
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
460
|
+
* @param {object} configPart - the given part of the object page config
|
|
461
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig.
|
|
432
462
|
*/
|
|
433
|
-
function
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
463
|
+
function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, configParameters) {
|
|
464
|
+
for (const sectionId in sectionProperties) {
|
|
465
|
+
const sectionPart = {
|
|
466
|
+
id: sectionId.replace(/\/@/g, '::'),
|
|
467
|
+
type: getSectionType(sectionProperties[sectionId]),
|
|
468
|
+
schema: sectionProperties[sectionId]
|
|
469
|
+
};
|
|
470
|
+
if (sectionPart.schema['$ref'] && sectionPart.type) {
|
|
471
|
+
switch (sectionPart.type) {
|
|
472
|
+
case types_1.SectionTypeV2.SectionTable:
|
|
473
|
+
case types_1.SectionTypeV2.SubSectionTable: {
|
|
474
|
+
sectionPart.schema =
|
|
475
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
476
|
+
fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
477
|
+
// Custom column ref
|
|
478
|
+
fillCustomColumnsInConfig(importParameters, sectionPart.id, undefined, configPart, configParameters.v2Page);
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
case types_1.SectionTypeV2.SectionChart:
|
|
482
|
+
case types_1.SectionTypeV2.SubSectionChart: {
|
|
483
|
+
// Section without subsections
|
|
484
|
+
sectionPart.schema =
|
|
485
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
486
|
+
fillChartSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
case types_1.SectionTypeV2.SectionForm:
|
|
490
|
+
case types_1.SectionTypeV2.SubSectionForm: {
|
|
491
|
+
sectionPart.schema =
|
|
492
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
493
|
+
fillFormSection(importParameters, sectionPart, configPart, configParameters);
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
case types_1.SectionTypeV2.Section:
|
|
497
|
+
case types_1.SectionTypeV2.SubSection: {
|
|
498
|
+
// Section with subsections
|
|
499
|
+
sectionPart.schema =
|
|
500
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
501
|
+
fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
445
504
|
}
|
|
446
505
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
506
|
+
else if (sectionPart.schema['properties'] && sectionPart.schema['properties']['subsections']) {
|
|
507
|
+
sectionPart.schema = importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
508
|
+
fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
509
|
+
}
|
|
450
510
|
}
|
|
451
511
|
}
|
|
452
512
|
/**
|
|
@@ -458,23 +518,28 @@ function fillActions(importParameters, actionProperties, configPart, factory, pa
|
|
|
458
518
|
* @param {MetadataInstanceInterface} factory - factory, for generating the access to reflect-metadata
|
|
459
519
|
* @returns {ObjectPageConfig} - the object page configuration (JSON)
|
|
460
520
|
*/
|
|
461
|
-
function fillConfig(importParameters,
|
|
462
|
-
const objectPageConfig = factory.createPageInstance(common_2.PageType.ObjectPage);
|
|
463
|
-
const manifestSettings = v2Page.component.settings;
|
|
521
|
+
function fillConfig(importParameters, configParameters) {
|
|
522
|
+
const objectPageConfig = configParameters.factory.createPageInstance(common_2.PageType.ObjectPage);
|
|
523
|
+
const manifestSettings = configParameters.v2Page.component.settings;
|
|
464
524
|
// Transfer page information
|
|
465
|
-
transferSettingsAndFlexChanges(importParameters, objectPageConfig, importParameters.jsonSchema['properties'], pageKeys,
|
|
525
|
+
transferSettingsAndFlexChanges(importParameters, objectPageConfig, importParameters.jsonSchema['properties'], configParameters.pageKeys, configParameters.flexChanges);
|
|
466
526
|
// Transfer header information
|
|
467
|
-
objectPageConfig.header = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageHeader');
|
|
527
|
+
objectPageConfig.header = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageHeader');
|
|
468
528
|
transferSettingsAndFlexChanges(importParameters, objectPageConfig.header, importParameters.jsonSchema['definitions']['ObjectPageHeader']
|
|
469
529
|
? importParameters.jsonSchema['definitions']['ObjectPageHeader']
|
|
470
|
-
: importParameters.jsonSchema['definitions']['ObjectPageHeader<GenericActions>'], pageKeys,
|
|
530
|
+
: importParameters.jsonSchema['definitions']['ObjectPageHeader<GenericActions>'], configParameters.pageKeys, configParameters.flexChanges);
|
|
471
531
|
const headerAction = importParameters.jsonSchema['definitions']['HeaderActions'];
|
|
472
532
|
if (headerAction) {
|
|
473
|
-
fillActions(importParameters, headerAction.properties, objectPageConfig.header,
|
|
533
|
+
fillActions(importParameters, headerAction.properties, objectPageConfig.header, configParameters, types_1.ActionTypeV2.Header);
|
|
534
|
+
}
|
|
535
|
+
objectPageConfig.footer = {};
|
|
536
|
+
const footerAction = importParameters.jsonSchema['definitions']['FooterActions'];
|
|
537
|
+
if (footerAction) {
|
|
538
|
+
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.Footer);
|
|
474
539
|
}
|
|
475
540
|
// Transfer Layout information
|
|
476
|
-
objectPageConfig.layout = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|
|
477
|
-
transferSettingsAndFlexChanges(importParameters, objectPageConfig.layout, importParameters.jsonSchema['definitions']['ObjectPageLayout'], pageKeys,
|
|
541
|
+
objectPageConfig.layout = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|
|
542
|
+
transferSettingsAndFlexChanges(importParameters, objectPageConfig.layout, importParameters.jsonSchema['definitions']['ObjectPageLayout'], configParameters.pageKeys, configParameters.flexChanges);
|
|
478
543
|
if (Object.keys(objectPageConfig.layout).length === 0) {
|
|
479
544
|
delete objectPageConfig.layout;
|
|
480
545
|
}
|
|
@@ -482,7 +547,7 @@ function fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page,
|
|
|
482
547
|
objectPageConfig.sections = {};
|
|
483
548
|
const sections = importParameters.jsonSchema['definitions']['Sections'];
|
|
484
549
|
if (sections) {
|
|
485
|
-
fillSectionsInConfig(importParameters, sections.properties, manifestSettings, objectPageConfig.sections,
|
|
550
|
+
fillSectionsInConfig(importParameters, sections.properties, manifestSettings, objectPageConfig.sections, configParameters);
|
|
486
551
|
}
|
|
487
552
|
// Find custom sections
|
|
488
553
|
const customSections = utils_1.findCustomSectionExtensions(importParameters.manifest, importParameters.entitySet);
|
|
@@ -490,11 +555,11 @@ function fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page,
|
|
|
490
555
|
objectPageConfig.sections.custom = [];
|
|
491
556
|
for (const sectionId in customSections) {
|
|
492
557
|
const customSection = 'fragmentName' in customSections[sectionId]
|
|
493
|
-
? factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionFragment')
|
|
494
|
-
: factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionView');
|
|
558
|
+
? configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionFragment')
|
|
559
|
+
: configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionView');
|
|
495
560
|
transferSettingsAndFlexChanges(importParameters, customSection, importParameters.jsonSchema['definitions']['fragmentName' in customSections[sectionId]
|
|
496
561
|
? 'ObjectPageCustomSectionFragment'
|
|
497
|
-
: 'ObjectPageCustomSectionView'], pageKeys,
|
|
562
|
+
: 'ObjectPageCustomSectionView'], configParameters.pageKeys, configParameters.flexChanges, sectionId);
|
|
498
563
|
objectPageConfig.sections.custom.push(customSection);
|
|
499
564
|
}
|
|
500
565
|
}
|
|
@@ -549,7 +614,7 @@ function createObjectPageConfigV2(importParameters) {
|
|
|
549
614
|
const flexChangesForTransfer = prepareFlexChanges(importParameters.flex, entitySet);
|
|
550
615
|
const factory = new factory_1.MetadataInstanceFactoryV2();
|
|
551
616
|
//Fill config.json with manifest settings and flex changes
|
|
552
|
-
return fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page, factory);
|
|
617
|
+
return fillConfig(importParameters, { pageKeys, flexChanges: flexChangesForTransfer, v2Page, factory });
|
|
553
618
|
}
|
|
554
619
|
exports.createObjectPageConfigV2 = createObjectPageConfigV2;
|
|
555
620
|
//# sourceMappingURL=objectPage.js.map
|