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