@sap/ux-specification 1.90.21 → 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 +97 -1
- 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/ApplicationV2.json +11 -11
- package/dist/schemas/v4/ApplicationV4.json +9 -5
- package/dist/schemas/v4/ListReportConfig.json +629 -183
- package/dist/schemas/v4/ObjectPageConfig.json +36 -0
- package/dist/scripts/extractDocu.js.map +1 -1
- package/dist/scripts/runDocu.js +10 -40
- package/dist/scripts/runDocu.js.map +1 -1
- package/dist/scripts/spec.js.map +1 -1
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/specification/v4/index-min.js +1 -1
- package/dist/src/api.d.ts +2 -2
- package/dist/src/api.js +11 -11
- package/dist/src/api.js.map +1 -1
- package/dist/src/apiTypes.d.ts +16 -19
- package/dist/src/apiTypes.js +0 -2
- package/dist/src/apiTypes.js.map +1 -1
- package/dist/src/extensionLogger.d.ts +1 -1
- package/dist/src/project.d.ts +1 -1
- package/dist/src/project.js +11 -3
- package/dist/src/project.js.map +1 -1
- package/dist/src/specification/common/Application.d.ts +24 -4
- package/dist/src/specification/common/page.d.ts +1 -1
- package/dist/src/specification/common/webapp/manifest/Manifest.d.ts +6 -6
- package/dist/src/specification/common/webapp/manifest/sapUi5.d.ts +1 -1
- package/dist/src/specification/schemaAccess.d.ts +1 -1
- package/dist/src/specification/schemaAccess.js +1 -2
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/specification/v2/ApplicationV2.d.ts +3 -17
- package/dist/src/specification/v2/controls/Facets.d.ts +1 -1
- package/dist/src/specification/v2/controls/Footer.d.ts +2 -2
- package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +1 -1
- package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +1 -1
- package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +2 -2
- package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +2 -2
- package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +1 -1
- package/dist/src/specification/v2/controls/Table.d.ts +3 -3
- package/dist/src/specification/v2/controls/ToolBar.d.ts +1 -1
- package/dist/src/specification/v2/page.d.ts +1 -1
- package/dist/src/specification/v2/pages/AnalyticalListPageConfig.d.ts +4 -4
- package/dist/src/specification/v2/pages/ListReportConfig.d.ts +2 -2
- package/dist/src/specification/v2/pages/ObjectPageConfig.d.ts +3 -3
- package/dist/src/specification/v2/pages/OverviewPageConfig.d.ts +3 -3
- package/dist/src/specification/v2/webapp/manifest/sapUi5.d.ts +2 -2
- package/dist/src/specification/v2/webapp/manifest/sapUi5.js +0 -1
- package/dist/src/specification/v2/webapp/manifest/sapUi5.js.map +1 -1
- package/dist/src/specification/v2/webapp/manifest/sapUiPageV2.d.ts +2 -2
- package/dist/src/specification/v4/ApplicationV4.d.ts +4 -14
- package/dist/src/specification/v4/controls/ObjectPageHeader.d.ts +1 -1
- package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +24 -3
- package/dist/src/specification/v4/controls/ObjectPageSection.js.map +1 -1
- package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +3 -3
- package/dist/src/specification/v4/controls/ObjectPageToolBar.d.ts +1 -1
- package/dist/src/specification/v4/controls/Table.d.ts +170 -25
- package/dist/src/specification/v4/controls/Table.js +6 -0
- package/dist/src/specification/v4/controls/Table.js.map +1 -1
- package/dist/src/specification/v4/controls/ToolBar.d.ts +26 -1
- package/dist/src/specification/v4/page.d.ts +2 -2
- package/dist/src/specification/v4/pages/ListReportConfig.d.ts +22 -3
- package/dist/src/specification/v4/pages/ObjectPageConfig.d.ts +2 -2
- package/dist/src/specification/v4/pages/ObjectPageConfig.js.map +1 -1
- package/dist/src/specification/v4/pages/index.d.ts +0 -1
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +77 -0
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js.map +1 -1
- package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +12 -3
- package/dist/src/specification/v4/webapp/manifest/sapUi5.js.map +1 -1
- package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.d.ts +21 -1
- package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
- package/dist/src/sync/common/appProvider.d.ts +6 -5
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/decoration/control.d.ts +1 -1
- package/dist/src/sync/common/decoration/control.js +27 -22
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/decoration/decorators.d.ts +1 -1
- package/dist/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/src/sync/common/decoration/factory.d.ts +3 -3
- package/dist/src/sync/common/decoration/flex.d.ts +3 -3
- package/dist/src/sync/common/flexUtils.d.ts +4 -4
- package/dist/src/sync/common/flexUtils.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +9 -7
- package/dist/src/sync/common/generate/objectPage.js +69 -73
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +52 -19
- package/dist/src/sync/common/generate/utils.js +127 -70
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/import/utils.d.ts +4 -3
- package/dist/src/sync/common/import/utils.js +3 -2
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.d.ts +4 -4
- package/dist/src/sync/common/importProject.js +33 -41
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +110 -13
- package/dist/src/sync/common/types.js +107 -7
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +23 -15
- package/dist/src/sync/common/utils.js +138 -72
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/i18n.d.ts +1 -1
- package/dist/src/sync/v2/application.d.ts +2 -2
- package/dist/src/sync/v2/application.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts +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.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/Card.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/Field.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts +2 -1
- package/dist/src/sync/v2/export/controls/FormAction.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts +5 -11
- package/dist/src/sync/v2/export/controls/Fragment.js +110 -34
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageChart.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.d.ts +3 -3
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +2 -2
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +3 -3
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts +4 -2
- package/dist/src/sync/v2/export/controls/Table.js +89 -47
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts +2 -2
- package/dist/src/sync/v2/export/controls/ToolBar.d.ts +1 -1
- package/dist/src/sync/v2/export/export.d.ts +3 -4
- package/dist/src/sync/v2/export/export.js +222 -160
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.d.ts +2 -2
- package/dist/src/sync/v2/export/exportPage.js +4 -11
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/factory.d.ts +2 -1
- package/dist/src/sync/v2/export/factory.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts +23 -1
- package/dist/src/sync/v2/export/manifest.js +77 -35
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts +4 -4
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ListReport.d.ts +2 -2
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ObjectPage.d.ts +3 -3
- package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +3 -3
- package/dist/src/sync/v2/export/pages/OverviewPage.js +20 -15
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.d.ts +2 -2
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +27 -36
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/generate.d.ts +2 -2
- package/dist/src/sync/v2/generate/generate.js +3 -0
- package/dist/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +7 -4
- package/dist/src/sync/v2/generate/listReport.js +38 -36
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +102 -100
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/overviewPage.d.ts +1 -1
- package/dist/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +8 -7
- package/dist/src/sync/v2/generate/utils.js +73 -69
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.d.ts +13 -4
- 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.d.ts +3 -3
- 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.d.ts +6 -5
- package/dist/src/sync/v2/import/common/index.js +9 -22
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/controls/table.d.ts +1 -1
- package/dist/src/sync/v2/import/controls/table.js +1 -1
- package/dist/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts +2 -2
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +1 -9
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.d.ts +2 -2
- package/dist/src/sync/v2/import/pages/objectPage.d.ts +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +36 -44
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/overviewPage.d.ts +2 -2
- package/dist/src/sync/v2/import/pages/overviewPage.js +1 -1
- package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.d.ts +3 -2
- package/dist/src/sync/v2/import/utils.js +16 -2
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +7 -7
- package/dist/src/sync/v4/application.d.ts +28 -12
- package/dist/src/sync/v4/application.js +85 -15
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/controls/FilterBar.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +2 -1
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTable.d.ts +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/ObjectPageTableColumn.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/Table.d.ts +131 -10
- package/dist/src/sync/v4/export/controls/Table.js +477 -75
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v4/export/controls/TableColumn.d.ts +52 -1
- package/dist/src/sync/v4/export/controls/TableColumn.js +248 -2
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ToolBar.d.ts +1 -1
- package/dist/src/sync/v4/export/controls/ToolBarAction.d.ts +4 -1
- package/dist/src/sync/v4/export/controls/ToolBarAction.js +10 -0
- package/dist/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/src/sync/v4/export/export.d.ts +2 -2
- package/dist/src/sync/v4/export/export.js +465 -96
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/factory.d.ts +2 -1
- package/dist/src/sync/v4/export/factory.js.map +1 -1
- package/dist/src/sync/v4/export/flexibleColumnLayout.d.ts +1 -1
- package/dist/src/sync/v4/export/flexibleColumnLayout.js.map +1 -1
- package/dist/src/sync/v4/export/manifest.d.ts +1 -1
- package/dist/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/src/sync/v4/export/pages/ListReport.d.ts +9 -3
- package/dist/src/sync/v4/export/pages/ListReport.js +49 -0
- package/dist/src/sync/v4/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v4/export/pages/ObjectPage.d.ts +2 -2
- 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/pages/index.d.ts +0 -1
- package/dist/src/sync/v4/export/pages/index.js +0 -1
- package/dist/src/sync/v4/export/pages/index.js.map +1 -1
- package/dist/src/sync/v4/export/types.d.ts +8 -6
- package/dist/src/sync/v4/export/utils.d.ts +1 -1
- package/dist/src/sync/v4/generate/generate.d.ts +5 -4
- package/dist/src/sync/v4/generate/generate.js +6 -3
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/listReport.d.ts +2 -4
- package/dist/src/sync/v4/generate/listReport.js +450 -36
- 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.d.ts +6 -5
- package/dist/src/sync/v4/import/app/appProvider.js +78 -56
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/fragment.d.ts +2 -2
- package/dist/src/sync/v4/import/fragment.js.map +1 -1
- package/dist/src/sync/v4/import/index.d.ts +0 -1
- package/dist/src/sync/v4/import/index.js +0 -1
- package/dist/src/sync/v4/import/index.js.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.d.ts +8 -7
- package/dist/src/sync/v4/import/pages/listReport.js +120 -29
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +15 -2
- package/dist/src/sync/v4/import/pages/objectPage.js +69 -40
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.d.ts +4 -3
- package/dist/src/sync/v4/import/utils.js +2 -2
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/src/sync/v4/types.d.ts +4 -2
- 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 +18 -12
- package/dist/src/sync/v4/utils/utils.js +77 -30
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/test/test-data/flexChange/v2/stta.prod.man/index.d.ts +1 -1
- package/dist/test/test-projects/index.d.ts +1 -1
- package/dist/test/test-utils/utils.d.ts +5 -4
- package/dist/test/unit/export/manifest.test.d.ts +1 -0
- package/package.json +13 -10
- package/dist/documentation/v4/v4-AnalyticalListPage.html +0 -49
- package/dist/schemas/v4/AnalyticalListPageConfig.json +0 -392
- package/dist/src/specification/v4/pages/AnalyticalListPageConfig.d.ts +0 -13
- package/dist/src/specification/v4/pages/AnalyticalListPageConfig.js +0 -3
- package/dist/src/specification/v4/pages/AnalyticalListPageConfig.js.map +0 -1
- package/dist/src/sync/v4/export/pages/AnalyticalListPage.d.ts +0 -8
- package/dist/src/sync/v4/export/pages/AnalyticalListPage.js +0 -38
- package/dist/src/sync/v4/export/pages/AnalyticalListPage.js.map +0 -1
- package/dist/src/sync/v4/import/pages/analyticalListPage.d.ts +0 -11
- package/dist/src/sync/v4/import/pages/analyticalListPage.js +0 -60
- package/dist/src/sync/v4/import/pages/analyticalListPage.js.map +0 -1
|
@@ -56,82 +56,205 @@ function exportFlexChange(syncRule, transferParameters, ids, breadcrumbs, config
|
|
|
56
56
|
const flexChange = common_1.fillFlexChangeContent(configObject, syncRule, transferParameters.ui5Version, key, controlId);
|
|
57
57
|
transferParameters.exportResults.flexChanges.push(syncRule.flex.createFlexChange(flexChange, transferParameters.exportResults.manifest));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
if (ids
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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];
|
|
66
74
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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('@'));
|
|
70
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
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Determines the target annotation that is relevant for the sync rule
|
|
127
|
+
* @param {string[]} ids - list of ids of parent elements
|
|
128
|
+
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
129
|
+
* @param { [key: string]: any } configObject - the given config.json, to be exported
|
|
130
|
+
* @returns { targetAnnotationEncoded, targetAnnotation, custom }
|
|
131
|
+
*/
|
|
132
|
+
function determineTargetAnnotation(ids, transferParameters, configObject) {
|
|
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));
|
|
136
|
+
}
|
|
137
|
+
else if (ids[0] === v4_1.PropertyName.chart && transferParameters.templateType === utils_1.TemplateType.AnalyticalListPageV4) {
|
|
138
|
+
({ targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfChart(ids, transferParameters, targetAnnotationEncoded, targetAnnotation, configObject));
|
|
71
139
|
}
|
|
72
|
-
if (ids[
|
|
140
|
+
else if (ids[0] === v4_1.PropertyName.sections) {
|
|
141
|
+
({ custom, targetAnnotationEncoded, targetAnnotation } = determineTargetAnnotationOfSections(ids, custom, targetAnnotationEncoded, targetAnnotation));
|
|
142
|
+
}
|
|
143
|
+
else if (ids[1] === v4_1.PropertyName.sections) {
|
|
73
144
|
//header sections
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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, '/');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (ids[1] === v4_1.PropertyName.views) {
|
|
156
|
+
({ targetAnnotation, targetAnnotationEncoded } = determineTargetAnnotationOfViews(transferParameters, ids, targetAnnotation, targetAnnotationEncoded));
|
|
78
157
|
}
|
|
79
158
|
return { targetAnnotationEncoded, targetAnnotation, custom };
|
|
80
159
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Calculates an additional key for the sync rule from the given ID's
|
|
162
|
+
* @param {string[]} ids - list of ids of parent elements
|
|
163
|
+
* @returns the key for the sync rule
|
|
164
|
+
*/
|
|
165
|
+
function determineKeyForSyncRule(ids) {
|
|
166
|
+
let idIndex = 0;
|
|
167
|
+
for (let index = ids.length - 1; index > -1; index--) {
|
|
168
|
+
const element = ids[index];
|
|
169
|
+
if (element === 'columns' || element === v4_1.PropertyName.actions || element === 'views') {
|
|
170
|
+
idIndex = index + 1;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
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
|
+
}
|
|
89
187
|
}
|
|
90
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Transfers a property value from config to manifest
|
|
190
|
+
* @param {ExportToManifestParams} params - list of parameters
|
|
191
|
+
* @param propertyDefinition - schema definiton of a particular property
|
|
192
|
+
* @param nextDefinition - schema definition referred by $ref
|
|
193
|
+
*/
|
|
194
|
+
function transferPropertyToManifest(params, propertyDefinition, nextDefinition) {
|
|
195
|
+
var _a, _b;
|
|
91
196
|
if (!(propertyDefinition['type'] !== 'array' &&
|
|
92
|
-
nextDefinition &&
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (exportHandler !== false) {
|
|
97
|
-
if (exportHandler && typeof exportHandler === 'function') {
|
|
98
|
-
exportHandler(manifestSection, configObject, key, manifestKey);
|
|
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);
|
|
99
201
|
}
|
|
100
|
-
else if (Array.isArray(configObject[
|
|
101
|
-
|
|
202
|
+
else if (Array.isArray(params.configObject[params.configPropertyKey]) &&
|
|
203
|
+
!params.configObject[params.configPropertyKey].length) {
|
|
204
|
+
delete params.manifestSection[params.manifestKey];
|
|
102
205
|
}
|
|
103
206
|
else {
|
|
104
|
-
manifestSection[manifestKey] = configObject[
|
|
207
|
+
params.manifestSection[params.manifestKey] = params.configObject[params.configPropertyKey];
|
|
105
208
|
}
|
|
106
209
|
}
|
|
107
210
|
}
|
|
108
|
-
else if (propertyDefinition['type'] !== 'array' && manifestSection[manifestKey] === undefined) {
|
|
109
|
-
|
|
211
|
+
else if (propertyDefinition['type'] !== 'array' && params.manifestSection[params.manifestKey] === undefined) {
|
|
212
|
+
createNewObjectInManifest(params);
|
|
110
213
|
}
|
|
111
214
|
}
|
|
112
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Transfers a change in config.json to manifest
|
|
217
|
+
* @param ids - list of parent & child ids
|
|
218
|
+
* @param {SyncRule} syncRule - syncRule (metadata)
|
|
219
|
+
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
220
|
+
* @param {string} configPropertyKey - key of property in the config
|
|
221
|
+
* @param { [key: string]: any } configObject - the given config.json, to be exported
|
|
222
|
+
* @param propertyDefinition - schema definiton of a particular property
|
|
223
|
+
* @param nextDefinition - schema definition referred by $ref
|
|
224
|
+
*/
|
|
225
|
+
function exportManifestChange(ids, syncRule, transferParameters, configPropertyKey, configObject, propertyDefinition, nextDefinition) {
|
|
113
226
|
//eliminate subsections' hierarchy
|
|
114
227
|
let index = ids.indexOf('subsections');
|
|
115
228
|
while (index > -1) {
|
|
116
229
|
ids.splice(index - 1, 2);
|
|
117
230
|
index = ids.indexOf('subsections');
|
|
118
231
|
}
|
|
119
|
-
const { targetAnnotationEncoded, targetAnnotation, custom } = determineTargetAnnotation(ids, transferParameters
|
|
120
|
-
const
|
|
121
|
-
const path = syncRule.manifest.path(transferParameters.pageNameArray,
|
|
232
|
+
const { targetAnnotationEncoded, targetAnnotation, custom } = determineTargetAnnotation(ids, transferParameters, configObject);
|
|
233
|
+
const syncRuleKey = determineKeyForSyncRule(ids);
|
|
234
|
+
const path = syncRule.manifest.path(transferParameters.pageNameArray, transferParameters.exportResults.manifest, targetAnnotationEncoded, syncRuleKey, targetAnnotation);
|
|
122
235
|
const manifestSection = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path, targetAnnotation, custom ? undefined : targetAnnotationEncoded);
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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];
|
|
135
258
|
}
|
|
136
259
|
}
|
|
137
260
|
utils_1.deleteEmptyStructure(transferParameters.exportResults.manifest, path, targetAnnotation, targetAnnotationEncoded);
|
|
@@ -158,15 +281,23 @@ function evaluateExportRule(transferParameters, breadcrumbs, key, configObject,
|
|
|
158
281
|
}
|
|
159
282
|
}
|
|
160
283
|
}
|
|
161
|
-
|
|
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) {
|
|
162
293
|
let objects = [], isArray = false;
|
|
163
|
-
if (propertyDefinition.$ref && nextDefinition) {
|
|
294
|
+
if (parameters.propertyDefinition.$ref && nextDefinition) {
|
|
164
295
|
objects.push(nextDefinition.configObject);
|
|
165
296
|
}
|
|
166
|
-
else if (propertyDefinition['anyOf']) {
|
|
297
|
+
else if (parameters.propertyDefinition['anyOf']) {
|
|
167
298
|
objects.push(currentConfigObject);
|
|
168
299
|
}
|
|
169
|
-
else if (propertyDefinition.type === 'array') {
|
|
300
|
+
else if (parameters.propertyDefinition.type === 'array') {
|
|
170
301
|
objects = currentConfigObject;
|
|
171
302
|
isArray = true;
|
|
172
303
|
}
|
|
@@ -175,15 +306,231 @@ function transferSubObject(propertyDefinition, nextDefinition, currentConfigObje
|
|
|
175
306
|
}
|
|
176
307
|
for (const innerObject of objects) {
|
|
177
308
|
const additionalIds = [];
|
|
178
|
-
if (breadcrumbs[0] ===
|
|
309
|
+
if (parameters.breadcrumbs[0] === v4_1.PropertyName.sections && parameters.key === 'custom' && isArray) {
|
|
179
310
|
// We need add custom section 'id' into breadcrumbs to retrieve correct path to manifest
|
|
180
311
|
additionalIds.push(innerObject['id']);
|
|
181
312
|
}
|
|
182
|
-
transferParameters.title = nextDefinition.title;
|
|
313
|
+
parameters.transferParameters.title = nextDefinition.title;
|
|
183
314
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
184
|
-
transferManifestEntriesAndFlexChange(transferParameters, innerObject, [...ids, ...additionalIds], localIdParts, [...breadcrumbs, key], nextDefinition.targetDefinition);
|
|
315
|
+
transferManifestEntriesAndFlexChange(parameters.transferParameters, innerObject, [...ids, ...additionalIds], localIdParts, [...parameters.breadcrumbs, parameters.key], nextDefinition.targetDefinition);
|
|
185
316
|
}
|
|
186
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Creates an ALP 'views' entry in the resulting manifest if not yet existing yet.
|
|
320
|
+
* Adds the secondary = table view if missing.
|
|
321
|
+
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
322
|
+
* @param configObject - current object in config.json
|
|
323
|
+
* @returns
|
|
324
|
+
* - a boolean indicating that the views entry got created.
|
|
325
|
+
* - a boolean infcating if the processing of sub-objects shall be stopped
|
|
326
|
+
**/
|
|
327
|
+
function createALPTableView(transferParameters, configObject, key) {
|
|
328
|
+
let newElementCreated = false;
|
|
329
|
+
if (!configObject[key] || Object.keys(configObject[key]).length === 0 || !configObject.chart) {
|
|
330
|
+
return { newElementCreated, stopProcessing: true };
|
|
331
|
+
}
|
|
332
|
+
const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
|
|
333
|
+
const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
|
|
334
|
+
if (!views['paths'] || Object.keys(views['paths']).length === 0) {
|
|
335
|
+
views['paths'] = [
|
|
336
|
+
{
|
|
337
|
+
secondary: [
|
|
338
|
+
{
|
|
339
|
+
annotationPath: configObject[key].annotationPath
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
];
|
|
344
|
+
newElementCreated = true;
|
|
345
|
+
}
|
|
346
|
+
else if (!views['paths'][0].secondary) {
|
|
347
|
+
views['paths'][0].secondary = [
|
|
348
|
+
{
|
|
349
|
+
annotationPath: configObject[key].annotationPath
|
|
350
|
+
}
|
|
351
|
+
];
|
|
352
|
+
newElementCreated = true;
|
|
353
|
+
}
|
|
354
|
+
return { newElementCreated, stopProcessing: false };
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Creates an ALP 'views' entry in the resulting manifest if not yet existing yet
|
|
358
|
+
* Adds the primary = chart view if missing.
|
|
359
|
+
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
360
|
+
* @param configObject - current object in config.json
|
|
361
|
+
* @returns
|
|
362
|
+
* - a boolean indicating that the views entry got created.
|
|
363
|
+
* - a boolean infcating if the processing of sub-objects shall be stopped
|
|
364
|
+
*/
|
|
365
|
+
function createALPChartView(transferParameters, configObject, key) {
|
|
366
|
+
var _a;
|
|
367
|
+
let newElementCreated = false;
|
|
368
|
+
if (!configObject[key] || Object.keys(configObject[key]).length === 0) {
|
|
369
|
+
return { newElementCreated, stopProcessing: true };
|
|
370
|
+
}
|
|
371
|
+
const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
|
|
372
|
+
const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
|
|
373
|
+
if (!views['paths'] || Object.keys(views['paths']).length === 0) {
|
|
374
|
+
views['paths'] = [
|
|
375
|
+
{
|
|
376
|
+
primary: [
|
|
377
|
+
{
|
|
378
|
+
annotationPath: configObject[key].annotationPath
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
];
|
|
383
|
+
newElementCreated = true;
|
|
384
|
+
}
|
|
385
|
+
else if (!views['paths'][0].primary) {
|
|
386
|
+
views['paths'][0].primary = [
|
|
387
|
+
{
|
|
388
|
+
annotationPath: configObject[key].annotationPath
|
|
389
|
+
}
|
|
390
|
+
];
|
|
391
|
+
newElementCreated = true;
|
|
392
|
+
}
|
|
393
|
+
if (!views['paths'][0].secondary) {
|
|
394
|
+
views['paths'][0].secondary = [
|
|
395
|
+
{
|
|
396
|
+
annotationPath: ((_a = configObject === null || configObject === void 0 ? void 0 : configObject.table) === null || _a === void 0 ? void 0 : _a.annotationPath) || 'com.sap.vocabularies.UI.v1.LineItem'
|
|
397
|
+
}
|
|
398
|
+
];
|
|
399
|
+
}
|
|
400
|
+
return { newElementCreated, stopProcessing: false };
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Creates an LR 'views' entry in the resulting manifest if not yet existing yet.
|
|
404
|
+
* Adds the current table view if missing.
|
|
405
|
+
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
406
|
+
* @param configObject - current object in config.json
|
|
407
|
+
* @returns a boolean indicating that the views entry got created.
|
|
408
|
+
*/
|
|
409
|
+
function createLRTableView(index, transferParameters, key, configObject) {
|
|
410
|
+
if (!configObject || Object.keys(configObject).length === 0) {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
let newElementCreated = false;
|
|
414
|
+
const path = application_1.getSettingsPathForPage(transferParameters.pageNameArray) + `/views`;
|
|
415
|
+
const views = common_1.getManifestSectionByPathV4(transferParameters.exportResults.manifest, path);
|
|
416
|
+
const newEntry = {
|
|
417
|
+
key: key,
|
|
418
|
+
annotationPath: configObject.annotationPath
|
|
419
|
+
};
|
|
420
|
+
if (!views['paths'] || Object.keys(views['paths']).length === 0) {
|
|
421
|
+
//No views yet
|
|
422
|
+
views['paths'] = [newEntry];
|
|
423
|
+
newElementCreated = true;
|
|
424
|
+
}
|
|
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
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return newElementCreated;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Special logic to create new elements in manifest
|
|
443
|
+
* @param definitionName - schema definition name of the current object
|
|
444
|
+
* @param key - key of the current object
|
|
445
|
+
* @param configObject - current object in config.json
|
|
446
|
+
* @param breadcrumbs - array of sequence of properties that we are currently processing. Required for instance for table column name
|
|
447
|
+
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
448
|
+
* @returns newElementCreated - boolean value to indicate that a new element was created ==> no further sync rule on this level
|
|
449
|
+
*/
|
|
450
|
+
function createNewElement(index, definitionName, key, configObject, breadcrumbs, transferParameters, preprocessed = false) {
|
|
451
|
+
let newElementCreated = false;
|
|
452
|
+
const stopProcessing = false;
|
|
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
|
+
}
|
|
464
|
+
}
|
|
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);
|
|
490
|
+
}
|
|
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
|
+
});
|
|
531
|
+
}
|
|
532
|
+
return preprocessed;
|
|
533
|
+
}
|
|
187
534
|
/**
|
|
188
535
|
* Recursive function that traverses the content of the current object. It reads decorators and fills exportResultManifest entries and flex changes
|
|
189
536
|
* @param {TransferParameterTypeV4} transferParameters - list of parameters passed from API
|
|
@@ -195,22 +542,38 @@ function transferSubObject(propertyDefinition, nextDefinition, currentConfigObje
|
|
|
195
542
|
* @param title - the title to be used for the given schema definition
|
|
196
543
|
*/
|
|
197
544
|
function transferManifestEntriesAndFlexChange(transferParameters, configObject, parentIds, stableIdParts, breadcrumbs, schemaDefinition) {
|
|
198
|
-
|
|
199
|
-
if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition
|
|
545
|
+
var _a, _b;
|
|
546
|
+
if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition.properties)) {
|
|
200
547
|
return;
|
|
201
548
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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);
|
|
563
|
+
if (sortedList) {
|
|
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]);
|
|
213
566
|
}
|
|
567
|
+
index = 0;
|
|
568
|
+
sortedList.forEach((element) => {
|
|
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++;
|
|
575
|
+
}
|
|
576
|
+
});
|
|
214
577
|
}
|
|
215
578
|
}
|
|
216
579
|
/**
|
|
@@ -220,7 +583,8 @@ function transferManifestEntriesAndFlexChange(transferParameters, configObject,
|
|
|
220
583
|
function getClassesForSingleSection(objectPageConfig, sectionId, factory) {
|
|
221
584
|
if (sectionId === 'custom' && Array.isArray(objectPageConfig.sections[sectionId])) {
|
|
222
585
|
// Custom sections
|
|
223
|
-
const customSections = objectPageConfig.sections
|
|
586
|
+
const customSections = objectPageConfig.sections
|
|
587
|
+
.custom;
|
|
224
588
|
for (let index = 0; index < customSections.length; index++) {
|
|
225
589
|
customSections[index] = factory.createInstance(v4_1.PageType.ObjectPage, 'ObjectPageCustomSectionView', customSections[index], customSections[index].className);
|
|
226
590
|
}
|
|
@@ -269,7 +633,7 @@ const exportObjectPage = (exportParameters, ui5Version) => {
|
|
|
269
633
|
const pageLayoutInformation = common_1.getPageLayoutInformation(objectPage);
|
|
270
634
|
const pageName = exportParameters.page.name;
|
|
271
635
|
const baseId = `${exportParameters.appId}::${pageLayoutInformation.id}::${pageName}--`;
|
|
272
|
-
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]) {
|
|
273
637
|
getExportClassesForSections(exportParameters.page.config, objectPage, factory);
|
|
274
638
|
}
|
|
275
639
|
const transferParameters = {
|
|
@@ -278,11 +642,13 @@ const exportObjectPage = (exportParameters, ui5Version) => {
|
|
|
278
642
|
appRootPath: exportParameters.appRootPath,
|
|
279
643
|
baseId,
|
|
280
644
|
appSchema: exportParameters.jsonSchema,
|
|
645
|
+
config: objectPage,
|
|
281
646
|
ui5Version,
|
|
282
647
|
factory,
|
|
283
648
|
pageNameArray: [pageName],
|
|
284
649
|
pageType: v4_1.PageType.ObjectPage,
|
|
285
|
-
title: undefined
|
|
650
|
+
title: undefined,
|
|
651
|
+
templateType: utils_1.TemplateType.ListReportObjectPageV4
|
|
286
652
|
};
|
|
287
653
|
transferManifestEntriesAndFlexChange(transferParameters, objectPage, [], //no parentIds
|
|
288
654
|
[], // no stableIds
|
|
@@ -298,66 +664,69 @@ const exportObjectPage = (exportParameters, ui5Version) => {
|
|
|
298
664
|
* @param {PageTypeV4} - pageType - Page type
|
|
299
665
|
* @param ui5Version - SAP UI5 version
|
|
300
666
|
*/
|
|
301
|
-
const exportListPage = (exportParameters, factory, config, pageType, ui5Version) => {
|
|
302
|
-
var _a;
|
|
667
|
+
const exportListPage = (exportParameters, factory, config, pageType, ui5Version, templateType) => {
|
|
668
|
+
var _a, _b;
|
|
303
669
|
const exportResults = defaultExportResult;
|
|
304
670
|
exportResults.manifest = JSON.parse(JSON.stringify(exportParameters.manifest));
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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;
|
|
674
|
+
config.table = factory.createInstance(pageType, tableDefinition, config.table);
|
|
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) {
|
|
308
677
|
config.table.toolBar.actions[actionKey] = factory.createInstance(pageType, 'ToolBarAction', config.table.toolBar.actions[actionKey]);
|
|
309
678
|
}
|
|
310
679
|
}
|
|
311
680
|
const pageLayoutInformation = common_1.getPageLayoutInformation(config);
|
|
312
681
|
const pageName = exportParameters.page.name;
|
|
313
682
|
const baseId = `${exportParameters.appId}::${pageLayoutInformation.id}::${pageName}--`;
|
|
314
|
-
if (!exportResults.manifest[v4_1.ManifestSection.ui5]
|
|
683
|
+
if (!exportResults.manifest[v4_1.ManifestSection.ui5].routing.targets[pageName]) {
|
|
315
684
|
const newV4Page = getV4ManifestPageTemplate(pageLayoutInformation.pageId, pageName);
|
|
316
|
-
exportResults.manifest[v4_1.ManifestSection.ui5]
|
|
685
|
+
exportResults.manifest[v4_1.ManifestSection.ui5].routing.targets[pageName] = newV4Page;
|
|
317
686
|
}
|
|
318
687
|
const transferParameters = {
|
|
319
688
|
exportResults,
|
|
320
689
|
appId: exportParameters.appId,
|
|
321
690
|
appRootPath: exportParameters.appRootPath,
|
|
322
691
|
baseId,
|
|
323
|
-
appSchema
|
|
692
|
+
appSchema,
|
|
693
|
+
config,
|
|
324
694
|
ui5Version,
|
|
325
695
|
factory,
|
|
326
696
|
pageNameArray: [pageName],
|
|
327
697
|
pageType: v4_1.PageType.ListReport,
|
|
328
698
|
title: undefined,
|
|
329
|
-
logger: exportParameters.logger
|
|
699
|
+
logger: exportParameters.logger,
|
|
700
|
+
templateType
|
|
330
701
|
};
|
|
331
702
|
transferManifestEntriesAndFlexChange(transferParameters, config, [], //no parentIds
|
|
332
703
|
[], // no stableIds
|
|
333
704
|
[], // no breadcrumbs
|
|
334
|
-
|
|
705
|
+
appSchema //starting point for target definition
|
|
335
706
|
);
|
|
336
707
|
return exportResults;
|
|
337
708
|
};
|
|
338
709
|
/**
|
|
339
710
|
* Run through the given ListReport config and return respective exportResultManifest entry and flex changes
|
|
340
711
|
* @param {ExportListReportV4Parameters} exportParameters - all API parameters needed for the export
|
|
341
|
-
*
|
|
712
|
+
* @param ui5Version - SAP UI5 version
|
|
342
713
|
* @returns ExportResults - The export result comprises the enhanced manifest as well as a list of flex changes.
|
|
343
714
|
*/
|
|
344
|
-
const exportListReportPage = (exportParameters, ui5Version) => {
|
|
715
|
+
const exportListReportPage = (exportParameters, ui5Version, templateType) => {
|
|
345
716
|
const factory = new factory_1.MetadataInstanceFactoryV4();
|
|
346
717
|
const listReport = factory.createPageInstance(v4_1.PageType.ListReport, exportParameters.page.config);
|
|
347
|
-
return exportListPage(exportParameters, factory, listReport, v4_1.PageTypeV4.ListReport, ui5Version);
|
|
718
|
+
return exportListPage(exportParameters, factory, listReport, v4_1.PageTypeV4.ListReport, ui5Version, templateType);
|
|
348
719
|
};
|
|
349
720
|
/**
|
|
350
721
|
* Run through the given Analytical List Page config and return respective exportResultManifest entry and flex changes
|
|
351
|
-
* @param
|
|
352
|
-
* @param
|
|
353
|
-
* @
|
|
722
|
+
* @param {ExportAnalyticalListPageV4Parameters} exportParameters - all API parameters needed for the export
|
|
723
|
+
* @param ui5Version - SAP UI5 version
|
|
724
|
+
* @returns ExportResults - The export result comprises the enhanced manifest as well as a list of flex changes.
|
|
354
725
|
*
|
|
355
726
|
* @returns ExportResults - The export result comprises the enhanced manifest as well as a list of flex changes.
|
|
356
727
|
*/
|
|
357
728
|
const exportAnalyticalListPage = (exportParameters, ui5Version) => {
|
|
358
|
-
|
|
359
|
-
const analyticalListPage = factory.createPageInstance(v4_1.PageType.AnalyticalListPage, exportParameters.page.config);
|
|
360
|
-
return exportListPage(exportParameters, factory, analyticalListPage, v4_1.PageTypeV4.AnalyticalListPage, ui5Version);
|
|
729
|
+
return exportListReportPage(exportParameters, ui5Version, utils_1.TemplateType.AnalyticalListPageV4);
|
|
361
730
|
};
|
|
362
731
|
/**
|
|
363
732
|
* API for the export of a V4 app configuration
|
|
@@ -379,7 +748,7 @@ const exportApplicationV4 = (application, manifest, jsonSchema) => {
|
|
|
379
748
|
if (syncRule && syncRule.manifest) {
|
|
380
749
|
const path = syncRule.manifest.path();
|
|
381
750
|
const manifestSection = common_1.getManifestSectionByPathV4(exportResults.manifest, path);
|
|
382
|
-
if (application['settings'] && application['settings'][key]) {
|
|
751
|
+
if (application['settings'] && application['settings'][key] !== undefined) {
|
|
383
752
|
manifestSection[key] = application['settings'][key];
|
|
384
753
|
}
|
|
385
754
|
else {
|
|
@@ -406,7 +775,7 @@ const exportApplicationV4 = (application, manifest, jsonSchema) => {
|
|
|
406
775
|
*/
|
|
407
776
|
exports.exportPageV4 = (exportParametersV4, ui5Version) => {
|
|
408
777
|
if (exportParametersV4[v4_1.SchemaType.ListReport]) {
|
|
409
|
-
return exportListReportPage(exportParametersV4[v4_1.SchemaType.ListReport], ui5Version);
|
|
778
|
+
return exportListReportPage(exportParametersV4[v4_1.SchemaType.ListReport], ui5Version, utils_1.TemplateType.ListReportObjectPageV4);
|
|
410
779
|
}
|
|
411
780
|
else if (exportParametersV4[v4_1.SchemaType.ObjectPage]) {
|
|
412
781
|
return exportObjectPage(exportParametersV4[v4_1.SchemaType.ObjectPage], ui5Version);
|