@sap/ux-specification 1.120.20 → 1.120.22
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 +42 -43
- 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 +153 -150
- 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 +4 -5
- 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 +7 -7
- 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
|
* Decodes encoded path element and returns it in form as used in manifest settings
|
|
429
456
|
* @param {string} pathElement - path of the property in the manifest
|
|
@@ -542,7 +569,7 @@ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
|
542
569
|
schemaKey =
|
|
543
570
|
'DataFieldForAnnotation:::sTarget::' +
|
|
544
571
|
target
|
|
545
|
-
.replace('@UI', `@${
|
|
572
|
+
.replace('@UI', `@${ux_specification_types_1.UIVOCABULARY}`)
|
|
546
573
|
.replace('@Communication', '@com.sap.vocabularies.Communication.v1')
|
|
547
574
|
.replace('@Contact', '@com.sap.vocabularies.Contact.v1');
|
|
548
575
|
}
|
|
@@ -571,7 +598,6 @@ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
|
571
598
|
}
|
|
572
599
|
return schemaKey;
|
|
573
600
|
}
|
|
574
|
-
exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
|
|
575
601
|
/**
|
|
576
602
|
* Determines if type of given annotation term is of UIAnnotationTerm
|
|
577
603
|
* @param {string} path path in manifest
|
|
@@ -642,20 +668,20 @@ function getAnnotationTerm(path, alias, entityType) {
|
|
|
642
668
|
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
643
669
|
*/
|
|
644
670
|
function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT) {
|
|
645
|
-
const alias = findAlias(
|
|
671
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
646
672
|
let path = section ? section.key : '';
|
|
647
673
|
const targetEntityType = section.entityType;
|
|
648
674
|
const annotationTerm = getAnnotationTerm(path, alias, entityType);
|
|
649
675
|
switch (annotationTerm) {
|
|
650
676
|
case "com.sap.vocabularies.UI.v1.Chart" /* UIAnnotationTerms.Chart */: {
|
|
651
|
-
facets[path] = { base:
|
|
677
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Chart };
|
|
652
678
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
653
679
|
facets[path].entityType = targetEntityType;
|
|
654
680
|
facets[path].namespace = section.namespace;
|
|
655
681
|
break;
|
|
656
682
|
}
|
|
657
683
|
case "com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */: {
|
|
658
|
-
facets[path] = { base:
|
|
684
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Identification };
|
|
659
685
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
660
686
|
facets[path].entityType = targetEntityType;
|
|
661
687
|
facets[path].namespace = section.namespace;
|
|
@@ -667,21 +693,21 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
667
693
|
pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
668
694
|
path = pathParts.join('::');
|
|
669
695
|
}
|
|
670
|
-
facets[path] = { base:
|
|
696
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.LineItem };
|
|
671
697
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
672
698
|
facets[path].entityType = targetEntityType;
|
|
673
699
|
facets[path].namespace = section.namespace;
|
|
674
700
|
break;
|
|
675
701
|
}
|
|
676
702
|
case "com.sap.vocabularies.UI.v1.FieldGroup" /* UIAnnotationTerms.FieldGroup */: {
|
|
677
|
-
facets[path] = { base:
|
|
703
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Form };
|
|
678
704
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
679
705
|
facets[path].entityType = targetEntityType;
|
|
680
706
|
facets[path].namespace = section.namespace;
|
|
681
707
|
break;
|
|
682
708
|
}
|
|
683
709
|
case "com.sap.vocabularies.UI.v1.DataPoint" /* UIAnnotationTerms.DataPoint */: {
|
|
684
|
-
facets[path] = { base:
|
|
710
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.DataPoint };
|
|
685
711
|
facets[path].Label = annotationRecord?.Target?.$target['Title'];
|
|
686
712
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
687
713
|
facets[path].entityType = targetEntityType;
|
|
@@ -689,39 +715,39 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
689
715
|
break;
|
|
690
716
|
}
|
|
691
717
|
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* UIAnnotationTerms.PresentationVariant */: {
|
|
692
|
-
facets[path] = { base:
|
|
718
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.PresentationVariant };
|
|
693
719
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
694
720
|
facets[path].entityType = targetEntityType;
|
|
695
721
|
facets[path].namespace = section.namespace;
|
|
696
722
|
break;
|
|
697
723
|
}
|
|
698
724
|
case "com.sap.vocabularies.UI.v1.SelectionPresentationVariant" /* UIAnnotationTerms.SelectionPresentationVariant */: {
|
|
699
|
-
facets[path] = { base:
|
|
725
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.SelectionPresentationVariant };
|
|
700
726
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
701
727
|
facets[path].entityType = targetEntityType;
|
|
702
728
|
facets[path].namespace = section.namespace;
|
|
703
729
|
break;
|
|
704
730
|
}
|
|
705
731
|
case "com.sap.vocabularies.Communication.v1.Contact" /* CommunicationAnnotationTerms.Contact */: {
|
|
706
|
-
facets[path] = { base:
|
|
732
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Contact };
|
|
707
733
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
708
734
|
facets[path].entityType = targetEntityType;
|
|
709
735
|
facets[path].namespace = section.namespace;
|
|
710
736
|
break;
|
|
711
737
|
}
|
|
712
738
|
case "com.sap.vocabularies.Communication.v1.Address" /* CommunicationAnnotationTerms.Address */: {
|
|
713
|
-
facets[path] = { base:
|
|
739
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Address };
|
|
714
740
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
715
741
|
facets[path].entityType = targetEntityType;
|
|
716
742
|
facets[path].namespace = section.namespace;
|
|
717
743
|
break;
|
|
718
744
|
}
|
|
719
745
|
default: {
|
|
720
|
-
facets[path] = { base:
|
|
746
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Unknown };
|
|
721
747
|
}
|
|
722
748
|
}
|
|
723
749
|
if (facets[path]) {
|
|
724
|
-
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies',
|
|
750
|
+
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', ux_specification_types_1.VOCWITHSLASH)}`;
|
|
725
751
|
if (annotationRecord.Label) {
|
|
726
752
|
facets[path].Label = annotationRecord.Label;
|
|
727
753
|
}
|
|
@@ -743,7 +769,6 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
743
769
|
function getAnnotationPathUsingFullyQualifiedName(entityType, fullyQualifiedName) {
|
|
744
770
|
return `/${entityType.fullyQualifiedName}/${fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
|
|
745
771
|
}
|
|
746
|
-
exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQualifiedName;
|
|
747
772
|
/**
|
|
748
773
|
* Adds the information from facets to the config
|
|
749
774
|
* @param {AnnotationTerm} annotationRecord - the actual annotation record
|
|
@@ -754,7 +779,7 @@ exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQu
|
|
|
754
779
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
755
780
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
756
781
|
*/
|
|
757
|
-
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion =
|
|
782
|
+
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
758
783
|
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
759
784
|
if (section) {
|
|
760
785
|
switch (annotationRecord.$Type) {
|
|
@@ -765,14 +790,14 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
765
790
|
case "com.sap.vocabularies.UI.v1.CollectionFacet" /* UIAnnotationTypes.CollectionFacet */: {
|
|
766
791
|
const annotationPath = getAnnotationPathUsingFullyQualifiedName(entityType, annotationRecord.fullyQualifiedName);
|
|
767
792
|
const facet = (facets[section.key] = {
|
|
768
|
-
base:
|
|
793
|
+
base: ux_specification_types_1.FacetBase.CollectionFacet,
|
|
769
794
|
facets: {},
|
|
770
795
|
ID: section.ID,
|
|
771
796
|
annotationPath: annotationPath,
|
|
772
797
|
Label: section.label,
|
|
773
798
|
namespace: section.namespace
|
|
774
799
|
});
|
|
775
|
-
if (!facet.ID && oDataVersion ===
|
|
800
|
+
if (!facet.ID && oDataVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
776
801
|
(0, extensionLogger_1.log)(logger, {
|
|
777
802
|
severity: "error" /* LogSeverity.Error */,
|
|
778
803
|
message: i18next_1.default.t('NOID4SECTION', { facet: annotationRecord.fullyQualifiedName })
|
|
@@ -793,12 +818,12 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
793
818
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
794
819
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
795
820
|
*/
|
|
796
|
-
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
821
|
+
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
797
822
|
const facets = {};
|
|
798
823
|
if (!entityType || !entityType.annotations) {
|
|
799
824
|
return;
|
|
800
825
|
}
|
|
801
|
-
const alias = findAlias(
|
|
826
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
802
827
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.HeaderFacets;
|
|
803
828
|
if (facetAnnotation) {
|
|
804
829
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -810,7 +835,6 @@ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = u
|
|
|
810
835
|
}
|
|
811
836
|
return facets;
|
|
812
837
|
}
|
|
813
|
-
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
814
838
|
/**
|
|
815
839
|
* Retrieve facet configurations that can be used to generate ObjectPage schemas
|
|
816
840
|
* @param {QualifiedName} entityTypeName - the name of the actual entity type
|
|
@@ -818,12 +842,12 @@ exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
|
818
842
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
819
843
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
820
844
|
*/
|
|
821
|
-
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
845
|
+
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
822
846
|
const facets = {};
|
|
823
847
|
if (!entityType || !entityType.annotations) {
|
|
824
848
|
return;
|
|
825
849
|
}
|
|
826
|
-
const alias = findAlias(
|
|
850
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
827
851
|
const facetAnnotation = alias && entityType?.annotations[alias]?.Facets;
|
|
828
852
|
if (facetAnnotation) {
|
|
829
853
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -835,31 +859,29 @@ function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_spec
|
|
|
835
859
|
}
|
|
836
860
|
return facets;
|
|
837
861
|
}
|
|
838
|
-
exports.getObjectPageFacets = getObjectPageFacets;
|
|
839
862
|
/**
|
|
840
863
|
* Returns the version of Fiori elements (v2/v4) from a given manifest
|
|
841
864
|
* @param manifest - the manifest.json file
|
|
842
865
|
* @returns FioriElementsVersion
|
|
843
866
|
*/
|
|
844
867
|
function getFEVersionFromManifest(manifest) {
|
|
845
|
-
if ((manifest[
|
|
846
|
-
(manifest[
|
|
847
|
-
return
|
|
868
|
+
if ((manifest[ux_specification_types_1.ManifestSection.generic] && Object.keys(manifest[ux_specification_types_1.ManifestSection.generic]).length > 0) ||
|
|
869
|
+
(manifest[ux_specification_types_1.ManifestSection.ovp] && Object.keys(manifest[ux_specification_types_1.ManifestSection.ovp]).length > 0)) {
|
|
870
|
+
return ux_specification_types_1.FioriElementsVersion.v2;
|
|
848
871
|
}
|
|
849
872
|
else {
|
|
850
|
-
const targets = manifest[
|
|
851
|
-
const libs = manifest[
|
|
873
|
+
const targets = manifest[ux_specification_types_1.ManifestSection.ui5]?.routing?.targets;
|
|
874
|
+
const libs = manifest[ux_specification_types_1.ManifestSection.ui5]?.dependencies?.libs;
|
|
852
875
|
if ((targets &&
|
|
853
876
|
Object.keys(targets).find((targetKey) => exports.V4_TEMPLATES.indexOf(targets[targetKey].name) > -1)) ||
|
|
854
877
|
(libs && Object.keys(libs).find((lib) => exports.V4_LIBS.indexOf(lib) > -1))) {
|
|
855
|
-
return
|
|
878
|
+
return ux_specification_types_1.FioriElementsVersion.v4;
|
|
856
879
|
}
|
|
857
880
|
else {
|
|
858
881
|
return undefined;
|
|
859
882
|
}
|
|
860
883
|
}
|
|
861
884
|
}
|
|
862
|
-
exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
863
885
|
/**
|
|
864
886
|
* Get the main service name from the manifest.
|
|
865
887
|
* LROP: by definition the service name can be read from the UI5 model with "" as name.
|
|
@@ -869,14 +891,13 @@ exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
|
869
891
|
* @returns - main service name
|
|
870
892
|
*/
|
|
871
893
|
function getMainService(manifest) {
|
|
872
|
-
const model = typeof manifest?.[
|
|
873
|
-
? manifest[
|
|
894
|
+
const model = typeof manifest?.[ux_specification_types_1.ManifestSection.ovp]?.globalFilterModel === 'string'
|
|
895
|
+
? manifest[ux_specification_types_1.ManifestSection.ovp].globalFilterModel
|
|
874
896
|
: '';
|
|
875
|
-
return typeof manifest?.[
|
|
876
|
-
? manifest[
|
|
897
|
+
return typeof manifest?.[ux_specification_types_1.ManifestSection.ui5]?.models?.[model]?.dataSource === 'string'
|
|
898
|
+
? manifest[ux_specification_types_1.ManifestSection.ui5].models[model].dataSource
|
|
877
899
|
: undefined;
|
|
878
900
|
}
|
|
879
|
-
exports.getMainService = getMainService;
|
|
880
901
|
/**
|
|
881
902
|
* Returns the oData version of the service (if any) from a given manifest
|
|
882
903
|
* @param manifest - the manifest.json file
|
|
@@ -887,10 +908,9 @@ function getODataVersionFromManifest(manifest) {
|
|
|
887
908
|
if (!mainService) {
|
|
888
909
|
return ux_specification_types_1.OdataVersion.v2;
|
|
889
910
|
}
|
|
890
|
-
const dataSource = manifest[
|
|
911
|
+
const dataSource = manifest[ux_specification_types_1.ManifestSection.app].dataSources?.[mainService];
|
|
891
912
|
return dataSource?.settings?.odataVersion === '4.0' ? ux_specification_types_1.OdataVersion.v4 : ux_specification_types_1.OdataVersion.v2;
|
|
892
913
|
}
|
|
893
|
-
exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
894
914
|
/**
|
|
895
915
|
* Determines the template type of a V2 app
|
|
896
916
|
* @param manifest - the manifest.json file
|
|
@@ -899,27 +919,27 @@ exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
|
899
919
|
*/
|
|
900
920
|
function determineV2Template(manifest, logger) {
|
|
901
921
|
let templateType;
|
|
902
|
-
if (manifest[
|
|
903
|
-
const v2Pages = manifest[
|
|
922
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic]) {
|
|
923
|
+
const v2Pages = manifest[ux_specification_types_1.ManifestSection.generic].pages;
|
|
904
924
|
if (!v2Pages) {
|
|
905
925
|
(0, extensionLogger_1.log)(logger, {
|
|
906
926
|
severity: "error" /* LogSeverity.Error */,
|
|
907
927
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
908
928
|
location: {
|
|
909
|
-
path:
|
|
910
|
-
range: [
|
|
929
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
930
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
911
931
|
}
|
|
912
932
|
});
|
|
913
933
|
return;
|
|
914
934
|
}
|
|
915
935
|
for (const pageKey in v2Pages) {
|
|
916
936
|
const v2Page = v2Pages[pageKey];
|
|
917
|
-
if (getPageTypeV2(v2Page.component?.name) ===
|
|
918
|
-
templateType =
|
|
937
|
+
if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.AnalyticalListPage) {
|
|
938
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV2;
|
|
919
939
|
break;
|
|
920
940
|
}
|
|
921
|
-
else if (getPageTypeV2(v2Page.component?.name) ===
|
|
922
|
-
templateType =
|
|
941
|
+
else if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.ListReport) {
|
|
942
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV2;
|
|
923
943
|
break;
|
|
924
944
|
}
|
|
925
945
|
}
|
|
@@ -928,17 +948,16 @@ function determineV2Template(manifest, logger) {
|
|
|
928
948
|
if (!templateType) {
|
|
929
949
|
(0, extensionLogger_1.log)(logger, {
|
|
930
950
|
severity: "error" /* LogSeverity.Error */,
|
|
931
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
951
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.generic }),
|
|
932
952
|
location: {
|
|
933
|
-
path:
|
|
934
|
-
range: [
|
|
953
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
954
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
935
955
|
}
|
|
936
956
|
});
|
|
937
957
|
}
|
|
938
958
|
}
|
|
939
959
|
return templateType;
|
|
940
960
|
}
|
|
941
|
-
exports.determineV2Template = determineV2Template;
|
|
942
961
|
/**
|
|
943
962
|
* Determines the template type of a single page
|
|
944
963
|
* @param v4Page - single page from routing targets
|
|
@@ -947,28 +966,27 @@ exports.determineV2Template = determineV2Template;
|
|
|
947
966
|
function determineV4PageTemplateType(v4Page) {
|
|
948
967
|
let templateType;
|
|
949
968
|
const pageType = getPageTypeV4(v4Page);
|
|
950
|
-
if (pageType ===
|
|
951
|
-
templateType =
|
|
969
|
+
if (pageType === ux_specification_types_1.PageTypeV4.AnalyticalListPage) {
|
|
970
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV4;
|
|
952
971
|
}
|
|
953
|
-
else if (pageType ===
|
|
972
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ListReport) {
|
|
954
973
|
const viewPath = v4Page.options?.settings?.views?.paths?.[0];
|
|
955
|
-
if (viewPath && (viewPath[
|
|
956
|
-
templateType =
|
|
974
|
+
if (viewPath && (viewPath[ux_specification_types_1.ALPViewType.Primary] || viewPath[ux_specification_types_1.ALPViewType.Secondary])) {
|
|
975
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV4;
|
|
957
976
|
}
|
|
958
977
|
else {
|
|
959
|
-
templateType =
|
|
978
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
960
979
|
}
|
|
961
980
|
}
|
|
962
|
-
else if (pageType ===
|
|
963
|
-
templateType =
|
|
981
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ObjectPage) {
|
|
982
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
964
983
|
//fixed now for FEOP scenario, bit continue to check if LR/ALP exists
|
|
965
984
|
}
|
|
966
|
-
else if ([
|
|
967
|
-
templateType =
|
|
985
|
+
else if ([ux_specification_types_1.PageTypeV4.CustomPage, ux_specification_types_1.PageTypeV4.FPMCustomPage].includes(pageType)) {
|
|
986
|
+
templateType = ux_specification_types_1.TemplateType.FreestylePageV4;
|
|
968
987
|
}
|
|
969
988
|
return templateType;
|
|
970
989
|
}
|
|
971
|
-
exports.determineV4PageTemplateType = determineV4PageTemplateType;
|
|
972
990
|
/**
|
|
973
991
|
* Determines the template type, based on the given manifest routing target entries of the app
|
|
974
992
|
* @param v4Pages - pages from routing targets
|
|
@@ -992,35 +1010,34 @@ function determineV4TemplateFromPages(v4Pages) {
|
|
|
992
1010
|
* @returns {TemplateType} the template type
|
|
993
1011
|
*/
|
|
994
1012
|
function determineV4Template(manifest, logger) {
|
|
995
|
-
const v4Pages = manifest[
|
|
996
|
-
manifest[
|
|
1013
|
+
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
1014
|
+
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
997
1015
|
// if there are no pages in routing targets, we use LROPV4 as default template type
|
|
998
1016
|
if (!v4Pages || Object.keys(v4Pages).length === 0) {
|
|
999
1017
|
(0, extensionLogger_1.log)(logger, {
|
|
1000
1018
|
severity: "info" /* LogSeverity.Info */,
|
|
1001
1019
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
1002
1020
|
location: {
|
|
1003
|
-
path:
|
|
1004
|
-
range: [
|
|
1021
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
1022
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
1005
1023
|
}
|
|
1006
1024
|
});
|
|
1007
|
-
return
|
|
1025
|
+
return ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
1008
1026
|
}
|
|
1009
1027
|
// else try to determine template type from routing targets
|
|
1010
1028
|
const templateType = determineV4TemplateFromPages(v4Pages);
|
|
1011
1029
|
if (!templateType) {
|
|
1012
1030
|
(0, extensionLogger_1.log)(logger, {
|
|
1013
1031
|
severity: "error" /* LogSeverity.Error */,
|
|
1014
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
1032
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.ui5 }),
|
|
1015
1033
|
location: {
|
|
1016
|
-
path:
|
|
1017
|
-
range: [
|
|
1034
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
1035
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing', 'targets']
|
|
1018
1036
|
}
|
|
1019
1037
|
});
|
|
1020
1038
|
}
|
|
1021
1039
|
return templateType;
|
|
1022
1040
|
}
|
|
1023
|
-
exports.determineV4Template = determineV4Template;
|
|
1024
1041
|
/**
|
|
1025
1042
|
* Determines the template type, based on the given manifest entries of the app
|
|
1026
1043
|
* @param manifest - the manifest.json file
|
|
@@ -1030,18 +1047,17 @@ exports.determineV4Template = determineV4Template;
|
|
|
1030
1047
|
*/
|
|
1031
1048
|
function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
|
|
1032
1049
|
let templateType;
|
|
1033
|
-
if (manifest[
|
|
1034
|
-
templateType =
|
|
1050
|
+
if (manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
1051
|
+
templateType = ux_specification_types_1.TemplateType.OverviewPageV2;
|
|
1035
1052
|
}
|
|
1036
|
-
else if (fioriElementsVersion ===
|
|
1053
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v2) {
|
|
1037
1054
|
templateType = determineV2Template(manifest, logger);
|
|
1038
1055
|
}
|
|
1039
|
-
else if (fioriElementsVersion ===
|
|
1056
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
1040
1057
|
templateType = determineV4Template(manifest, logger);
|
|
1041
1058
|
}
|
|
1042
1059
|
return templateType;
|
|
1043
1060
|
}
|
|
1044
|
-
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
1045
1061
|
/**
|
|
1046
1062
|
* Adds title and description to a section or header section in an app schema
|
|
1047
1063
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -1050,12 +1066,12 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
|
1050
1066
|
*/
|
|
1051
1067
|
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
1052
1068
|
if (facet?.ID) {
|
|
1053
|
-
section.title =
|
|
1054
|
-
section[
|
|
1069
|
+
section.title = ux_specification_types_1.FACETTITLEPREFIX + facet.ID;
|
|
1070
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facet.ID }];
|
|
1055
1071
|
}
|
|
1056
1072
|
else {
|
|
1057
1073
|
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
1058
|
-
section[
|
|
1074
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facetKey.replace(ux_specification_types_1.UIVOCABULARYALPHADOT, '') }];
|
|
1059
1075
|
}
|
|
1060
1076
|
// Description
|
|
1061
1077
|
if (facet?.Label) {
|
|
@@ -1068,7 +1084,6 @@ function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
|
1068
1084
|
section.description = facetKey.substring(facetKey.lastIndexOf('.') + 1);
|
|
1069
1085
|
}
|
|
1070
1086
|
}
|
|
1071
|
-
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
1072
1087
|
/**
|
|
1073
1088
|
* Adds target title or description to a section or header section in an app schema
|
|
1074
1089
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -1090,7 +1105,6 @@ function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
|
1090
1105
|
section.description = facet.target['Label'];
|
|
1091
1106
|
}
|
|
1092
1107
|
}
|
|
1093
|
-
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
1094
1108
|
/**
|
|
1095
1109
|
* Creates a default object for a new section or subsection, and adds the ID as title if present.
|
|
1096
1110
|
* @param facet Facet configuration, to be analyzed
|
|
@@ -1102,12 +1116,11 @@ function createDefaultSection(appSchema, facet, facetKey) {
|
|
|
1102
1116
|
properties: {},
|
|
1103
1117
|
additionalProperties: false
|
|
1104
1118
|
};
|
|
1105
|
-
section[
|
|
1106
|
-
section[
|
|
1119
|
+
section[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
1120
|
+
section[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
1107
1121
|
addTargetTitleAndSectionDescription(facet, section, facetKey);
|
|
1108
1122
|
return section;
|
|
1109
1123
|
}
|
|
1110
|
-
exports.createDefaultSection = createDefaultSection;
|
|
1111
1124
|
/**
|
|
1112
1125
|
* Retrieve page section data(so far id/key and label/description).
|
|
1113
1126
|
* @param {EntityType} entityType The actual entityType
|
|
@@ -1117,8 +1130,8 @@ exports.createDefaultSection = createDefaultSection;
|
|
|
1117
1130
|
* @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
|
|
1118
1131
|
* @returns {FacetSection[]} - Array of facets or sections
|
|
1119
1132
|
*/
|
|
1120
|
-
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion =
|
|
1121
|
-
const alias = findAlias(
|
|
1133
|
+
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
|
|
1134
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
1122
1135
|
let sections = [];
|
|
1123
1136
|
if (entityType) {
|
|
1124
1137
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.Facets;
|
|
@@ -1137,7 +1150,6 @@ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVer
|
|
|
1137
1150
|
return sections;
|
|
1138
1151
|
}
|
|
1139
1152
|
}
|
|
1140
|
-
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
1141
1153
|
/**
|
|
1142
1154
|
* Cleans empty sub-structures from the export result for manifest
|
|
1143
1155
|
* @param {object} manifest - manifest.json part of the export result
|
|
@@ -1155,11 +1167,16 @@ const deleteEmptyStructure = (manifest, path, deletionRequest, entityPathArray,
|
|
|
1155
1167
|
let manifestSection = manifest;
|
|
1156
1168
|
const pathArray = path.split('/');
|
|
1157
1169
|
pathArray.forEach(function (element) {
|
|
1158
|
-
|
|
1170
|
+
let decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
|
|
1159
1171
|
? targetAnnotation
|
|
1160
1172
|
: element.replace(/\?\?/g, '/');
|
|
1161
1173
|
if (!manifestSection[decodedElement]) {
|
|
1162
|
-
|
|
1174
|
+
if (targetAnnotationEncoded === element) {
|
|
1175
|
+
decodedElement = targetAnnotationEncoded;
|
|
1176
|
+
}
|
|
1177
|
+
if (!manifestSection[decodedElement]) {
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1163
1180
|
}
|
|
1164
1181
|
if (Object.keys(manifestSection[decodedElement]).length === 0 ||
|
|
1165
1182
|
//deletion explicitly requested by using entityPath
|
|
@@ -1184,12 +1201,12 @@ exports.deleteEmptyStructure = deleteEmptyStructure;
|
|
|
1184
1201
|
* @return {string} File name of generic schema.
|
|
1185
1202
|
*/
|
|
1186
1203
|
const getGenericSchemaFileName = (schemaType) => {
|
|
1187
|
-
if (schemaType ===
|
|
1188
|
-
return
|
|
1204
|
+
if (schemaType === ux_specification_types_1.SchemaType.FreestylePage) {
|
|
1205
|
+
return ux_specification_types_1.PageTypeV2.CustomPage;
|
|
1189
1206
|
}
|
|
1190
|
-
if (schemaType ===
|
|
1207
|
+
if (schemaType === ux_specification_types_1.SchemaType.FPMCustomPage) {
|
|
1191
1208
|
// FPM custom pages uses generic schema generated for building blocks
|
|
1192
|
-
return
|
|
1209
|
+
return ux_specification_types_1.SchemaType.BuildingBlocks;
|
|
1193
1210
|
}
|
|
1194
1211
|
return `${schemaType}`;
|
|
1195
1212
|
};
|
|
@@ -1206,30 +1223,30 @@ const getSchemaFilePath = (schemaType, pageId, viewId) => {
|
|
|
1206
1223
|
};
|
|
1207
1224
|
switch (schemaType) {
|
|
1208
1225
|
// Application schema
|
|
1209
|
-
case
|
|
1226
|
+
case ux_specification_types_1.SchemaType.Application: {
|
|
1210
1227
|
// File name
|
|
1211
1228
|
schemaFile.filename = `App`;
|
|
1212
1229
|
// Full path
|
|
1213
|
-
schemaFile.path = `./${
|
|
1230
|
+
schemaFile.path = `./${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1214
1231
|
break;
|
|
1215
1232
|
}
|
|
1216
1233
|
// List report and object page
|
|
1217
|
-
case
|
|
1218
|
-
case
|
|
1234
|
+
case ux_specification_types_1.SchemaType.ListReport:
|
|
1235
|
+
case ux_specification_types_1.SchemaType.ObjectPage: {
|
|
1219
1236
|
// File name
|
|
1220
1237
|
schemaFile.filename = pageId ? `${schemaType}_${pageId}` : getGenericSchemaFileName(schemaType);
|
|
1221
1238
|
// Full path
|
|
1222
|
-
schemaFile.path = `../${
|
|
1239
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1223
1240
|
break;
|
|
1224
1241
|
}
|
|
1225
|
-
case
|
|
1226
|
-
case
|
|
1242
|
+
case ux_specification_types_1.PageTypeV4.FPMCustomPage:
|
|
1243
|
+
case ux_specification_types_1.SchemaType.FPMCustomPage: {
|
|
1227
1244
|
// File name
|
|
1228
1245
|
schemaFile.filename = viewId
|
|
1229
|
-
? `${
|
|
1230
|
-
: getGenericSchemaFileName(
|
|
1246
|
+
? `${ux_specification_types_1.SchemaType.FPMCustomPage}_${viewId}`
|
|
1247
|
+
: getGenericSchemaFileName(ux_specification_types_1.SchemaType.FPMCustomPage);
|
|
1231
1248
|
// Full path
|
|
1232
|
-
schemaFile.path = `../${
|
|
1249
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1233
1250
|
break;
|
|
1234
1251
|
}
|
|
1235
1252
|
// Other page configs
|
|
@@ -1237,7 +1254,7 @@ const getSchemaFilePath = (schemaType, pageId, viewId) => {
|
|
|
1237
1254
|
// File name
|
|
1238
1255
|
schemaFile.filename = getGenericSchemaFileName(schemaType);
|
|
1239
1256
|
// Full path
|
|
1240
|
-
schemaFile.path = `../${
|
|
1257
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1241
1258
|
break;
|
|
1242
1259
|
}
|
|
1243
1260
|
}
|
|
@@ -1255,7 +1272,7 @@ exports.getSchemaFilePath = getSchemaFilePath;
|
|
|
1255
1272
|
* @returns {string} Generated page id
|
|
1256
1273
|
*/
|
|
1257
1274
|
function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
1258
|
-
if (pageType ===
|
|
1275
|
+
if (pageType === ux_specification_types_1.PageTypeV2.CustomPage) {
|
|
1259
1276
|
const names = viewId && viewId.split('.');
|
|
1260
1277
|
return names && names[names.length - 1] + 'Page';
|
|
1261
1278
|
}
|
|
@@ -1269,7 +1286,6 @@ function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
|
1269
1286
|
}
|
|
1270
1287
|
return parts.join('_');
|
|
1271
1288
|
}
|
|
1272
|
-
exports.generatePageId = generatePageId;
|
|
1273
1289
|
/**
|
|
1274
1290
|
* Method finds matching objects against passed interface of 'additionalProperties' and returns array of matching object keys.
|
|
1275
1291
|
* @param {Definition} appSchema - App-specific JSON schema.
|
|
@@ -1303,7 +1319,6 @@ function findMatchingKeysByAdditionalProperties(appSchema, additionalProperties,
|
|
|
1303
1319
|
}
|
|
1304
1320
|
return result;
|
|
1305
1321
|
}
|
|
1306
|
-
exports.findMatchingKeysByAdditionalProperties = findMatchingKeysByAdditionalProperties;
|
|
1307
1322
|
function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
|
|
1308
1323
|
const $ref = element.$ref;
|
|
1309
1324
|
if (!$ref) {
|
|
@@ -1376,7 +1391,6 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1376
1391
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1377
1392
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1378
1393
|
if (nextDefinition?.targetDefinition?.['$ref'] || nextDefinition?.targetDefinition?.['type'] === 'array') {
|
|
1379
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1380
1394
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1381
1395
|
return nextDefinition;
|
|
1382
1396
|
}
|
|
@@ -1430,7 +1444,6 @@ function getNextTargetDefinition(appSchema, title, currentConfigObject, property
|
|
|
1430
1444
|
nextDefinition = determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition);
|
|
1431
1445
|
return nextDefinition;
|
|
1432
1446
|
}
|
|
1433
|
-
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
1434
1447
|
/**
|
|
1435
1448
|
* Custom array merge function called by deepmerge's merge function
|
|
1436
1449
|
*
|
|
@@ -1467,7 +1480,6 @@ function convertEnumToCSV(manifestSection, configPart, key) {
|
|
|
1467
1480
|
const field = configPart[key];
|
|
1468
1481
|
manifestSection[key] = field.join();
|
|
1469
1482
|
}
|
|
1470
|
-
exports.convertEnumToCSV = convertEnumToCSV;
|
|
1471
1483
|
/**
|
|
1472
1484
|
* Converts an action ID from the internal format (schema, config) to the stable ID representation
|
|
1473
1485
|
* @param actionId - the (unique) internal format of the action ID
|
|
@@ -1479,7 +1491,6 @@ function convertActionKeyToStableId(actionId) {
|
|
|
1479
1491
|
}
|
|
1480
1492
|
return (actionId.indexOf('??') > -1 ? actionId.split('??')[1] : actionId).replace(/@/g, '::');
|
|
1481
1493
|
}
|
|
1482
|
-
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
1483
1494
|
/**
|
|
1484
1495
|
* Method returns definition key for passed '$ref' property by removing 'definition' prefix
|
|
1485
1496
|
* @param {string} $ref Definition reference.
|
|
@@ -1488,7 +1499,6 @@ exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
|
1488
1499
|
function getDefinitionKey($ref) {
|
|
1489
1500
|
return $ref?.split(exports.DEFINITION_LINK_PREFIX)[1];
|
|
1490
1501
|
}
|
|
1491
|
-
exports.getDefinitionKey = getDefinitionKey;
|
|
1492
1502
|
/**
|
|
1493
1503
|
* Method returns definition $ref' property for passed definition key.
|
|
1494
1504
|
* @param {string} key Definition key.
|
|
@@ -1497,7 +1507,6 @@ exports.getDefinitionKey = getDefinitionKey;
|
|
|
1497
1507
|
function getDefinitionsRef(key) {
|
|
1498
1508
|
return `#/definitions/${key}`;
|
|
1499
1509
|
}
|
|
1500
|
-
exports.getDefinitionsRef = getDefinitionsRef;
|
|
1501
1510
|
/**
|
|
1502
1511
|
* Returns the message property if the error is an instance of `Error` else a string representation of the error.
|
|
1503
1512
|
*
|
|
@@ -1507,7 +1516,6 @@ exports.getDefinitionsRef = getDefinitionsRef;
|
|
|
1507
1516
|
function getErrorMessage(error) {
|
|
1508
1517
|
return error instanceof Error ? error.message : String(error);
|
|
1509
1518
|
}
|
|
1510
|
-
exports.getErrorMessage = getErrorMessage;
|
|
1511
1519
|
/**
|
|
1512
1520
|
* Method checks if passed array of features contains required feature.
|
|
1513
1521
|
*
|
|
@@ -1518,7 +1526,6 @@ exports.getErrorMessage = getErrorMessage;
|
|
|
1518
1526
|
function isFeatureSupported(featureToggles, feature) {
|
|
1519
1527
|
return featureToggles?.includes(feature);
|
|
1520
1528
|
}
|
|
1521
|
-
exports.isFeatureSupported = isFeatureSupported;
|
|
1522
1529
|
/**
|
|
1523
1530
|
* Method adds indices (propertyIndex property) to app-specific JSON schema properties.
|
|
1524
1531
|
*
|
|
@@ -1533,7 +1540,6 @@ function updatePropertyIndices(schema, order) {
|
|
|
1533
1540
|
}
|
|
1534
1541
|
});
|
|
1535
1542
|
}
|
|
1536
|
-
exports.updatePropertyIndices = updatePropertyIndices;
|
|
1537
1543
|
/**
|
|
1538
1544
|
* Method to get value for passed path in passed object.
|
|
1539
1545
|
* @param obj Object to check.
|
|
@@ -1556,27 +1562,24 @@ function getJSONPropertyByPath(obj, paths) {
|
|
|
1556
1562
|
}
|
|
1557
1563
|
return current;
|
|
1558
1564
|
}
|
|
1559
|
-
exports.getJSONPropertyByPath = getJSONPropertyByPath;
|
|
1560
1565
|
/**
|
|
1561
1566
|
* Method to remove namespaces
|
|
1562
1567
|
* @param {string } [sId]
|
|
1563
1568
|
* @returns {string} modified string without namespace
|
|
1564
1569
|
*/
|
|
1565
1570
|
function removeNamespaces(sId) {
|
|
1566
|
-
sId = sId.replace(
|
|
1571
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARYDOT, '');
|
|
1567
1572
|
sId = sId.replace('com.sap.vocabularies.Communication.v1.', '');
|
|
1568
1573
|
return sId;
|
|
1569
1574
|
}
|
|
1570
|
-
exports.removeNamespaces = removeNamespaces;
|
|
1571
1575
|
/**
|
|
1572
1576
|
* Method to replace namespaces with short hand form
|
|
1573
1577
|
* @param {string } [sId]
|
|
1574
1578
|
* @returns {string} modified string with replaced namespaces
|
|
1575
1579
|
*/
|
|
1576
1580
|
function replaceNamespaces(sId) {
|
|
1577
|
-
sId = sId.replace(
|
|
1581
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARY, 'UI');
|
|
1578
1582
|
sId = sId.replace('com.sap.vocabularies.Communication.v1', 'Communication');
|
|
1579
1583
|
return sId;
|
|
1580
1584
|
}
|
|
1581
|
-
exports.replaceNamespaces = replaceNamespaces;
|
|
1582
1585
|
//# sourceMappingURL=utils.js.map
|