@sap/ux-specification 1.71.45 → 1.71.49

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.
Files changed (120) hide show
  1. package/CHANGELOG.md +77 -7
  2. package/dist/documentation/runDocu-min.js +1 -1
  3. package/dist/documentation/styleDocu.css +4 -5
  4. package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
  5. package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
  6. package/dist/documentation/v2/v2-ListReport.html +1 -1
  7. package/dist/documentation/v2/v2-ObjectPage.html +1 -1
  8. package/dist/documentation/v2/v2-OverviewPage.html +1 -1
  9. package/dist/index-min.js +1 -1
  10. package/dist/schemas/v2/AnalyticalListPageConfig.json +35 -38
  11. package/dist/schemas/v2/ListReportConfig.json +36 -28
  12. package/dist/schemas/v2/ObjectPageConfig.json +181 -48
  13. package/dist/schemas/v2/OverviewPageConfig.json +236 -190
  14. package/dist/scripts/extractDocu.js +18 -8
  15. package/dist/scripts/extractDocu.js.map +1 -1
  16. package/dist/scripts/runDocu.js +105 -89
  17. package/dist/scripts/runDocu.js.map +1 -1
  18. package/dist/scripts/to-json-schema.js +9 -1
  19. package/dist/scripts/to-json-schema.js.map +1 -1
  20. package/dist/specification/v2/index-min.js +1 -1
  21. package/dist/src/specification/common/types.d.ts +4 -0
  22. package/dist/src/specification/common/types.js +5 -0
  23. package/dist/src/specification/common/types.js.map +1 -1
  24. package/dist/src/specification/v2/controls/{FormAction.d.ts → Action.d.ts} +29 -2
  25. package/dist/src/specification/v2/controls/{FormAction.js → Action.js} +1 -1
  26. package/dist/src/specification/v2/controls/Action.js.map +1 -0
  27. package/dist/src/specification/v2/controls/Card.d.ts +20 -72
  28. package/dist/src/specification/v2/controls/Card.js.map +1 -1
  29. package/dist/src/specification/v2/controls/FilterBar.d.ts +4 -0
  30. package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +2 -2
  31. package/dist/src/specification/v2/controls/{ObjectPageHeaderAction.d.ts → ObjectPageFooterAction.d.ts} +4 -3
  32. package/dist/src/specification/v2/controls/{ObjectPageHeaderAction.js → ObjectPageFooterAction.js} +1 -1
  33. package/dist/src/specification/v2/controls/ObjectPageFooterAction.js.map +1 -0
  34. package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +1 -2
  35. package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +1 -1
  36. package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +5 -0
  37. package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
  38. package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +1 -5
  39. package/dist/src/specification/v2/controls/Table.d.ts +6 -9
  40. package/dist/src/specification/v2/controls/Table.js.map +1 -1
  41. package/dist/src/specification/v2/controls/ToolBar.d.ts +2 -2
  42. package/dist/src/specification/v2/controls/index.d.ts +8 -9
  43. package/dist/src/specification/v2/controls/index.js +3 -3
  44. package/dist/src/specification/v2/controls/index.js.map +1 -1
  45. package/dist/src/sync/common/generate/index.d.ts +1 -0
  46. package/dist/src/sync/common/generate/index.js +1 -0
  47. package/dist/src/sync/common/generate/index.js.map +1 -1
  48. package/dist/src/sync/common/generate/objectPage.js +22 -17
  49. package/dist/src/sync/common/generate/objectPage.js.map +1 -1
  50. package/dist/src/sync/common/generate/utils.d.ts +59 -0
  51. package/dist/src/sync/common/generate/utils.js +192 -0
  52. package/dist/src/sync/common/generate/utils.js.map +1 -0
  53. package/dist/src/sync/common/importProject.js +3 -3
  54. package/dist/src/sync/common/importProject.js.map +1 -1
  55. package/dist/src/sync/common/utils.d.ts +3 -23
  56. package/dist/src/sync/common/utils.js +15 -83
  57. package/dist/src/sync/common/utils.js.map +1 -1
  58. package/dist/src/sync/v2/export/controls/Action.d.ts +13 -0
  59. package/dist/src/sync/v2/export/controls/Action.js +74 -0
  60. package/dist/src/sync/v2/export/controls/Action.js.map +1 -0
  61. package/dist/src/sync/v2/export/controls/Card.d.ts +3 -7
  62. package/dist/src/sync/v2/export/controls/Card.js +15 -43
  63. package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
  64. package/dist/src/sync/v2/export/controls/FilterBar.d.ts +1 -0
  65. package/dist/src/sync/v2/export/controls/FilterBar.js +10 -0
  66. package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
  67. package/dist/src/sync/v2/export/controls/Fragment.js +5 -4
  68. package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
  69. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +8 -0
  70. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +62 -0
  71. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -0
  72. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +11 -29
  73. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
  74. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +5 -1
  75. package/dist/src/sync/v2/export/controls/ObjectPageTable.js +25 -0
  76. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
  77. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +8 -0
  78. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +59 -0
  79. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -0
  80. package/dist/src/sync/v2/export/controls/Table.d.ts +5 -4
  81. package/dist/src/sync/v2/export/controls/Table.js +16 -21
  82. package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
  83. package/dist/src/sync/v2/export/controls/ToolBar.d.ts +4 -0
  84. package/dist/src/sync/v2/export/controls/ToolBar.js +6 -0
  85. package/dist/src/sync/v2/export/controls/ToolBar.js.map +1 -0
  86. package/dist/src/sync/v2/export/controls/index.d.ts +11 -7
  87. package/dist/src/sync/v2/export/controls/index.js +11 -7
  88. package/dist/src/sync/v2/export/controls/index.js.map +1 -1
  89. package/dist/src/sync/v2/export/export.js +1 -1
  90. package/dist/src/sync/v2/export/export.js.map +1 -1
  91. package/dist/src/sync/v2/export/exportPage.js +3 -2
  92. package/dist/src/sync/v2/export/exportPage.js.map +1 -1
  93. package/dist/src/sync/v2/generate/analyticalListReport.js +6 -3
  94. package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  95. package/dist/src/sync/v2/generate/listReport.d.ts +8 -0
  96. package/dist/src/sync/v2/generate/listReport.js +18 -4
  97. package/dist/src/sync/v2/generate/listReport.js.map +1 -1
  98. package/dist/src/sync/v2/generate/objectPage.d.ts +0 -1
  99. package/dist/src/sync/v2/generate/objectPage.js +199 -106
  100. package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
  101. package/dist/src/sync/v2/generate/utils.d.ts +3 -3
  102. package/dist/src/sync/v2/generate/utils.js +22 -14
  103. package/dist/src/sync/v2/generate/utils.js.map +1 -1
  104. package/dist/src/sync/v2/import/common/index.d.ts +8 -1
  105. package/dist/src/sync/v2/import/common/index.js +107 -43
  106. package/dist/src/sync/v2/import/common/index.js.map +1 -1
  107. package/dist/src/sync/v2/import/pages/listReport.js +31 -0
  108. package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
  109. package/dist/src/sync/v2/import/pages/objectPage.d.ts +1 -1
  110. package/dist/src/sync/v2/import/pages/objectPage.js +302 -235
  111. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
  112. package/dist/src/sync/v2/import/utils.d.ts +1 -1
  113. package/dist/src/sync/v2/import/utils.js +2 -2
  114. package/dist/src/sync/v2/import/utils.js.map +1 -1
  115. package/dist/src/sync/v2/types.d.ts +21 -2
  116. package/dist/src/sync/v2/types.js +7 -0
  117. package/dist/src/sync/v2/types.js.map +1 -1
  118. package/package.json +6 -4
  119. package/dist/src/specification/v2/controls/FormAction.js.map +0 -1
  120. 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 selectorIdParts = selectorId.split(':::');
39
- let id, facetID;
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 (!flexChange.facetId && actionIdMatch && propertyIdMatch) {
167
- addFlexToConfig(configPart, propertyKey, flexChange.newValue);
168
- break;
169
- }
170
- else if (flexChange.facetId === 'action' &&
171
- !sectionTitle &&
172
- actionIdMatch &&
173
- propertyIdMatch) {
174
- // Actions
175
- addFlexToConfig(configPart, propertyKey, flexChange.newValue);
176
- break;
177
- }
178
- else if (!sectionTitle && actionIdMatch && propertyIdMatch && controlTypeMatch) {
179
- addFlexToConfig(configPart, propertyKey, flexChange.newValue);
180
- break;
181
- }
182
- else if (selector.includes(sectionTitle) &&
183
- actionIdMatch &&
184
- propertyIdMatch &&
185
- controlTypeMatch) {
186
+ 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
- const path = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
198
- manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
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 manifest - manifest.json of the app
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, factory, pageKeys, flexChanges) {
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
- * Fill table settings in config.json
263
- * @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
264
- * @param manifestSettings - object page settings section of the manifest
265
- * @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
266
- * @param {MetadataInstanceInterface} factory - factory, for generating the access to reflect-metadata
267
- * @param configPart - the given part of the object page config
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, manifestSettings, flexChanges, factory, configPart, pageKeys, sectionId, sectionType) {
275
- const escapedSectionId = sectionId.replace(/\/@/g, '::');
276
- const schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
277
- const sectionTitle = schemaSection.title ? schemaSection.title.split(v2_1.FacetTitlePrefix)[1] : undefined;
278
- const manifestKey = escapedSectionId.replace('@com.sap', 'com.sap');
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
- configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, { table: {} });
291
- configPart[escapedSectionId]['table'] = OPtable;
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 + '<' + escapedSectionId + '>'];
338
+ localJsonSchema = schemaDefinitions['ObjectPage' + tableType + '<' + sectionPart.id + '>'];
296
339
  }
297
340
  else {
298
- localJsonSchema = schemaDefinitions['ObjectPageResponsiveTable<' + escapedSectionId + '>'];
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 appSchema - app specific schema
307
- * @param escapedSectionId - escaped version of the section ID
308
- * @param sectionTitle - section title
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;
@@ -327,122 +375,136 @@ function fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTi
327
375
  /**
328
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 sectionProperties - current properties' list (of sections or subsections)
331
- * @param manifestSettings - object page settings section of the manifest
332
- * @param configPart - the given part of the object page config
333
- * @param pageKeys - list of page keys (comprises the one entry describing the given page)
334
- * @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
335
- * @param {SapUiAppPageV2} v2Page - v2 page from manifest.
336
- * @param {ObjectPageConfig} objectPageConfig - page config object.
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
382
+ */
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);
394
+ }
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
337
402
  */
338
- function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, factory, pageKeys, flexChanges, v2Page, objectPageConfig) {
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];
425
+ }
426
+ }
427
+ /**
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
434
+ */
435
+ function fillSubSection(importParameters, sectionPart, manifestSettings, configPart, configParameters) {
339
436
  var _a, _b;
340
- let sectionTitle;
341
- for (const sectionId in sectionProperties) {
342
- const escapedSectionId = sectionId.replace(/\/@/g, '::');
343
- let schemaSection = sectionProperties[sectionId];
344
- if (schemaSection['$ref'] &&
345
- (getSectionType(schemaSection) === types_1.SectionTypeV2.SectionTable ||
346
- getSectionType(schemaSection) === types_1.SectionTypeV2.SubSectionTable)) {
347
- const sectionType = getSectionType(schemaSection);
348
- fillTableInConfig(importParameters, manifestSettings, flexChanges, factory, configPart, pageKeys, sectionId, sectionType);
349
- // Custom column ref
350
- fillCustomColumnsInConfig(importParameters, escapedSectionId, sectionTitle, configPart, v2Page);
351
- }
352
- else if (schemaSection['$ref'] &&
353
- (getSectionType(schemaSection) === types_1.SectionTypeV2.SectionChart ||
354
- getSectionType(schemaSection) === types_1.SectionTypeV2.SubSectionChart)) {
355
- // Section without subsections
356
- const sectionType = getSectionType(schemaSection);
357
- schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
358
- const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
359
- const manifestKey = escapedSectionId.replace('@com.sap', 'com.sap');
360
- const manifestSection = manifestSettings && manifestSettings.sections && manifestSettings.sections[manifestKey];
361
- configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, { chart: {} });
362
- configPart[escapedSectionId]['chart'] = factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageChart');
363
- if (manifestSection || flexChanges) {
364
- transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
365
- transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId]['chart'], importParameters.jsonSchema['definitions']['ObjectPageChart'], pageKeys, flexChanges, sectionId, sectionTitle);
366
- }
367
- }
368
- else if (schemaSection['$ref'] &&
369
- (getSectionType(schemaSection) === types_1.SectionTypeV2.SectionForm ||
370
- getSectionType(schemaSection) === types_1.SectionTypeV2.SubSectionForm)) {
371
- const sectionType = getSectionType(schemaSection);
372
- schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
373
- const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
374
- const formId = schemaSection['properties']['form']['$ref'].split('SectionForm')[1];
375
- configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, { form: {} });
376
- if (flexChanges) {
377
- transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
378
- }
379
- const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
380
- if (formActions['properties']) {
381
- fillActions(importParameters, formActions.properties, configPart[escapedSectionId]['form'], factory, pageKeys, flexChanges, `${escapedSectionId}::FormAction`);
382
- }
383
- const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
384
- if (formFields['properties']) {
385
- fillFields(importParameters, escapedSectionId, formFields.properties, configPart, factory, pageKeys, flexChanges);
386
- }
387
- if (Object.keys(configPart[escapedSectionId]['form']).length === 0) {
388
- delete configPart[escapedSectionId]['form'];
389
- }
390
- if (Object.keys(configPart[escapedSectionId]).length === 0) {
391
- delete configPart[escapedSectionId];
392
- }
393
- }
394
- else if ((schemaSection['properties'] && schemaSection['properties']['subsections']) ||
395
- (schemaSection['$ref'] &&
396
- (getSectionType(schemaSection) === types_1.SectionTypeV2.Section ||
397
- getSectionType(schemaSection) === types_1.SectionTypeV2.SubSection))) {
398
- // Section with subsections
399
- const sectionType = getSectionType(schemaSection);
400
- schemaSection = importParameters.jsonSchema['definitions'][`${sectionType}<${sectionId}>`];
401
- const sectionTitle = common_1.getSectionTitle(schemaSection, importParameters.jsonSchema);
402
- configPart[escapedSectionId] = factory.createInstance(common_2.PageType.ObjectPage, sectionType, {
403
- subsections: {}
404
- });
405
- if (flexChanges) {
406
- transferSettingsAndFlexChanges(importParameters, configPart[escapedSectionId], schemaSection, pageKeys, flexChanges, undefined, sectionTitle);
407
- }
408
- let currentSchemaSection;
409
- if ((_b = (_a = schemaSection['properties']) === null || _a === void 0 ? void 0 : _a['subsections']) === null || _b === void 0 ? void 0 : _b['properties']) {
410
- currentSchemaSection = schemaSection['properties']['subsections']['properties'];
411
- }
412
- else {
413
- currentSchemaSection = schemaSection['properties'];
414
- }
415
- fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[escapedSectionId]['subsections'], factory, pageKeys, flexChanges, v2Page, objectPageConfig);
416
- }
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'];
417
447
  }
448
+ else {
449
+ currentSchemaSection = sectionPart.schema['properties'];
450
+ }
451
+ fillSectionsInConfig(importParameters, currentSchemaSection, manifestSettings, configPart[sectionPart.id]['subsections'], configParameters);
418
452
  }
419
453
  /**
420
- * Fills the action of the configuration
421
- * @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
422
- * @param actionProperties - current properties' list (of action)
423
- * @param configPart - the given part of the object page config
424
- * @param actionInstance - type of action that should be initiated
425
- * @param {MetadataInstanceInterface} factory - factory, for generating the access to reflect-metadata
426
- * @param pageKeys - list of page keys (comprises the one entry describing the given page)
427
- * @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
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.
428
460
  */
429
- function fillActions(importParameters, actionProperties, configPart, factory, pageKeys, flexChanges, sectionId) {
430
- let actionId, configActionId;
431
- configPart['actions'] = {};
432
- const actionType = sectionId ? 'FormAction' : 'HeaderAction';
433
- if (flexChanges.constructor === Object && Object.keys(flexChanges).length !== 0) {
434
- for (const actionProperty in actionProperties) {
435
- configActionId = actionProperty.replace(/@/g, '::');
436
- actionId = (sectionId ? `${actionProperty}${sectionId}` : actionProperty).replace(/@/g, '::');
437
- configPart['actions'][configActionId] = factory.createInstance(common_2.PageType.ObjectPage, actionType);
438
- transferSettingsAndFlexChanges(importParameters, configPart['actions'][configActionId], importParameters.jsonSchema['definitions'][actionType], pageKeys, flexChanges, undefined, undefined, actionId);
439
- if (sectionId && Object.keys(configPart['actions'][configActionId]).length === 0) {
440
- delete configPart['actions'][configActionId];
461
+ function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, configParameters) {
462
+ for (const sectionId in sectionProperties) {
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
+ }
441
502
  }
442
503
  }
443
- }
444
- if (sectionId && Object.keys(configPart['actions']).length === 0) {
445
- delete configPart['actions'];
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);
507
+ }
446
508
  }
447
509
  }
448
510
  /**
@@ -454,23 +516,28 @@ function fillActions(importParameters, actionProperties, configPart, factory, pa
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, pageKeys, flexChangesForTransfer, v2Page, factory) {
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, flexChangesForTransfer);
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, flexChangesForTransfer);
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, factory, pageKeys, flexChangesForTransfer);
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, flexChangesForTransfer);
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, factory, pageKeys, flexChangesForTransfer, v2Page, objectPageConfig);
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, flexChangesForTransfer, sectionId);
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