@sap/ux-specification 1.90.25 → 1.90.26
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 +32 -0
- package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
- package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
- package/dist/documentation/v2/v2-ListReport.html +1 -1
- package/dist/documentation/v2/v2-ObjectPage.html +1 -1
- package/dist/documentation/v2/v2-OverviewPage.html +1 -1
- package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
- package/dist/documentation/v4/v4-ListReport.html +1 -1
- package/dist/documentation/v4/v4-ObjectPage.html +1 -1
- package/dist/index-min.js +1 -1
- package/dist/schemas/v4/ListReportConfig.json +22 -2
- package/dist/schemas/v4/ObjectPageConfig.json +36 -0
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/src/apiTypes.d.ts +2 -1
- package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +22 -1
- package/dist/src/specification/v4/controls/ObjectPageSection.js.map +1 -1
- package/dist/src/specification/v4/controls/Table.d.ts +4 -0
- package/dist/src/sync/common/decoration/control.js +26 -21
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +7 -7
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +40 -9
- package/dist/src/sync/common/generate/utils.js +90 -21
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.js +20 -19
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +57 -8
- package/dist/src/sync/common/types.js +52 -4
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +16 -11
- package/dist/src/sync/common/utils.js +87 -52
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts +1 -0
- package/dist/src/sync/v2/export/controls/Table.js +89 -48
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/export.d.ts +0 -1
- package/dist/src/sync/v2/export/export.js +219 -157
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +2 -1
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts +6 -0
- package/dist/src/sync/v2/export/manifest.js +50 -35
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.js +18 -16
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +3 -3
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +43 -42
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +5 -4
- package/dist/src/sync/v2/generate/utils.js +93 -90
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.d.ts +9 -0
- package/dist/src/sync/v2/import/app/appProvider.js +36 -13
- package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.js +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.js +5 -5
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +31 -34
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/application.d.ts +22 -10
- package/dist/src/sync/v4/application.js +67 -18
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js +6 -18
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.d.ts +5 -1
- package/dist/src/sync/v4/export/controls/Table.js +96 -85
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v4/export/controls/TableColumn.js +4 -4
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +300 -170
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/pages/ObjectPage.js +3 -2
- package/dist/src/sync/v4/export/pages/ObjectPage.js.map +1 -1
- package/dist/src/sync/v4/export/types.d.ts +5 -5
- package/dist/src/sync/v4/generate/listReport.js +114 -70
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.d.ts +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +302 -144
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +32 -22
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +13 -0
- package/dist/src/sync/v4/import/pages/objectPage.js +64 -35
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.d.ts +2 -1
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/src/sync/v4/types.d.ts +2 -0
- package/dist/src/sync/v4/utils/StableIdHelper.js +13 -10
- package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +4 -3
- package/dist/src/sync/v4/utils/utils.js +20 -20
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,6 @@ const application_1 = require("../application");
|
|
|
5
5
|
const manifest_1 = require("./manifest");
|
|
6
6
|
const flexibleColumnLayout_1 = require("./flexibleColumnLayout");
|
|
7
7
|
const v4_1 = require("../../../v4");
|
|
8
|
-
const v4_2 = require("../../../v4");
|
|
9
8
|
const utils_1 = require("../../common/utils");
|
|
10
9
|
const factory_1 = require("./factory");
|
|
11
10
|
/**
|
|
@@ -57,6 +56,72 @@ function exportFlexChange(syncRule, transferParameters, ids, breadcrumbs, config
|
|
|
57
56
|
const flexChange = common_1.fillFlexChangeContent(configObject, syncRule, transferParameters.ui5Version, key, controlId);
|
|
58
57
|
transferParameters.exportResults.flexChanges.push(syncRule.flex.createFlexChange(flexChange, transferParameters.exportResults.manifest));
|
|
59
58
|
}
|
|
59
|
+
function determineTargetAnnotationOfTable(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject) {
|
|
60
|
+
var _a, _b, _c;
|
|
61
|
+
if (ids.length > 1 && transferParameters.templateType === utils_1.TemplateType.AnalyticalListPageV4) {
|
|
62
|
+
const annoPath = (_a = transferParameters.appSchema.definitions[v4_1.DefinitionName.ALPTable]) === null || _a === void 0 ? void 0 : _a[v4_1.SchemaTag.annotationPath];
|
|
63
|
+
targetAnnotationEncoded = targetAnnotation = annoPath && annoPath.substr(annoPath.lastIndexOf('@'));
|
|
64
|
+
}
|
|
65
|
+
else if ((_b = configObject.table) === null || _b === void 0 ? void 0 : _b.annotationPath) {
|
|
66
|
+
//view definition
|
|
67
|
+
targetAnnotationEncoded = targetAnnotation = `@${configObject.table.annotationPath}`;
|
|
68
|
+
}
|
|
69
|
+
else if (ids[0] === v4_1.PropertyName.table && transferParameters.config[v4_1.PropertyName.defaultTemplateAnnotationPath]) {
|
|
70
|
+
const annotationPath = (_c = transferParameters.appSchema.definitions[v4_1.DefinitionName.TableSPV]) === null || _c === void 0 ? void 0 : _c[v4_1.SchemaTag.annotationPath];
|
|
71
|
+
if (annotationPath) {
|
|
72
|
+
const annotationPathArray = annotationPath.split('/');
|
|
73
|
+
targetAnnotationEncoded = targetAnnotation = annotationPathArray[annotationPathArray.length - 1];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { targetAnnotationEncoded, targetAnnotation };
|
|
77
|
+
}
|
|
78
|
+
function determineTargetAnnotationOfChart(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
if (ids.length > 1) {
|
|
81
|
+
const annoPath = (_a = transferParameters.appSchema.definitions[v4_1.DefinitionName.ALPChart]) === null || _a === void 0 ? void 0 : _a[v4_1.SchemaTag.annotationPath];
|
|
82
|
+
targetAnnotationEncoded = targetAnnotation = annoPath && annoPath.substr(annoPath.lastIndexOf('@'));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
//chart level
|
|
86
|
+
targetAnnotationEncoded = targetAnnotation = `@${(_b = configObject.chart) === null || _b === void 0 ? void 0 : _b.annotationPath}`;
|
|
87
|
+
}
|
|
88
|
+
return { targetAnnotationEncoded, targetAnnotation };
|
|
89
|
+
}
|
|
90
|
+
function determineTargetAnnotationOfViews(transferParameters, ids, targetAnnotation, targetAnnotationEncoded) {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
const parentDefinition = (_a = transferParameters.appSchema.definitions['MultiTableModeV4']) === null || _a === void 0 ? void 0 : _a.properties[ids[2]];
|
|
93
|
+
if (parentDefinition) {
|
|
94
|
+
if (ids.length === 3) {
|
|
95
|
+
//the parent definition comprises the annotation of the visualization of the (Selection)PresentationVariant.
|
|
96
|
+
targetAnnotation = targetAnnotationEncoded =
|
|
97
|
+
parentDefinition[v4_1.SchemaTag.annotationPath] &&
|
|
98
|
+
parentDefinition[v4_1.SchemaTag.annotationPath].substr(parentDefinition[v4_1.SchemaTag.annotationPath].lastIndexOf('@'));
|
|
99
|
+
}
|
|
100
|
+
else if (ids.length > 3) {
|
|
101
|
+
//the own definitio comprises the lineItem or chart annotation from he visualization
|
|
102
|
+
const ownDefinitionName = (_b = parentDefinition.$ref) === null || _b === void 0 ? void 0 : _b.split(utils_1.DEFINITION_LINK_PREFIX)[1];
|
|
103
|
+
const ownDefinition = ownDefinitionName && transferParameters.appSchema.definitions[ownDefinitionName];
|
|
104
|
+
const annotation = (ownDefinition === null || ownDefinition === void 0 ? void 0 : ownDefinition[v4_1.SchemaTag.annotationPath]) &&
|
|
105
|
+
ownDefinition[v4_1.SchemaTag.annotationPath].substr(ownDefinition[v4_1.SchemaTag.annotationPath].lastIndexOf('@'));
|
|
106
|
+
targetAnnotation = targetAnnotationEncoded = ownDefinition['navigationProperty']
|
|
107
|
+
? `${ownDefinition['navigationProperty']}/${annotation}`
|
|
108
|
+
: annotation;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { targetAnnotation, targetAnnotationEncoded };
|
|
112
|
+
}
|
|
113
|
+
function determineTargetAnnotationOfSections(ids, custom, targetAnnotationEncoded, targetAnnotation) {
|
|
114
|
+
if (ids[1] === 'custom' && ids[2] !== ids[ids.length - 1]) {
|
|
115
|
+
custom = true;
|
|
116
|
+
targetAnnotationEncoded = ids[2];
|
|
117
|
+
targetAnnotation = targetAnnotationEncoded && targetAnnotationEncoded.replace(/::/g, '/');
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
targetAnnotationEncoded = ids[1] && ids[1].replace(/\//g, '::');
|
|
121
|
+
targetAnnotation = targetAnnotationEncoded && targetAnnotationEncoded.replace(/::/g, '/');
|
|
122
|
+
}
|
|
123
|
+
return { custom, targetAnnotationEncoded, targetAnnotation };
|
|
124
|
+
}
|
|
60
125
|
/**
|
|
61
126
|
* Determines the target annotation that is relevant for the sync rule
|
|
62
127
|
* @param {string[]} ids - list of ids of parent elements
|
|
@@ -65,67 +130,31 @@ function exportFlexChange(syncRule, transferParameters, ids, breadcrumbs, config
|
|
|
65
130
|
* @returns { targetAnnotationEncoded, targetAnnotation, custom }
|
|
66
131
|
*/
|
|
67
132
|
function determineTargetAnnotation(ids, transferParameters, configObject) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (ids.length > 1) {
|
|
72
|
-
annoPath = (_a = transferParameters.appSchema.definitions[v4_2.DefinitionName.ALPTable]) === null || _a === void 0 ? void 0 : _a[v4_1.SchemaTag.annotationPath];
|
|
73
|
-
targetAnnotationEncoded = targetAnnotation = annoPath && annoPath.substr(annoPath.lastIndexOf('@'));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
//table level
|
|
77
|
-
targetAnnotationEncoded = targetAnnotation = `@${(_b = configObject.table) === null || _b === void 0 ? void 0 : _b.annotationPath}`;
|
|
78
|
-
}
|
|
133
|
+
let targetAnnotation, targetAnnotationEncoded, custom = false;
|
|
134
|
+
if (ids[0] === v4_1.PropertyName.table && ids[1] !== v4_1.PropertyName.views) {
|
|
135
|
+
({ targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfTable(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject));
|
|
79
136
|
}
|
|
80
|
-
else if (ids[0] ===
|
|
81
|
-
|
|
82
|
-
annoPath = (_c = transferParameters.appSchema.definitions[v4_2.DefinitionName.ALPChart]) === null || _c === void 0 ? void 0 : _c[v4_1.SchemaTag.annotationPath];
|
|
83
|
-
targetAnnotationEncoded = targetAnnotation = annoPath && annoPath.substr(annoPath.lastIndexOf('@'));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
//chart level
|
|
87
|
-
targetAnnotationEncoded = targetAnnotation = `@${(_d = configObject.chart) === null || _d === void 0 ? void 0 : _d.annotationPath}`;
|
|
88
|
-
}
|
|
137
|
+
else if (ids[0] === v4_1.PropertyName.chart && transferParameters.templateType === utils_1.TemplateType.AnalyticalListPageV4) {
|
|
138
|
+
({ targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfChart(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject));
|
|
89
139
|
}
|
|
90
|
-
else if (ids[0] ===
|
|
91
|
-
|
|
92
|
-
custom = true;
|
|
93
|
-
targetAnnotationEncoded = ids[2];
|
|
94
|
-
targetAnnotation = targetAnnotationEncoded && targetAnnotationEncoded.replace(/::/g, '/');
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
targetAnnotationEncoded = ids[1] && ids[1].replace(/\//g, '::');
|
|
98
|
-
targetAnnotation = targetAnnotationEncoded && targetAnnotationEncoded.replace(/::/g, '/');
|
|
99
|
-
}
|
|
140
|
+
else if (ids[0] === v4_1.PropertyName.sections) {
|
|
141
|
+
({ custom, targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfSections(ids, custom, targetAnnotationEncoded, targetAnnotation));
|
|
100
142
|
}
|
|
101
|
-
else if (ids[1] ===
|
|
143
|
+
else if (ids[1] === v4_1.PropertyName.sections) {
|
|
102
144
|
//header sections
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (ids.length === 3) {
|
|
112
|
-
//the parent definition comprises the annotation of the visualization of the (Selection)PresentationVariant.
|
|
113
|
-
targetAnnotation = targetAnnotationEncoded =
|
|
114
|
-
parentDefinition[v4_1.SchemaTag.annotationPath] &&
|
|
115
|
-
parentDefinition[v4_1.SchemaTag.annotationPath].substr(parentDefinition[v4_1.SchemaTag.annotationPath].lastIndexOf('@'));
|
|
116
|
-
}
|
|
117
|
-
else if (ids.length > 3) {
|
|
118
|
-
//the own definitio comprises the lineItem or chart annotation from he visualization
|
|
119
|
-
const ownDefinitionName = (_f = parentDefinition.$ref) === null || _f === void 0 ? void 0 : _f.split(utils_1.DEFINITION_LINK_PREFIX)[1];
|
|
120
|
-
const ownDefinition = ownDefinitionName && transferParameters.appSchema.definitions[ownDefinitionName];
|
|
121
|
-
const annotation = (ownDefinition === null || ownDefinition === void 0 ? void 0 : ownDefinition[v4_1.SchemaTag.annotationPath]) &&
|
|
122
|
-
ownDefinition[v4_1.SchemaTag.annotationPath].substr(ownDefinition[v4_1.SchemaTag.annotationPath].lastIndexOf('@'));
|
|
123
|
-
targetAnnotation = targetAnnotationEncoded = ownDefinition['navigationProperty']
|
|
124
|
-
? `${ownDefinition['navigationProperty']}/${annotation}`
|
|
125
|
-
: annotation;
|
|
126
|
-
}
|
|
145
|
+
if (transferParameters.title && transferParameters.title.indexOf(v4_1.FacetTitlePrefix) > -1) {
|
|
146
|
+
targetAnnotation = targetAnnotationEncoded = transferParameters.title.split(v4_1.FacetTitlePrefix)[1];
|
|
147
|
+
}
|
|
148
|
+
else if (ids[2]) {
|
|
149
|
+
targetAnnotation = targetAnnotationEncoded = ids[2].split('@')[1];
|
|
150
|
+
}
|
|
151
|
+
else if (targetAnnotationEncoded) {
|
|
152
|
+
targetAnnotation = targetAnnotationEncoded = targetAnnotationEncoded.replace(/::/g, '/');
|
|
127
153
|
}
|
|
128
154
|
}
|
|
155
|
+
else if (ids[1] === v4_1.PropertyName.views) {
|
|
156
|
+
({ targetAnnotation, targetAnnotationEncoded } = determineTargetAnnotationOfViews(transferParameters, ids, targetAnnotation, targetAnnotationEncoded));
|
|
157
|
+
}
|
|
129
158
|
return { targetAnnotationEncoded, targetAnnotation, custom };
|
|
130
159
|
}
|
|
131
160
|
/**
|
|
@@ -137,49 +166,50 @@ function determineKeyForSyncRule(ids) {
|
|
|
137
166
|
let idIndex = 0;
|
|
138
167
|
for (let index = ids.length - 1; index > -1; index--) {
|
|
139
168
|
const element = ids[index];
|
|
140
|
-
if (element === 'columns' || element ===
|
|
169
|
+
if (element === 'columns' || element === v4_1.PropertyName.actions || element === 'views') {
|
|
141
170
|
idIndex = index + 1;
|
|
142
171
|
break;
|
|
143
172
|
}
|
|
144
173
|
}
|
|
145
|
-
return idIndex > 0 ? ids[idIndex] : undefined;
|
|
174
|
+
return idIndex > 0 ? ids[idIndex].replace(/\//gi, '??') : undefined;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Creates a new object in manifest
|
|
178
|
+
* @param {ExportToManifestParams} params - list of parameters
|
|
179
|
+
*/
|
|
180
|
+
function createNewObjectInManifest(params) {
|
|
181
|
+
if (params.exportHandler && typeof params.exportHandler === 'function') {
|
|
182
|
+
params.exportHandler(params.manifestSection, params.configObject, params.configPropertyKey, params.manifestKey, params.syncRuleKey);
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
params.manifestSection[params.manifestKey] = {};
|
|
186
|
+
}
|
|
146
187
|
}
|
|
147
188
|
/**
|
|
148
189
|
* Transfers a property value from config to manifest
|
|
190
|
+
* @param {ExportToManifestParams} params - list of parameters
|
|
149
191
|
* @param propertyDefinition - schema definiton of a particular property
|
|
150
192
|
* @param nextDefinition - schema definition referred by $ref
|
|
151
|
-
* @param {SyncRule} syncRule - syncRule (metadata)
|
|
152
|
-
* @param manifestSection - actual section n manifest.json
|
|
153
|
-
* @param { [key: string]: any } configObject - the given config.json, to be exported
|
|
154
|
-
* @param {string} configPropertyKey - key of property in the config
|
|
155
|
-
* @param manifestKey - key in manifest (might be different from propertyKey)
|
|
156
|
-
* @param syncRuleKey - specific key, calculated for the export handler
|
|
157
193
|
*/
|
|
158
|
-
function transferPropertyToManifest(propertyDefinition, nextDefinition
|
|
159
|
-
|
|
194
|
+
function transferPropertyToManifest(params, propertyDefinition, nextDefinition) {
|
|
195
|
+
var _a, _b;
|
|
160
196
|
if (!(propertyDefinition['type'] !== 'array' &&
|
|
161
|
-
nextDefinition &&
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (exportHandler && typeof exportHandler === 'function') {
|
|
166
|
-
exportHandler(manifestSection, configObject, configPropertyKey, manifestKey, syncRuleKey);
|
|
197
|
+
((_a = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition['targetDefinition']) === null || _a === void 0 ? void 0 : _a.type) === 'object' && ((_b = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition['targetDefinition']) === null || _b === void 0 ? void 0 : _b.properties))) {
|
|
198
|
+
if (params.exportHandler !== false) {
|
|
199
|
+
if (params.exportHandler && typeof params.exportHandler === 'function') {
|
|
200
|
+
params.exportHandler(params.manifestSection, params.configObject, params.configPropertyKey, params.manifestKey, params.syncRuleKey);
|
|
167
201
|
}
|
|
168
|
-
else if (Array.isArray(configObject[configPropertyKey]) &&
|
|
169
|
-
|
|
202
|
+
else if (Array.isArray(params.configObject[params.configPropertyKey]) &&
|
|
203
|
+
!params.configObject[params.configPropertyKey].length) {
|
|
204
|
+
delete params.manifestSection[params.manifestKey];
|
|
170
205
|
}
|
|
171
206
|
else {
|
|
172
|
-
manifestSection[manifestKey] = configObject[configPropertyKey];
|
|
207
|
+
params.manifestSection[params.manifestKey] = params.configObject[params.configPropertyKey];
|
|
173
208
|
}
|
|
174
209
|
}
|
|
175
210
|
}
|
|
176
|
-
else if (propertyDefinition['type'] !== 'array' && manifestSection[manifestKey] === undefined) {
|
|
177
|
-
|
|
178
|
-
exportHandler(manifestSection, configObject, configPropertyKey, manifestKey, syncRuleKey);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
manifestSection[manifestKey] = {};
|
|
182
|
-
}
|
|
211
|
+
else if (propertyDefinition['type'] !== 'array' && params.manifestSection[params.manifestKey] === undefined) {
|
|
212
|
+
createNewObjectInManifest(params);
|
|
183
213
|
}
|
|
184
214
|
}
|
|
185
215
|
/**
|
|
@@ -203,19 +233,29 @@ function exportManifestChange(ids, syncRule, transferParameters, configPropertyK
|
|
|
203
233
|
const syncRuleKey = determineKeyForSyncRule(ids);
|
|
204
234
|
const path = syncRule.manifest.path(transferParameters.pageNameArray, transferParameters.exportResults.manifest, targetAnnotationEncoded, syncRuleKey, targetAnnotation);
|
|
205
235
|
const manifestSection = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path, targetAnnotation, custom ? undefined : targetAnnotationEncoded);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
236
|
+
if (manifestSection) {
|
|
237
|
+
const manifestKey = syncRule.manifest.key || configPropertyKey;
|
|
238
|
+
if (configObject[configPropertyKey] !== undefined) {
|
|
239
|
+
// In case of arrays we take over complete array
|
|
240
|
+
const exportParams = {
|
|
241
|
+
exportHandler: syncRule.manifest.export,
|
|
242
|
+
manifestSection,
|
|
243
|
+
configObject,
|
|
244
|
+
configPropertyKey,
|
|
245
|
+
manifestKey,
|
|
246
|
+
syncRuleKey
|
|
247
|
+
};
|
|
248
|
+
transferPropertyToManifest(exportParams, propertyDefinition, nextDefinition);
|
|
249
|
+
}
|
|
250
|
+
else if (syncRule.manifest.delete) {
|
|
251
|
+
const deleteHandler = syncRule.manifest.delete;
|
|
252
|
+
if (typeof deleteHandler === 'function') {
|
|
253
|
+
deleteHandler(manifestSection, configObject, configPropertyKey, manifestKey, syncRuleKey);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
else if (manifestSection[manifestKey] !== undefined) {
|
|
257
|
+
delete manifestSection[manifestKey];
|
|
215
258
|
}
|
|
216
|
-
}
|
|
217
|
-
else if (manifestSection[manifestKey] !== undefined) {
|
|
218
|
-
delete manifestSection[manifestKey];
|
|
219
259
|
}
|
|
220
260
|
utils_1.deleteEmptyStructure(transferParameters.exportResults.manifest, path, targetAnnotation, targetAnnotationEncoded);
|
|
221
261
|
}
|
|
@@ -241,15 +281,23 @@ function evaluateExportRule(transferParameters, breadcrumbs, key, configObject,
|
|
|
241
281
|
}
|
|
242
282
|
}
|
|
243
283
|
}
|
|
244
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Processes an (object-like) sub-object of the app schema and transfer all connected config entries to manifest
|
|
286
|
+
* @param {TransferEntryParameters} parameters - list of parameters
|
|
287
|
+
* @param {NextDefinition} nextDefinition - the next definition in app schema to be processed
|
|
288
|
+
* @param currentConfigObject - current config object
|
|
289
|
+
* @param ids - list of parent & child ID's
|
|
290
|
+
* @param localIdParts - list of ID parts for building the stable ID
|
|
291
|
+
*/
|
|
292
|
+
function transferSubObject(parameters, nextDefinition, currentConfigObject, ids, localIdParts) {
|
|
245
293
|
let objects = [], isArray = false;
|
|
246
|
-
if (propertyDefinition.$ref && nextDefinition) {
|
|
294
|
+
if (parameters.propertyDefinition.$ref && nextDefinition) {
|
|
247
295
|
objects.push(nextDefinition.configObject);
|
|
248
296
|
}
|
|
249
|
-
else if (propertyDefinition['anyOf']) {
|
|
297
|
+
else if (parameters.propertyDefinition['anyOf']) {
|
|
250
298
|
objects.push(currentConfigObject);
|
|
251
299
|
}
|
|
252
|
-
else if (propertyDefinition.type === 'array') {
|
|
300
|
+
else if (parameters.propertyDefinition.type === 'array') {
|
|
253
301
|
objects = currentConfigObject;
|
|
254
302
|
isArray = true;
|
|
255
303
|
}
|
|
@@ -258,13 +306,13 @@ function transferSubObject(propertyDefinition, nextDefinition, currentConfigObje
|
|
|
258
306
|
}
|
|
259
307
|
for (const innerObject of objects) {
|
|
260
308
|
const additionalIds = [];
|
|
261
|
-
if (breadcrumbs[0] ===
|
|
309
|
+
if (parameters.breadcrumbs[0] === v4_1.PropertyName.sections && parameters.key === 'custom' && isArray) {
|
|
262
310
|
// We need add custom section 'id' into breadcrumbs to retrieve correct path to manifest
|
|
263
311
|
additionalIds.push(innerObject['id']);
|
|
264
312
|
}
|
|
265
|
-
transferParameters.title = nextDefinition.title;
|
|
313
|
+
parameters.transferParameters.title = nextDefinition.title;
|
|
266
314
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
267
|
-
transferManifestEntriesAndFlexChange(transferParameters, innerObject, [...ids, ...additionalIds], localIdParts, [...breadcrumbs, key], nextDefinition.targetDefinition);
|
|
315
|
+
transferManifestEntriesAndFlexChange(parameters.transferParameters, innerObject, [...ids, ...additionalIds], localIdParts, [...parameters.breadcrumbs, parameters.key], nextDefinition.targetDefinition);
|
|
268
316
|
}
|
|
269
317
|
}
|
|
270
318
|
/**
|
|
@@ -358,28 +406,35 @@ function createALPChartView(transferParameters, configObject, key) {
|
|
|
358
406
|
* @param configObject - current object in config.json
|
|
359
407
|
* @returns a boolean indicating that the views entry got created.
|
|
360
408
|
*/
|
|
361
|
-
function createLRTableView(transferParameters, key, configObject) {
|
|
409
|
+
function createLRTableView(index, transferParameters, key, configObject) {
|
|
362
410
|
if (!configObject || Object.keys(configObject).length === 0) {
|
|
363
411
|
return false;
|
|
364
412
|
}
|
|
365
413
|
let newElementCreated = false;
|
|
366
414
|
const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
|
|
367
415
|
const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
|
|
416
|
+
const newEntry = {
|
|
417
|
+
key: key,
|
|
418
|
+
annotationPath: configObject.annotationPath
|
|
419
|
+
};
|
|
368
420
|
if (!views['paths'] || Object.keys(views['paths']).length === 0) {
|
|
369
|
-
views
|
|
370
|
-
|
|
371
|
-
key: key,
|
|
372
|
-
annotationPath: configObject.annotationPath
|
|
373
|
-
}
|
|
374
|
-
];
|
|
421
|
+
//No views yet
|
|
422
|
+
views['paths'] = [newEntry];
|
|
375
423
|
newElementCreated = true;
|
|
376
424
|
}
|
|
377
|
-
else
|
|
378
|
-
views['paths'].
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
425
|
+
else {
|
|
426
|
+
const existingIndex = views['paths'].findIndex((view) => view.key === key);
|
|
427
|
+
if (existingIndex === -1) {
|
|
428
|
+
//Given view does not exist yet
|
|
429
|
+
views['paths'].push(newEntry);
|
|
430
|
+
newElementCreated = true;
|
|
431
|
+
}
|
|
432
|
+
else if (existingIndex !== index) {
|
|
433
|
+
//Reordering scenario
|
|
434
|
+
views['paths'].splice(existingIndex, 1);
|
|
435
|
+
views['paths'].splice(index, 0, newEntry);
|
|
436
|
+
newElementCreated = true;
|
|
437
|
+
}
|
|
383
438
|
}
|
|
384
439
|
return newElementCreated;
|
|
385
440
|
}
|
|
@@ -392,19 +447,89 @@ function createLRTableView(transferParameters, key, configObject) {
|
|
|
392
447
|
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
393
448
|
* @returns newElementCreated - boolean value to indicate that a new element was created ==> no further sync rule on this level
|
|
394
449
|
*/
|
|
395
|
-
function createNewElement(definitionName, key, configObject, breadcrumbs, transferParameters) {
|
|
450
|
+
function createNewElement(index, definitionName, key, configObject, breadcrumbs, transferParameters, preprocessed = false) {
|
|
396
451
|
let newElementCreated = false;
|
|
397
452
|
const stopProcessing = false;
|
|
398
|
-
if (
|
|
399
|
-
|
|
453
|
+
if (!preprocessed) {
|
|
454
|
+
if (definitionName === v4_1.DefinitionName.ALPChartView && key === v4_1.PropertyName.chart && configObject) {
|
|
455
|
+
return createALPChartView(transferParameters, configObject, key);
|
|
456
|
+
}
|
|
457
|
+
else if (definitionName === v4_1.DefinitionName.ALPTableView && key === v4_1.PropertyName.table && configObject) {
|
|
458
|
+
return createALPTableView(transferParameters, configObject, key);
|
|
459
|
+
}
|
|
460
|
+
else if (key &&
|
|
461
|
+
((definitionName === null || definitionName === void 0 ? void 0 : definitionName.startsWith(v4_1.DefinitionName.LRTableView)) || (definitionName === null || definitionName === void 0 ? void 0 : definitionName.startsWith(v4_1.DefinitionName.LRChartView)))) {
|
|
462
|
+
newElementCreated = createLRTableView(index, transferParameters, key, configObject[key]);
|
|
463
|
+
}
|
|
400
464
|
}
|
|
401
|
-
|
|
402
|
-
|
|
465
|
+
return { newElementCreated, stopProcessing };
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Transfers one enry of a list (aka one property of the config) to the manifest
|
|
469
|
+
* @param {TransferEntryParameters} parameters - list of parameters
|
|
470
|
+
* @param parentIds - array of collected parent ids
|
|
471
|
+
* @param stableIdParts - list of parts of the stable ID for flex changes
|
|
472
|
+
* @param preprocessed - indicates that the list was already preprocessed by following the config order
|
|
473
|
+
*/
|
|
474
|
+
function transferSortedListEntry(parameters, parentIds, stableIdParts, preprocessed = false) {
|
|
475
|
+
var _a;
|
|
476
|
+
const currentConfigObject = parameters.configObject[parameters.key];
|
|
477
|
+
const childId = common_1.getChildId(parameters.configObject, parameters.key);
|
|
478
|
+
const nextDefinition = utils_1.getNextTargetDefinition(parameters.transferParameters.appSchema, parameters.transferParameters.title, currentConfigObject, parameters.propertyDefinition, parameters.key, parameters.transferParameters.factory, parameters.transferParameters.pageType);
|
|
479
|
+
const { newElementCreated, stopProcessing } = createNewElement(parameters.index, (_a = parameters.propertyDefinition.$ref) === null || _a === void 0 ? void 0 : _a.split(utils_1.DEFINITION_LINK_PREFIX)[1], parameters.key, parameters.configObject, parameters.breadcrumbs, parameters.transferParameters, preprocessed);
|
|
480
|
+
const ids = childId ? [...parentIds, childId] : [...parentIds, parameters.key];
|
|
481
|
+
if (!newElementCreated) {
|
|
482
|
+
evaluateExportRule(parameters.transferParameters, parameters.breadcrumbs, parameters.key, parameters.configObject, ids, parameters.propertyDefinition, nextDefinition);
|
|
483
|
+
}
|
|
484
|
+
if (parameters.propertyDefinition &&
|
|
485
|
+
(typeof currentConfigObject === 'object' ||
|
|
486
|
+
(parameters.propertyDefinition.$ref && nextDefinition.configObject)) &&
|
|
487
|
+
!stopProcessing) {
|
|
488
|
+
const localIdParts = childId ? [...stableIdParts, childId] : stableIdParts;
|
|
489
|
+
transferSubObject(parameters, nextDefinition, currentConfigObject, ids, localIdParts);
|
|
403
490
|
}
|
|
404
|
-
|
|
405
|
-
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Function for special handling of anyOf definitions during the export
|
|
494
|
+
* @param {TransferEntryParameters} parameters - list of parameters
|
|
495
|
+
* @param anyOfDefinitions - the array of definitions from the anyOf (of additionalProperties)
|
|
496
|
+
* @param schemaDefinition - parent definition, comprising properties as well as additionalProperties
|
|
497
|
+
* @param parentIds - array of collected parent ids
|
|
498
|
+
* @param stableIdParts - list of parts of the stable ID for flex changes
|
|
499
|
+
* @returns
|
|
500
|
+
*/
|
|
501
|
+
function transferConfigEntriesWithAnyOfDefinitions(transferEntryParameters, anyOfDefinitions, schemaDefinition, parentIds, stableIdParts) {
|
|
502
|
+
let preprocessed = false;
|
|
503
|
+
if (anyOfDefinitions) {
|
|
504
|
+
const configEntries = Object.entries(transferEntryParameters.configObject);
|
|
505
|
+
if (!configEntries || configEntries.length < 1) {
|
|
506
|
+
return preprocessed;
|
|
507
|
+
}
|
|
508
|
+
configEntries.sort((a, b) => a[1]['index'] - b[1]['index']);
|
|
509
|
+
//follow the config order, to support reordering
|
|
510
|
+
configEntries.forEach((configEntry) => {
|
|
511
|
+
if (schemaDefinition.properties[configEntry[0]]) {
|
|
512
|
+
transferEntryParameters.key = configEntry[0];
|
|
513
|
+
transferEntryParameters.propertyDefinition = schemaDefinition.properties[configEntry[0]];
|
|
514
|
+
//already part of schema
|
|
515
|
+
transferSortedListEntry(transferEntryParameters, parentIds, stableIdParts);
|
|
516
|
+
preprocessed = true;
|
|
517
|
+
}
|
|
518
|
+
else if (typeof configEntry[1] === 'object') {
|
|
519
|
+
//match against potential schema definitions
|
|
520
|
+
anyOfDefinitions.forEach((anyOfDefinition) => {
|
|
521
|
+
if (anyOfDefinition.$ref) {
|
|
522
|
+
transferEntryParameters.key = configEntry[0];
|
|
523
|
+
transferEntryParameters.propertyDefinition = anyOfDefinition;
|
|
524
|
+
transferSortedListEntry(transferEntryParameters, parentIds, stableIdParts);
|
|
525
|
+
preprocessed = true;
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
transferEntryParameters.index++;
|
|
530
|
+
});
|
|
406
531
|
}
|
|
407
|
-
return
|
|
532
|
+
return preprocessed;
|
|
408
533
|
}
|
|
409
534
|
/**
|
|
410
535
|
* Recursive function that traverses the content of the current object. It reads decorators and fills exportResultManifest entries and flex changes
|
|
@@ -417,35 +542,36 @@ function createNewElement(definitionName, key, configObject, breadcrumbs, transf
|
|
|
417
542
|
* @param title - the title to be used for the given schema definition
|
|
418
543
|
*/
|
|
419
544
|
function transferManifestEntriesAndFlexChange(transferParameters, configObject, parentIds, stableIdParts, breadcrumbs, schemaDefinition) {
|
|
420
|
-
var _a;
|
|
421
|
-
|
|
422
|
-
if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition['properties'])) {
|
|
545
|
+
var _a, _b;
|
|
546
|
+
if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition.properties)) {
|
|
423
547
|
return;
|
|
424
548
|
}
|
|
425
|
-
|
|
426
|
-
|
|
549
|
+
let index = 0;
|
|
550
|
+
//In case of additionalProperties = flexible array definition ==> new entries from the config shall be exported too
|
|
551
|
+
const transferEntryParameters = {
|
|
552
|
+
transferParameters,
|
|
553
|
+
breadcrumbs,
|
|
554
|
+
key: undefined,
|
|
555
|
+
index,
|
|
556
|
+
configObject,
|
|
557
|
+
propertyDefinition: undefined
|
|
558
|
+
};
|
|
559
|
+
const anyOfDefinitions = (_a = schemaDefinition.additionalProperties) === null || _a === void 0 ? void 0 : _a.anyOf;
|
|
560
|
+
const preprocessed = transferConfigEntriesWithAnyOfDefinitions(transferEntryParameters, anyOfDefinitions, schemaDefinition, parentIds, stableIdParts);
|
|
561
|
+
//Sort if there is a propertyIndex, so that the exported list ends up in manifest in the right order
|
|
562
|
+
let sortedList = schemaDefinition.properties && Object.entries(schemaDefinition.properties);
|
|
427
563
|
if (sortedList) {
|
|
428
|
-
if ((
|
|
429
|
-
sortedList = Object.entries(schemaDefinition
|
|
564
|
+
if ((_b = sortedList[0]) === null || _b === void 0 ? void 0 : _b[1][v4_1.SchemaTag.propertyIndex]) {
|
|
565
|
+
sortedList = Object.entries(schemaDefinition.properties).sort((a, b) => a[1][v4_1.SchemaTag.propertyIndex] - b[1][v4_1.SchemaTag.propertyIndex]);
|
|
430
566
|
}
|
|
567
|
+
index = 0;
|
|
431
568
|
sortedList.forEach((element) => {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
const definitionInSchema = (_a = propertyDefinition.$ref) === null || _a === void 0 ? void 0 : _a.split(utils_1.DEFINITION_LINK_PREFIX)[1];
|
|
439
|
-
const { newElementCreated, stopProcessing } = createNewElement(definitionInSchema, key, configObject, breadcrumbs, transferParameters);
|
|
440
|
-
const ids = childId ? [...parentIds, childId] : [...parentIds, key];
|
|
441
|
-
if (!newElementCreated) {
|
|
442
|
-
evaluateExportRule(transferParameters, breadcrumbs, key, configObject, ids, propertyDefinition, nextDefinition);
|
|
443
|
-
}
|
|
444
|
-
if (propertyDefinition &&
|
|
445
|
-
(typeof currentConfigObject === 'object' || (propertyDefinition.$ref && nextDefinition.configObject)) &&
|
|
446
|
-
!stopProcessing) {
|
|
447
|
-
const localIdParts = childId ? [...stableIdParts, childId] : stableIdParts;
|
|
448
|
-
transferSubObject(propertyDefinition, nextDefinition, currentConfigObject, breadcrumbs, key, transferParameters, ids, localIdParts);
|
|
569
|
+
transferEntryParameters.key = element[0];
|
|
570
|
+
transferEntryParameters.propertyDefinition = element[1];
|
|
571
|
+
transferEntryParameters.index = index;
|
|
572
|
+
transferSortedListEntry(transferEntryParameters, parentIds, stableIdParts, preprocessed);
|
|
573
|
+
if (element[1].$ref) {
|
|
574
|
+
index++;
|
|
449
575
|
}
|
|
450
576
|
});
|
|
451
577
|
}
|
|
@@ -460,7 +586,7 @@ function getClassesForSingleSection(objectPageConfig, sectionId, factory) {
|
|
|
460
586
|
const customSections = objectPageConfig.sections
|
|
461
587
|
.custom;
|
|
462
588
|
for (let index = 0; index < customSections.length; index++) {
|
|
463
|
-
customSections[index] = factory.createInstance(
|
|
589
|
+
customSections[index] = factory.createInstance(v4_1.PageType.ObjectPage, 'ObjectPageCustomSectionView', customSections[index], customSections[index].className);
|
|
464
590
|
}
|
|
465
591
|
}
|
|
466
592
|
}
|
|
@@ -503,11 +629,11 @@ const exportObjectPage = (exportParameters, ui5Version) => {
|
|
|
503
629
|
const exportResults = defaultExportResult;
|
|
504
630
|
exportResults.manifest = JSON.parse(JSON.stringify(exportParameters.manifest));
|
|
505
631
|
const factory = new factory_1.MetadataInstanceFactoryV4();
|
|
506
|
-
const objectPage = factory.createPageInstance(
|
|
632
|
+
const objectPage = factory.createPageInstance(v4_1.PageType.ObjectPage, exportParameters.page.config);
|
|
507
633
|
const pageLayoutInformation = common_1.getPageLayoutInformation(objectPage);
|
|
508
634
|
const pageName = exportParameters.page.name;
|
|
509
635
|
const baseId = `${exportParameters.appId}::${pageLayoutInformation.id}::${pageName}--`;
|
|
510
|
-
if ((_a = exportParameters.page.config) === null || _a === void 0 ? void 0 : _a[
|
|
636
|
+
if ((_a = exportParameters.page.config) === null || _a === void 0 ? void 0 : _a[v4_1.PropertyName.sections]) {
|
|
511
637
|
getExportClassesForSections(exportParameters.page.config, objectPage, factory);
|
|
512
638
|
}
|
|
513
639
|
const transferParameters = {
|
|
@@ -516,10 +642,11 @@ const exportObjectPage = (exportParameters, ui5Version) => {
|
|
|
516
642
|
appRootPath: exportParameters.appRootPath,
|
|
517
643
|
baseId,
|
|
518
644
|
appSchema: exportParameters.jsonSchema,
|
|
645
|
+
config: objectPage,
|
|
519
646
|
ui5Version,
|
|
520
647
|
factory,
|
|
521
648
|
pageNameArray: [pageName],
|
|
522
|
-
pageType:
|
|
649
|
+
pageType: v4_1.PageType.ObjectPage,
|
|
523
650
|
title: undefined,
|
|
524
651
|
templateType: utils_1.TemplateType.ListReportObjectPageV4
|
|
525
652
|
};
|
|
@@ -541,30 +668,33 @@ const exportListPage = (exportParameters, factory, config, pageType, ui5Version,
|
|
|
541
668
|
var _a, _b;
|
|
542
669
|
const exportResults = defaultExportResult;
|
|
543
670
|
exportResults.manifest = JSON.parse(JSON.stringify(exportParameters.manifest));
|
|
544
|
-
const
|
|
671
|
+
const appSchema = exportParameters.jsonSchema;
|
|
672
|
+
const tableDefinition = ((_a = config.table) === null || _a === void 0 ? void 0 : _a[v4_1.PropertyName.annotationPath]) ? v4_1.DefinitionName.ALPTableView
|
|
673
|
+
: v4_1.DefinitionName.Table;
|
|
545
674
|
config.table = factory.createInstance(pageType, tableDefinition, config.table);
|
|
546
|
-
if (((_b = config.table.toolBar) === null || _b === void 0 ? void 0 : _b.actions) &&
|
|
547
|
-
for (const actionKey in
|
|
675
|
+
if (((_b = config.table.toolBar) === null || _b === void 0 ? void 0 : _b.actions) && appSchema.definitions['Actions<LineItems>']) {
|
|
676
|
+
for (const actionKey in appSchema.definitions['Actions<LineItems>'].properties) {
|
|
548
677
|
config.table.toolBar.actions[actionKey] = factory.createInstance(pageType, 'ToolBarAction', config.table.toolBar.actions[actionKey]);
|
|
549
678
|
}
|
|
550
679
|
}
|
|
551
680
|
const pageLayoutInformation = common_1.getPageLayoutInformation(config);
|
|
552
681
|
const pageName = exportParameters.page.name;
|
|
553
682
|
const baseId = `${exportParameters.appId}::${pageLayoutInformation.id}::${pageName}--`;
|
|
554
|
-
if (!exportResults.manifest[
|
|
683
|
+
if (!exportResults.manifest[v4_1.ManifestSection.ui5].routing.targets[pageName]) {
|
|
555
684
|
const newV4Page = getV4ManifestPageTemplate(pageLayoutInformation.pageId, pageName);
|
|
556
|
-
exportResults.manifest[
|
|
685
|
+
exportResults.manifest[v4_1.ManifestSection.ui5].routing.targets[pageName] = newV4Page;
|
|
557
686
|
}
|
|
558
687
|
const transferParameters = {
|
|
559
688
|
exportResults,
|
|
560
689
|
appId: exportParameters.appId,
|
|
561
690
|
appRootPath: exportParameters.appRootPath,
|
|
562
691
|
baseId,
|
|
563
|
-
appSchema
|
|
692
|
+
appSchema,
|
|
693
|
+
config,
|
|
564
694
|
ui5Version,
|
|
565
695
|
factory,
|
|
566
696
|
pageNameArray: [pageName],
|
|
567
|
-
pageType:
|
|
697
|
+
pageType: v4_1.PageType.ListReport,
|
|
568
698
|
title: undefined,
|
|
569
699
|
logger: exportParameters.logger,
|
|
570
700
|
templateType
|
|
@@ -572,7 +702,7 @@ const exportListPage = (exportParameters, factory, config, pageType, ui5Version,
|
|
|
572
702
|
transferManifestEntriesAndFlexChange(transferParameters, config, [], //no parentIds
|
|
573
703
|
[], // no stableIds
|
|
574
704
|
[], // no breadcrumbs
|
|
575
|
-
|
|
705
|
+
appSchema //starting point for target definition
|
|
576
706
|
);
|
|
577
707
|
return exportResults;
|
|
578
708
|
};
|
|
@@ -584,8 +714,8 @@ const exportListPage = (exportParameters, factory, config, pageType, ui5Version,
|
|
|
584
714
|
*/
|
|
585
715
|
const exportListReportPage = (exportParameters, ui5Version, templateType) => {
|
|
586
716
|
const factory = new factory_1.MetadataInstanceFactoryV4();
|
|
587
|
-
const listReport = factory.createPageInstance(
|
|
588
|
-
return exportListPage(exportParameters, factory, listReport,
|
|
717
|
+
const listReport = factory.createPageInstance(v4_1.PageType.ListReport, exportParameters.page.config);
|
|
718
|
+
return exportListPage(exportParameters, factory, listReport, v4_1.PageTypeV4.ListReport, ui5Version, templateType);
|
|
589
719
|
};
|
|
590
720
|
/**
|
|
591
721
|
* Run through the given Analytical List Page config and return respective exportResultManifest entry and flex changes
|
|
@@ -628,9 +758,9 @@ const exportApplicationV4 = (application, manifest, jsonSchema) => {
|
|
|
628
758
|
}
|
|
629
759
|
}
|
|
630
760
|
//transform routing
|
|
631
|
-
exportResults.manifest[
|
|
761
|
+
exportResults.manifest[v4_1.ManifestSection.ui5].routing = manifest_1.transformRoutingV4(application['home'], application['pages'], exportResults.manifest);
|
|
632
762
|
// Update FCL data
|
|
633
|
-
flexibleColumnLayout_1.updateFcl(exportResults.manifest[
|
|
763
|
+
flexibleColumnLayout_1.updateFcl(exportResults.manifest[v4_1.ManifestSection.ui5], application);
|
|
634
764
|
return exportResults;
|
|
635
765
|
};
|
|
636
766
|
/**
|
|
@@ -644,18 +774,18 @@ const exportApplicationV4 = (application, manifest, jsonSchema) => {
|
|
|
644
774
|
* @returns ExportResults = object comprising the updated manifest and a list of flex changes
|
|
645
775
|
*/
|
|
646
776
|
exports.exportPageV4 = (exportParametersV4, ui5Version) => {
|
|
647
|
-
if (exportParametersV4[
|
|
648
|
-
return exportListReportPage(exportParametersV4[
|
|
777
|
+
if (exportParametersV4[v4_1.SchemaType.ListReport]) {
|
|
778
|
+
return exportListReportPage(exportParametersV4[v4_1.SchemaType.ListReport], ui5Version, utils_1.TemplateType.ListReportObjectPageV4);
|
|
649
779
|
}
|
|
650
|
-
else if (exportParametersV4[
|
|
651
|
-
return exportObjectPage(exportParametersV4[
|
|
780
|
+
else if (exportParametersV4[v4_1.SchemaType.ObjectPage]) {
|
|
781
|
+
return exportObjectPage(exportParametersV4[v4_1.SchemaType.ObjectPage], ui5Version);
|
|
652
782
|
}
|
|
653
|
-
else if (exportParametersV4[
|
|
654
|
-
const { application, manifest, jsonSchema } = exportParametersV4[
|
|
783
|
+
else if (exportParametersV4[v4_1.SchemaType.Application]) {
|
|
784
|
+
const { application, manifest, jsonSchema } = exportParametersV4[v4_1.SchemaType.Application];
|
|
655
785
|
return exportApplicationV4(application, manifest, jsonSchema);
|
|
656
786
|
}
|
|
657
|
-
else if (exportParametersV4[
|
|
658
|
-
return exportAnalyticalListPage(exportParametersV4[
|
|
787
|
+
else if (exportParametersV4[v4_1.SchemaType.AnalyticalListPage]) {
|
|
788
|
+
return exportAnalyticalListPage(exportParametersV4[v4_1.SchemaType.AnalyticalListPage], ui5Version);
|
|
659
789
|
}
|
|
660
790
|
};
|
|
661
791
|
//# sourceMappingURL=export.js.map
|