@sap/ux-specification 1.96.72 → 1.96.74
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 +65 -0
- package/dist/documentation/runDocu-min.js.map +3 -3
- package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
- package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
- package/dist/documentation/v2/v2-ListReport.html +2 -2
- package/dist/documentation/v2/v2-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
- package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
- package/dist/documentation/v4/v4-FreestylePage.html +2 -2
- package/dist/documentation/v4/v4-ListReport.html +2 -2
- package/dist/documentation/v4/v4-ObjectPage.html +2 -2
- package/dist/index-min.js +111 -111
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v4/ApplicationV4.json +13 -0
- package/dist/specification/package.json +9 -9
- package/dist/specification/scripts/documentation/components/filter.js +1 -3
- package/dist/specification/scripts/documentation/components/filter.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/TreeUI.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/TreeUI.js +2 -1
- package/dist/specification/scripts/documentation/components/ui/TreeUI.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/keyboardNavigation.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/keyboardNavigation.js +4 -4
- package/dist/specification/scripts/documentation/components/ui/keyboardNavigation.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/search.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/search.js +8 -6
- package/dist/specification/scripts/documentation/components/ui/search.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/toggle.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/toggle.js +10 -8
- package/dist/specification/scripts/documentation/components/ui/toggle.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/tooltip.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/tooltip.js +17 -13
- package/dist/specification/scripts/documentation/components/ui/tooltip.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/utils.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/utils.js +14 -11
- package/dist/specification/scripts/documentation/components/ui/utils.js.map +1 -1
- package/dist/specification/scripts/extractDocu.js +64 -24
- package/dist/specification/scripts/extractDocu.js.map +1 -1
- package/dist/specification/scripts/macros/api.d.ts.map +1 -1
- package/dist/specification/scripts/macros/api.js +7 -7
- package/dist/specification/scripts/macros/api.js.map +1 -1
- package/dist/specification/scripts/macros/cmd.js +4 -4
- package/dist/specification/scripts/macros/cmd.js.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +2 -2
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/scripts/macros/i18n.js +1 -2
- package/dist/specification/scripts/macros/i18n.js.map +1 -1
- package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
- package/dist/specification/scripts/macros/schema.js +1 -2
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/scripts/to-json-schema.d.ts.map +1 -1
- package/dist/specification/scripts/to-json-schema.js +4 -4
- package/dist/specification/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/src/api.js +14 -14
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/extensionLogger.js +3 -3
- package/dist/specification/src/i18n/i18n.js +1 -2
- package/dist/specification/src/i18n/i18n.js.map +1 -1
- package/dist/specification/src/project.d.ts.map +1 -1
- package/dist/specification/src/specification/schemaAccess.d.ts.map +1 -1
- package/dist/specification/src/sync/common/appProvider.d.ts.map +1 -1
- package/dist/specification/src/sync/common/appProvider.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/control.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/control.js +5 -5
- package/dist/specification/src/sync/common/decoration/control.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +3 -3
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/flex.js +1 -2
- package/dist/specification/src/sync/common/decoration/flex.js.map +1 -1
- package/dist/specification/src/sync/common/flexUtils.js +4 -5
- package/dist/specification/src/sync/common/flexUtils.js.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +8 -11
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.d.ts +1 -2
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +41 -42
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/import/utils.js +7 -8
- package/dist/specification/src/sync/common/import/utils.js.map +1 -1
- package/dist/specification/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/specification/src/sync/common/importProject.js +7 -9
- package/dist/specification/src/sync/common/importProject.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +2 -3
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +152 -149
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/i18n.js +1 -2
- package/dist/specification/src/sync/i18n.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Action.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/Action.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Action.js +4 -8
- package/dist/specification/src/sync/v2/export/controls/Action.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/AnalyticalListPageChart.js +4 -9
- package/dist/specification/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Card.js +3 -3
- package/dist/specification/src/sync/v2/export/controls/Card.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Field.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Field.js +1 -2
- package/dist/specification/src/sync/v2/export/controls/Field.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/FilterBar.d.ts +1 -1
- package/dist/specification/src/sync/v2/export/controls/FilterBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/FilterBar.js +5 -6
- package/dist/specification/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/FormAction.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/FormAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/FormAction.js +1 -2
- package/dist/specification/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.js +4 -4
- package/dist/specification/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageFooterAction.js +1 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeader.d.ts +0 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeader.js +1 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderAction.js +1 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderSection.js +7 -8
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderSection.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageLayout.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageLayout.js +4 -8
- package/dist/specification/src/sync/v2/export/controls/ObjectPageLayout.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageSection.js +11 -22
- package/dist/specification/src/sync/v2/export/controls/ObjectPageSection.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.js +7 -14
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageToolBarAction.js +1 -2
- package/dist/specification/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Table.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Table.js +12 -19
- package/dist/specification/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/TableColumn.d.ts +0 -2
- package/dist/specification/src/sync/v2/export/controls/TableColumn.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/TableColumn.js +4 -8
- package/dist/specification/src/sync/v2/export/controls/TableColumn.js.map +1 -1
- package/dist/specification/src/sync/v2/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/export.js +6 -11
- package/dist/specification/src/sync/v2/export/export.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.js +6 -7
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/factory.js +8 -8
- package/dist/specification/src/sync/v2/export/manifest.js +2 -3
- package/dist/specification/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/AnalyticalListPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/AnalyticalListPage.js +1 -2
- package/dist/specification/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/ListReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/ListReport.js +1 -2
- package/dist/specification/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/OverviewPage.js +4 -4
- package/dist/specification/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +2 -3
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/generate.js +4 -5
- package/dist/specification/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.js +2 -3
- package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.js +5 -6
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.js +3 -4
- package/dist/specification/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.js +18 -21
- package/dist/specification/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.js +2 -3
- package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/specification/src/sync/v2/import/app/ovpProvider.js.map +1 -1
- package/dist/specification/src/sync/v2/import/common/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/common/index.js +10 -9
- package/dist/specification/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/specification/src/sync/v2/import/controls/table.js +1 -2
- package/dist/specification/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js +1 -2
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.js +1 -2
- package/dist/specification/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.js +8 -10
- package/dist/specification/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/overviewPage.js +1 -2
- package/dist/specification/src/sync/v2/import/pages/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/utils.js +8 -9
- package/dist/specification/src/sync/v2/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +1 -0
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +7 -0
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFooter.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFooter.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +9 -9
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/export.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/export.js +9 -10
- package/dist/specification/src/sync/v4/export/export.js.map +1 -1
- package/dist/specification/src/sync/v4/export/exportCustomColumn.js +1 -2
- package/dist/specification/src/sync/v4/export/exportCustomColumn.js.map +1 -1
- package/dist/specification/src/sync/v4/export/factory.js +6 -6
- package/dist/specification/src/sync/v4/export/flexibleColumnLayout.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/manifest.js +2 -2
- package/dist/specification/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/specification/src/sync/v4/export/utils.js +2 -3
- package/dist/specification/src/sync/v4/export/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js +1 -2
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +2 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/pageExtensions.js +1 -2
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/pageExtensions.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +2 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/freestylePage.js +1 -2
- package/dist/specification/src/sync/v4/generate/freestylePage.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/generate.js +4 -5
- package/dist/specification/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/listReport.js +3 -4
- package/dist/specification/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +6 -2
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/app/appProvider.js +5 -5
- package/dist/specification/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/specification/src/sync/v4/import/fragment.js +4 -5
- package/dist/specification/src/sync/v4/import/fragment.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js +3 -4
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.js +2 -3
- package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.js +6 -7
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/utils.js +1 -2
- package/dist/specification/src/sync/v4/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js +3 -3
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/macros.js +4 -5
- package/dist/specification/src/sync/v4/utils/macros.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts +7 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +54 -21
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/types/src/apiTypes.d.ts +1 -1
- package/dist/types/src/apiTypes.js +2 -2
- package/dist/types/src/common/page.d.ts +1 -1
- package/dist/types/src/common/page.d.ts.map +1 -1
- package/dist/types/src/common/page.js.map +1 -1
- package/dist/types/src/common/types.d.ts +3 -5
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +4 -4
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/common/webapp/manifest/Manifest.d.ts +2 -1
- package/dist/types/src/common/webapp/manifest/Manifest.d.ts.map +1 -1
- package/dist/types/src/common/webapp/manifest/Manifest.js +1 -0
- package/dist/types/src/common/webapp/manifest/Manifest.js.map +1 -1
- package/dist/types/src/v2/controls/Action.d.ts +0 -2
- package/dist/types/src/v2/controls/Action.d.ts.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageHeader.d.ts +0 -1
- package/dist/types/src/v2/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts +0 -2
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v2/controls/Table.d.ts +0 -3
- package/dist/types/src/v2/controls/Table.d.ts.map +1 -1
- package/dist/types/src/v4/application.d.ts +12 -0
- package/dist/types/src/v4/application.d.ts.map +1 -1
- package/dist/types/src/v4/application.js +10 -0
- package/dist/types/src/v4/application.js.map +1 -1
- package/package.json +9 -9
|
@@ -3,10 +3,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
6
|
+
exports.arrayCombineMerge = exports.getSchemaFilePath = exports.deleteEmptyStructure = exports.setManifestSectionByPathV4 = exports.getManifestSectionByPathV4 = exports.prepareValueForPath = exports.getAnnotationPropertyValue = exports.createAnnotationPath = exports.arrayIncludes = exports.V4_LIBS = exports.V4_TEMPLATES = exports.DEFINITION_LINK_PREFIX = void 0;
|
|
7
|
+
exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
|
|
8
|
+
exports.evaluateCommonLabel = evaluateCommonLabel;
|
|
9
|
+
exports.getLabelForPropertyPath = getLabelForPropertyPath;
|
|
10
|
+
exports.getLabelForDataField = getLabelForDataField;
|
|
11
|
+
exports.getDataFieldDescription = getDataFieldDescription;
|
|
12
|
+
exports.prepareRef = prepareRef;
|
|
13
|
+
exports.getPageTypeV2 = getPageTypeV2;
|
|
14
|
+
exports.getPageTypeV4 = getPageTypeV4;
|
|
15
|
+
exports.findAlias = findAlias;
|
|
16
|
+
exports.getAnnotationFromMetaPath = getAnnotationFromMetaPath;
|
|
17
|
+
exports.getSectionFacet = getSectionFacet;
|
|
18
|
+
exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
|
|
19
|
+
exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQualifiedName;
|
|
20
|
+
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
21
|
+
exports.getObjectPageFacets = getObjectPageFacets;
|
|
22
|
+
exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
23
|
+
exports.getMainService = getMainService;
|
|
24
|
+
exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
25
|
+
exports.determineV2Template = determineV2Template;
|
|
26
|
+
exports.determineV4PageTemplateType = determineV4PageTemplateType;
|
|
27
|
+
exports.determineV4Template = determineV4Template;
|
|
28
|
+
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
29
|
+
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
30
|
+
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
31
|
+
exports.createDefaultSection = createDefaultSection;
|
|
32
|
+
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
33
|
+
exports.generatePageId = generatePageId;
|
|
34
|
+
exports.findMatchingKeysByAdditionalProperties = findMatchingKeysByAdditionalProperties;
|
|
35
|
+
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
36
|
+
exports.convertEnumToCSV = convertEnumToCSV;
|
|
37
|
+
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
38
|
+
exports.getDefinitionKey = getDefinitionKey;
|
|
39
|
+
exports.getDefinitionsRef = getDefinitionsRef;
|
|
40
|
+
exports.getErrorMessage = getErrorMessage;
|
|
41
|
+
exports.isFeatureSupported = isFeatureSupported;
|
|
42
|
+
exports.updatePropertyIndices = updatePropertyIndices;
|
|
43
|
+
exports.getJSONPropertyByPath = getJSONPropertyByPath;
|
|
44
|
+
exports.removeNamespaces = removeNamespaces;
|
|
45
|
+
exports.replaceNamespaces = replaceNamespaces;
|
|
8
46
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
9
|
-
const ux_specification_types_2 = require("@sap/ux-specification-types");
|
|
10
47
|
const i18next_1 = __importDefault(require("i18next"));
|
|
11
48
|
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
12
49
|
const annotation_converter_1 = require("@sap-ux/annotation-converter");
|
|
@@ -14,10 +51,10 @@ const edmx_parser_1 = require("@sap-ux/edmx-parser");
|
|
|
14
51
|
const extensionLogger_1 = require("../../extensionLogger");
|
|
15
52
|
exports.DEFINITION_LINK_PREFIX = '#/definitions/';
|
|
16
53
|
exports.V4_TEMPLATES = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
54
|
+
ux_specification_types_1.v4.FE_TEMPLATE_V4_LIST_REPORT,
|
|
55
|
+
ux_specification_types_1.v4.FE_TEMPLATE_V4_ALP,
|
|
56
|
+
ux_specification_types_1.v4.FE_TEMPLATE_V4_OBJECT_PAGE,
|
|
57
|
+
ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE
|
|
21
58
|
];
|
|
22
59
|
exports.V4_LIBS = ['sap.fe.core', 'sap.fe.templates'];
|
|
23
60
|
const arrayIncludes = (arr, target) => target.every((v) => arr.includes(v));
|
|
@@ -69,7 +106,6 @@ function parseAndMergeAndConvert(annotationFiles, logger) {
|
|
|
69
106
|
}
|
|
70
107
|
return converterOutput;
|
|
71
108
|
}
|
|
72
|
-
exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
|
|
73
109
|
const getAnnotationPropertyValue = (annotationProperty) => annotationProperty?.value || annotationProperty?.path;
|
|
74
110
|
exports.getAnnotationPropertyValue = getAnnotationPropertyValue;
|
|
75
111
|
/**
|
|
@@ -98,7 +134,6 @@ function evaluateCommonLabel(annotations, entityType, label) {
|
|
|
98
134
|
}
|
|
99
135
|
return label;
|
|
100
136
|
}
|
|
101
|
-
exports.evaluateCommonLabel = evaluateCommonLabel;
|
|
102
137
|
/**
|
|
103
138
|
* Determines the label for a property path
|
|
104
139
|
* @param {PropertyPath} propertyPath - property path
|
|
@@ -112,7 +147,6 @@ function getLabelForPropertyPath(propertyPath, entityType) {
|
|
|
112
147
|
}
|
|
113
148
|
return label;
|
|
114
149
|
}
|
|
115
|
-
exports.getLabelForPropertyPath = getLabelForPropertyPath;
|
|
116
150
|
/**
|
|
117
151
|
* Determines the label for a LineItem record
|
|
118
152
|
* @param {DataFieldAbstractType} field - Line item record
|
|
@@ -145,7 +179,6 @@ function getLabelForDataField(field, entityType) {
|
|
|
145
179
|
}
|
|
146
180
|
return label;
|
|
147
181
|
}
|
|
148
|
-
exports.getLabelForDataField = getLabelForDataField;
|
|
149
182
|
/**
|
|
150
183
|
* Function to resolve the dataField label
|
|
151
184
|
* @param dataFieldLabel - Given dataField label; might be of type string, or an object in case of a path reference
|
|
@@ -235,49 +268,46 @@ function getDataFieldDescription(dataFieldAbstract, entityType) {
|
|
|
235
268
|
}
|
|
236
269
|
return title;
|
|
237
270
|
}
|
|
238
|
-
catch
|
|
271
|
+
catch {
|
|
239
272
|
return title;
|
|
240
273
|
}
|
|
241
274
|
}
|
|
242
|
-
exports.getDataFieldDescription = getDataFieldDescription;
|
|
243
275
|
/**
|
|
244
276
|
* Prepare string for reference use in schema
|
|
245
277
|
* @param refInput string to be character checked and replaced
|
|
246
278
|
* @returns string with replaced characters
|
|
247
279
|
*/
|
|
280
|
+
//@typescript-eslint/no-wrapper-object-types turned off tor prevent conversion String > string; String is used by AVT
|
|
248
281
|
function prepareRef(refInput) {
|
|
249
282
|
return refInput.replace('#', '::').replace(/\//g, ':2f');
|
|
250
283
|
}
|
|
251
|
-
exports.prepareRef = prepareRef;
|
|
252
284
|
/**
|
|
253
285
|
* Return the page type for a given V2 page in manifest
|
|
254
286
|
* @param name - page component name
|
|
255
287
|
*/
|
|
256
288
|
function getPageTypeV2(name) {
|
|
257
289
|
if (name) {
|
|
258
|
-
const templatePart = `${
|
|
290
|
+
const templatePart = `${ux_specification_types_1.v2.FE_TEMPLATE_V2}.`;
|
|
259
291
|
return name.split(templatePart)[1];
|
|
260
292
|
}
|
|
261
293
|
}
|
|
262
|
-
exports.getPageTypeV2 = getPageTypeV2;
|
|
263
294
|
/**
|
|
264
295
|
* Return the page type for a given V4 page in manifest
|
|
265
296
|
* @param name - page component name
|
|
266
297
|
*/
|
|
267
298
|
function getPageTypeV4(v4App) {
|
|
268
|
-
if (v4App.name && v4App.name !==
|
|
269
|
-
const templatePart = `${
|
|
299
|
+
if (v4App.name && v4App.name !== ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE) {
|
|
300
|
+
const templatePart = `${ux_specification_types_1.v4.FE_TEMPLATE_V4}.`;
|
|
270
301
|
return v4App.name.split(templatePart)[1];
|
|
271
302
|
}
|
|
272
|
-
else if (v4App?.name ===
|
|
273
|
-
return
|
|
303
|
+
else if (v4App?.name === ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE) {
|
|
304
|
+
return ux_specification_types_1.PageTypeV4.FPMCustomPage;
|
|
274
305
|
}
|
|
275
306
|
else if (v4App.viewId ||
|
|
276
307
|
v4App.viewName) {
|
|
277
|
-
return
|
|
308
|
+
return ux_specification_types_1.PageTypeV4.CustomPage;
|
|
278
309
|
}
|
|
279
310
|
}
|
|
280
|
-
exports.getPageTypeV4 = getPageTypeV4;
|
|
281
311
|
function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = false) {
|
|
282
312
|
const termWithQualifier = `${targetAnnotation.term}#${targetAnnotation.qualifier}`;
|
|
283
313
|
return `${!keyForRelatedFacetKeys ? '@' : ''}${targetAnnotation.qualifier ? termWithQualifier : targetAnnotation.term}`;
|
|
@@ -308,7 +338,6 @@ function findAlias(namespace, oDataServiceAVT) {
|
|
|
308
338
|
}
|
|
309
339
|
return aliasReference?.alias;
|
|
310
340
|
}
|
|
311
|
-
exports.findAlias = findAlias;
|
|
312
341
|
/**
|
|
313
342
|
* Method returns annotation from passed meta path.
|
|
314
343
|
* @param metaPath - annotation meta path
|
|
@@ -317,7 +346,6 @@ exports.findAlias = findAlias;
|
|
|
317
346
|
function getAnnotationFromMetaPath(metaPath) {
|
|
318
347
|
return metaPath.substring(metaPath.lastIndexOf('.') + 1, metaPath.length);
|
|
319
348
|
}
|
|
320
|
-
exports.getAnnotationFromMetaPath = getAnnotationFromMetaPath;
|
|
321
349
|
/**
|
|
322
350
|
* Determines the target annotation
|
|
323
351
|
* @param navigationParts - parts of the target annotation path
|
|
@@ -345,11 +373,11 @@ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
|
|
|
345
373
|
key = pathParts.join('::');
|
|
346
374
|
}
|
|
347
375
|
else {
|
|
348
|
-
key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}${
|
|
376
|
+
key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}${ux_specification_types_1.UIVOCABULARY}`);
|
|
349
377
|
}
|
|
350
378
|
return key;
|
|
351
379
|
}
|
|
352
|
-
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion =
|
|
380
|
+
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
353
381
|
let stopProcessing = false;
|
|
354
382
|
let namespace;
|
|
355
383
|
const navigationParts = propertyValue.split('/');
|
|
@@ -360,7 +388,7 @@ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, p
|
|
|
360
388
|
key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
|
|
361
389
|
const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
|
|
362
390
|
if (targetAnnotation) {
|
|
363
|
-
const separator = oDataVersion ===
|
|
391
|
+
const separator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '#';
|
|
364
392
|
key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
|
|
365
393
|
namespace = targetAnnotation.fullyQualifiedName?.split('@')[0];
|
|
366
394
|
}
|
|
@@ -369,7 +397,7 @@ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, p
|
|
|
369
397
|
return { key, entityType, stopProcessing, namespace };
|
|
370
398
|
}
|
|
371
399
|
if (navigation) {
|
|
372
|
-
const navSeparator = oDataVersion ===
|
|
400
|
+
const navSeparator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '/';
|
|
373
401
|
navigationParts.pop();
|
|
374
402
|
const navigationIDs = [...navigationParts].join(navSeparator);
|
|
375
403
|
key = `${navigationIDs}${navSeparator}${key}`;
|
|
@@ -385,7 +413,7 @@ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, p
|
|
|
385
413
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
386
414
|
* @returns {FacetSection} - object comprising the relevant facet information
|
|
387
415
|
*/
|
|
388
|
-
function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion =
|
|
416
|
+
function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
389
417
|
//Take facet ID as fallback
|
|
390
418
|
const facetName = facetDefinition.fullyQualifiedName?.substring(facetDefinition.fullyQualifiedName?.lastIndexOf('@'));
|
|
391
419
|
let key = facetDefinition.ID ? facetDefinition.ID.toString() : facetName;
|
|
@@ -423,7 +451,6 @@ function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, log
|
|
|
423
451
|
return undefined;
|
|
424
452
|
}
|
|
425
453
|
}
|
|
426
|
-
exports.getSectionFacet = getSectionFacet;
|
|
427
454
|
/**
|
|
428
455
|
* Method prepares value as empty object or array based on passed path.
|
|
429
456
|
* For array path should end with '[]'.
|
|
@@ -528,7 +555,7 @@ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
|
528
555
|
schemaKey =
|
|
529
556
|
'DataFieldForAnnotation:::sTarget::' +
|
|
530
557
|
target
|
|
531
|
-
.replace('@UI', `@${
|
|
558
|
+
.replace('@UI', `@${ux_specification_types_1.UIVOCABULARY}`)
|
|
532
559
|
.replace('@Communication', '@com.sap.vocabularies.Communication.v1')
|
|
533
560
|
.replace('@Contact', '@com.sap.vocabularies.Contact.v1');
|
|
534
561
|
}
|
|
@@ -557,7 +584,6 @@ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
|
557
584
|
}
|
|
558
585
|
return schemaKey;
|
|
559
586
|
}
|
|
560
|
-
exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
|
|
561
587
|
/**
|
|
562
588
|
* Determines if type of given annotation term is of UIAnnotationTerm
|
|
563
589
|
* @param {string} path path in manifest
|
|
@@ -624,20 +650,20 @@ function getAnnotationTerm(path, alias, entityType) {
|
|
|
624
650
|
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
625
651
|
*/
|
|
626
652
|
function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT) {
|
|
627
|
-
const alias = findAlias(
|
|
653
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
628
654
|
let path = section ? section.key : '';
|
|
629
655
|
const targetEntityType = section.entityType;
|
|
630
656
|
const annotationTerm = getAnnotationTerm(path, alias, entityType);
|
|
631
657
|
switch (annotationTerm) {
|
|
632
658
|
case "com.sap.vocabularies.UI.v1.Chart" /* UIAnnotationTerms.Chart */: {
|
|
633
|
-
facets[path] = { base:
|
|
659
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Chart };
|
|
634
660
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
635
661
|
facets[path].entityType = targetEntityType;
|
|
636
662
|
facets[path].namespace = section.namespace;
|
|
637
663
|
break;
|
|
638
664
|
}
|
|
639
665
|
case "com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */: {
|
|
640
|
-
facets[path] = { base:
|
|
666
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Identification };
|
|
641
667
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
642
668
|
facets[path].entityType = targetEntityType;
|
|
643
669
|
facets[path].namespace = section.namespace;
|
|
@@ -649,21 +675,21 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
649
675
|
pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
650
676
|
path = pathParts.join('::');
|
|
651
677
|
}
|
|
652
|
-
facets[path] = { base:
|
|
678
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.LineItem };
|
|
653
679
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
654
680
|
facets[path].entityType = targetEntityType;
|
|
655
681
|
facets[path].namespace = section.namespace;
|
|
656
682
|
break;
|
|
657
683
|
}
|
|
658
684
|
case "com.sap.vocabularies.UI.v1.FieldGroup" /* UIAnnotationTerms.FieldGroup */: {
|
|
659
|
-
facets[path] = { base:
|
|
685
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Form };
|
|
660
686
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
661
687
|
facets[path].entityType = targetEntityType;
|
|
662
688
|
facets[path].namespace = section.namespace;
|
|
663
689
|
break;
|
|
664
690
|
}
|
|
665
691
|
case "com.sap.vocabularies.UI.v1.DataPoint" /* UIAnnotationTerms.DataPoint */: {
|
|
666
|
-
facets[path] = { base:
|
|
692
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.DataPoint };
|
|
667
693
|
facets[path].Label = annotationRecord?.Target?.$target['Title'];
|
|
668
694
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
669
695
|
facets[path].entityType = targetEntityType;
|
|
@@ -671,32 +697,32 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
671
697
|
break;
|
|
672
698
|
}
|
|
673
699
|
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* UIAnnotationTerms.PresentationVariant */: {
|
|
674
|
-
facets[path] = { base:
|
|
700
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.PresentationVariant };
|
|
675
701
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
676
702
|
facets[path].entityType = targetEntityType;
|
|
677
703
|
facets[path].namespace = section.namespace;
|
|
678
704
|
break;
|
|
679
705
|
}
|
|
680
706
|
case "com.sap.vocabularies.Communication.v1.Contact" /* CommunicationAnnotationTerms.Contact */: {
|
|
681
|
-
facets[path] = { base:
|
|
707
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Contact };
|
|
682
708
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
683
709
|
facets[path].entityType = targetEntityType;
|
|
684
710
|
facets[path].namespace = section.namespace;
|
|
685
711
|
break;
|
|
686
712
|
}
|
|
687
713
|
case "com.sap.vocabularies.Communication.v1.Address" /* CommunicationAnnotationTerms.Address */: {
|
|
688
|
-
facets[path] = { base:
|
|
714
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Address };
|
|
689
715
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
690
716
|
facets[path].entityType = targetEntityType;
|
|
691
717
|
facets[path].namespace = section.namespace;
|
|
692
718
|
break;
|
|
693
719
|
}
|
|
694
720
|
default: {
|
|
695
|
-
facets[path] = { base:
|
|
721
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Unknown };
|
|
696
722
|
}
|
|
697
723
|
}
|
|
698
724
|
if (facets[path]) {
|
|
699
|
-
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies',
|
|
725
|
+
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', ux_specification_types_1.VOCWITHSLASH)}`;
|
|
700
726
|
if (annotationRecord.Label) {
|
|
701
727
|
facets[path].Label = annotationRecord.Label;
|
|
702
728
|
}
|
|
@@ -718,7 +744,6 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
718
744
|
function getAnnotationPathUsingFullyQualifiedName(entityType, fullyQualifiedName) {
|
|
719
745
|
return `/${entityType.fullyQualifiedName}/${fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
|
|
720
746
|
}
|
|
721
|
-
exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQualifiedName;
|
|
722
747
|
/**
|
|
723
748
|
* Adds the information from facets to the config
|
|
724
749
|
* @param {AnnotationTerm} annotationRecord - the actual annotation record
|
|
@@ -729,7 +754,7 @@ exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQu
|
|
|
729
754
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
730
755
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
731
756
|
*/
|
|
732
|
-
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion =
|
|
757
|
+
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
733
758
|
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
734
759
|
if (section) {
|
|
735
760
|
switch (annotationRecord.$Type) {
|
|
@@ -740,14 +765,14 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
740
765
|
case "com.sap.vocabularies.UI.v1.CollectionFacet" /* UIAnnotationTypes.CollectionFacet */: {
|
|
741
766
|
const annotationPath = getAnnotationPathUsingFullyQualifiedName(entityType, annotationRecord.fullyQualifiedName);
|
|
742
767
|
const facet = (facets[section.key] = {
|
|
743
|
-
base:
|
|
768
|
+
base: ux_specification_types_1.FacetBase.CollectionFacet,
|
|
744
769
|
facets: {},
|
|
745
770
|
ID: section.ID,
|
|
746
771
|
annotationPath: annotationPath,
|
|
747
772
|
Label: section.label,
|
|
748
773
|
namespace: section.namespace
|
|
749
774
|
});
|
|
750
|
-
if (!facet.ID && oDataVersion ===
|
|
775
|
+
if (!facet.ID && oDataVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
751
776
|
(0, extensionLogger_1.log)(logger, {
|
|
752
777
|
severity: "error" /* LogSeverity.Error */,
|
|
753
778
|
message: i18next_1.default.t('NOID4SECTION', { facet: annotationRecord.fullyQualifiedName })
|
|
@@ -768,12 +793,12 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
768
793
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
769
794
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
770
795
|
*/
|
|
771
|
-
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
796
|
+
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
772
797
|
const facets = {};
|
|
773
798
|
if (!entityType || !entityType.annotations) {
|
|
774
799
|
return;
|
|
775
800
|
}
|
|
776
|
-
const alias = findAlias(
|
|
801
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
777
802
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.HeaderFacets;
|
|
778
803
|
if (facetAnnotation) {
|
|
779
804
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -785,7 +810,6 @@ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = u
|
|
|
785
810
|
}
|
|
786
811
|
return facets;
|
|
787
812
|
}
|
|
788
|
-
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
789
813
|
/**
|
|
790
814
|
* Retrieve facet configurations that can be used to generate ObjectPage schemas
|
|
791
815
|
* @param {QualifiedName} entityTypeName - the name of the actual entity type
|
|
@@ -793,12 +817,12 @@ exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
|
793
817
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
794
818
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
795
819
|
*/
|
|
796
|
-
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
820
|
+
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
797
821
|
const facets = {};
|
|
798
822
|
if (!entityType || !entityType.annotations) {
|
|
799
823
|
return;
|
|
800
824
|
}
|
|
801
|
-
const alias = findAlias(
|
|
825
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
802
826
|
const facetAnnotation = alias && entityType?.annotations[alias]?.Facets;
|
|
803
827
|
if (facetAnnotation) {
|
|
804
828
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -810,31 +834,29 @@ function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_spec
|
|
|
810
834
|
}
|
|
811
835
|
return facets;
|
|
812
836
|
}
|
|
813
|
-
exports.getObjectPageFacets = getObjectPageFacets;
|
|
814
837
|
/**
|
|
815
838
|
* Returns the version of Fiori elements (v2/v4) from a given manifest
|
|
816
839
|
* @param manifest - the manifest.json file
|
|
817
840
|
* @returns FioriElementsVersion
|
|
818
841
|
*/
|
|
819
842
|
function getFEVersionFromManifest(manifest) {
|
|
820
|
-
if ((manifest[
|
|
821
|
-
(manifest[
|
|
822
|
-
return
|
|
843
|
+
if ((manifest[ux_specification_types_1.ManifestSection.generic] && Object.keys(manifest[ux_specification_types_1.ManifestSection.generic]).length > 0) ||
|
|
844
|
+
(manifest[ux_specification_types_1.ManifestSection.ovp] && Object.keys(manifest[ux_specification_types_1.ManifestSection.ovp]).length > 0)) {
|
|
845
|
+
return ux_specification_types_1.FioriElementsVersion.v2;
|
|
823
846
|
}
|
|
824
847
|
else {
|
|
825
|
-
const targets = manifest[
|
|
826
|
-
const libs = manifest[
|
|
848
|
+
const targets = manifest[ux_specification_types_1.ManifestSection.ui5]?.routing?.targets;
|
|
849
|
+
const libs = manifest[ux_specification_types_1.ManifestSection.ui5]?.dependencies?.libs;
|
|
827
850
|
if ((targets &&
|
|
828
851
|
Object.keys(targets).find((targetKey) => exports.V4_TEMPLATES.indexOf(targets[targetKey].name) > -1)) ||
|
|
829
852
|
(libs && Object.keys(libs).find((lib) => exports.V4_LIBS.indexOf(lib) > -1))) {
|
|
830
|
-
return
|
|
853
|
+
return ux_specification_types_1.FioriElementsVersion.v4;
|
|
831
854
|
}
|
|
832
855
|
else {
|
|
833
856
|
return undefined;
|
|
834
857
|
}
|
|
835
858
|
}
|
|
836
859
|
}
|
|
837
|
-
exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
838
860
|
/**
|
|
839
861
|
* Get the main service name from the manifest.
|
|
840
862
|
* LROP: by definition the service name can be read from the UI5 model with "" as name.
|
|
@@ -844,14 +866,13 @@ exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
|
844
866
|
* @returns - main service name
|
|
845
867
|
*/
|
|
846
868
|
function getMainService(manifest) {
|
|
847
|
-
const model = typeof manifest?.[
|
|
848
|
-
? manifest[
|
|
869
|
+
const model = typeof manifest?.[ux_specification_types_1.ManifestSection.ovp]?.globalFilterModel === 'string'
|
|
870
|
+
? manifest[ux_specification_types_1.ManifestSection.ovp].globalFilterModel
|
|
849
871
|
: '';
|
|
850
|
-
return typeof manifest?.[
|
|
851
|
-
? manifest[
|
|
872
|
+
return typeof manifest?.[ux_specification_types_1.ManifestSection.ui5]?.models?.[model]?.dataSource === 'string'
|
|
873
|
+
? manifest[ux_specification_types_1.ManifestSection.ui5].models[model].dataSource
|
|
852
874
|
: undefined;
|
|
853
875
|
}
|
|
854
|
-
exports.getMainService = getMainService;
|
|
855
876
|
/**
|
|
856
877
|
* Returns the oData version of the service (if any) from a given manifest
|
|
857
878
|
* @param manifest - the manifest.json file
|
|
@@ -862,10 +883,9 @@ function getODataVersionFromManifest(manifest) {
|
|
|
862
883
|
if (!mainService) {
|
|
863
884
|
return ux_specification_types_1.OdataVersion.v2;
|
|
864
885
|
}
|
|
865
|
-
const dataSource = manifest[
|
|
886
|
+
const dataSource = manifest[ux_specification_types_1.ManifestSection.app].dataSources?.[mainService];
|
|
866
887
|
return dataSource?.settings?.odataVersion === '4.0' ? ux_specification_types_1.OdataVersion.v4 : ux_specification_types_1.OdataVersion.v2;
|
|
867
888
|
}
|
|
868
|
-
exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
869
889
|
/**
|
|
870
890
|
* Determines the template type of a V2 app
|
|
871
891
|
* @param manifest - the manifest.json file
|
|
@@ -874,27 +894,27 @@ exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
|
874
894
|
*/
|
|
875
895
|
function determineV2Template(manifest, logger) {
|
|
876
896
|
let templateType;
|
|
877
|
-
if (manifest[
|
|
878
|
-
const v2Pages = manifest[
|
|
897
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic]) {
|
|
898
|
+
const v2Pages = manifest[ux_specification_types_1.ManifestSection.generic].pages;
|
|
879
899
|
if (!v2Pages) {
|
|
880
900
|
(0, extensionLogger_1.log)(logger, {
|
|
881
901
|
severity: "error" /* LogSeverity.Error */,
|
|
882
902
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
883
903
|
location: {
|
|
884
|
-
path:
|
|
885
|
-
range: [
|
|
904
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
905
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
886
906
|
}
|
|
887
907
|
});
|
|
888
908
|
return;
|
|
889
909
|
}
|
|
890
910
|
for (const pageKey in v2Pages) {
|
|
891
911
|
const v2Page = v2Pages[pageKey];
|
|
892
|
-
if (getPageTypeV2(v2Page.component?.name) ===
|
|
893
|
-
templateType =
|
|
912
|
+
if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.AnalyticalListPage) {
|
|
913
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV2;
|
|
894
914
|
break;
|
|
895
915
|
}
|
|
896
|
-
else if (getPageTypeV2(v2Page.component?.name) ===
|
|
897
|
-
templateType =
|
|
916
|
+
else if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.ListReport) {
|
|
917
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV2;
|
|
898
918
|
break;
|
|
899
919
|
}
|
|
900
920
|
}
|
|
@@ -903,17 +923,16 @@ function determineV2Template(manifest, logger) {
|
|
|
903
923
|
if (!templateType) {
|
|
904
924
|
(0, extensionLogger_1.log)(logger, {
|
|
905
925
|
severity: "error" /* LogSeverity.Error */,
|
|
906
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
926
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.generic }),
|
|
907
927
|
location: {
|
|
908
|
-
path:
|
|
909
|
-
range: [
|
|
928
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
929
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
910
930
|
}
|
|
911
931
|
});
|
|
912
932
|
}
|
|
913
933
|
}
|
|
914
934
|
return templateType;
|
|
915
935
|
}
|
|
916
|
-
exports.determineV2Template = determineV2Template;
|
|
917
936
|
/**
|
|
918
937
|
* Determines the template type of a single page
|
|
919
938
|
* @param v4Page - single page from routing targets
|
|
@@ -922,28 +941,27 @@ exports.determineV2Template = determineV2Template;
|
|
|
922
941
|
function determineV4PageTemplateType(v4Page) {
|
|
923
942
|
let templateType;
|
|
924
943
|
const pageType = getPageTypeV4(v4Page);
|
|
925
|
-
if (pageType ===
|
|
926
|
-
templateType =
|
|
944
|
+
if (pageType === ux_specification_types_1.PageTypeV4.AnalyticalListPage) {
|
|
945
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV4;
|
|
927
946
|
}
|
|
928
|
-
else if (pageType ===
|
|
947
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ListReport) {
|
|
929
948
|
const viewPath = v4Page.options?.settings?.views?.paths?.[0];
|
|
930
|
-
if (viewPath && (viewPath[
|
|
931
|
-
templateType =
|
|
949
|
+
if (viewPath && (viewPath[ux_specification_types_1.ALPViewType.Primary] || viewPath[ux_specification_types_1.ALPViewType.Secondary])) {
|
|
950
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV4;
|
|
932
951
|
}
|
|
933
952
|
else {
|
|
934
|
-
templateType =
|
|
953
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
935
954
|
}
|
|
936
955
|
}
|
|
937
|
-
else if (pageType ===
|
|
938
|
-
templateType =
|
|
956
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ObjectPage) {
|
|
957
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
939
958
|
//fixed now for FEOP scenario, bit continue to check if LR/ALP exists
|
|
940
959
|
}
|
|
941
|
-
else if ([
|
|
942
|
-
templateType =
|
|
960
|
+
else if ([ux_specification_types_1.PageTypeV4.CustomPage, ux_specification_types_1.PageTypeV4.FPMCustomPage].includes(pageType)) {
|
|
961
|
+
templateType = ux_specification_types_1.TemplateType.FreestylePageV4;
|
|
943
962
|
}
|
|
944
963
|
return templateType;
|
|
945
964
|
}
|
|
946
|
-
exports.determineV4PageTemplateType = determineV4PageTemplateType;
|
|
947
965
|
/**
|
|
948
966
|
* Determines the template type, based on the given manifest routing target entries of the app
|
|
949
967
|
* @param v4Pages - pages from routing targets
|
|
@@ -967,35 +985,34 @@ function determineV4TemplateFromPages(v4Pages) {
|
|
|
967
985
|
* @returns {TemplateType} the template type
|
|
968
986
|
*/
|
|
969
987
|
function determineV4Template(manifest, logger) {
|
|
970
|
-
const v4Pages = manifest[
|
|
971
|
-
manifest[
|
|
988
|
+
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
989
|
+
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
972
990
|
// if there are no pages in routing targets, we use LROPV4 as default template type
|
|
973
991
|
if (!v4Pages || Object.keys(v4Pages).length === 0) {
|
|
974
992
|
(0, extensionLogger_1.log)(logger, {
|
|
975
993
|
severity: "info" /* LogSeverity.Info */,
|
|
976
994
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
977
995
|
location: {
|
|
978
|
-
path:
|
|
979
|
-
range: [
|
|
996
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
997
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
980
998
|
}
|
|
981
999
|
});
|
|
982
|
-
return
|
|
1000
|
+
return ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
983
1001
|
}
|
|
984
1002
|
// else try to determine template type from routing targets
|
|
985
1003
|
const templateType = determineV4TemplateFromPages(v4Pages);
|
|
986
1004
|
if (!templateType) {
|
|
987
1005
|
(0, extensionLogger_1.log)(logger, {
|
|
988
1006
|
severity: "error" /* LogSeverity.Error */,
|
|
989
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
1007
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.ui5 }),
|
|
990
1008
|
location: {
|
|
991
|
-
path:
|
|
992
|
-
range: [
|
|
1009
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
1010
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing', 'targets']
|
|
993
1011
|
}
|
|
994
1012
|
});
|
|
995
1013
|
}
|
|
996
1014
|
return templateType;
|
|
997
1015
|
}
|
|
998
|
-
exports.determineV4Template = determineV4Template;
|
|
999
1016
|
/**
|
|
1000
1017
|
* Determines the template type, based on the given manifest entries of the app
|
|
1001
1018
|
* @param manifest - the manifest.json file
|
|
@@ -1005,18 +1022,17 @@ exports.determineV4Template = determineV4Template;
|
|
|
1005
1022
|
*/
|
|
1006
1023
|
function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
|
|
1007
1024
|
let templateType;
|
|
1008
|
-
if (manifest[
|
|
1009
|
-
templateType =
|
|
1025
|
+
if (manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
1026
|
+
templateType = ux_specification_types_1.TemplateType.OverviewPageV2;
|
|
1010
1027
|
}
|
|
1011
|
-
else if (fioriElementsVersion ===
|
|
1028
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v2) {
|
|
1012
1029
|
templateType = determineV2Template(manifest, logger);
|
|
1013
1030
|
}
|
|
1014
|
-
else if (fioriElementsVersion ===
|
|
1031
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
1015
1032
|
templateType = determineV4Template(manifest, logger);
|
|
1016
1033
|
}
|
|
1017
1034
|
return templateType;
|
|
1018
1035
|
}
|
|
1019
|
-
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
1020
1036
|
/**
|
|
1021
1037
|
* Adds title and description to a section or header section in an app schema
|
|
1022
1038
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -1025,12 +1041,12 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
|
1025
1041
|
*/
|
|
1026
1042
|
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
1027
1043
|
if (facet?.ID) {
|
|
1028
|
-
section.title =
|
|
1029
|
-
section[
|
|
1044
|
+
section.title = ux_specification_types_1.FACETTITLEPREFIX + facet.ID;
|
|
1045
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facet.ID }];
|
|
1030
1046
|
}
|
|
1031
1047
|
else {
|
|
1032
1048
|
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
1033
|
-
section[
|
|
1049
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facetKey.replace(ux_specification_types_1.UIVOCABULARYALPHADOT, '') }];
|
|
1034
1050
|
}
|
|
1035
1051
|
// Description
|
|
1036
1052
|
if (facet?.Label) {
|
|
@@ -1043,7 +1059,6 @@ function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
|
1043
1059
|
section.description = facetKey.substring(facetKey.lastIndexOf('.') + 1);
|
|
1044
1060
|
}
|
|
1045
1061
|
}
|
|
1046
|
-
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
1047
1062
|
/**
|
|
1048
1063
|
* Adds target title or description to a section or header section in an app schema
|
|
1049
1064
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -1065,7 +1080,6 @@ function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
|
1065
1080
|
section.description = facet.target['Label'];
|
|
1066
1081
|
}
|
|
1067
1082
|
}
|
|
1068
|
-
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
1069
1083
|
/**
|
|
1070
1084
|
* Creates a default object for a new section or subsection, and adds the ID as title if present.
|
|
1071
1085
|
* @param facet Facet configuration, to be analyzed
|
|
@@ -1077,12 +1091,11 @@ function createDefaultSection(appSchema, facet, facetKey) {
|
|
|
1077
1091
|
properties: {},
|
|
1078
1092
|
additionalProperties: false
|
|
1079
1093
|
};
|
|
1080
|
-
section[
|
|
1081
|
-
section[
|
|
1094
|
+
section[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
1095
|
+
section[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
1082
1096
|
addTargetTitleAndSectionDescription(facet, section, facetKey);
|
|
1083
1097
|
return section;
|
|
1084
1098
|
}
|
|
1085
|
-
exports.createDefaultSection = createDefaultSection;
|
|
1086
1099
|
/**
|
|
1087
1100
|
* Retrieve page section data(so far id/key and label/description).
|
|
1088
1101
|
* @param {EntityType} entityType The actual entityType
|
|
@@ -1092,8 +1105,8 @@ exports.createDefaultSection = createDefaultSection;
|
|
|
1092
1105
|
* @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
|
|
1093
1106
|
* @returns {FacetSection[]} - Array of facets or sections
|
|
1094
1107
|
*/
|
|
1095
|
-
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion =
|
|
1096
|
-
const alias = findAlias(
|
|
1108
|
+
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
|
|
1109
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
1097
1110
|
let sections = [];
|
|
1098
1111
|
if (entityType) {
|
|
1099
1112
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.Facets;
|
|
@@ -1112,7 +1125,6 @@ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVer
|
|
|
1112
1125
|
return sections;
|
|
1113
1126
|
}
|
|
1114
1127
|
}
|
|
1115
|
-
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
1116
1128
|
/**
|
|
1117
1129
|
* Cleans empty sub-structures from the export result for manifest
|
|
1118
1130
|
* @param {object} manifest - manifest.json part of the export result
|
|
@@ -1130,11 +1142,16 @@ const deleteEmptyStructure = (manifest, path, deletionRequest, entityPathArray,
|
|
|
1130
1142
|
let manifestSection = manifest;
|
|
1131
1143
|
const pathArray = path.split('/');
|
|
1132
1144
|
pathArray.forEach(function (element) {
|
|
1133
|
-
|
|
1145
|
+
let decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
|
|
1134
1146
|
? targetAnnotation
|
|
1135
1147
|
: element.replace('??', '/');
|
|
1136
1148
|
if (!manifestSection[decodedElement]) {
|
|
1137
|
-
|
|
1149
|
+
if (targetAnnotationEncoded === element) {
|
|
1150
|
+
decodedElement = targetAnnotationEncoded;
|
|
1151
|
+
}
|
|
1152
|
+
if (!manifestSection[decodedElement]) {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1138
1155
|
}
|
|
1139
1156
|
if (Object.keys(manifestSection[decodedElement]).length === 0 ||
|
|
1140
1157
|
//deletion explicitly requested by using entityPath
|
|
@@ -1159,12 +1176,12 @@ exports.deleteEmptyStructure = deleteEmptyStructure;
|
|
|
1159
1176
|
* @return {string} File name of generic schema.
|
|
1160
1177
|
*/
|
|
1161
1178
|
const getGenericSchemaFileName = (schemaType) => {
|
|
1162
|
-
if (schemaType ===
|
|
1163
|
-
return
|
|
1179
|
+
if (schemaType === ux_specification_types_1.SchemaType.FreestylePage) {
|
|
1180
|
+
return ux_specification_types_1.PageTypeV2.CustomPage;
|
|
1164
1181
|
}
|
|
1165
|
-
if (schemaType ===
|
|
1182
|
+
if (schemaType === ux_specification_types_1.SchemaType.FPMCustomPage) {
|
|
1166
1183
|
// FPM custom pages uses generic schema generated for building blocks
|
|
1167
|
-
return
|
|
1184
|
+
return ux_specification_types_1.SchemaType.BuildingBlocks;
|
|
1168
1185
|
}
|
|
1169
1186
|
return `${schemaType}`;
|
|
1170
1187
|
};
|
|
@@ -1181,30 +1198,30 @@ const getSchemaFilePath = (schemaType, pageId, viewId) => {
|
|
|
1181
1198
|
};
|
|
1182
1199
|
switch (schemaType) {
|
|
1183
1200
|
// Application schema
|
|
1184
|
-
case
|
|
1201
|
+
case ux_specification_types_1.SchemaType.Application: {
|
|
1185
1202
|
// File name
|
|
1186
1203
|
schemaFile.filename = `App`;
|
|
1187
1204
|
// Full path
|
|
1188
|
-
schemaFile.path = `./${
|
|
1205
|
+
schemaFile.path = `./${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1189
1206
|
break;
|
|
1190
1207
|
}
|
|
1191
1208
|
// List report and object page
|
|
1192
|
-
case
|
|
1193
|
-
case
|
|
1209
|
+
case ux_specification_types_1.SchemaType.ListReport:
|
|
1210
|
+
case ux_specification_types_1.SchemaType.ObjectPage: {
|
|
1194
1211
|
// File name
|
|
1195
1212
|
schemaFile.filename = pageId ? `${schemaType}_${pageId}` : getGenericSchemaFileName(schemaType);
|
|
1196
1213
|
// Full path
|
|
1197
|
-
schemaFile.path = `../${
|
|
1214
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1198
1215
|
break;
|
|
1199
1216
|
}
|
|
1200
|
-
case
|
|
1201
|
-
case
|
|
1217
|
+
case ux_specification_types_1.PageTypeV4.FPMCustomPage:
|
|
1218
|
+
case ux_specification_types_1.SchemaType.FPMCustomPage: {
|
|
1202
1219
|
// File name
|
|
1203
1220
|
schemaFile.filename = viewId
|
|
1204
|
-
? `${
|
|
1205
|
-
: getGenericSchemaFileName(
|
|
1221
|
+
? `${ux_specification_types_1.SchemaType.FPMCustomPage}_${viewId}`
|
|
1222
|
+
: getGenericSchemaFileName(ux_specification_types_1.SchemaType.FPMCustomPage);
|
|
1206
1223
|
// Full path
|
|
1207
|
-
schemaFile.path = `../${
|
|
1224
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1208
1225
|
break;
|
|
1209
1226
|
}
|
|
1210
1227
|
// Other page configs
|
|
@@ -1212,7 +1229,7 @@ const getSchemaFilePath = (schemaType, pageId, viewId) => {
|
|
|
1212
1229
|
// File name
|
|
1213
1230
|
schemaFile.filename = getGenericSchemaFileName(schemaType);
|
|
1214
1231
|
// Full path
|
|
1215
|
-
schemaFile.path = `../${
|
|
1232
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1216
1233
|
break;
|
|
1217
1234
|
}
|
|
1218
1235
|
}
|
|
@@ -1230,7 +1247,7 @@ exports.getSchemaFilePath = getSchemaFilePath;
|
|
|
1230
1247
|
* @returns {string} Generated page id
|
|
1231
1248
|
*/
|
|
1232
1249
|
function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
1233
|
-
if (pageType ===
|
|
1250
|
+
if (pageType === ux_specification_types_1.PageTypeV2.CustomPage) {
|
|
1234
1251
|
const names = viewId && viewId.split('.');
|
|
1235
1252
|
return names && names[names.length - 1] + 'Page';
|
|
1236
1253
|
}
|
|
@@ -1244,7 +1261,6 @@ function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
|
1244
1261
|
}
|
|
1245
1262
|
return parts.join('_');
|
|
1246
1263
|
}
|
|
1247
|
-
exports.generatePageId = generatePageId;
|
|
1248
1264
|
/**
|
|
1249
1265
|
* Method finds matching objects against passed interface of 'additionalProperties' and returns array of matching object keys.
|
|
1250
1266
|
* @param {Definition} appSchema - App-specific JSON schema.
|
|
@@ -1278,7 +1294,6 @@ function findMatchingKeysByAdditionalProperties(appSchema, additionalProperties,
|
|
|
1278
1294
|
}
|
|
1279
1295
|
return result;
|
|
1280
1296
|
}
|
|
1281
|
-
exports.findMatchingKeysByAdditionalProperties = findMatchingKeysByAdditionalProperties;
|
|
1282
1297
|
function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
|
|
1283
1298
|
const $ref = element.$ref;
|
|
1284
1299
|
if (!$ref) {
|
|
@@ -1351,7 +1366,6 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1351
1366
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1352
1367
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1353
1368
|
if (nextDefinition?.targetDefinition?.['$ref'] || nextDefinition?.targetDefinition?.['type'] === 'array') {
|
|
1354
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1355
1369
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1356
1370
|
return nextDefinition;
|
|
1357
1371
|
}
|
|
@@ -1405,7 +1419,6 @@ function getNextTargetDefinition(appSchema, title, currentConfigObject, property
|
|
|
1405
1419
|
nextDefinition = determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition);
|
|
1406
1420
|
return nextDefinition;
|
|
1407
1421
|
}
|
|
1408
|
-
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
1409
1422
|
/**
|
|
1410
1423
|
* Custom array merge function called by deepmerge's merge function
|
|
1411
1424
|
*
|
|
@@ -1442,7 +1455,6 @@ function convertEnumToCSV(manifestSection, configPart, key) {
|
|
|
1442
1455
|
const field = configPart[key];
|
|
1443
1456
|
manifestSection[key] = field.join();
|
|
1444
1457
|
}
|
|
1445
|
-
exports.convertEnumToCSV = convertEnumToCSV;
|
|
1446
1458
|
/**
|
|
1447
1459
|
* Converts an action ID from the internal format (schema, config) to the stable ID representation
|
|
1448
1460
|
* @param actionId - the (unique) internal format of the action ID
|
|
@@ -1454,7 +1466,6 @@ function convertActionKeyToStableId(actionId) {
|
|
|
1454
1466
|
}
|
|
1455
1467
|
return (actionId.indexOf('??') > -1 ? actionId.split('??')[1] : actionId).replace(/@/g, '::');
|
|
1456
1468
|
}
|
|
1457
|
-
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
1458
1469
|
/**
|
|
1459
1470
|
* Method returns definition key for passed '$ref' property by removing 'definition' prefix
|
|
1460
1471
|
* @param {string} $ref Definition reference.
|
|
@@ -1463,7 +1474,6 @@ exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
|
1463
1474
|
function getDefinitionKey($ref) {
|
|
1464
1475
|
return $ref?.split(exports.DEFINITION_LINK_PREFIX)[1];
|
|
1465
1476
|
}
|
|
1466
|
-
exports.getDefinitionKey = getDefinitionKey;
|
|
1467
1477
|
/**
|
|
1468
1478
|
* Method returns definition $ref' property for passed definition key.
|
|
1469
1479
|
* @param {string} key Definition key.
|
|
@@ -1472,7 +1482,6 @@ exports.getDefinitionKey = getDefinitionKey;
|
|
|
1472
1482
|
function getDefinitionsRef(key) {
|
|
1473
1483
|
return `#/definitions/${key}`;
|
|
1474
1484
|
}
|
|
1475
|
-
exports.getDefinitionsRef = getDefinitionsRef;
|
|
1476
1485
|
/**
|
|
1477
1486
|
* Returns the message property if the error is an instance of `Error` else a string representation of the error.
|
|
1478
1487
|
*
|
|
@@ -1482,7 +1491,6 @@ exports.getDefinitionsRef = getDefinitionsRef;
|
|
|
1482
1491
|
function getErrorMessage(error) {
|
|
1483
1492
|
return error instanceof Error ? error.message : String(error);
|
|
1484
1493
|
}
|
|
1485
|
-
exports.getErrorMessage = getErrorMessage;
|
|
1486
1494
|
/**
|
|
1487
1495
|
* Method checks if passed array of features contains required feature.
|
|
1488
1496
|
*
|
|
@@ -1493,7 +1501,6 @@ exports.getErrorMessage = getErrorMessage;
|
|
|
1493
1501
|
function isFeatureSupported(featureToggles, feature) {
|
|
1494
1502
|
return featureToggles?.includes(feature);
|
|
1495
1503
|
}
|
|
1496
|
-
exports.isFeatureSupported = isFeatureSupported;
|
|
1497
1504
|
/**
|
|
1498
1505
|
* Method adds indices (propertyIndex property) to app-specific JSON schema properties.
|
|
1499
1506
|
*
|
|
@@ -1508,7 +1515,6 @@ function updatePropertyIndices(schema, order) {
|
|
|
1508
1515
|
}
|
|
1509
1516
|
});
|
|
1510
1517
|
}
|
|
1511
|
-
exports.updatePropertyIndices = updatePropertyIndices;
|
|
1512
1518
|
/**
|
|
1513
1519
|
* Method to get value for passed path in passed object.
|
|
1514
1520
|
* @param obj Object to check.
|
|
@@ -1531,27 +1537,24 @@ function getJSONPropertyByPath(obj, paths) {
|
|
|
1531
1537
|
}
|
|
1532
1538
|
return current;
|
|
1533
1539
|
}
|
|
1534
|
-
exports.getJSONPropertyByPath = getJSONPropertyByPath;
|
|
1535
1540
|
/**
|
|
1536
1541
|
* Method to remove namespaces
|
|
1537
1542
|
* @param {string } [sId]
|
|
1538
1543
|
* @returns {string} modified string without namespace
|
|
1539
1544
|
*/
|
|
1540
1545
|
function removeNamespaces(sId) {
|
|
1541
|
-
sId = sId.replace(
|
|
1546
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARYDOT, '');
|
|
1542
1547
|
sId = sId.replace('com.sap.vocabularies.Communication.v1.', '');
|
|
1543
1548
|
return sId;
|
|
1544
1549
|
}
|
|
1545
|
-
exports.removeNamespaces = removeNamespaces;
|
|
1546
1550
|
/**
|
|
1547
1551
|
* Method to replace namespaces with short hand form
|
|
1548
1552
|
* @param {string } [sId]
|
|
1549
1553
|
* @returns {string} modified string with replaced namespaces
|
|
1550
1554
|
*/
|
|
1551
1555
|
function replaceNamespaces(sId) {
|
|
1552
|
-
sId = sId.replace(
|
|
1556
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARY, 'UI');
|
|
1553
1557
|
sId = sId.replace('com.sap.vocabularies.Communication.v1', 'Communication');
|
|
1554
1558
|
return sId;
|
|
1555
1559
|
}
|
|
1556
|
-
exports.replaceNamespaces = replaceNamespaces;
|
|
1557
1560
|
//# sourceMappingURL=utils.js.map
|