@sap/ux-specification 1.71.47 → 1.71.48
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 +38 -7
- 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/index-min.js +1 -1
- package/dist/schemas/v2/AnalyticalListPageConfig.json +10 -38
- package/dist/schemas/v2/ListReportConfig.json +5 -28
- package/dist/schemas/v2/ObjectPageConfig.json +150 -48
- package/dist/schemas/v2/OverviewPageConfig.json +236 -190
- 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/specification/v2/index-min.js +1 -1
- package/dist/src/specification/v2/controls/{FormAction.d.ts → Action.d.ts} +29 -2
- 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 +4 -0
- package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +2 -2
- package/dist/src/specification/v2/controls/{ObjectPageHeaderAction.d.ts → ObjectPageFooterAction.d.ts} +4 -3
- package/dist/src/specification/v2/controls/{ObjectPageHeaderAction.js → ObjectPageFooterAction.js} +1 -1
- 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 +1 -1
- package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +1 -5
- package/dist/src/specification/v2/controls/Table.d.ts +1 -9
- 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 +3 -3
- package/dist/src/specification/v2/controls/index.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +12 -8
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +1 -1
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +13 -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 +1 -0
- package/dist/src/sync/v2/export/controls/FilterBar.js +10 -0
- package/dist/src/sync/v2/export/controls/FilterBar.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 +8 -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/ObjectPageTable.d.ts +3 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +13 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +8 -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 +3 -4
- package/dist/src/sync/v2/export/controls/Table.js +4 -21
- package/dist/src/sync/v2/export/controls/Table.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 +11 -7
- package/dist/src/sync/v2/export/controls/index.js +11 -7
- 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/generate/objectPage.d.ts +0 -1
- package/dist/src/sync/v2/generate/objectPage.js +183 -95
- 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 +31 -0
- 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 +300 -233
- 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/package.json +3 -3
- 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,57 +309,55 @@ 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) {
|
|
295
|
-
localJsonSchema = schemaDefinitions['ObjectPage' + tableType + '<' +
|
|
338
|
+
localJsonSchema = schemaDefinitions['ObjectPage' + tableType + '<' + sectionPart.id + '>'];
|
|
296
339
|
}
|
|
297
340
|
else {
|
|
298
|
-
localJsonSchema = schemaDefinitions['ObjectPageResponsiveTable<' +
|
|
341
|
+
localJsonSchema = schemaDefinitions['ObjectPageResponsiveTable<' + sectionPart.id + '>'];
|
|
342
|
+
}
|
|
343
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
344
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['table'], localJsonSchema, configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
345
|
+
const toolBarActions = JSON.parse(JSON.stringify(schemaDefinitions))[`Actions<${sectionPart.id}>`];
|
|
346
|
+
if (toolBarActions === null || toolBarActions === void 0 ? void 0 : toolBarActions['properties']) {
|
|
347
|
+
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.ToolBar);
|
|
348
|
+
}
|
|
349
|
+
if (Object.keys(configPart[sectionPart.id]['table']['toolBar']).length === 0) {
|
|
350
|
+
delete configPart[sectionPart.id]['table']['toolBar'];
|
|
299
351
|
}
|
|
300
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
301
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId]['table'], localJsonSchema, pageKeys, flexChanges, sectionId, sectionTitle);
|
|
302
352
|
}
|
|
303
353
|
}
|
|
304
354
|
/**
|
|
305
355
|
* Fills custom columns in a V2 object page config JSON
|
|
306
|
-
* @param
|
|
307
|
-
* @param escapedSectionId - escaped version of the section ID
|
|
308
|
-
* @param sectionTitle - section
|
|
309
|
-
* @param configPart - the given part of the object page config
|
|
310
|
-
* @param manifest - manifest.json of the app
|
|
356
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
357
|
+
* @param {string} escapedSectionId - escaped version of the section ID
|
|
358
|
+
* @param {string} sectionTitle - title of current section, if available
|
|
359
|
+
* @param {object} configPart - the given part of the object page config
|
|
311
360
|
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
312
|
-
* @param {FileData[]} fragments - Array with XML fragments.
|
|
313
361
|
*/
|
|
314
362
|
function fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTitle, configPart, v2Page) {
|
|
315
363
|
const customColumnSchemaProp = importParameters.jsonSchema['definitions'][escapedSectionId].properties.custom;
|
|
@@ -325,123 +373,137 @@ function fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTi
|
|
|
325
373
|
}
|
|
326
374
|
}
|
|
327
375
|
/**
|
|
328
|
-
* Fills the
|
|
376
|
+
* Fills the sections and subsections of the object page config (recursive function)
|
|
329
377
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
330
|
-
* @param
|
|
331
|
-
* @param
|
|
332
|
-
* @param
|
|
333
|
-
* @param {
|
|
334
|
-
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
335
|
-
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
378
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of chart section
|
|
379
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
380
|
+
* @param {object} configPart - the given part of the object page config
|
|
381
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
336
382
|
*/
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
delete configPart['actions'][configActionId];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
383
|
+
function fillChartSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
384
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
385
|
+
const manifestKey = sectionPart.id.replace('@com.sap', 'com.sap');
|
|
386
|
+
const manifestSection = manifestSettings && manifestSettings.sections && manifestSettings.sections[manifestKey];
|
|
387
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
388
|
+
chart: {}
|
|
389
|
+
});
|
|
390
|
+
configPart[sectionPart.id]['chart'] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageChart');
|
|
391
|
+
if (manifestSection || configParameters.flexChanges) {
|
|
392
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
393
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['chart'], importParameters.jsonSchema['definitions']['ObjectPageChart'], configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
351
394
|
}
|
|
352
|
-
|
|
353
|
-
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Fills the form section of the object page config
|
|
398
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
399
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of form section
|
|
400
|
+
* @param {object} configPart - the given part of the object page config
|
|
401
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
402
|
+
*/
|
|
403
|
+
function fillFormSection(importParameters, sectionPart, configPart, configParameters) {
|
|
404
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
405
|
+
const formId = sectionPart.schema['properties']['form']['$ref'].split('SectionForm')[1];
|
|
406
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
407
|
+
form: {}
|
|
408
|
+
});
|
|
409
|
+
if (configParameters.flexChanges) {
|
|
410
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
411
|
+
}
|
|
412
|
+
const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
|
|
413
|
+
if (formActions && formActions['properties']) {
|
|
414
|
+
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters, `${sectionPart.id}::${types_1.ActionTypeV2.Form}`);
|
|
415
|
+
}
|
|
416
|
+
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
417
|
+
if (formFields['properties']) {
|
|
418
|
+
fillFields(importParameters, sectionPart.id, formFields.properties, configPart, configParameters);
|
|
419
|
+
}
|
|
420
|
+
if (Object.keys(configPart[sectionPart.id]['form']).length === 0) {
|
|
421
|
+
delete configPart[sectionPart.id]['form'];
|
|
422
|
+
}
|
|
423
|
+
if (Object.keys(configPart[sectionPart.id]).length === 0) {
|
|
424
|
+
delete configPart[sectionPart.id];
|
|
354
425
|
}
|
|
355
426
|
}
|
|
356
427
|
/**
|
|
357
|
-
* Fills the
|
|
358
|
-
* @param {ImportObjectPageV2Parameters} importParameters
|
|
359
|
-
* @param
|
|
360
|
-
* @param manifestSettings - object page settings section of the manifest
|
|
361
|
-
* @param configPart - the given part of the object page config
|
|
362
|
-
* @param
|
|
363
|
-
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
364
|
-
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
365
|
-
* @param {ObjectPageConfig} objectPageConfig - page config object.
|
|
428
|
+
* Fills the subsection of the object page config
|
|
429
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
430
|
+
* @param {sectionPartProperties} sectionPart - current properties' list of subsection
|
|
431
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
432
|
+
* @param {object} configPart - the given part of the object page config
|
|
433
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
366
434
|
*/
|
|
367
|
-
function
|
|
435
|
+
function fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
|
|
368
436
|
var _a, _b;
|
|
369
|
-
|
|
437
|
+
const sectionTitle = common_1.getSectionTitle(sectionPart.schema, importParameters.jsonSchema);
|
|
438
|
+
configPart[sectionPart.id] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, sectionPart.type, {
|
|
439
|
+
subsections: {}
|
|
440
|
+
});
|
|
441
|
+
if (configParameters.flexChanges) {
|
|
442
|
+
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
443
|
+
}
|
|
444
|
+
let currentSchemaSection;
|
|
445
|
+
if ((_b = (_a = sectionPart.schema['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
|
|
446
|
+
currentSchemaSection = sectionPart.schema['properties']['subsections']['properties'];
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
currentSchemaSection = sectionPart.schema['properties'];
|
|
450
|
+
}
|
|
451
|
+
fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[sectionPart.id]['subsections'], configParameters);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Fills the sections and subsections of the object page config (recursive function)
|
|
455
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
456
|
+
* @param {object} sectionProperties - current properties' list (of sections or subsections)
|
|
457
|
+
* @param {Settings} manifestSettings - object page settings section of the manifest
|
|
458
|
+
* @param {object} configPart - the given part of the object page config
|
|
459
|
+
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig.
|
|
460
|
+
*/
|
|
461
|
+
function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, configParameters) {
|
|
370
462
|
for (const sectionId in sectionProperties) {
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
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
|
-
fillActions(importParameters, formActions.properties, configPart[escapedSectionId]['form'], factory, pageKeys, flexChanges, `${escapedSectionId}::FormAction`);
|
|
411
|
-
}
|
|
412
|
-
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
413
|
-
if (formFields['properties']) {
|
|
414
|
-
fillFields(importParameters, escapedSectionId, formFields.properties, configPart, factory, pageKeys, flexChanges);
|
|
415
|
-
}
|
|
416
|
-
if (Object.keys(configPart[escapedSectionId]['form']).length === 0) {
|
|
417
|
-
delete configPart[escapedSectionId]['form'];
|
|
418
|
-
}
|
|
419
|
-
if (Object.keys(configPart[escapedSectionId]).length === 0) {
|
|
420
|
-
delete configPart[escapedSectionId];
|
|
463
|
+
const sectionPart = {
|
|
464
|
+
id: sectionId.replace(/\/@/g, '::'),
|
|
465
|
+
type: getSectionType(sectionProperties[sectionId]),
|
|
466
|
+
schema: sectionProperties[sectionId]
|
|
467
|
+
};
|
|
468
|
+
if (sectionPart.schema['$ref'] && sectionPart.type) {
|
|
469
|
+
switch (sectionPart.type) {
|
|
470
|
+
case types_1.SectionTypeV2.SectionTable:
|
|
471
|
+
case types_1.SectionTypeV2.SubSectionTable: {
|
|
472
|
+
sectionPart.schema =
|
|
473
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
474
|
+
fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
475
|
+
// Custom column ref
|
|
476
|
+
fillCustomColumnsInConfig(importParameters, sectionPart.id, undefined, configPart, configParameters.v2Page);
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
case types_1.SectionTypeV2.SectionChart:
|
|
480
|
+
case types_1.SectionTypeV2.SubSectionChart: {
|
|
481
|
+
// Section without subsections
|
|
482
|
+
sectionPart.schema =
|
|
483
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
484
|
+
fillChartSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
case types_1.SectionTypeV2.SectionForm:
|
|
488
|
+
case types_1.SectionTypeV2.SubSectionForm: {
|
|
489
|
+
sectionPart.schema =
|
|
490
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
491
|
+
fillFormSection(importParameters, sectionPart, configPart, configParameters);
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
case types_1.SectionTypeV2.Section:
|
|
495
|
+
case types_1.SectionTypeV2.SubSection: {
|
|
496
|
+
// Section with subsections
|
|
497
|
+
sectionPart.schema =
|
|
498
|
+
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
499
|
+
fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
421
502
|
}
|
|
422
503
|
}
|
|
423
|
-
else if (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
getSectionType(schemaSection) === types_1.SectionTypeV2.SubSection))) {
|
|
427
|
-
// Section with subsections
|
|
428
|
-
const sectionType = getSectionType(schemaSection);
|
|
429
|
-
schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
|
|
430
|
-
const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
|
|
431
|
-
configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, {
|
|
432
|
-
subsections: {}
|
|
433
|
-
});
|
|
434
|
-
if (flexChanges) {
|
|
435
|
-
transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
|
|
436
|
-
}
|
|
437
|
-
let currentSchemaSection;
|
|
438
|
-
if ((_b = (_a = schemaSection['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
|
|
439
|
-
currentSchemaSection = schemaSection['properties']['subsections']['properties'];
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
currentSchemaSection = schemaSection['properties'];
|
|
443
|
-
}
|
|
444
|
-
fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[escapedSectionId]['subsections'], factory, pageKeys, flexChanges, v2Page, objectPageConfig);
|
|
504
|
+
else if (sectionPart.schema['properties'] && sectionPart.schema['properties']['subsections']) {
|
|
505
|
+
sectionPart.schema = importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
506
|
+
fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
445
507
|
}
|
|
446
508
|
}
|
|
447
509
|
}
|
|
@@ -454,23 +516,28 @@ function fillSectionsInConfig(importParameters, sectionProperties, manifestSetti
|
|
|
454
516
|
* @param {MetadataInstanceInterface} factory - factory, for generating the access to reflect-metadata
|
|
455
517
|
* @returns {ObjectPageConfig} - the object page configuration (JSON)
|
|
456
518
|
*/
|
|
457
|
-
function fillConfig(importParameters,
|
|
458
|
-
const objectPageConfig = factory.createPageInstance(common_2.PageType.ObjectPage);
|
|
459
|
-
const manifestSettings = v2Page.component.settings;
|
|
519
|
+
function fillConfig(importParameters, configParameters) {
|
|
520
|
+
const objectPageConfig = configParameters.factory.createPageInstance(common_2.PageType.ObjectPage);
|
|
521
|
+
const manifestSettings = configParameters.v2Page.component.settings;
|
|
460
522
|
// Transfer page information
|
|
461
|
-
transferSettingsAndFlexChanges(importParameters, objectPageConfig, importParameters.jsonSchema['properties'], pageKeys,
|
|
523
|
+
transferSettingsAndFlexChanges(importParameters, objectPageConfig, importParameters.jsonSchema['properties'], configParameters.pageKeys, configParameters.flexChanges);
|
|
462
524
|
// Transfer header information
|
|
463
|
-
objectPageConfig.header = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageHeader');
|
|
525
|
+
objectPageConfig.header = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageHeader');
|
|
464
526
|
transferSettingsAndFlexChanges(importParameters, objectPageConfig.header, importParameters.jsonSchema['definitions']['ObjectPageHeader']
|
|
465
527
|
? importParameters.jsonSchema['definitions']['ObjectPageHeader']
|
|
466
|
-
: importParameters.jsonSchema['definitions']['ObjectPageHeader<GenericActions>'], pageKeys,
|
|
528
|
+
: importParameters.jsonSchema['definitions']['ObjectPageHeader<GenericActions>'], configParameters.pageKeys, configParameters.flexChanges);
|
|
467
529
|
const headerAction = importParameters.jsonSchema['definitions']['HeaderActions'];
|
|
468
530
|
if (headerAction) {
|
|
469
|
-
fillActions(importParameters, headerAction.properties, objectPageConfig.header,
|
|
531
|
+
fillActions(importParameters, headerAction.properties, objectPageConfig.header, configParameters, types_1.ActionTypeV2.Header);
|
|
532
|
+
}
|
|
533
|
+
objectPageConfig.footer = {};
|
|
534
|
+
const footerAction = importParameters.jsonSchema['definitions']['FooterActions'];
|
|
535
|
+
if (footerAction) {
|
|
536
|
+
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.Footer);
|
|
470
537
|
}
|
|
471
538
|
// Transfer Layout information
|
|
472
|
-
objectPageConfig.layout = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|
|
473
|
-
transferSettingsAndFlexChanges(importParameters, objectPageConfig.layout, importParameters.jsonSchema['definitions']['ObjectPageLayout'], pageKeys,
|
|
539
|
+
objectPageConfig.layout = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|
|
540
|
+
transferSettingsAndFlexChanges(importParameters, objectPageConfig.layout, importParameters.jsonSchema['definitions']['ObjectPageLayout'], configParameters.pageKeys, configParameters.flexChanges);
|
|
474
541
|
if (Object.keys(objectPageConfig.layout).length === 0) {
|
|
475
542
|
delete objectPageConfig.layout;
|
|
476
543
|
}
|
|
@@ -478,7 +545,7 @@ function fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page,
|
|
|
478
545
|
objectPageConfig.sections = {};
|
|
479
546
|
const sections = importParameters.jsonSchema['definitions']['Sections'];
|
|
480
547
|
if (sections) {
|
|
481
|
-
fillSectionsInConfig(importParameters, sections.properties, manifestSettings, objectPageConfig.sections,
|
|
548
|
+
fillSectionsInConfig(importParameters, sections.properties, manifestSettings, objectPageConfig.sections, configParameters);
|
|
482
549
|
}
|
|
483
550
|
// Find custom sections
|
|
484
551
|
const customSections = utils_1.findCustomSectionExtensions(importParameters.manifest, importParameters.entitySet);
|
|
@@ -486,11 +553,11 @@ function fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page,
|
|
|
486
553
|
objectPageConfig.sections.custom = [];
|
|
487
554
|
for (const sectionId in customSections) {
|
|
488
555
|
const customSection = 'fragmentName' in customSections[sectionId]
|
|
489
|
-
? factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionFragment')
|
|
490
|
-
: factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionView');
|
|
556
|
+
? configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionFragment')
|
|
557
|
+
: configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageCustomSectionView');
|
|
491
558
|
transferSettingsAndFlexChanges(importParameters, customSection, importParameters.jsonSchema['definitions']['fragmentName' in customSections[sectionId]
|
|
492
559
|
? 'ObjectPageCustomSectionFragment'
|
|
493
|
-
: 'ObjectPageCustomSectionView'], pageKeys,
|
|
560
|
+
: 'ObjectPageCustomSectionView'], configParameters.pageKeys, configParameters.flexChanges, sectionId);
|
|
494
561
|
objectPageConfig.sections.custom.push(customSection);
|
|
495
562
|
}
|
|
496
563
|
}
|
|
@@ -545,7 +612,7 @@ function createObjectPageConfigV2(importParameters) {
|
|
|
545
612
|
const flexChangesForTransfer = prepareFlexChanges(importParameters.flex, entitySet);
|
|
546
613
|
const factory = new factory_1.MetadataInstanceFactoryV2();
|
|
547
614
|
//Fill config.json with manifest settings and flex changes
|
|
548
|
-
return fillConfig(importParameters, pageKeys, flexChangesForTransfer, v2Page, factory);
|
|
615
|
+
return fillConfig(importParameters, { pageKeys, flexChanges: flexChangesForTransfer, v2Page, factory });
|
|
549
616
|
}
|
|
550
617
|
exports.createObjectPageConfigV2 = createObjectPageConfigV2;
|
|
551
618
|
//# sourceMappingURL=objectPage.js.map
|