@sap/ux-specification 1.108.39 → 1.108.41
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 +110 -110
- 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 +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 +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
|
|
@@ -638,20 +664,20 @@ function getAnnotationTerm(path, alias, entityType) {
|
|
|
638
664
|
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
639
665
|
*/
|
|
640
666
|
function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT) {
|
|
641
|
-
const alias = findAlias(
|
|
667
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
642
668
|
let path = section ? section.key : '';
|
|
643
669
|
const targetEntityType = section.entityType;
|
|
644
670
|
const annotationTerm = getAnnotationTerm(path, alias, entityType);
|
|
645
671
|
switch (annotationTerm) {
|
|
646
672
|
case "com.sap.vocabularies.UI.v1.Chart" /* UIAnnotationTerms.Chart */: {
|
|
647
|
-
facets[path] = { base:
|
|
673
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Chart };
|
|
648
674
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
649
675
|
facets[path].entityType = targetEntityType;
|
|
650
676
|
facets[path].namespace = section.namespace;
|
|
651
677
|
break;
|
|
652
678
|
}
|
|
653
679
|
case "com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */: {
|
|
654
|
-
facets[path] = { base:
|
|
680
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Identification };
|
|
655
681
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
656
682
|
facets[path].entityType = targetEntityType;
|
|
657
683
|
facets[path].namespace = section.namespace;
|
|
@@ -663,21 +689,21 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
663
689
|
pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
664
690
|
path = pathParts.join('::');
|
|
665
691
|
}
|
|
666
|
-
facets[path] = { base:
|
|
692
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.LineItem };
|
|
667
693
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
668
694
|
facets[path].entityType = targetEntityType;
|
|
669
695
|
facets[path].namespace = section.namespace;
|
|
670
696
|
break;
|
|
671
697
|
}
|
|
672
698
|
case "com.sap.vocabularies.UI.v1.FieldGroup" /* UIAnnotationTerms.FieldGroup */: {
|
|
673
|
-
facets[path] = { base:
|
|
699
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Form };
|
|
674
700
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
675
701
|
facets[path].entityType = targetEntityType;
|
|
676
702
|
facets[path].namespace = section.namespace;
|
|
677
703
|
break;
|
|
678
704
|
}
|
|
679
705
|
case "com.sap.vocabularies.UI.v1.DataPoint" /* UIAnnotationTerms.DataPoint */: {
|
|
680
|
-
facets[path] = { base:
|
|
706
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.DataPoint };
|
|
681
707
|
facets[path].Label = annotationRecord?.Target?.$target['Title'];
|
|
682
708
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
683
709
|
facets[path].entityType = targetEntityType;
|
|
@@ -685,32 +711,32 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
685
711
|
break;
|
|
686
712
|
}
|
|
687
713
|
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* UIAnnotationTerms.PresentationVariant */: {
|
|
688
|
-
facets[path] = { base:
|
|
714
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.PresentationVariant };
|
|
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
|
case "com.sap.vocabularies.Communication.v1.Contact" /* CommunicationAnnotationTerms.Contact */: {
|
|
695
|
-
facets[path] = { base:
|
|
721
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Contact };
|
|
696
722
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
697
723
|
facets[path].entityType = targetEntityType;
|
|
698
724
|
facets[path].namespace = section.namespace;
|
|
699
725
|
break;
|
|
700
726
|
}
|
|
701
727
|
case "com.sap.vocabularies.Communication.v1.Address" /* CommunicationAnnotationTerms.Address */: {
|
|
702
|
-
facets[path] = { base:
|
|
728
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Address };
|
|
703
729
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
704
730
|
facets[path].entityType = targetEntityType;
|
|
705
731
|
facets[path].namespace = section.namespace;
|
|
706
732
|
break;
|
|
707
733
|
}
|
|
708
734
|
default: {
|
|
709
|
-
facets[path] = { base:
|
|
735
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Unknown };
|
|
710
736
|
}
|
|
711
737
|
}
|
|
712
738
|
if (facets[path]) {
|
|
713
|
-
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies',
|
|
739
|
+
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', ux_specification_types_1.VOCWITHSLASH)}`;
|
|
714
740
|
if (annotationRecord.Label) {
|
|
715
741
|
facets[path].Label = annotationRecord.Label;
|
|
716
742
|
}
|
|
@@ -732,7 +758,6 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
732
758
|
function getAnnotationPathUsingFullyQualifiedName(entityType, fullyQualifiedName) {
|
|
733
759
|
return `/${entityType.fullyQualifiedName}/${fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
|
|
734
760
|
}
|
|
735
|
-
exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQualifiedName;
|
|
736
761
|
/**
|
|
737
762
|
* Adds the information from facets to the config
|
|
738
763
|
* @param {AnnotationTerm} annotationRecord - the actual annotation record
|
|
@@ -743,7 +768,7 @@ exports.getAnnotationPathUsingFullyQualifiedName = getAnnotationPathUsingFullyQu
|
|
|
743
768
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
744
769
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
745
770
|
*/
|
|
746
|
-
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion =
|
|
771
|
+
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
747
772
|
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
748
773
|
if (section) {
|
|
749
774
|
switch (annotationRecord.$Type) {
|
|
@@ -754,14 +779,14 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
754
779
|
case "com.sap.vocabularies.UI.v1.CollectionFacet" /* UIAnnotationTypes.CollectionFacet */: {
|
|
755
780
|
const annotationPath = getAnnotationPathUsingFullyQualifiedName(entityType, annotationRecord.fullyQualifiedName);
|
|
756
781
|
const facet = (facets[section.key] = {
|
|
757
|
-
base:
|
|
782
|
+
base: ux_specification_types_1.FacetBase.CollectionFacet,
|
|
758
783
|
facets: {},
|
|
759
784
|
ID: section.ID,
|
|
760
785
|
annotationPath: annotationPath,
|
|
761
786
|
Label: section.label,
|
|
762
787
|
namespace: section.namespace
|
|
763
788
|
});
|
|
764
|
-
if (!facet.ID && oDataVersion ===
|
|
789
|
+
if (!facet.ID && oDataVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
765
790
|
(0, extensionLogger_1.log)(logger, {
|
|
766
791
|
severity: "error" /* LogSeverity.Error */,
|
|
767
792
|
message: i18next_1.default.t('NOID4SECTION', { facet: annotationRecord.fullyQualifiedName })
|
|
@@ -782,12 +807,12 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
782
807
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
783
808
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
784
809
|
*/
|
|
785
|
-
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
810
|
+
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
786
811
|
const facets = {};
|
|
787
812
|
if (!entityType || !entityType.annotations) {
|
|
788
813
|
return;
|
|
789
814
|
}
|
|
790
|
-
const alias = findAlias(
|
|
815
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
791
816
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.HeaderFacets;
|
|
792
817
|
if (facetAnnotation) {
|
|
793
818
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -799,7 +824,6 @@ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = u
|
|
|
799
824
|
}
|
|
800
825
|
return facets;
|
|
801
826
|
}
|
|
802
|
-
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
803
827
|
/**
|
|
804
828
|
* Retrieve facet configurations that can be used to generate ObjectPage schemas
|
|
805
829
|
* @param {QualifiedName} entityTypeName - the name of the actual entity type
|
|
@@ -807,12 +831,12 @@ exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
|
807
831
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
808
832
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
809
833
|
*/
|
|
810
|
-
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
834
|
+
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
811
835
|
const facets = {};
|
|
812
836
|
if (!entityType || !entityType.annotations) {
|
|
813
837
|
return;
|
|
814
838
|
}
|
|
815
|
-
const alias = findAlias(
|
|
839
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
816
840
|
const facetAnnotation = alias && entityType?.annotations[alias]?.Facets;
|
|
817
841
|
if (facetAnnotation) {
|
|
818
842
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -824,31 +848,29 @@ function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_spec
|
|
|
824
848
|
}
|
|
825
849
|
return facets;
|
|
826
850
|
}
|
|
827
|
-
exports.getObjectPageFacets = getObjectPageFacets;
|
|
828
851
|
/**
|
|
829
852
|
* Returns the version of Fiori elements (v2/v4) from a given manifest
|
|
830
853
|
* @param manifest - the manifest.json file
|
|
831
854
|
* @returns FioriElementsVersion
|
|
832
855
|
*/
|
|
833
856
|
function getFEVersionFromManifest(manifest) {
|
|
834
|
-
if ((manifest[
|
|
835
|
-
(manifest[
|
|
836
|
-
return
|
|
857
|
+
if ((manifest[ux_specification_types_1.ManifestSection.generic] && Object.keys(manifest[ux_specification_types_1.ManifestSection.generic]).length > 0) ||
|
|
858
|
+
(manifest[ux_specification_types_1.ManifestSection.ovp] && Object.keys(manifest[ux_specification_types_1.ManifestSection.ovp]).length > 0)) {
|
|
859
|
+
return ux_specification_types_1.FioriElementsVersion.v2;
|
|
837
860
|
}
|
|
838
861
|
else {
|
|
839
|
-
const targets = manifest[
|
|
840
|
-
const libs = manifest[
|
|
862
|
+
const targets = manifest[ux_specification_types_1.ManifestSection.ui5]?.routing?.targets;
|
|
863
|
+
const libs = manifest[ux_specification_types_1.ManifestSection.ui5]?.dependencies?.libs;
|
|
841
864
|
if ((targets &&
|
|
842
865
|
Object.keys(targets).find((targetKey) => exports.V4_TEMPLATES.indexOf(targets[targetKey].name) > -1)) ||
|
|
843
866
|
(libs && Object.keys(libs).find((lib) => exports.V4_LIBS.indexOf(lib) > -1))) {
|
|
844
|
-
return
|
|
867
|
+
return ux_specification_types_1.FioriElementsVersion.v4;
|
|
845
868
|
}
|
|
846
869
|
else {
|
|
847
870
|
return undefined;
|
|
848
871
|
}
|
|
849
872
|
}
|
|
850
873
|
}
|
|
851
|
-
exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
852
874
|
/**
|
|
853
875
|
* Get the main service name from the manifest.
|
|
854
876
|
* LROP: by definition the service name can be read from the UI5 model with "" as name.
|
|
@@ -858,14 +880,13 @@ exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
|
858
880
|
* @returns - main service name
|
|
859
881
|
*/
|
|
860
882
|
function getMainService(manifest) {
|
|
861
|
-
const model = typeof manifest?.[
|
|
862
|
-
? manifest[
|
|
883
|
+
const model = typeof manifest?.[ux_specification_types_1.ManifestSection.ovp]?.globalFilterModel === 'string'
|
|
884
|
+
? manifest[ux_specification_types_1.ManifestSection.ovp].globalFilterModel
|
|
863
885
|
: '';
|
|
864
|
-
return typeof manifest?.[
|
|
865
|
-
? manifest[
|
|
886
|
+
return typeof manifest?.[ux_specification_types_1.ManifestSection.ui5]?.models?.[model]?.dataSource === 'string'
|
|
887
|
+
? manifest[ux_specification_types_1.ManifestSection.ui5].models[model].dataSource
|
|
866
888
|
: undefined;
|
|
867
889
|
}
|
|
868
|
-
exports.getMainService = getMainService;
|
|
869
890
|
/**
|
|
870
891
|
* Returns the oData version of the service (if any) from a given manifest
|
|
871
892
|
* @param manifest - the manifest.json file
|
|
@@ -876,10 +897,9 @@ function getODataVersionFromManifest(manifest) {
|
|
|
876
897
|
if (!mainService) {
|
|
877
898
|
return ux_specification_types_1.OdataVersion.v2;
|
|
878
899
|
}
|
|
879
|
-
const dataSource = manifest[
|
|
900
|
+
const dataSource = manifest[ux_specification_types_1.ManifestSection.app].dataSources?.[mainService];
|
|
880
901
|
return dataSource?.settings?.odataVersion === '4.0' ? ux_specification_types_1.OdataVersion.v4 : ux_specification_types_1.OdataVersion.v2;
|
|
881
902
|
}
|
|
882
|
-
exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
883
903
|
/**
|
|
884
904
|
* Determines the template type of a V2 app
|
|
885
905
|
* @param manifest - the manifest.json file
|
|
@@ -888,27 +908,27 @@ exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
|
888
908
|
*/
|
|
889
909
|
function determineV2Template(manifest, logger) {
|
|
890
910
|
let templateType;
|
|
891
|
-
if (manifest[
|
|
892
|
-
const v2Pages = manifest[
|
|
911
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic]) {
|
|
912
|
+
const v2Pages = manifest[ux_specification_types_1.ManifestSection.generic].pages;
|
|
893
913
|
if (!v2Pages) {
|
|
894
914
|
(0, extensionLogger_1.log)(logger, {
|
|
895
915
|
severity: "error" /* LogSeverity.Error */,
|
|
896
916
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
897
917
|
location: {
|
|
898
|
-
path:
|
|
899
|
-
range: [
|
|
918
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
919
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
900
920
|
}
|
|
901
921
|
});
|
|
902
922
|
return;
|
|
903
923
|
}
|
|
904
924
|
for (const pageKey in v2Pages) {
|
|
905
925
|
const v2Page = v2Pages[pageKey];
|
|
906
|
-
if (getPageTypeV2(v2Page.component?.name) ===
|
|
907
|
-
templateType =
|
|
926
|
+
if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.AnalyticalListPage) {
|
|
927
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV2;
|
|
908
928
|
break;
|
|
909
929
|
}
|
|
910
|
-
else if (getPageTypeV2(v2Page.component?.name) ===
|
|
911
|
-
templateType =
|
|
930
|
+
else if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.ListReport) {
|
|
931
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV2;
|
|
912
932
|
break;
|
|
913
933
|
}
|
|
914
934
|
}
|
|
@@ -917,17 +937,16 @@ function determineV2Template(manifest, logger) {
|
|
|
917
937
|
if (!templateType) {
|
|
918
938
|
(0, extensionLogger_1.log)(logger, {
|
|
919
939
|
severity: "error" /* LogSeverity.Error */,
|
|
920
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
940
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.generic }),
|
|
921
941
|
location: {
|
|
922
|
-
path:
|
|
923
|
-
range: [
|
|
942
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
943
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
924
944
|
}
|
|
925
945
|
});
|
|
926
946
|
}
|
|
927
947
|
}
|
|
928
948
|
return templateType;
|
|
929
949
|
}
|
|
930
|
-
exports.determineV2Template = determineV2Template;
|
|
931
950
|
/**
|
|
932
951
|
* Determines the template type of a single page
|
|
933
952
|
* @param v4Page - single page from routing targets
|
|
@@ -936,28 +955,27 @@ exports.determineV2Template = determineV2Template;
|
|
|
936
955
|
function determineV4PageTemplateType(v4Page) {
|
|
937
956
|
let templateType;
|
|
938
957
|
const pageType = getPageTypeV4(v4Page);
|
|
939
|
-
if (pageType ===
|
|
940
|
-
templateType =
|
|
958
|
+
if (pageType === ux_specification_types_1.PageTypeV4.AnalyticalListPage) {
|
|
959
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV4;
|
|
941
960
|
}
|
|
942
|
-
else if (pageType ===
|
|
961
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ListReport) {
|
|
943
962
|
const viewPath = v4Page.options?.settings?.views?.paths?.[0];
|
|
944
|
-
if (viewPath && (viewPath[
|
|
945
|
-
templateType =
|
|
963
|
+
if (viewPath && (viewPath[ux_specification_types_1.ALPViewType.Primary] || viewPath[ux_specification_types_1.ALPViewType.Secondary])) {
|
|
964
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV4;
|
|
946
965
|
}
|
|
947
966
|
else {
|
|
948
|
-
templateType =
|
|
967
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
949
968
|
}
|
|
950
969
|
}
|
|
951
|
-
else if (pageType ===
|
|
952
|
-
templateType =
|
|
970
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ObjectPage) {
|
|
971
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
953
972
|
//fixed now for FEOP scenario, bit continue to check if LR/ALP exists
|
|
954
973
|
}
|
|
955
|
-
else if ([
|
|
956
|
-
templateType =
|
|
974
|
+
else if ([ux_specification_types_1.PageTypeV4.CustomPage, ux_specification_types_1.PageTypeV4.FPMCustomPage].includes(pageType)) {
|
|
975
|
+
templateType = ux_specification_types_1.TemplateType.FreestylePageV4;
|
|
957
976
|
}
|
|
958
977
|
return templateType;
|
|
959
978
|
}
|
|
960
|
-
exports.determineV4PageTemplateType = determineV4PageTemplateType;
|
|
961
979
|
/**
|
|
962
980
|
* Determines the template type, based on the given manifest routing target entries of the app
|
|
963
981
|
* @param v4Pages - pages from routing targets
|
|
@@ -981,35 +999,34 @@ function determineV4TemplateFromPages(v4Pages) {
|
|
|
981
999
|
* @returns {TemplateType} the template type
|
|
982
1000
|
*/
|
|
983
1001
|
function determineV4Template(manifest, logger) {
|
|
984
|
-
const v4Pages = manifest[
|
|
985
|
-
manifest[
|
|
1002
|
+
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
1003
|
+
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
986
1004
|
// if there are no pages in routing targets, we use LROPV4 as default template type
|
|
987
1005
|
if (!v4Pages || Object.keys(v4Pages).length === 0) {
|
|
988
1006
|
(0, extensionLogger_1.log)(logger, {
|
|
989
1007
|
severity: "info" /* LogSeverity.Info */,
|
|
990
1008
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
991
1009
|
location: {
|
|
992
|
-
path:
|
|
993
|
-
range: [
|
|
1010
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
1011
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
994
1012
|
}
|
|
995
1013
|
});
|
|
996
|
-
return
|
|
1014
|
+
return ux_specification_types_1.TemplateType.ListReportObjectPageV4;
|
|
997
1015
|
}
|
|
998
1016
|
// else try to determine template type from routing targets
|
|
999
1017
|
const templateType = determineV4TemplateFromPages(v4Pages);
|
|
1000
1018
|
if (!templateType) {
|
|
1001
1019
|
(0, extensionLogger_1.log)(logger, {
|
|
1002
1020
|
severity: "error" /* LogSeverity.Error */,
|
|
1003
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
1021
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.ui5 }),
|
|
1004
1022
|
location: {
|
|
1005
|
-
path:
|
|
1006
|
-
range: [
|
|
1023
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
1024
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing', 'targets']
|
|
1007
1025
|
}
|
|
1008
1026
|
});
|
|
1009
1027
|
}
|
|
1010
1028
|
return templateType;
|
|
1011
1029
|
}
|
|
1012
|
-
exports.determineV4Template = determineV4Template;
|
|
1013
1030
|
/**
|
|
1014
1031
|
* Determines the template type, based on the given manifest entries of the app
|
|
1015
1032
|
* @param manifest - the manifest.json file
|
|
@@ -1019,18 +1036,17 @@ exports.determineV4Template = determineV4Template;
|
|
|
1019
1036
|
*/
|
|
1020
1037
|
function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
|
|
1021
1038
|
let templateType;
|
|
1022
|
-
if (manifest[
|
|
1023
|
-
templateType =
|
|
1039
|
+
if (manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
1040
|
+
templateType = ux_specification_types_1.TemplateType.OverviewPageV2;
|
|
1024
1041
|
}
|
|
1025
|
-
else if (fioriElementsVersion ===
|
|
1042
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v2) {
|
|
1026
1043
|
templateType = determineV2Template(manifest, logger);
|
|
1027
1044
|
}
|
|
1028
|
-
else if (fioriElementsVersion ===
|
|
1045
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
1029
1046
|
templateType = determineV4Template(manifest, logger);
|
|
1030
1047
|
}
|
|
1031
1048
|
return templateType;
|
|
1032
1049
|
}
|
|
1033
|
-
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
1034
1050
|
/**
|
|
1035
1051
|
* Adds title and description to a section or header section in an app schema
|
|
1036
1052
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -1039,12 +1055,12 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
|
1039
1055
|
*/
|
|
1040
1056
|
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
1041
1057
|
if (facet?.ID) {
|
|
1042
|
-
section.title =
|
|
1043
|
-
section[
|
|
1058
|
+
section.title = ux_specification_types_1.FACETTITLEPREFIX + facet.ID;
|
|
1059
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facet.ID }];
|
|
1044
1060
|
}
|
|
1045
1061
|
else {
|
|
1046
1062
|
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
1047
|
-
section[
|
|
1063
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facetKey.replace(ux_specification_types_1.UIVOCABULARYALPHADOT, '') }];
|
|
1048
1064
|
}
|
|
1049
1065
|
// Description
|
|
1050
1066
|
if (facet?.Label) {
|
|
@@ -1057,7 +1073,6 @@ function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
|
1057
1073
|
section.description = facetKey.substring(facetKey.lastIndexOf('.') + 1);
|
|
1058
1074
|
}
|
|
1059
1075
|
}
|
|
1060
|
-
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
1061
1076
|
/**
|
|
1062
1077
|
* Adds target title or description to a section or header section in an app schema
|
|
1063
1078
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -1079,7 +1094,6 @@ function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
|
1079
1094
|
section.description = facet.target['Label'];
|
|
1080
1095
|
}
|
|
1081
1096
|
}
|
|
1082
|
-
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
1083
1097
|
/**
|
|
1084
1098
|
* Creates a default object for a new section or subsection, and adds the ID as title if present.
|
|
1085
1099
|
* @param facet Facet configuration, to be analyzed
|
|
@@ -1091,12 +1105,11 @@ function createDefaultSection(appSchema, facet, facetKey) {
|
|
|
1091
1105
|
properties: {},
|
|
1092
1106
|
additionalProperties: false
|
|
1093
1107
|
};
|
|
1094
|
-
section[
|
|
1095
|
-
section[
|
|
1108
|
+
section[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
1109
|
+
section[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
1096
1110
|
addTargetTitleAndSectionDescription(facet, section, facetKey);
|
|
1097
1111
|
return section;
|
|
1098
1112
|
}
|
|
1099
|
-
exports.createDefaultSection = createDefaultSection;
|
|
1100
1113
|
/**
|
|
1101
1114
|
* Retrieve page section data(so far id/key and label/description).
|
|
1102
1115
|
* @param {EntityType} entityType The actual entityType
|
|
@@ -1106,8 +1119,8 @@ exports.createDefaultSection = createDefaultSection;
|
|
|
1106
1119
|
* @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
|
|
1107
1120
|
* @returns {FacetSection[]} - Array of facets or sections
|
|
1108
1121
|
*/
|
|
1109
|
-
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion =
|
|
1110
|
-
const alias = findAlias(
|
|
1122
|
+
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
|
|
1123
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
1111
1124
|
let sections = [];
|
|
1112
1125
|
if (entityType) {
|
|
1113
1126
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.Facets;
|
|
@@ -1126,7 +1139,6 @@ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVer
|
|
|
1126
1139
|
return sections;
|
|
1127
1140
|
}
|
|
1128
1141
|
}
|
|
1129
|
-
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
1130
1142
|
/**
|
|
1131
1143
|
* Cleans empty sub-structures from the export result for manifest
|
|
1132
1144
|
* @param {object} manifest - manifest.json part of the export result
|
|
@@ -1144,11 +1156,16 @@ const deleteEmptyStructure = (manifest, path, deletionRequest, entityPathArray,
|
|
|
1144
1156
|
let manifestSection = manifest;
|
|
1145
1157
|
const pathArray = path.split('/');
|
|
1146
1158
|
pathArray.forEach(function (element) {
|
|
1147
|
-
|
|
1159
|
+
let decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
|
|
1148
1160
|
? targetAnnotation
|
|
1149
1161
|
: element.replace(/\?\?/g, '/');
|
|
1150
1162
|
if (!manifestSection[decodedElement]) {
|
|
1151
|
-
|
|
1163
|
+
if (targetAnnotationEncoded === element) {
|
|
1164
|
+
decodedElement = targetAnnotationEncoded;
|
|
1165
|
+
}
|
|
1166
|
+
if (!manifestSection[decodedElement]) {
|
|
1167
|
+
return;
|
|
1168
|
+
}
|
|
1152
1169
|
}
|
|
1153
1170
|
if (Object.keys(manifestSection[decodedElement]).length === 0 ||
|
|
1154
1171
|
//deletion explicitly requested by using entityPath
|
|
@@ -1173,12 +1190,12 @@ exports.deleteEmptyStructure = deleteEmptyStructure;
|
|
|
1173
1190
|
* @return {string} File name of generic schema.
|
|
1174
1191
|
*/
|
|
1175
1192
|
const getGenericSchemaFileName = (schemaType) => {
|
|
1176
|
-
if (schemaType ===
|
|
1177
|
-
return
|
|
1193
|
+
if (schemaType === ux_specification_types_1.SchemaType.FreestylePage) {
|
|
1194
|
+
return ux_specification_types_1.PageTypeV2.CustomPage;
|
|
1178
1195
|
}
|
|
1179
|
-
if (schemaType ===
|
|
1196
|
+
if (schemaType === ux_specification_types_1.SchemaType.FPMCustomPage) {
|
|
1180
1197
|
// FPM custom pages uses generic schema generated for building blocks
|
|
1181
|
-
return
|
|
1198
|
+
return ux_specification_types_1.SchemaType.BuildingBlocks;
|
|
1182
1199
|
}
|
|
1183
1200
|
return `${schemaType}`;
|
|
1184
1201
|
};
|
|
@@ -1195,30 +1212,30 @@ const getSchemaFilePath = (schemaType, pageId, viewId) => {
|
|
|
1195
1212
|
};
|
|
1196
1213
|
switch (schemaType) {
|
|
1197
1214
|
// Application schema
|
|
1198
|
-
case
|
|
1215
|
+
case ux_specification_types_1.SchemaType.Application: {
|
|
1199
1216
|
// File name
|
|
1200
1217
|
schemaFile.filename = `App`;
|
|
1201
1218
|
// Full path
|
|
1202
|
-
schemaFile.path = `./${
|
|
1219
|
+
schemaFile.path = `./${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1203
1220
|
break;
|
|
1204
1221
|
}
|
|
1205
1222
|
// List report and object page
|
|
1206
|
-
case
|
|
1207
|
-
case
|
|
1223
|
+
case ux_specification_types_1.SchemaType.ListReport:
|
|
1224
|
+
case ux_specification_types_1.SchemaType.ObjectPage: {
|
|
1208
1225
|
// File name
|
|
1209
1226
|
schemaFile.filename = pageId ? `${schemaType}_${pageId}` : getGenericSchemaFileName(schemaType);
|
|
1210
1227
|
// Full path
|
|
1211
|
-
schemaFile.path = `../${
|
|
1228
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1212
1229
|
break;
|
|
1213
1230
|
}
|
|
1214
|
-
case
|
|
1215
|
-
case
|
|
1231
|
+
case ux_specification_types_1.PageTypeV4.FPMCustomPage:
|
|
1232
|
+
case ux_specification_types_1.SchemaType.FPMCustomPage: {
|
|
1216
1233
|
// File name
|
|
1217
1234
|
schemaFile.filename = viewId
|
|
1218
|
-
? `${
|
|
1219
|
-
: getGenericSchemaFileName(
|
|
1235
|
+
? `${ux_specification_types_1.SchemaType.FPMCustomPage}_${viewId}`
|
|
1236
|
+
: getGenericSchemaFileName(ux_specification_types_1.SchemaType.FPMCustomPage);
|
|
1220
1237
|
// Full path
|
|
1221
|
-
schemaFile.path = `../${
|
|
1238
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1222
1239
|
break;
|
|
1223
1240
|
}
|
|
1224
1241
|
// Other page configs
|
|
@@ -1226,7 +1243,7 @@ const getSchemaFilePath = (schemaType, pageId, viewId) => {
|
|
|
1226
1243
|
// File name
|
|
1227
1244
|
schemaFile.filename = getGenericSchemaFileName(schemaType);
|
|
1228
1245
|
// Full path
|
|
1229
|
-
schemaFile.path = `../${
|
|
1246
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1230
1247
|
break;
|
|
1231
1248
|
}
|
|
1232
1249
|
}
|
|
@@ -1244,7 +1261,7 @@ exports.getSchemaFilePath = getSchemaFilePath;
|
|
|
1244
1261
|
* @returns {string} Generated page id
|
|
1245
1262
|
*/
|
|
1246
1263
|
function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
1247
|
-
if (pageType ===
|
|
1264
|
+
if (pageType === ux_specification_types_1.PageTypeV2.CustomPage) {
|
|
1248
1265
|
const names = viewId && viewId.split('.');
|
|
1249
1266
|
return names && names[names.length - 1] + 'Page';
|
|
1250
1267
|
}
|
|
@@ -1258,7 +1275,6 @@ function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
|
1258
1275
|
}
|
|
1259
1276
|
return parts.join('_');
|
|
1260
1277
|
}
|
|
1261
|
-
exports.generatePageId = generatePageId;
|
|
1262
1278
|
/**
|
|
1263
1279
|
* Method finds matching objects against passed interface of 'additionalProperties' and returns array of matching object keys.
|
|
1264
1280
|
* @param {Definition} appSchema - App-specific JSON schema.
|
|
@@ -1292,7 +1308,6 @@ function findMatchingKeysByAdditionalProperties(appSchema, additionalProperties,
|
|
|
1292
1308
|
}
|
|
1293
1309
|
return result;
|
|
1294
1310
|
}
|
|
1295
|
-
exports.findMatchingKeysByAdditionalProperties = findMatchingKeysByAdditionalProperties;
|
|
1296
1311
|
function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
|
|
1297
1312
|
const $ref = element.$ref;
|
|
1298
1313
|
if (!$ref) {
|
|
@@ -1365,7 +1380,6 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1365
1380
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1366
1381
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1367
1382
|
if (nextDefinition?.targetDefinition?.['$ref'] || nextDefinition?.targetDefinition?.['type'] === 'array') {
|
|
1368
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1369
1383
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1370
1384
|
return nextDefinition;
|
|
1371
1385
|
}
|
|
@@ -1419,7 +1433,6 @@ function getNextTargetDefinition(appSchema, title, currentConfigObject, property
|
|
|
1419
1433
|
nextDefinition = determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition);
|
|
1420
1434
|
return nextDefinition;
|
|
1421
1435
|
}
|
|
1422
|
-
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
1423
1436
|
/**
|
|
1424
1437
|
* Custom array merge function called by deepmerge's merge function
|
|
1425
1438
|
*
|
|
@@ -1456,7 +1469,6 @@ function convertEnumToCSV(manifestSection, configPart, key) {
|
|
|
1456
1469
|
const field = configPart[key];
|
|
1457
1470
|
manifestSection[key] = field.join();
|
|
1458
1471
|
}
|
|
1459
|
-
exports.convertEnumToCSV = convertEnumToCSV;
|
|
1460
1472
|
/**
|
|
1461
1473
|
* Converts an action ID from the internal format (schema, config) to the stable ID representation
|
|
1462
1474
|
* @param actionId - the (unique) internal format of the action ID
|
|
@@ -1468,7 +1480,6 @@ function convertActionKeyToStableId(actionId) {
|
|
|
1468
1480
|
}
|
|
1469
1481
|
return (actionId.indexOf('??') > -1 ? actionId.split('??')[1] : actionId).replace(/@/g, '::');
|
|
1470
1482
|
}
|
|
1471
|
-
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
1472
1483
|
/**
|
|
1473
1484
|
* Method returns definition key for passed '$ref' property by removing 'definition' prefix
|
|
1474
1485
|
* @param {string} $ref Definition reference.
|
|
@@ -1477,7 +1488,6 @@ exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
|
1477
1488
|
function getDefinitionKey($ref) {
|
|
1478
1489
|
return $ref?.split(exports.DEFINITION_LINK_PREFIX)[1];
|
|
1479
1490
|
}
|
|
1480
|
-
exports.getDefinitionKey = getDefinitionKey;
|
|
1481
1491
|
/**
|
|
1482
1492
|
* Method returns definition $ref' property for passed definition key.
|
|
1483
1493
|
* @param {string} key Definition key.
|
|
@@ -1486,7 +1496,6 @@ exports.getDefinitionKey = getDefinitionKey;
|
|
|
1486
1496
|
function getDefinitionsRef(key) {
|
|
1487
1497
|
return `#/definitions/${key}`;
|
|
1488
1498
|
}
|
|
1489
|
-
exports.getDefinitionsRef = getDefinitionsRef;
|
|
1490
1499
|
/**
|
|
1491
1500
|
* Returns the message property if the error is an instance of `Error` else a string representation of the error.
|
|
1492
1501
|
*
|
|
@@ -1496,7 +1505,6 @@ exports.getDefinitionsRef = getDefinitionsRef;
|
|
|
1496
1505
|
function getErrorMessage(error) {
|
|
1497
1506
|
return error instanceof Error ? error.message : String(error);
|
|
1498
1507
|
}
|
|
1499
|
-
exports.getErrorMessage = getErrorMessage;
|
|
1500
1508
|
/**
|
|
1501
1509
|
* Method checks if passed array of features contains required feature.
|
|
1502
1510
|
*
|
|
@@ -1507,7 +1515,6 @@ exports.getErrorMessage = getErrorMessage;
|
|
|
1507
1515
|
function isFeatureSupported(featureToggles, feature) {
|
|
1508
1516
|
return featureToggles?.includes(feature);
|
|
1509
1517
|
}
|
|
1510
|
-
exports.isFeatureSupported = isFeatureSupported;
|
|
1511
1518
|
/**
|
|
1512
1519
|
* Method adds indices (propertyIndex property) to app-specific JSON schema properties.
|
|
1513
1520
|
*
|
|
@@ -1522,7 +1529,6 @@ function updatePropertyIndices(schema, order) {
|
|
|
1522
1529
|
}
|
|
1523
1530
|
});
|
|
1524
1531
|
}
|
|
1525
|
-
exports.updatePropertyIndices = updatePropertyIndices;
|
|
1526
1532
|
/**
|
|
1527
1533
|
* Method to get value for passed path in passed object.
|
|
1528
1534
|
* @param obj Object to check.
|
|
@@ -1545,27 +1551,24 @@ function getJSONPropertyByPath(obj, paths) {
|
|
|
1545
1551
|
}
|
|
1546
1552
|
return current;
|
|
1547
1553
|
}
|
|
1548
|
-
exports.getJSONPropertyByPath = getJSONPropertyByPath;
|
|
1549
1554
|
/**
|
|
1550
1555
|
* Method to remove namespaces
|
|
1551
1556
|
* @param {string } [sId]
|
|
1552
1557
|
* @returns {string} modified string without namespace
|
|
1553
1558
|
*/
|
|
1554
1559
|
function removeNamespaces(sId) {
|
|
1555
|
-
sId = sId.replace(
|
|
1560
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARYDOT, '');
|
|
1556
1561
|
sId = sId.replace('com.sap.vocabularies.Communication.v1.', '');
|
|
1557
1562
|
return sId;
|
|
1558
1563
|
}
|
|
1559
|
-
exports.removeNamespaces = removeNamespaces;
|
|
1560
1564
|
/**
|
|
1561
1565
|
* Method to replace namespaces with short hand form
|
|
1562
1566
|
* @param {string } [sId]
|
|
1563
1567
|
* @returns {string} modified string with replaced namespaces
|
|
1564
1568
|
*/
|
|
1565
1569
|
function replaceNamespaces(sId) {
|
|
1566
|
-
sId = sId.replace(
|
|
1570
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARY, 'UI');
|
|
1567
1571
|
sId = sId.replace('com.sap.vocabularies.Communication.v1', 'Communication');
|
|
1568
1572
|
return sId;
|
|
1569
1573
|
}
|
|
1570
|
-
exports.replaceNamespaces = replaceNamespaces;
|
|
1571
1574
|
//# sourceMappingURL=utils.js.map
|