@sap/ux-specification 1.136.13 → 1.136.15
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 +73 -1
- 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-ListReportNew.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 +260 -261
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/ApplicationV2.json +28 -3
- package/dist/schemas/v2/ListReportNewConfig.json +45 -0
- package/dist/schemas/v2/ObjectPageConfig.json +11 -5
- package/dist/schemas/v4/ApplicationV4.json +18 -12
- package/dist/schemas/v4/BuildingBlocksConfig.json +72 -35
- package/dist/schemas/v4/ListReportConfig.json +299 -28
- package/dist/schemas/v4/ObjectPageConfig.json +409 -130
- package/dist/specification/package.json +17 -17
- package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +17 -1
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
- package/dist/specification/scripts/macros/schema.js +10 -1
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/scripts/macros/types.d.ts +1 -0
- package/dist/specification/scripts/macros/types.d.ts.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js +23 -13
- package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
- package/dist/specification/src/api.d.ts.map +1 -1
- package/dist/specification/src/api.js +2 -1
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/sync/common/DataFieldStrategy.d.ts +38 -8
- package/dist/specification/src/sync/common/DataFieldStrategy.d.ts.map +1 -1
- package/dist/specification/src/sync/common/DataFieldStrategy.js +64 -11
- package/dist/specification/src/sync/common/DataFieldStrategy.js.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +0 -4
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +0 -3
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -1
- package/dist/specification/src/sync/common/appProvider.d.ts +0 -1
- package/dist/specification/src/sync/common/appProvider.d.ts.map +1 -1
- package/dist/specification/src/sync/common/appProvider.js +0 -1
- package/dist/specification/src/sync/common/appProvider.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.d.ts +65 -4
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +138 -8
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/distTagEvaluator.d.ts +10 -3
- package/dist/specification/src/sync/common/distTagEvaluator.d.ts.map +1 -1
- package/dist/specification/src/sync/common/distTagEvaluator.js +14 -4
- package/dist/specification/src/sync/common/distTagEvaluator.js.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.d.ts +0 -1
- package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +0 -3
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.d.ts +12 -6
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +33 -22
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +6 -4
- package/dist/specification/src/sync/common/import/utils.d.ts +0 -1
- package/dist/specification/src/sync/common/import/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/import/utils.js +0 -1
- package/dist/specification/src/sync/common/import/utils.js.map +1 -1
- package/dist/specification/src/sync/common/rules.d.ts.map +1 -1
- package/dist/specification/src/sync/common/rules.js +18 -13
- package/dist/specification/src/sync/common/rules.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +52 -2
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +176 -5
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/application.d.ts +1 -0
- package/dist/specification/src/sync/v2/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/application.js +18 -0
- package/dist/specification/src/sync/v2/application.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.js +15 -4
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js +8 -15
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
- package/dist/specification/src/sync/v2/export/factory.d.ts +26 -0
- package/dist/specification/src/sync/v2/export/factory.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/factory.js +3 -3
- package/dist/specification/src/sync/v2/export/factory.js.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/ObjectPage.d.ts +1 -0
- package/dist/specification/src/sync/v2/export/pages/ObjectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/pages/ObjectPage.js +11 -0
- package/dist/specification/src/sync/v2/export/pages/ObjectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +46 -0
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.js +46 -1
- package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.js +63 -13
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +28 -1
- package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.d.ts +22 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.d.ts.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.js +124 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.js.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +4 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.js +5 -6
- package/dist/specification/src/sync/v2/import/importPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/overviewPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/overviewPage.js +4 -0
- package/dist/specification/src/sync/v2/import/pages/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +17 -1
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +57 -0
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +1 -1
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +1 -1
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/actions.d.ts +39 -0
- package/dist/specification/src/sync/v4/export/actions.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/export/actions.js +99 -0
- package/dist/specification/src/sync/v4/export/actions.js.map +1 -0
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts +3 -2
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.js +14 -2
- package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -2
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.d.ts +2 -4
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.js +2 -21
- package/dist/specification/src/sync/v4/export/controls/ObjectPageFormAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts +2 -2
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts +14 -3
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js +52 -9
- package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +4 -0
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.js +30 -0
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +15 -3
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js +53 -10
- package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +0 -3
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +0 -3
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts +7 -0
- package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/TableColumn.js +60 -0
- package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +9 -2
- package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.js +39 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBar.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +17 -4
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +76 -19
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/export.d.ts +7 -0
- package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/export.js +100 -11
- package/dist/specification/src/sync/v4/export/export.js.map +1 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.js +2 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
- package/dist/specification/src/sync/v4/export/types.d.ts +2 -0
- package/dist/specification/src/sync/v4/export/types.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +107 -0
- package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/ListReportUtils.js +394 -0
- package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/actions.d.ts +35 -0
- package/dist/specification/src/sync/v4/generate/actions.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/actions.js +112 -0
- package/dist/specification/src/sync/v4/generate/actions.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +3 -3
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +10 -2
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.d.ts +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/extensions.js +3 -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.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +9 -2
- 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/utils.js +2 -2
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/listReport.d.ts +129 -4
- package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/listReport.js +196 -353
- package/dist/specification/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts +0 -1
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +15 -21
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.js +16 -3
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/utils.d.ts +0 -1
- package/dist/specification/src/sync/v4/import/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/utils.js +0 -1
- package/dist/specification/src/sync/v4/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts +141 -0
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/App.js +208 -0
- package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +193 -0
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +384 -0
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +172 -0
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +410 -0
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +70 -0
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/Page.js +73 -0
- package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.d.ts +9 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.js +43 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -0
- package/dist/specification/src/sync/v4/utils/utils.d.ts +105 -49
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +363 -97
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/types/src/apiTypes.d.ts +3 -2
- package/dist/types/src/apiTypes.d.ts.map +1 -1
- package/dist/types/src/apiTypes.js +1 -0
- package/dist/types/src/apiTypes.js.map +1 -1
- package/dist/types/src/common/types.d.ts +152 -3
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +47 -2
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/common/webapp/manifest/Manifest.d.ts +1 -1
- package/dist/types/src/common/webapp/manifest/Manifest.d.ts.map +1 -1
- package/dist/types/src/v2/application.d.ts +18 -0
- package/dist/types/src/v2/application.d.ts.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageHeaderSection.d.ts.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts +4 -4
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v2/controls/Table.d.ts.map +1 -1
- package/dist/types/src/v2/pages/ObjectPageConfigV2.d.ts +10 -1
- package/dist/types/src/v2/pages/ObjectPageConfigV2.d.ts.map +1 -1
- package/dist/types/src/v4/application.d.ts +6 -6
- package/dist/types/src/v4/controls/CustomAction.d.ts +133 -19
- package/dist/types/src/v4/controls/CustomAction.d.ts.map +1 -1
- package/dist/types/src/v4/controls/CustomAction.js.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageForm.d.ts +2 -2
- package/dist/types/src/v4/controls/ObjectPageForm.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageHeader.d.ts +22 -3
- package/dist/types/src/v4/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageHeaderSection.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageSection.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts +2 -2
- package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts.map +1 -1
- package/dist/types/src/v4/controls/ToolBar.d.ts +3 -3
- package/dist/types/src/v4/controls/ToolBar.d.ts.map +1 -1
- package/dist/types/src/v4/webapp/manifest/ManifestSettings.d.ts +59 -0
- package/dist/types/src/v4/webapp/manifest/ManifestSettings.d.ts.map +1 -1
- package/dist/types/src/v4/webapp/manifest/ManifestSettings.js.map +1 -1
- package/package.json +17 -17
|
@@ -4,7 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.addSelectionFields = addSelectionFields;
|
|
7
|
+
exports.getVisualFilters = getVisualFilters;
|
|
8
|
+
exports.addVisualFilters = addVisualFilters;
|
|
9
|
+
exports.applyCustomFilterFields = applyCustomFilterFields;
|
|
7
10
|
exports.analyzeViewAnnotation = analyzeViewAnnotation;
|
|
11
|
+
exports.addALPViews = addALPViews;
|
|
12
|
+
exports.applyLRSchemaAdjustments = applyLRSchemaAdjustments;
|
|
13
|
+
exports.addTagsToView = addTagsToView;
|
|
14
|
+
exports.addLRViewParts = addLRViewParts;
|
|
15
|
+
exports.getDefaultAnnotationPath = getDefaultAnnotationPath;
|
|
16
|
+
exports.addHeaderActions = addHeaderActions;
|
|
17
|
+
exports.addManifestPathsToPropertiesLR = addManifestPathsToPropertiesLR;
|
|
8
18
|
exports.generateListReportSchemaV4 = generateListReportSchemaV4;
|
|
9
19
|
const utils_1 = require("../utils/utils");
|
|
10
20
|
const utils_2 = require("../utils/utils");
|
|
@@ -12,6 +22,11 @@ const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
|
12
22
|
const i18next_1 = __importDefault(require("i18next"));
|
|
13
23
|
const extensionLogger_1 = require("../../../extensionLogger");
|
|
14
24
|
const common_1 = require("../../common");
|
|
25
|
+
const actions_1 = require("./actions");
|
|
26
|
+
const AppSchema_1 = require("../sync-rules/AppSchema");
|
|
27
|
+
const App_1 = require("../sync-rules/App");
|
|
28
|
+
const Page_1 = require("../sync-rules/Page");
|
|
29
|
+
const ListReportUtils_1 = require("./ListReportUtils");
|
|
15
30
|
const ROOT_PROPERTIES_ORDER = ['header', 'filterBar', 'chart', 'table'];
|
|
16
31
|
const UILINEITEM = '@UI.LineItem';
|
|
17
32
|
/**
|
|
@@ -167,38 +182,6 @@ function applyCustomFilterFields(appSchema, selectionFieldsDefinition, v4Page) {
|
|
|
167
182
|
});
|
|
168
183
|
}
|
|
169
184
|
}
|
|
170
|
-
/**
|
|
171
|
-
* Adds selection fields or compact/visual filters to filter bar.
|
|
172
|
-
*
|
|
173
|
-
* @param entityType - actual entity type (AVT information)
|
|
174
|
-
* @param appSchema - app-specific JSON schema
|
|
175
|
-
* @param v4Page - actual page in the manifest
|
|
176
|
-
* @param alias - the given alias or namespace of the OData annotations
|
|
177
|
-
*/
|
|
178
|
-
function addFilterBar(entityType, appSchema, v4Page, alias) {
|
|
179
|
-
const visualFilters = getVisualFilters(v4Page);
|
|
180
|
-
const selectionFields = alias && entityType?.annotations?.[alias]?.SelectionFields;
|
|
181
|
-
let selectionFieldsDefinition;
|
|
182
|
-
// Hide visualFilters/selectionFields depending on existing visual filters
|
|
183
|
-
if (visualFilters) {
|
|
184
|
-
appSchema.definitions[ux_specification_types_1.DefinitionName.SelectionFields][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
185
|
-
appSchema.definitions[ux_specification_types_1.DefinitionName.SelectionFields]['properties'] = {};
|
|
186
|
-
selectionFieldsDefinition = appSchema.definitions[ux_specification_types_1.DefinitionName.CompactFilters];
|
|
187
|
-
selectionFieldsDefinition.additionalProperties = false;
|
|
188
|
-
selectionFieldsDefinition.properties = {};
|
|
189
|
-
addVisualFilters(entityType, appSchema, visualFilters, selectionFields);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
const filterBar = appSchema.definitions[ux_specification_types_1.DefinitionName.FilterBar];
|
|
193
|
-
filterBar.properties['initialLayout'][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
194
|
-
filterBar.properties['layout'][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
195
|
-
appSchema.definitions[ux_specification_types_1.DefinitionName.CompactFilters][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
196
|
-
appSchema.definitions[ux_specification_types_1.DefinitionName.VisualFilters][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
197
|
-
}
|
|
198
|
-
selectionFieldsDefinition = addSelectionFields(entityType, appSchema, selectionFields, selectionFieldsDefinition);
|
|
199
|
-
// Apply custom filter fields
|
|
200
|
-
applyCustomFilterFields(appSchema, selectionFieldsDefinition, v4Page);
|
|
201
|
-
}
|
|
202
185
|
/**
|
|
203
186
|
*
|
|
204
187
|
* @param appSchema - The app JSON schema to be updated
|
|
@@ -406,7 +389,7 @@ function addALPChartView(appSchema, chartAnnotationPath, targetAnnotation, annot
|
|
|
406
389
|
}
|
|
407
390
|
else {
|
|
408
391
|
// Add message about unexisting annotation path
|
|
409
|
-
(0, common_1.addMessageToSchema)(chartView, i18next_1.default.t('UNEXISTING_ANNOTATION_PATH'));
|
|
392
|
+
(0, common_1.addMessageToSchema)(chartView, { text: i18next_1.default.t('UNEXISTING_ANNOTATION_PATH') });
|
|
410
393
|
}
|
|
411
394
|
}
|
|
412
395
|
chartView[ux_specification_types_1.SchemaTag.artifactType] = ux_specification_types_1.ArtifactType.Manifest;
|
|
@@ -484,29 +467,27 @@ function addALPViews(appSchema, viewsPaths, generateParameters, templateAnnotati
|
|
|
484
467
|
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTable][ux_specification_types_1.SchemaTag.annotationPath] = target;
|
|
485
468
|
}
|
|
486
469
|
const schemaAdjustmentParameters = {
|
|
487
|
-
generateParameters,
|
|
470
|
+
logger: generateParameters.logger,
|
|
488
471
|
appSchema,
|
|
489
472
|
v4Page,
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
dataForLineItem
|
|
473
|
+
tableDefinitionKey: ux_specification_types_1.DefinitionName.ALPTable,
|
|
474
|
+
facetDefinitionKey: ux_specification_types_1.DefinitionName.LineItems,
|
|
475
|
+
dataForLineItem,
|
|
476
|
+
customActionDefinitionName: ux_specification_types_1.DefinitionName.CustomTableAction,
|
|
477
|
+
sectionActionsDefinitionKey: `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(ux_specification_types_1.DefinitionName.LineItems)}>`
|
|
493
478
|
};
|
|
494
|
-
|
|
479
|
+
applyLRSchemaAdjustments(schemaAdjustmentParameters);
|
|
495
480
|
const pathParts = annotations[viewAnnotation].fullyQualifiedName.split('@');
|
|
496
481
|
tableView[ux_specification_types_1.SchemaTag.annotationPath] = `/${pathParts[0]}/@${pathParts[1]}`;
|
|
497
482
|
tableView[ux_specification_types_1.SchemaTag.key] = 'secondary';
|
|
498
483
|
tableView[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: 'secondary' }];
|
|
499
484
|
}
|
|
500
485
|
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger);
|
|
501
|
-
// Table toolbar actions with custom actions
|
|
502
|
-
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(ux_specification_types_1.DefinitionName.LineItems)}>`;
|
|
503
|
-
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, undefined, schemaIdForToolbarActions);
|
|
504
|
-
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForToolbarActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
505
486
|
// Add "manifestPath" for table properties
|
|
506
487
|
addManifestPathsToPropertiesLR(appSchema, ux_specification_types_1.DefinitionName.ALPTable, tableDefinition, {
|
|
507
488
|
pageName: v4Page.id,
|
|
508
489
|
manifest: generateParameters.manifest,
|
|
509
|
-
targetAnnotation
|
|
490
|
+
targetAnnotation: target
|
|
510
491
|
});
|
|
511
492
|
}
|
|
512
493
|
/**
|
|
@@ -545,18 +526,30 @@ function addViewChartDefinitions(inputParameters, annotations) {
|
|
|
545
526
|
* @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
|
|
546
527
|
* @param viewKey - view key
|
|
547
528
|
* @param title - view title
|
|
529
|
+
* @param page - Represents the page in the application's structure where the view line items are to be added.
|
|
548
530
|
*/
|
|
549
|
-
function addViewChart(inputParameters, UIAnnotations, appSchema, viewsDefinition, viewKey, title) {
|
|
531
|
+
function addViewChart(inputParameters, UIAnnotations, appSchema, viewsDefinition, viewKey, title, page) {
|
|
550
532
|
const idForChart = addViewChartDefinitions(inputParameters, UIAnnotations);
|
|
551
|
-
appSchema.definitions[idForChart]
|
|
552
|
-
|
|
553
|
-
|
|
533
|
+
const chartViewDefinition = appSchema.definitions[idForChart];
|
|
534
|
+
chartViewDefinition.properties.annotationPath[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
535
|
+
chartViewDefinition.properties.index[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
536
|
+
chartViewDefinition.properties.entitySet[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
554
537
|
const titleOnHover = `Chart View (key: ${viewKey})`;
|
|
555
538
|
viewsDefinition.properties[viewKey] = {
|
|
556
539
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${idForChart}`,
|
|
557
540
|
description: title ? title : titleOnHover,
|
|
558
541
|
title: titleOnHover
|
|
559
542
|
};
|
|
543
|
+
// Add "manifestPath" for table properties
|
|
544
|
+
addManifestPathsToPropertiesLR(inputParameters.appSchema, ux_specification_types_1.DefinitionName.LRChartView, chartViewDefinition, {
|
|
545
|
+
pageName: page.getPage().id,
|
|
546
|
+
manifest: page.getApp().manifest,
|
|
547
|
+
targetAnnotation: inputParameters.targetAnnotation,
|
|
548
|
+
viewConfig: {
|
|
549
|
+
key: viewKey,
|
|
550
|
+
entitySet: inputParameters.entitySet
|
|
551
|
+
}
|
|
552
|
+
});
|
|
560
553
|
}
|
|
561
554
|
/**
|
|
562
555
|
* Retrieves the line item reference for a specified view and entity type.
|
|
@@ -586,21 +579,19 @@ function getLineItemRef(v4Page, entityType, viewKey, lineItemTerm, lineItemQuali
|
|
|
586
579
|
*
|
|
587
580
|
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - An object containing parameters required for schema adjustments.
|
|
588
581
|
* It includes the application schema, table definition ID, facet definition ID, and the V4 page information.
|
|
589
|
-
* @returns {void} This function does not return any value.
|
|
590
582
|
*/
|
|
591
583
|
function adjustCreationFieldsDefinition(schemaAdjustmentParameters) {
|
|
592
|
-
const { appSchema,
|
|
584
|
+
const { entityType, appSchema, tableDefinitionKey, facetDefinitionKey, v4Page, viewKey } = schemaAdjustmentParameters;
|
|
593
585
|
// when the table view is created, the entity type may differ from the one used for the table
|
|
594
586
|
// schemaAdjustmentParameters contains the entity type used for the view
|
|
595
|
-
const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
|
|
596
587
|
const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term);
|
|
597
588
|
// set specific implementation for creation fields in the LR table
|
|
598
|
-
const creationModeDefinitionKey = (0, common_1.getFacetDefinitionKey)(ux_specification_types_1.DefinitionName.TableCreationModeLR,
|
|
599
|
-
const tableDefinition = appSchema.definitions[
|
|
589
|
+
const creationModeDefinitionKey = (0, common_1.getFacetDefinitionKey)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionKey);
|
|
590
|
+
const tableDefinition = appSchema.definitions[tableDefinitionKey];
|
|
600
591
|
const creationModeProperty = tableDefinition.properties[ux_specification_types_1.PropertyName.creationMode];
|
|
601
|
-
creationModeProperty.$ref = (0, common_1.getFacetDefinitionLink)(ux_specification_types_1.DefinitionName.TableCreationModeLR,
|
|
592
|
+
creationModeProperty.$ref = (0, common_1.getFacetDefinitionLink)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionKey);
|
|
602
593
|
const creationModeDefinition = appSchema.definitions[creationModeDefinitionKey] ??
|
|
603
|
-
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.TableCreationModeLR,
|
|
594
|
+
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionKey, appSchema);
|
|
604
595
|
const context = {
|
|
605
596
|
page: v4Page,
|
|
606
597
|
schema: creationModeDefinition,
|
|
@@ -622,21 +613,19 @@ function adjustCreationFieldsDefinition(schemaAdjustmentParameters) {
|
|
|
622
613
|
*
|
|
623
614
|
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - An object containing parameters required for schema adjustments.
|
|
624
615
|
* It includes the application schema, table definition ID, facet definition ID, and the V4 page information.
|
|
625
|
-
* @returns {void} This function does not return any value.
|
|
626
616
|
*/
|
|
627
617
|
function adjustAnalyticalConfiguration(schemaAdjustmentParameters) {
|
|
628
|
-
const { appSchema,
|
|
618
|
+
const { entityType, appSchema, tableDefinitionKey, facetDefinitionKey, v4Page, viewKey, dataForLineItem } = schemaAdjustmentParameters;
|
|
629
619
|
// when the table view is created, the entity type may differ from the one used for the table
|
|
630
620
|
// schemaAdjustmentParameters contains the entity type used for the view
|
|
631
|
-
const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
|
|
632
621
|
const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term, dataForLineItem.lineItemAnnotation?.qualifier);
|
|
633
622
|
// set specific implementation for analytical configuration in the LR table
|
|
634
|
-
const tableDefinition = appSchema.definitions[
|
|
623
|
+
const tableDefinition = appSchema.definitions[tableDefinitionKey];
|
|
635
624
|
const analyticalConfigurationDefinitionName = viewKey
|
|
636
625
|
? ux_specification_types_1.DefinitionName.ViewAnalyticalConfiguration
|
|
637
626
|
: ux_specification_types_1.DefinitionName.AnalyticalConfiguration;
|
|
638
627
|
const analyticalConfigurationDefinition = appSchema.definitions[analyticalConfigurationDefinitionName] ??
|
|
639
|
-
(0, common_1.parseSchemaDefinition)(analyticalConfigurationDefinitionName,
|
|
628
|
+
(0, common_1.parseSchemaDefinition)(analyticalConfigurationDefinitionName, facetDefinitionKey, appSchema);
|
|
640
629
|
const context = {
|
|
641
630
|
page: v4Page,
|
|
642
631
|
schema: analyticalConfigurationDefinition,
|
|
@@ -648,38 +637,67 @@ function adjustAnalyticalConfiguration(schemaAdjustmentParameters) {
|
|
|
648
637
|
// for the AnalyticalTable we set the analytical configuration property
|
|
649
638
|
common_1.manifestDrivenSchemaProcessor.apply(ux_specification_types_1.RuleName.LRAnalyticalConfigurationForNonAnalyticalTable, context);
|
|
650
639
|
}
|
|
640
|
+
/**
|
|
641
|
+
* Adjusts the schema definition related to the popin layout in the list report (LR) table.
|
|
642
|
+
* This function modifies the app schema to handle the popin layout and relevant settings for the table.
|
|
643
|
+
*
|
|
644
|
+
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - An object containing parameters required for schema adjustments.
|
|
645
|
+
* It includes the application schema, table definition ID, facet definition ID, and the V4 page information.
|
|
646
|
+
*/
|
|
647
|
+
function adjustPopinLayout(schemaAdjustmentParameters) {
|
|
648
|
+
const { entityType, appSchema, tableDefinitionKey, v4Page, viewKey, dataForLineItem } = schemaAdjustmentParameters;
|
|
649
|
+
// when the table view is created, the entity type may differ from the one used for the table
|
|
650
|
+
// schemaAdjustmentParameters contains the entity type used for the view
|
|
651
|
+
const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term, dataForLineItem.lineItemAnnotation?.qualifier);
|
|
652
|
+
// set specific implementation for popinLayout in the LR table
|
|
653
|
+
const tableDefinition = appSchema.definitions[tableDefinitionKey];
|
|
654
|
+
const popinLayoutDefinition = tableDefinition.properties['popinLayout'];
|
|
655
|
+
const context = {
|
|
656
|
+
page: v4Page,
|
|
657
|
+
schema: popinLayoutDefinition,
|
|
658
|
+
parameters: {
|
|
659
|
+
lineItemRef,
|
|
660
|
+
tableDefinition
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
// for the ResponsiveTable (default table type) we allow to set the popin layout property
|
|
664
|
+
common_1.manifestDrivenSchemaProcessor.apply(ux_specification_types_1.RuleName.LRPopinLayoutForNonResponsiveTable, context);
|
|
665
|
+
}
|
|
651
666
|
/**
|
|
652
667
|
* Adjusts the schema for a table by making necessary changes such as populating creation fields,
|
|
653
668
|
* adjusting creation field definitions, and adding enum mappings for mass edit functionalities.
|
|
654
669
|
*
|
|
655
670
|
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - Object containing the parameters required for schema adjustments. Includes the generate parameters, application schema, table definition ID, and facet definition ID.
|
|
656
|
-
* @returns {void} This function does not return a value; it performs in-place adjustments to the schema provided through the input parameters.
|
|
657
671
|
*/
|
|
658
|
-
function
|
|
659
|
-
const {
|
|
660
|
-
const { entityType } = generateParameters;
|
|
672
|
+
function applyLRSchemaAdjustments(schemaAdjustmentParameters) {
|
|
673
|
+
const { entityType, appSchema, tableDefinitionKey, facetDefinitionKey } = schemaAdjustmentParameters;
|
|
661
674
|
// in the future, all postgeneration adjustments for the LR Page should be done here
|
|
662
675
|
// populate the creation fields for the table with the data from the columns
|
|
663
|
-
(0, utils_1.initializeCreationModeSchema)(appSchema,
|
|
676
|
+
(0, utils_1.initializeCreationModeSchema)(appSchema, facetDefinitionKey, entityType, ux_specification_types_1.DefinitionName.TableCreationModeLR);
|
|
664
677
|
// remove unnecessary properties from the creation mode aggregation according to the table type
|
|
665
678
|
adjustCreationFieldsDefinition(schemaAdjustmentParameters);
|
|
666
679
|
// remove unnecessary properties from the analytical configuration aggregation according to the table type
|
|
667
680
|
adjustAnalyticalConfiguration(schemaAdjustmentParameters);
|
|
681
|
+
adjustPopinLayout(schemaAdjustmentParameters);
|
|
668
682
|
// add columns to a enum, in this case enableMassEdit -> visibleFields and ignoredFields
|
|
669
|
-
(0, utils_2.addEnumForEnableMassEdit)(appSchema,
|
|
683
|
+
(0, utils_2.addEnumForEnableMassEdit)(appSchema, tableDefinitionKey, facetDefinitionKey, entityType);
|
|
684
|
+
// add the custom action and custom action menu definition
|
|
685
|
+
(0, actions_1.configureCustomActionDefinition)(schemaAdjustmentParameters);
|
|
670
686
|
}
|
|
671
687
|
/**
|
|
672
688
|
* Modifies the app schema, adds the right line item settings as derived from the visualization.
|
|
673
689
|
*
|
|
674
|
-
* @param {ViewsParameters} inputParameters -
|
|
675
|
-
* @param {Definition} viewsDefinition - The
|
|
676
|
-
* @param {string} visualization - The visualization
|
|
677
|
-
* @param {string} templateAnnotation -
|
|
678
|
-
* @param
|
|
679
|
-
* @param
|
|
680
|
-
* @
|
|
690
|
+
* @param {ViewsParameters} inputParameters - Parameters containing details needed for the view line item addition, including the app schema, view key, and target annotation.
|
|
691
|
+
* @param {Definition} viewsDefinition - The definition object to which the view line items will be added.
|
|
692
|
+
* @param {string} visualization - The specific visualization type, typically used to determine the annotation term.
|
|
693
|
+
* @param {string} templateAnnotation - Annotation path or type related to the template.
|
|
694
|
+
* @param generateParameters - list of API input parameters
|
|
695
|
+
* @param generateParameters.serviceAVT - OData service AVT information
|
|
696
|
+
* @param generateParameters.entityType - entity type of the current page
|
|
697
|
+
* @param {Page} page - Represents the page in the application's structure where the view line items are to be added.
|
|
698
|
+
* @param {ExtensionLogger} logger - Logger for recording informational or error messages during the schema adjustment process.
|
|
681
699
|
*/
|
|
682
|
-
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation,
|
|
700
|
+
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, { serviceAVT, entityType }, page, logger) {
|
|
683
701
|
const tableId = `${ux_specification_types_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
|
|
684
702
|
const viewId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`;
|
|
685
703
|
const lrTableView = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.LRTableView, inputParameters.viewKey, inputParameters.appSchema);
|
|
@@ -709,26 +727,46 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
|
|
|
709
727
|
appSchema: inputParameters.appSchema,
|
|
710
728
|
lineItemAnnotation: inputParameters.targetEntityType?.annotations.UI[annotationTerm],
|
|
711
729
|
entityType: inputParameters.targetEntityType,
|
|
712
|
-
oDataServiceAVT:
|
|
730
|
+
oDataServiceAVT: serviceAVT,
|
|
713
731
|
lineItemId: viewId
|
|
714
732
|
};
|
|
715
733
|
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem, ux_specification_types_1.DefinitionName.ViewTableColumn, ux_specification_types_1.DefinitionName.ViewCustomColumn, ux_specification_types_1.DefinitionName.ViewCustomAction);
|
|
734
|
+
// Table toolbar actions with custom actions
|
|
735
|
+
const sectionIdPrefix = inputParameters.entitySet ? `/${inputParameters.entitySet}/` : '';
|
|
736
|
+
const sectionIdInManifest = `${sectionIdPrefix}@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}${visualization.split(ux_specification_types_1.Visualization.LineItem)[1]}`;
|
|
737
|
+
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${viewId}>`;
|
|
738
|
+
const customActionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomAction}<${viewId}>`;
|
|
739
|
+
// Anchor selection
|
|
740
|
+
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomActionPosition, viewId, inputParameters.appSchema);
|
|
741
|
+
const customActionPositionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomActionPosition}<${viewId}>`;
|
|
742
|
+
const customActionDefinition = inputParameters.appSchema.definitions[customActionDefinitionKey];
|
|
743
|
+
customActionDefinition.properties.position.$ref =
|
|
744
|
+
`${common_1.DEFINITION_LINK_PREFIX}${customActionPositionDefinitionKey}`;
|
|
716
745
|
const schemaAdjustmentParameters = {
|
|
717
|
-
|
|
746
|
+
logger: logger,
|
|
718
747
|
appSchema: inputParameters.appSchema,
|
|
719
|
-
v4Page,
|
|
720
|
-
|
|
721
|
-
|
|
748
|
+
v4Page: page.getPage(),
|
|
749
|
+
tableDefinitionKey: tableId,
|
|
750
|
+
facetDefinitionKey: viewId,
|
|
722
751
|
viewKey: inputParameters.viewKey,
|
|
723
|
-
entityType: inputParameters.targetEntityType,
|
|
724
|
-
dataForLineItem
|
|
752
|
+
entityType: inputParameters.targetEntityType || entityType,
|
|
753
|
+
dataForLineItem,
|
|
754
|
+
sectionActionsDefinitionKey: schemaIdForToolbarActions,
|
|
755
|
+
scopedCustomActionDefinitionKey: customActionDefinitionKey,
|
|
756
|
+
customActionDefinitionName: ux_specification_types_1.DefinitionName.ViewCustomAction,
|
|
757
|
+
sectionIdInManifest,
|
|
758
|
+
customActionPosition: customActionPositionDefinitionKey
|
|
725
759
|
};
|
|
726
|
-
|
|
760
|
+
applyLRSchemaAdjustments(schemaAdjustmentParameters);
|
|
727
761
|
// Add "manifestPath" for table properties
|
|
728
762
|
addManifestPathsToPropertiesLR(inputParameters.appSchema, ux_specification_types_1.DefinitionName.LRTableView, lrTableView, {
|
|
729
|
-
pageName:
|
|
730
|
-
manifest:
|
|
731
|
-
targetAnnotation: inputParameters.targetAnnotation
|
|
763
|
+
pageName: page.getPage().id,
|
|
764
|
+
manifest: page.getApp().manifest,
|
|
765
|
+
targetAnnotation: inputParameters.targetAnnotation,
|
|
766
|
+
viewConfig: {
|
|
767
|
+
key: inputParameters.viewKey,
|
|
768
|
+
entitySet: inputParameters.entitySet
|
|
769
|
+
}
|
|
732
770
|
});
|
|
733
771
|
}
|
|
734
772
|
/**
|
|
@@ -748,57 +786,27 @@ function addTagsToView(viewsDefinition, viewKey, namespace, view) {
|
|
|
748
786
|
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.key] = viewKey;
|
|
749
787
|
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: viewKey }];
|
|
750
788
|
}
|
|
751
|
-
/**
|
|
752
|
-
* Adjusts the entity type if a different entity set is maintained for a view.
|
|
753
|
-
*
|
|
754
|
-
* @param {EntitySet} entitySet - actual entity set (AVT information)
|
|
755
|
-
* @param view - the current view in manifest
|
|
756
|
-
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
757
|
-
* @returns the target entity type
|
|
758
|
-
*/
|
|
759
|
-
function getTargetEntityType(entitySet, view, generateParameters) {
|
|
760
|
-
let targetEntityType = generateParameters.entityType;
|
|
761
|
-
let viewEntitySet = entitySet;
|
|
762
|
-
if (view['entitySet'] && view['entitySet'] !== entitySet.name) {
|
|
763
|
-
viewEntitySet = generateParameters.serviceAVT?.entitySets.find((es) => {
|
|
764
|
-
return es.name === view['entitySet'];
|
|
765
|
-
});
|
|
766
|
-
targetEntityType = viewEntitySet.entityType;
|
|
767
|
-
}
|
|
768
|
-
return targetEntityType;
|
|
769
|
-
}
|
|
770
789
|
/**
|
|
771
790
|
* Adds view custom extensions - custom column and custom action definitions.
|
|
772
791
|
*
|
|
773
792
|
* @param commonInputParameters - list of input parameters as collected by the calling instance
|
|
774
|
-
* @param generateParameters - list of API input parameters
|
|
775
793
|
* @param visualization - visualization of the annotation
|
|
776
794
|
* @param v4Page - the given page in manifest
|
|
795
|
+
* @param logger - extension logger
|
|
777
796
|
*/
|
|
778
|
-
function addViewCustomExtensions(commonInputParameters,
|
|
797
|
+
function addViewCustomExtensions(commonInputParameters, visualization, v4Page, logger) {
|
|
779
798
|
const sectionId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${commonInputParameters.viewKey}`;
|
|
780
799
|
const sectionIdPrefix = commonInputParameters.entitySet ? `/${commonInputParameters.entitySet}/` : '';
|
|
781
800
|
const sectionIdInManifest = `${sectionIdPrefix}@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}${visualization.split(ux_specification_types_1.Visualization.LineItem)[1]}`;
|
|
782
801
|
const viewColumnDefinition = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomColumn, sectionId, commonInputParameters.appSchema);
|
|
783
802
|
(0, common_1.addDefinitionRef)(viewColumnDefinition.properties.position, ux_specification_types_1.DefinitionName.ViewPosition, sectionId);
|
|
784
803
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewPosition, sectionId, commonInputParameters.appSchema);
|
|
785
|
-
(0, utils_2.addCustomColumnDefinition)(commonInputParameters.appSchema, v4Page,
|
|
804
|
+
(0, utils_2.addCustomColumnDefinition)(commonInputParameters.appSchema, v4Page, logger, `${ux_specification_types_1.DefinitionName.ViewCustomColumn}<${sectionId}>`, sectionId, sectionIdInManifest);
|
|
786
805
|
(0, utils_2.addFragmentEnumForAnchor)(commonInputParameters.appSchema, sectionId, v4Page, `${ux_specification_types_1.DefinitionName.ViewPosition}<${sectionId}>`, sectionIdInManifest);
|
|
787
806
|
// Remove generic position
|
|
788
807
|
if (commonInputParameters.appSchema.definitions.Position) {
|
|
789
808
|
delete commonInputParameters.appSchema.definitions.Position;
|
|
790
809
|
}
|
|
791
|
-
// Table toolbar actions with custom actions
|
|
792
|
-
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${sectionId}>`;
|
|
793
|
-
const customActionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomAction}<${sectionId}>`;
|
|
794
|
-
(0, utils_2.addCustomActionDefinition)(commonInputParameters.appSchema, v4Page, generateParameters.logger, customActionDefinitionKey, schemaIdForToolbarActions, sectionIdInManifest);
|
|
795
|
-
// Anchor selection
|
|
796
|
-
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomActionPosition, sectionId, commonInputParameters.appSchema);
|
|
797
|
-
const customActionPositionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomActionPosition}<${sectionId}>`;
|
|
798
|
-
const customActionDefinition = commonInputParameters.appSchema.definitions[customActionDefinitionKey];
|
|
799
|
-
customActionDefinition.properties.position.$ref =
|
|
800
|
-
`${common_1.DEFINITION_LINK_PREFIX}${customActionPositionDefinitionKey}`;
|
|
801
|
-
(0, utils_2.addEnumForActionAnchor)(commonInputParameters.appSchema, schemaIdForToolbarActions, customActionPositionDefinitionKey);
|
|
802
810
|
}
|
|
803
811
|
/**
|
|
804
812
|
* Adds definition parts to a LR View (LineItem/Chart).
|
|
@@ -807,19 +815,22 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
|
|
|
807
815
|
* @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
|
|
808
816
|
* @param commonInputParameters - list of input parameters as collected by the calling instance
|
|
809
817
|
* @param generateParameters - list of API input parameters
|
|
810
|
-
* @param
|
|
818
|
+
* @param generateParameters.serviceAVT - OData service AVT information
|
|
819
|
+
* @param generateParameters.entityType - entity type of the current page
|
|
820
|
+
* @param generateParameters.logger - extension logger
|
|
821
|
+
* @param page - the current page object
|
|
811
822
|
* @param uiAnnotations - UI annotations of the given entityType
|
|
812
823
|
* @param view - the given view
|
|
813
824
|
*/
|
|
814
|
-
function addLRViewParts(visualization, viewsDefinition, commonInputParameters,
|
|
825
|
+
function addLRViewParts(visualization, viewsDefinition, commonInputParameters, { serviceAVT, entityType, logger }, page, uiAnnotations, view) {
|
|
815
826
|
if (visualization?.indexOf(ux_specification_types_1.Visualization.LineItem) > -1) {
|
|
816
827
|
//Add Line item view
|
|
817
|
-
addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation,
|
|
818
|
-
addViewCustomExtensions(commonInputParameters,
|
|
828
|
+
addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, { serviceAVT, entityType }, page, logger);
|
|
829
|
+
addViewCustomExtensions(commonInputParameters, visualization, page.getPage(), logger);
|
|
819
830
|
}
|
|
820
831
|
else if (visualization?.indexOf('Chart') > -1) {
|
|
821
832
|
//Add Chart view
|
|
822
|
-
addViewChart(commonInputParameters, uiAnnotations, commonInputParameters.appSchema, viewsDefinition, commonInputParameters.viewKey, commonInputParameters.title);
|
|
833
|
+
addViewChart(commonInputParameters, uiAnnotations, commonInputParameters.appSchema, viewsDefinition, commonInputParameters.viewKey, commonInputParameters.title, page);
|
|
823
834
|
}
|
|
824
835
|
else if (view['template']) {
|
|
825
836
|
const titleOnHover = view['label'] || `Custom View (key: ${commonInputParameters.viewKey})`;
|
|
@@ -840,161 +851,6 @@ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, g
|
|
|
840
851
|
};
|
|
841
852
|
}
|
|
842
853
|
}
|
|
843
|
-
/**
|
|
844
|
-
* Add list report views to the app-specific schema.
|
|
845
|
-
*
|
|
846
|
-
* @param appSchema - app-specific JSON schema
|
|
847
|
-
* @param viewsPaths - views' paths' section in the manifest
|
|
848
|
-
* @param generateParameters - list of API input parameters
|
|
849
|
-
* @param v4Page - the given page in manifest
|
|
850
|
-
* @param tableDefinitionName - The name of the table definition in the schema
|
|
851
|
-
*/
|
|
852
|
-
function addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefinitionName) {
|
|
853
|
-
const tableDefinition = appSchema.definitions[tableDefinitionName];
|
|
854
|
-
tableDefinition.properties = {
|
|
855
|
-
annotationPath: tableDefinition.properties.annotationPath,
|
|
856
|
-
initialLoad: tableDefinition.properties.initialLoad,
|
|
857
|
-
views: tableDefinition.properties.views
|
|
858
|
-
};
|
|
859
|
-
const viewsDefinition = appSchema.definitions.MultiTableModeV4;
|
|
860
|
-
for (const view of viewsPaths) {
|
|
861
|
-
if (!view[ux_specification_types_1.SchemaTag.key]) {
|
|
862
|
-
continue;
|
|
863
|
-
}
|
|
864
|
-
let navPropName = undefined;
|
|
865
|
-
const targetEntityType = getTargetEntityType(generateParameters.entitySet, view, generateParameters);
|
|
866
|
-
const uiAnnotations = targetEntityType?.annotations.UI;
|
|
867
|
-
const { visualization, targetAnnotation, namespace, title } = analyzeViewAnnotation(view?.[ux_specification_types_1.SchemaTag.annotationPath], uiAnnotations, generateParameters.serviceAVT, view[ux_specification_types_1.SchemaTag.key], undefined, generateParameters.logger);
|
|
868
|
-
if (view['entitySet']) {
|
|
869
|
-
navPropName = generateParameters.entityType.navigationProperties.find((np) => {
|
|
870
|
-
return np.targetTypeName === namespace;
|
|
871
|
-
})?.name;
|
|
872
|
-
}
|
|
873
|
-
const viewKey = (0, common_1.prepareRef)(view[ux_specification_types_1.SchemaTag.key]);
|
|
874
|
-
const commonInputParameters = {
|
|
875
|
-
viewKey,
|
|
876
|
-
appSchema,
|
|
877
|
-
targetAnnotation,
|
|
878
|
-
navPropName,
|
|
879
|
-
targetEntityType,
|
|
880
|
-
title,
|
|
881
|
-
entitySet: view['entitySet']
|
|
882
|
-
};
|
|
883
|
-
addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, v4Page, uiAnnotations, view);
|
|
884
|
-
addTagsToView(viewsDefinition, viewKey, namespace, view);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
/**
|
|
888
|
-
* Adapts the table definition in schema.
|
|
889
|
-
* Evaluates the path depending on if defaultTemplateAnnotationPath or Selection-/PresentationVariant is present.
|
|
890
|
-
*
|
|
891
|
-
* @param appSchema - the app-specific JSON schema
|
|
892
|
-
* @param generateParameters - list of API input parameters
|
|
893
|
-
* @param templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
|
|
894
|
-
* @param v4Page - the given page in manifest
|
|
895
|
-
* @param alias - alias definition for the UI vocabulary
|
|
896
|
-
* @param tableDefinitionName - The name of the table definition in the schema
|
|
897
|
-
*/
|
|
898
|
-
function adaptTableDefinition(appSchema, generateParameters, templateAnnotation, v4Page, alias, tableDefinitionName) {
|
|
899
|
-
//here: tableDefinitionName = DefinitionName.Table
|
|
900
|
-
const tableDefinition = appSchema.definitions[tableDefinitionName];
|
|
901
|
-
const { visualization, targetAnnotation, namespace } = analyzeViewAnnotation(templateAnnotation, generateParameters.entityType?.annotations.UI, generateParameters.serviceAVT, undefined, ux_specification_types_1.Visualization.LineItem, generateParameters.logger);
|
|
902
|
-
if (visualization) {
|
|
903
|
-
const annotationTerm = visualization.split('.')[1];
|
|
904
|
-
const annotationTermInSchema = `${ux_specification_types_1.DefinitionName.LineItems}OfSPV::${(0, common_1.prepareRef)(annotationTerm)}`;
|
|
905
|
-
const spvTable = (appSchema.definitions[`${tableDefinitionName}SPV`] = JSON.parse(JSON.stringify(appSchema.definitions[tableDefinitionName])));
|
|
906
|
-
delete spvTable[ux_specification_types_1.SchemaTag.isViewNode];
|
|
907
|
-
(0, common_1.addDefinitionRef)(spvTable.properties.toolBar, ux_specification_types_1.DefinitionName.ToolBar, annotationTermInSchema);
|
|
908
|
-
// Switch from generic column to specific definition
|
|
909
|
-
spvTable[ux_specification_types_1.SchemaTag.annotationPath] = targetAnnotation;
|
|
910
|
-
spvTable.properties.columns = {};
|
|
911
|
-
(0, common_1.addDefinitionRef)(spvTable.properties.columns, annotationTermInSchema);
|
|
912
|
-
delete tableDefinition.properties;
|
|
913
|
-
(0, common_1.addDefinitionRef)(tableDefinition, `${tableDefinitionName}SPV`);
|
|
914
|
-
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/@${templateAnnotation}`;
|
|
915
|
-
const lineItemAnnotation = generateParameters.entityType?.annotations.UI[annotationTerm];
|
|
916
|
-
if (!lineItemAnnotation) {
|
|
917
|
-
(0, extensionLogger_1.log)(generateParameters.logger, {
|
|
918
|
-
severity: "error" /* LogSeverity.Error */,
|
|
919
|
-
message: i18next_1.default.t('NOTARGET', { target: annotationTerm })
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
const dataForLineItem = {
|
|
923
|
-
isObjectPage: false,
|
|
924
|
-
appSchema,
|
|
925
|
-
lineItemAnnotation,
|
|
926
|
-
entityType: generateParameters.entityType,
|
|
927
|
-
oDataServiceAVT: generateParameters.serviceAVT,
|
|
928
|
-
lineItemId: annotationTermInSchema
|
|
929
|
-
};
|
|
930
|
-
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem);
|
|
931
|
-
const annotationTermQualifier = annotationTerm.split('#')?.[1];
|
|
932
|
-
const sectionIdInManifest = annotationTermQualifier
|
|
933
|
-
? `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}#${annotationTermQualifier}`
|
|
934
|
-
: `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
935
|
-
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger, undefined, annotationTermInSchema, sectionIdInManifest);
|
|
936
|
-
(0, utils_2.addFragmentEnumForAnchor)(appSchema, annotationTermInSchema, v4Page, undefined, sectionIdInManifest);
|
|
937
|
-
const schemaAdjustmentParameters = {
|
|
938
|
-
generateParameters,
|
|
939
|
-
appSchema,
|
|
940
|
-
v4Page,
|
|
941
|
-
tableDefinitionId: `${tableDefinitionName}SPV`,
|
|
942
|
-
facetDefinitionId: annotationTermInSchema,
|
|
943
|
-
dataForLineItem
|
|
944
|
-
};
|
|
945
|
-
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
946
|
-
// Table toolbar actions with custom actions
|
|
947
|
-
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${annotationTermInSchema}>`;
|
|
948
|
-
const customColumnDefinitionName = (0, common_1.getCustomExtensionDefinitionName)(appSchema, annotationTermInSchema, ux_specification_types_1.DefinitionName.CustomTableAction);
|
|
949
|
-
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, (0, common_1.getDefinitionKey)(customColumnDefinitionName), schemaIdForToolbarActions, sectionIdInManifest);
|
|
950
|
-
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForToolbarActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
951
|
-
}
|
|
952
|
-
else {
|
|
953
|
-
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ToolBarLR}`;
|
|
954
|
-
// Switch from generic column to specific definition
|
|
955
|
-
(0, common_1.addDefinitionRef)(tableDefinition.properties.columns, ux_specification_types_1.DefinitionName.LineItems);
|
|
956
|
-
const lineItemAnnotation = generateParameters.entityType?.annotations?.[alias]?.LineItem;
|
|
957
|
-
if (!lineItemAnnotation && !v4Page.options?.settings?.views?.paths) {
|
|
958
|
-
(0, extensionLogger_1.log)(generateParameters.logger, {
|
|
959
|
-
severity: "error" /* LogSeverity.Error */,
|
|
960
|
-
message: i18next_1.default.t('NOLINEITEMS')
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
const dataForLineItem = {
|
|
964
|
-
isObjectPage: false,
|
|
965
|
-
appSchema,
|
|
966
|
-
lineItemAnnotation,
|
|
967
|
-
entityType: generateParameters.entityType,
|
|
968
|
-
oDataServiceAVT: generateParameters.serviceAVT,
|
|
969
|
-
lineItemId: ux_specification_types_1.DefinitionName.LineItems
|
|
970
|
-
};
|
|
971
|
-
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem);
|
|
972
|
-
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger);
|
|
973
|
-
(0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
|
|
974
|
-
const schemaAdjustmentParameters = {
|
|
975
|
-
generateParameters,
|
|
976
|
-
appSchema,
|
|
977
|
-
v4Page,
|
|
978
|
-
tableDefinitionId: tableDefinitionName,
|
|
979
|
-
facetDefinitionId: ux_specification_types_1.DefinitionName.LineItems,
|
|
980
|
-
dataForLineItem
|
|
981
|
-
};
|
|
982
|
-
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
983
|
-
if (lineItemAnnotation && !v4Page.options?.settings?.views?.paths) {
|
|
984
|
-
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = (0, common_1.createAnnotationPath)(generateParameters.entityType?.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
|
|
985
|
-
}
|
|
986
|
-
// Table toolbar actions with custom actions
|
|
987
|
-
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(ux_specification_types_1.DefinitionName.LineItems)}>`;
|
|
988
|
-
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, undefined, schemaIdForActions);
|
|
989
|
-
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
990
|
-
}
|
|
991
|
-
// Add "manifestPath" for table properties
|
|
992
|
-
addManifestPathsToPropertiesLR(appSchema, tableDefinitionName, tableDefinition, {
|
|
993
|
-
pageName: v4Page.id,
|
|
994
|
-
manifest: generateParameters.manifest,
|
|
995
|
-
targetAnnotation
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
854
|
/**
|
|
999
855
|
* Checks for the default annotation path to use for LR table.
|
|
1000
856
|
*
|
|
@@ -1015,39 +871,6 @@ function getDefaultAnnotationPath(v4Page, entityType, templateType) {
|
|
|
1015
871
|
entityType?.annotations.UI?.PresentationVariant?.term);
|
|
1016
872
|
}
|
|
1017
873
|
}
|
|
1018
|
-
/**
|
|
1019
|
-
* Add views to schema (LR or ALP).
|
|
1020
|
-
*
|
|
1021
|
-
* @param appSchema - app-specific JSON schema
|
|
1022
|
-
* @param v4Page - actual page in the manifest
|
|
1023
|
-
* @param generateParameters - list of API input parameters
|
|
1024
|
-
* @param alias - The alias of the OData annotations
|
|
1025
|
-
*/
|
|
1026
|
-
function addTableAndViews(appSchema, v4Page, generateParameters, alias) {
|
|
1027
|
-
const viewsPaths = v4Page.options?.settings?.views?.paths;
|
|
1028
|
-
const entityType = generateParameters.entityType;
|
|
1029
|
-
const defaultAnnotation = getDefaultAnnotationPath(v4Page, generateParameters.entityType, generateParameters.templateType);
|
|
1030
|
-
const tableDefinitionName = (0, utils_2.alignSchemaWithTemplateType)(appSchema, generateParameters);
|
|
1031
|
-
// Add filter bar
|
|
1032
|
-
addFilterBar(entityType, appSchema, v4Page, alias);
|
|
1033
|
-
if (generateParameters.templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
1034
|
-
adaptTableDefinition(appSchema, generateParameters, defaultAnnotation, v4Page, alias, tableDefinitionName);
|
|
1035
|
-
if (viewsPaths) {
|
|
1036
|
-
delete appSchema.definitions['LineItems'];
|
|
1037
|
-
delete appSchema.definitions['ToolBar<LineItems>'];
|
|
1038
|
-
delete appSchema.definitions['Actions<LineItems>'];
|
|
1039
|
-
addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefinitionName);
|
|
1040
|
-
}
|
|
1041
|
-
else if (!v4Page.options?.settings?.views) {
|
|
1042
|
-
appSchema.definitions.MultiTableModeV4.properties = {};
|
|
1043
|
-
}
|
|
1044
|
-
appSchema.properties[ux_specification_types_1.PropertyName.chart][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
1045
|
-
}
|
|
1046
|
-
else if (generateParameters.templateType === ux_specification_types_1.TemplateType.AnalyticalListPageV4) {
|
|
1047
|
-
addALPViews(appSchema, viewsPaths, generateParameters, defaultAnnotation, v4Page, tableDefinitionName);
|
|
1048
|
-
(0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
874
|
/**
|
|
1052
875
|
* Adds header actions to schema (LR or ALP).
|
|
1053
876
|
*
|
|
@@ -1077,10 +900,10 @@ function addHeaderActions(appSchema, v4Page, logger) {
|
|
|
1077
900
|
/**
|
|
1078
901
|
* Adds 'manifestPath' to each property in a definition based on metadata sync rules.
|
|
1079
902
|
*
|
|
1080
|
-
* @param
|
|
1081
|
-
* @param
|
|
1082
|
-
* @param
|
|
1083
|
-
* @param
|
|
903
|
+
* @param appSchema - Full schema.
|
|
904
|
+
* @param definitionName - The name of the definition/class whose properties are being processed.
|
|
905
|
+
* @param definition - The definition object containing property schemas.
|
|
906
|
+
* @param pathParams - Additional context required to compute manifest paths.
|
|
1084
907
|
*/
|
|
1085
908
|
function addManifestPathsToPropertiesLR(appSchema, definitionName, definition, pathParams) {
|
|
1086
909
|
let targetAnnotation = undefined;
|
|
@@ -1092,16 +915,20 @@ function addManifestPathsToPropertiesLR(appSchema, definitionName, definition, p
|
|
|
1092
915
|
// Default annotation path
|
|
1093
916
|
targetAnnotation = `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
1094
917
|
}
|
|
918
|
+
const entitySet = pathParams.viewConfig?.entitySet;
|
|
919
|
+
if (entitySet) {
|
|
920
|
+
targetAnnotation = entitySet ? `/${entitySet}/${targetAnnotation}` : targetAnnotation;
|
|
921
|
+
}
|
|
1095
922
|
(0, utils_1.addManifestPathsToProperties)(appSchema, definitionName, definition, {
|
|
1096
923
|
...pathParams,
|
|
1097
|
-
pathsParts: [targetAnnotation, '', targetAnnotation]
|
|
924
|
+
pathsParts: [targetAnnotation, '', targetAnnotation, pathParams.viewConfig]
|
|
1098
925
|
});
|
|
1099
926
|
}
|
|
1100
927
|
/**
|
|
1101
928
|
* Adds 'manifestPath' to static nodes in schema.
|
|
1102
929
|
*
|
|
1103
|
-
* @param
|
|
1104
|
-
* @param
|
|
930
|
+
* @param appSchema - Full schema.
|
|
931
|
+
* @param pathParams - Additional context required to compute manifest paths.
|
|
1105
932
|
*/
|
|
1106
933
|
function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
1107
934
|
// Root level - rules stored on page class level
|
|
@@ -1115,6 +942,53 @@ function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
|
1115
942
|
}
|
|
1116
943
|
}
|
|
1117
944
|
}
|
|
945
|
+
/**
|
|
946
|
+
* Class to generate the List Report page schema.
|
|
947
|
+
*/
|
|
948
|
+
class ListReportPage {
|
|
949
|
+
/**
|
|
950
|
+
* Constructor for ListReportPage.
|
|
951
|
+
*
|
|
952
|
+
* @param generateParameters - parameters for generating the app schema
|
|
953
|
+
* @param schema - generic JSON schema of the List Report page
|
|
954
|
+
* @param templateName - name of the template
|
|
955
|
+
* @param contextPath - context path of the page
|
|
956
|
+
*/
|
|
957
|
+
constructor(generateParameters, schema, templateName, contextPath) {
|
|
958
|
+
this.schema = new AppSchema_1.AppSchema(schema);
|
|
959
|
+
this.app = (0, App_1.createApp)(generateParameters.manifest, generateParameters.serviceAVT, generateParameters.logger);
|
|
960
|
+
this.page = new Page_1.Page(this.app, { name: templateName, type: generateParameters.templateType }, generateParameters.entitySet, contextPath);
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Cleans up the schema by hiding specific properties and removing unnecessary definitions.
|
|
964
|
+
*/
|
|
965
|
+
cleanup() {
|
|
966
|
+
this.schema.hide(this.schema.getRootProperty([ux_specification_types_1.PropertyName.defaultTemplateAnnotationPath]));
|
|
967
|
+
this.schema.cleanup(['GenericColumns', 'Action']);
|
|
968
|
+
(0, common_1.updatePropertyIndices)(this.schema.getSchema(), ROOT_PROPERTIES_ORDER);
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Generates the finalized schema for the List Report page.
|
|
972
|
+
*
|
|
973
|
+
* @returns The finalized schema for List Report page
|
|
974
|
+
*/
|
|
975
|
+
generate() {
|
|
976
|
+
new ListReportUtils_1.GeneralListReportSettings(this.schema, this.page, this.app.getLogger()).instantiate();
|
|
977
|
+
if (!this.page.getPage()) {
|
|
978
|
+
return this.schema.finalize();
|
|
979
|
+
}
|
|
980
|
+
new ListReportUtils_1.Header(this.schema, this.page, this.app.getLogger()).instantiate();
|
|
981
|
+
new ListReportUtils_1.FilterBar(this.schema, this.page, this.app.getLogger()).instantiate();
|
|
982
|
+
new ListReportUtils_1.TableAndViews(this.schema, this.page, this.app.getLogger()).instantiate();
|
|
983
|
+
// Add "manifestPath" for properties in static nodes
|
|
984
|
+
addManifestPathsToStaticNodes(this.schema.getSchema(), {
|
|
985
|
+
pageName: this.page.getPage().id,
|
|
986
|
+
manifest: this.app.getManifest()
|
|
987
|
+
});
|
|
988
|
+
this.cleanup();
|
|
989
|
+
return this.schema.finalize();
|
|
990
|
+
}
|
|
991
|
+
}
|
|
1118
992
|
/**
|
|
1119
993
|
* Generates an app specific schema for the FE V4 ListReport from the generic schema.
|
|
1120
994
|
* Generic types are replaced by information from the app specific annotations.
|
|
@@ -1126,42 +1000,11 @@ function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
|
1126
1000
|
* @returns {object} application-specific schema of the list report
|
|
1127
1001
|
*/
|
|
1128
1002
|
function generateListReportSchemaV4(generateParameters, genericSchema, templateName, contextPath) {
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
//enum for annotation path as part of QuickVariantSelection
|
|
1134
|
-
(0, common_1.addEnumForSingleTabVariant)(entityType, appSchema, ux_specification_types_1.DefinitionName.AnnotationPathAsObject);
|
|
1135
|
-
if (generateParameters.manifest) {
|
|
1136
|
-
//Find page in targets
|
|
1137
|
-
const pages = generateParameters.manifest[ux_specification_types_1.ManifestSection.ui5].routing
|
|
1138
|
-
.targets;
|
|
1139
|
-
if (!pages) {
|
|
1140
|
-
(0, extensionLogger_1.log)(generateParameters.logger, {
|
|
1141
|
-
severity: "error" /* LogSeverity.Error */,
|
|
1142
|
-
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
1143
|
-
location: {
|
|
1144
|
-
path: ux_specification_types_1.MANIFESTPATH,
|
|
1145
|
-
range: [ux_specification_types_1.ManifestSection.generic]
|
|
1146
|
-
}
|
|
1147
|
-
});
|
|
1148
|
-
return appSchema;
|
|
1149
|
-
}
|
|
1150
|
-
const v4Page = (0, utils_2.findPageV4)(pages, templateName, generateParameters.entitySet, contextPath);
|
|
1151
|
-
if (!v4Page) {
|
|
1152
|
-
return appSchema;
|
|
1153
|
-
}
|
|
1154
|
-
addHeaderActions(appSchema, v4Page, generateParameters.logger);
|
|
1155
|
-
addTableAndViews(appSchema, v4Page, generateParameters, alias);
|
|
1156
|
-
// Add "manifestPath" for properties in static nodes
|
|
1157
|
-
addManifestPathsToStaticNodes(appSchema, {
|
|
1158
|
-
pageName: v4Page.id,
|
|
1159
|
-
manifest: generateParameters.manifest
|
|
1160
|
-
});
|
|
1003
|
+
const listReport = new ListReportPage(generateParameters, genericSchema, templateName, contextPath);
|
|
1004
|
+
if (!listReport.app.getManifest()) {
|
|
1005
|
+
listReport.cleanup();
|
|
1006
|
+
return listReport.schema.finalize();
|
|
1161
1007
|
}
|
|
1162
|
-
|
|
1163
|
-
delete appSchema.definitions.Action;
|
|
1164
|
-
(0, common_1.updatePropertyIndices)(appSchema, ROOT_PROPERTIES_ORDER);
|
|
1165
|
-
return appSchema;
|
|
1008
|
+
return listReport.generate();
|
|
1166
1009
|
}
|
|
1167
1010
|
//# sourceMappingURL=listReport.js.map
|