@sap/ux-specification 1.142.0 → 1.142.2
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 +71 -0
- 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 +261 -262
- 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 +84 -41
- package/dist/schemas/v4/ListReportConfig.json +358 -52
- package/dist/schemas/v4/ObjectPageConfig.json +511 -196
- 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/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 +9 -2
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +30 -18
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +5 -3
- 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.js +0 -1
- 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 -6
- 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 -44
- 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 +54 -11
- 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 +55 -12
- 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 +80 -23
- 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 +170 -356
- 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 +14 -20
- 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/DecoratorClass.js +2 -2
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/utils.js +2 -2
- package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts +105 -50
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +356 -117
- 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 +40 -1
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +39 -1
- 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/Action.d.ts +3 -2
- package/dist/types/src/v4/controls/Action.d.ts.map +1 -1
- 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 +10 -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
|
|
@@ -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,
|
|
@@ -654,16 +643,14 @@ function adjustAnalyticalConfiguration(schemaAdjustmentParameters) {
|
|
|
654
643
|
*
|
|
655
644
|
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - An object containing parameters required for schema adjustments.
|
|
656
645
|
* It includes the application schema, table definition ID, facet definition ID, and the V4 page information.
|
|
657
|
-
* @returns {void} This function does not return any value.
|
|
658
646
|
*/
|
|
659
647
|
function adjustPopinLayout(schemaAdjustmentParameters) {
|
|
660
|
-
const { appSchema,
|
|
648
|
+
const { entityType, appSchema, tableDefinitionKey, v4Page, viewKey, dataForLineItem } = schemaAdjustmentParameters;
|
|
661
649
|
// when the table view is created, the entity type may differ from the one used for the table
|
|
662
650
|
// schemaAdjustmentParameters contains the entity type used for the view
|
|
663
|
-
const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
|
|
664
651
|
const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term, dataForLineItem.lineItemAnnotation?.qualifier);
|
|
665
652
|
// set specific implementation for popinLayout in the LR table
|
|
666
|
-
const tableDefinition = appSchema.definitions[
|
|
653
|
+
const tableDefinition = appSchema.definitions[tableDefinitionKey];
|
|
667
654
|
const popinLayoutDefinition = tableDefinition.properties['popinLayout'];
|
|
668
655
|
const context = {
|
|
669
656
|
page: v4Page,
|
|
@@ -681,34 +668,36 @@ function adjustPopinLayout(schemaAdjustmentParameters) {
|
|
|
681
668
|
* adjusting creation field definitions, and adding enum mappings for mass edit functionalities.
|
|
682
669
|
*
|
|
683
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.
|
|
684
|
-
* @returns {void} This function does not return a value; it performs in-place adjustments to the schema provided through the input parameters.
|
|
685
671
|
*/
|
|
686
|
-
function
|
|
687
|
-
const {
|
|
688
|
-
const { entityType } = generateParameters;
|
|
672
|
+
function applyLRSchemaAdjustments(schemaAdjustmentParameters) {
|
|
673
|
+
const { entityType, appSchema, tableDefinitionKey, facetDefinitionKey } = schemaAdjustmentParameters;
|
|
689
674
|
// in the future, all postgeneration adjustments for the LR Page should be done here
|
|
690
675
|
// populate the creation fields for the table with the data from the columns
|
|
691
|
-
(0, utils_1.initializeCreationModeSchema)(appSchema,
|
|
676
|
+
(0, utils_1.initializeCreationModeSchema)(appSchema, facetDefinitionKey, entityType, ux_specification_types_1.DefinitionName.TableCreationModeLR);
|
|
692
677
|
// remove unnecessary properties from the creation mode aggregation according to the table type
|
|
693
678
|
adjustCreationFieldsDefinition(schemaAdjustmentParameters);
|
|
694
679
|
// remove unnecessary properties from the analytical configuration aggregation according to the table type
|
|
695
680
|
adjustAnalyticalConfiguration(schemaAdjustmentParameters);
|
|
696
681
|
adjustPopinLayout(schemaAdjustmentParameters);
|
|
697
682
|
// add columns to a enum, in this case enableMassEdit -> visibleFields and ignoredFields
|
|
698
|
-
(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);
|
|
699
686
|
}
|
|
700
687
|
/**
|
|
701
688
|
* Modifies the app schema, adds the right line item settings as derived from the visualization.
|
|
702
689
|
*
|
|
703
|
-
* @param {ViewsParameters} inputParameters -
|
|
704
|
-
* @param {Definition} viewsDefinition - The
|
|
705
|
-
* @param {string} visualization - The visualization
|
|
706
|
-
* @param {string} templateAnnotation -
|
|
707
|
-
* @param
|
|
708
|
-
* @param
|
|
709
|
-
* @
|
|
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.
|
|
710
699
|
*/
|
|
711
|
-
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation,
|
|
700
|
+
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, { serviceAVT, entityType }, page, logger) {
|
|
712
701
|
const tableId = `${ux_specification_types_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
|
|
713
702
|
const viewId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`;
|
|
714
703
|
const lrTableView = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.LRTableView, inputParameters.viewKey, inputParameters.appSchema);
|
|
@@ -738,26 +727,46 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
|
|
|
738
727
|
appSchema: inputParameters.appSchema,
|
|
739
728
|
lineItemAnnotation: inputParameters.targetEntityType?.annotations.UI[annotationTerm],
|
|
740
729
|
entityType: inputParameters.targetEntityType,
|
|
741
|
-
oDataServiceAVT:
|
|
730
|
+
oDataServiceAVT: serviceAVT,
|
|
742
731
|
lineItemId: viewId
|
|
743
732
|
};
|
|
744
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}`;
|
|
745
745
|
const schemaAdjustmentParameters = {
|
|
746
|
-
|
|
746
|
+
logger: logger,
|
|
747
747
|
appSchema: inputParameters.appSchema,
|
|
748
|
-
v4Page,
|
|
749
|
-
|
|
750
|
-
|
|
748
|
+
v4Page: page.getPage(),
|
|
749
|
+
tableDefinitionKey: tableId,
|
|
750
|
+
facetDefinitionKey: viewId,
|
|
751
751
|
viewKey: inputParameters.viewKey,
|
|
752
|
-
entityType: inputParameters.targetEntityType,
|
|
753
|
-
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
|
|
754
759
|
};
|
|
755
|
-
|
|
760
|
+
applyLRSchemaAdjustments(schemaAdjustmentParameters);
|
|
756
761
|
// Add "manifestPath" for table properties
|
|
757
762
|
addManifestPathsToPropertiesLR(inputParameters.appSchema, ux_specification_types_1.DefinitionName.LRTableView, lrTableView, {
|
|
758
|
-
pageName:
|
|
759
|
-
manifest:
|
|
760
|
-
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
|
+
}
|
|
761
770
|
});
|
|
762
771
|
}
|
|
763
772
|
/**
|
|
@@ -777,57 +786,27 @@ function addTagsToView(viewsDefinition, viewKey, namespace, view) {
|
|
|
777
786
|
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.key] = viewKey;
|
|
778
787
|
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: viewKey }];
|
|
779
788
|
}
|
|
780
|
-
/**
|
|
781
|
-
* Adjusts the entity type if a different entity set is maintained for a view.
|
|
782
|
-
*
|
|
783
|
-
* @param {EntitySet} entitySet - actual entity set (AVT information)
|
|
784
|
-
* @param view - the current view in manifest
|
|
785
|
-
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
786
|
-
* @returns the target entity type
|
|
787
|
-
*/
|
|
788
|
-
function getTargetEntityType(entitySet, view, generateParameters) {
|
|
789
|
-
let targetEntityType = generateParameters.entityType;
|
|
790
|
-
let viewEntitySet = entitySet;
|
|
791
|
-
if (view['entitySet'] && view['entitySet'] !== entitySet.name) {
|
|
792
|
-
viewEntitySet = generateParameters.serviceAVT?.entitySets.find((es) => {
|
|
793
|
-
return es.name === view['entitySet'];
|
|
794
|
-
});
|
|
795
|
-
targetEntityType = viewEntitySet.entityType;
|
|
796
|
-
}
|
|
797
|
-
return targetEntityType;
|
|
798
|
-
}
|
|
799
789
|
/**
|
|
800
790
|
* Adds view custom extensions - custom column and custom action definitions.
|
|
801
791
|
*
|
|
802
792
|
* @param commonInputParameters - list of input parameters as collected by the calling instance
|
|
803
|
-
* @param generateParameters - list of API input parameters
|
|
804
793
|
* @param visualization - visualization of the annotation
|
|
805
794
|
* @param v4Page - the given page in manifest
|
|
795
|
+
* @param logger - extension logger
|
|
806
796
|
*/
|
|
807
|
-
function addViewCustomExtensions(commonInputParameters,
|
|
797
|
+
function addViewCustomExtensions(commonInputParameters, visualization, v4Page, logger) {
|
|
808
798
|
const sectionId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${commonInputParameters.viewKey}`;
|
|
809
799
|
const sectionIdPrefix = commonInputParameters.entitySet ? `/${commonInputParameters.entitySet}/` : '';
|
|
810
800
|
const sectionIdInManifest = `${sectionIdPrefix}@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}${visualization.split(ux_specification_types_1.Visualization.LineItem)[1]}`;
|
|
811
801
|
const viewColumnDefinition = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomColumn, sectionId, commonInputParameters.appSchema);
|
|
812
802
|
(0, common_1.addDefinitionRef)(viewColumnDefinition.properties.position, ux_specification_types_1.DefinitionName.ViewPosition, sectionId);
|
|
813
803
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewPosition, sectionId, commonInputParameters.appSchema);
|
|
814
|
-
(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);
|
|
815
805
|
(0, utils_2.addFragmentEnumForAnchor)(commonInputParameters.appSchema, sectionId, v4Page, `${ux_specification_types_1.DefinitionName.ViewPosition}<${sectionId}>`, sectionIdInManifest);
|
|
816
806
|
// Remove generic position
|
|
817
807
|
if (commonInputParameters.appSchema.definitions.Position) {
|
|
818
808
|
delete commonInputParameters.appSchema.definitions.Position;
|
|
819
809
|
}
|
|
820
|
-
// Table toolbar actions with custom actions
|
|
821
|
-
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${sectionId}>`;
|
|
822
|
-
const customActionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomAction}<${sectionId}>`;
|
|
823
|
-
(0, utils_2.addCustomActionDefinition)(commonInputParameters.appSchema, v4Page, generateParameters.logger, customActionDefinitionKey, schemaIdForToolbarActions, sectionIdInManifest);
|
|
824
|
-
// Anchor selection
|
|
825
|
-
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomActionPosition, sectionId, commonInputParameters.appSchema);
|
|
826
|
-
const customActionPositionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomActionPosition}<${sectionId}>`;
|
|
827
|
-
const customActionDefinition = commonInputParameters.appSchema.definitions[customActionDefinitionKey];
|
|
828
|
-
customActionDefinition.properties.position.$ref =
|
|
829
|
-
`${common_1.DEFINITION_LINK_PREFIX}${customActionPositionDefinitionKey}`;
|
|
830
|
-
(0, utils_2.addEnumForActionAnchor)(commonInputParameters.appSchema, schemaIdForToolbarActions, customActionPositionDefinitionKey);
|
|
831
810
|
}
|
|
832
811
|
/**
|
|
833
812
|
* Adds definition parts to a LR View (LineItem/Chart).
|
|
@@ -836,19 +815,22 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
|
|
|
836
815
|
* @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
|
|
837
816
|
* @param commonInputParameters - list of input parameters as collected by the calling instance
|
|
838
817
|
* @param generateParameters - list of API input parameters
|
|
839
|
-
* @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
|
|
840
822
|
* @param uiAnnotations - UI annotations of the given entityType
|
|
841
823
|
* @param view - the given view
|
|
842
824
|
*/
|
|
843
|
-
function addLRViewParts(visualization, viewsDefinition, commonInputParameters,
|
|
825
|
+
function addLRViewParts(visualization, viewsDefinition, commonInputParameters, { serviceAVT, entityType, logger }, page, uiAnnotations, view) {
|
|
844
826
|
if (visualization?.indexOf(ux_specification_types_1.Visualization.LineItem) > -1) {
|
|
845
827
|
//Add Line item view
|
|
846
|
-
addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation,
|
|
847
|
-
addViewCustomExtensions(commonInputParameters,
|
|
828
|
+
addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, { serviceAVT, entityType }, page, logger);
|
|
829
|
+
addViewCustomExtensions(commonInputParameters, visualization, page.getPage(), logger);
|
|
848
830
|
}
|
|
849
831
|
else if (visualization?.indexOf('Chart') > -1) {
|
|
850
832
|
//Add Chart view
|
|
851
|
-
addViewChart(commonInputParameters, uiAnnotations, commonInputParameters.appSchema, viewsDefinition, commonInputParameters.viewKey, commonInputParameters.title);
|
|
833
|
+
addViewChart(commonInputParameters, uiAnnotations, commonInputParameters.appSchema, viewsDefinition, commonInputParameters.viewKey, commonInputParameters.title, page);
|
|
852
834
|
}
|
|
853
835
|
else if (view['template']) {
|
|
854
836
|
const titleOnHover = view['label'] || `Custom View (key: ${commonInputParameters.viewKey})`;
|
|
@@ -869,161 +851,6 @@ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, g
|
|
|
869
851
|
};
|
|
870
852
|
}
|
|
871
853
|
}
|
|
872
|
-
/**
|
|
873
|
-
* Add list report views to the app-specific schema.
|
|
874
|
-
*
|
|
875
|
-
* @param appSchema - app-specific JSON schema
|
|
876
|
-
* @param viewsPaths - views' paths' section in the manifest
|
|
877
|
-
* @param generateParameters - list of API input parameters
|
|
878
|
-
* @param v4Page - the given page in manifest
|
|
879
|
-
* @param tableDefinitionName - The name of the table definition in the schema
|
|
880
|
-
*/
|
|
881
|
-
function addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefinitionName) {
|
|
882
|
-
const tableDefinition = appSchema.definitions[tableDefinitionName];
|
|
883
|
-
tableDefinition.properties = {
|
|
884
|
-
annotationPath: tableDefinition.properties.annotationPath,
|
|
885
|
-
initialLoad: tableDefinition.properties.initialLoad,
|
|
886
|
-
views: tableDefinition.properties.views
|
|
887
|
-
};
|
|
888
|
-
const viewsDefinition = appSchema.definitions.MultiTableModeV4;
|
|
889
|
-
for (const view of viewsPaths) {
|
|
890
|
-
if (!view[ux_specification_types_1.SchemaTag.key]) {
|
|
891
|
-
continue;
|
|
892
|
-
}
|
|
893
|
-
let navPropName = undefined;
|
|
894
|
-
const targetEntityType = getTargetEntityType(generateParameters.entitySet, view, generateParameters);
|
|
895
|
-
const uiAnnotations = targetEntityType?.annotations.UI;
|
|
896
|
-
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);
|
|
897
|
-
if (view['entitySet']) {
|
|
898
|
-
navPropName = generateParameters.entityType.navigationProperties.find((np) => {
|
|
899
|
-
return np.targetTypeName === namespace;
|
|
900
|
-
})?.name;
|
|
901
|
-
}
|
|
902
|
-
const viewKey = (0, common_1.prepareRef)(view[ux_specification_types_1.SchemaTag.key]);
|
|
903
|
-
const commonInputParameters = {
|
|
904
|
-
viewKey,
|
|
905
|
-
appSchema,
|
|
906
|
-
targetAnnotation,
|
|
907
|
-
navPropName,
|
|
908
|
-
targetEntityType,
|
|
909
|
-
title,
|
|
910
|
-
entitySet: view['entitySet']
|
|
911
|
-
};
|
|
912
|
-
addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, v4Page, uiAnnotations, view);
|
|
913
|
-
addTagsToView(viewsDefinition, viewKey, namespace, view);
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
/**
|
|
917
|
-
* Adapts the table definition in schema.
|
|
918
|
-
* Evaluates the path depending on if defaultTemplateAnnotationPath or Selection-/PresentationVariant is present.
|
|
919
|
-
*
|
|
920
|
-
* @param appSchema - the app-specific JSON schema
|
|
921
|
-
* @param generateParameters - list of API input parameters
|
|
922
|
-
* @param templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
|
|
923
|
-
* @param v4Page - the given page in manifest
|
|
924
|
-
* @param alias - alias definition for the UI vocabulary
|
|
925
|
-
* @param tableDefinitionName - The name of the table definition in the schema
|
|
926
|
-
*/
|
|
927
|
-
function adaptTableDefinition(appSchema, generateParameters, templateAnnotation, v4Page, alias, tableDefinitionName) {
|
|
928
|
-
//here: tableDefinitionName = DefinitionName.Table
|
|
929
|
-
const tableDefinition = appSchema.definitions[tableDefinitionName];
|
|
930
|
-
const { visualization, targetAnnotation, namespace } = analyzeViewAnnotation(templateAnnotation, generateParameters.entityType?.annotations.UI, generateParameters.serviceAVT, undefined, ux_specification_types_1.Visualization.LineItem, generateParameters.logger);
|
|
931
|
-
if (visualization) {
|
|
932
|
-
const annotationTerm = visualization.split('.')[1];
|
|
933
|
-
const annotationTermInSchema = `${ux_specification_types_1.DefinitionName.LineItems}OfSPV::${(0, common_1.prepareRef)(annotationTerm)}`;
|
|
934
|
-
const spvTable = (appSchema.definitions[`${tableDefinitionName}SPV`] = JSON.parse(JSON.stringify(appSchema.definitions[tableDefinitionName])));
|
|
935
|
-
delete spvTable[ux_specification_types_1.SchemaTag.isViewNode];
|
|
936
|
-
(0, common_1.addDefinitionRef)(spvTable.properties.toolBar, ux_specification_types_1.DefinitionName.ToolBar, annotationTermInSchema);
|
|
937
|
-
// Switch from generic column to specific definition
|
|
938
|
-
spvTable[ux_specification_types_1.SchemaTag.annotationPath] = targetAnnotation;
|
|
939
|
-
spvTable.properties.columns = {};
|
|
940
|
-
(0, common_1.addDefinitionRef)(spvTable.properties.columns, annotationTermInSchema);
|
|
941
|
-
delete tableDefinition.properties;
|
|
942
|
-
(0, common_1.addDefinitionRef)(tableDefinition, `${tableDefinitionName}SPV`);
|
|
943
|
-
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/@${templateAnnotation}`;
|
|
944
|
-
const lineItemAnnotation = generateParameters.entityType?.annotations.UI[annotationTerm];
|
|
945
|
-
if (!lineItemAnnotation) {
|
|
946
|
-
(0, extensionLogger_1.log)(generateParameters.logger, {
|
|
947
|
-
severity: "error" /* LogSeverity.Error */,
|
|
948
|
-
message: i18next_1.default.t('NOTARGET', { target: annotationTerm })
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
const dataForLineItem = {
|
|
952
|
-
isObjectPage: false,
|
|
953
|
-
appSchema,
|
|
954
|
-
lineItemAnnotation,
|
|
955
|
-
entityType: generateParameters.entityType,
|
|
956
|
-
oDataServiceAVT: generateParameters.serviceAVT,
|
|
957
|
-
lineItemId: annotationTermInSchema
|
|
958
|
-
};
|
|
959
|
-
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem);
|
|
960
|
-
const annotationTermQualifier = annotationTerm.split('#')?.[1];
|
|
961
|
-
const sectionIdInManifest = annotationTermQualifier
|
|
962
|
-
? `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}#${annotationTermQualifier}`
|
|
963
|
-
: `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
964
|
-
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger, undefined, annotationTermInSchema, sectionIdInManifest);
|
|
965
|
-
(0, utils_2.addFragmentEnumForAnchor)(appSchema, annotationTermInSchema, v4Page, undefined, sectionIdInManifest);
|
|
966
|
-
const schemaAdjustmentParameters = {
|
|
967
|
-
generateParameters,
|
|
968
|
-
appSchema,
|
|
969
|
-
v4Page,
|
|
970
|
-
tableDefinitionId: `${tableDefinitionName}SPV`,
|
|
971
|
-
facetDefinitionId: annotationTermInSchema,
|
|
972
|
-
dataForLineItem
|
|
973
|
-
};
|
|
974
|
-
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
975
|
-
// Table toolbar actions with custom actions
|
|
976
|
-
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${annotationTermInSchema}>`;
|
|
977
|
-
const customColumnDefinitionName = (0, common_1.getCustomExtensionDefinitionName)(appSchema, annotationTermInSchema, ux_specification_types_1.DefinitionName.CustomTableAction);
|
|
978
|
-
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, (0, common_1.getDefinitionKey)(customColumnDefinitionName), schemaIdForToolbarActions, sectionIdInManifest);
|
|
979
|
-
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForToolbarActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
980
|
-
}
|
|
981
|
-
else {
|
|
982
|
-
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ToolBarLR}`;
|
|
983
|
-
// Switch from generic column to specific definition
|
|
984
|
-
(0, common_1.addDefinitionRef)(tableDefinition.properties.columns, ux_specification_types_1.DefinitionName.LineItems);
|
|
985
|
-
const lineItemAnnotation = generateParameters.entityType?.annotations?.[alias]?.LineItem;
|
|
986
|
-
if (!lineItemAnnotation && !v4Page.options?.settings?.views?.paths) {
|
|
987
|
-
(0, extensionLogger_1.log)(generateParameters.logger, {
|
|
988
|
-
severity: "error" /* LogSeverity.Error */,
|
|
989
|
-
message: i18next_1.default.t('NOLINEITEMS')
|
|
990
|
-
});
|
|
991
|
-
}
|
|
992
|
-
const dataForLineItem = {
|
|
993
|
-
isObjectPage: false,
|
|
994
|
-
appSchema,
|
|
995
|
-
lineItemAnnotation,
|
|
996
|
-
entityType: generateParameters.entityType,
|
|
997
|
-
oDataServiceAVT: generateParameters.serviceAVT,
|
|
998
|
-
lineItemId: ux_specification_types_1.DefinitionName.LineItems
|
|
999
|
-
};
|
|
1000
|
-
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem);
|
|
1001
|
-
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger);
|
|
1002
|
-
(0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
|
|
1003
|
-
const schemaAdjustmentParameters = {
|
|
1004
|
-
generateParameters,
|
|
1005
|
-
appSchema,
|
|
1006
|
-
v4Page,
|
|
1007
|
-
tableDefinitionId: tableDefinitionName,
|
|
1008
|
-
facetDefinitionId: ux_specification_types_1.DefinitionName.LineItems,
|
|
1009
|
-
dataForLineItem
|
|
1010
|
-
};
|
|
1011
|
-
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
1012
|
-
if (lineItemAnnotation && !v4Page.options?.settings?.views?.paths) {
|
|
1013
|
-
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = (0, common_1.createAnnotationPath)(generateParameters.entityType?.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
|
|
1014
|
-
}
|
|
1015
|
-
// Table toolbar actions with custom actions
|
|
1016
|
-
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(ux_specification_types_1.DefinitionName.LineItems)}>`;
|
|
1017
|
-
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, undefined, schemaIdForActions);
|
|
1018
|
-
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
1019
|
-
}
|
|
1020
|
-
// Add "manifestPath" for table properties
|
|
1021
|
-
addManifestPathsToPropertiesLR(appSchema, tableDefinitionName, tableDefinition, {
|
|
1022
|
-
pageName: v4Page.id,
|
|
1023
|
-
manifest: generateParameters.manifest,
|
|
1024
|
-
targetAnnotation
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
854
|
/**
|
|
1028
855
|
* Checks for the default annotation path to use for LR table.
|
|
1029
856
|
*
|
|
@@ -1044,39 +871,6 @@ function getDefaultAnnotationPath(v4Page, entityType, templateType) {
|
|
|
1044
871
|
entityType?.annotations.UI?.PresentationVariant?.term);
|
|
1045
872
|
}
|
|
1046
873
|
}
|
|
1047
|
-
/**
|
|
1048
|
-
* Add views to schema (LR or ALP).
|
|
1049
|
-
*
|
|
1050
|
-
* @param appSchema - app-specific JSON schema
|
|
1051
|
-
* @param v4Page - actual page in the manifest
|
|
1052
|
-
* @param generateParameters - list of API input parameters
|
|
1053
|
-
* @param alias - The alias of the OData annotations
|
|
1054
|
-
*/
|
|
1055
|
-
function addTableAndViews(appSchema, v4Page, generateParameters, alias) {
|
|
1056
|
-
const viewsPaths = v4Page.options?.settings?.views?.paths;
|
|
1057
|
-
const entityType = generateParameters.entityType;
|
|
1058
|
-
const defaultAnnotation = getDefaultAnnotationPath(v4Page, generateParameters.entityType, generateParameters.templateType);
|
|
1059
|
-
const tableDefinitionName = (0, utils_2.alignSchemaWithTemplateType)(appSchema, generateParameters);
|
|
1060
|
-
// Add filter bar
|
|
1061
|
-
addFilterBar(entityType, appSchema, v4Page, alias);
|
|
1062
|
-
if (generateParameters.templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
1063
|
-
adaptTableDefinition(appSchema, generateParameters, defaultAnnotation, v4Page, alias, tableDefinitionName);
|
|
1064
|
-
if (viewsPaths) {
|
|
1065
|
-
delete appSchema.definitions['LineItems'];
|
|
1066
|
-
delete appSchema.definitions['ToolBar<LineItems>'];
|
|
1067
|
-
delete appSchema.definitions['Actions<LineItems>'];
|
|
1068
|
-
addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefinitionName);
|
|
1069
|
-
}
|
|
1070
|
-
else if (!v4Page.options?.settings?.views) {
|
|
1071
|
-
appSchema.definitions.MultiTableModeV4.properties = {};
|
|
1072
|
-
}
|
|
1073
|
-
appSchema.properties[ux_specification_types_1.PropertyName.chart][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
1074
|
-
}
|
|
1075
|
-
else if (generateParameters.templateType === ux_specification_types_1.TemplateType.AnalyticalListPageV4) {
|
|
1076
|
-
addALPViews(appSchema, viewsPaths, generateParameters, defaultAnnotation, v4Page, tableDefinitionName);
|
|
1077
|
-
(0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
874
|
/**
|
|
1081
875
|
* Adds header actions to schema (LR or ALP).
|
|
1082
876
|
*
|
|
@@ -1106,10 +900,10 @@ function addHeaderActions(appSchema, v4Page, logger) {
|
|
|
1106
900
|
/**
|
|
1107
901
|
* Adds 'manifestPath' to each property in a definition based on metadata sync rules.
|
|
1108
902
|
*
|
|
1109
|
-
* @param
|
|
1110
|
-
* @param
|
|
1111
|
-
* @param
|
|
1112
|
-
* @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.
|
|
1113
907
|
*/
|
|
1114
908
|
function addManifestPathsToPropertiesLR(appSchema, definitionName, definition, pathParams) {
|
|
1115
909
|
let targetAnnotation = undefined;
|
|
@@ -1121,16 +915,20 @@ function addManifestPathsToPropertiesLR(appSchema, definitionName, definition, p
|
|
|
1121
915
|
// Default annotation path
|
|
1122
916
|
targetAnnotation = `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
1123
917
|
}
|
|
918
|
+
const entitySet = pathParams.viewConfig?.entitySet;
|
|
919
|
+
if (entitySet) {
|
|
920
|
+
targetAnnotation = entitySet ? `/${entitySet}/${targetAnnotation}` : targetAnnotation;
|
|
921
|
+
}
|
|
1124
922
|
(0, utils_1.addManifestPathsToProperties)(appSchema, definitionName, definition, {
|
|
1125
923
|
...pathParams,
|
|
1126
|
-
pathsParts: [targetAnnotation, '', targetAnnotation]
|
|
924
|
+
pathsParts: [targetAnnotation, '', targetAnnotation, pathParams.viewConfig]
|
|
1127
925
|
});
|
|
1128
926
|
}
|
|
1129
927
|
/**
|
|
1130
928
|
* Adds 'manifestPath' to static nodes in schema.
|
|
1131
929
|
*
|
|
1132
|
-
* @param
|
|
1133
|
-
* @param
|
|
930
|
+
* @param appSchema - Full schema.
|
|
931
|
+
* @param pathParams - Additional context required to compute manifest paths.
|
|
1134
932
|
*/
|
|
1135
933
|
function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
1136
934
|
// Root level - rules stored on page class level
|
|
@@ -1144,6 +942,53 @@ function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
|
1144
942
|
}
|
|
1145
943
|
}
|
|
1146
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
|
+
}
|
|
1147
992
|
/**
|
|
1148
993
|
* Generates an app specific schema for the FE V4 ListReport from the generic schema.
|
|
1149
994
|
* Generic types are replaced by information from the app specific annotations.
|
|
@@ -1155,42 +1000,11 @@ function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
|
1155
1000
|
* @returns {object} application-specific schema of the list report
|
|
1156
1001
|
*/
|
|
1157
1002
|
function generateListReportSchemaV4(generateParameters, genericSchema, templateName, contextPath) {
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
//enum for annotation path as part of QuickVariantSelection
|
|
1163
|
-
(0, common_1.addEnumForSingleTabVariant)(entityType, appSchema, ux_specification_types_1.DefinitionName.AnnotationPathAsObject);
|
|
1164
|
-
if (generateParameters.manifest) {
|
|
1165
|
-
//Find page in targets
|
|
1166
|
-
const pages = generateParameters.manifest[ux_specification_types_1.ManifestSection.ui5].routing
|
|
1167
|
-
.targets;
|
|
1168
|
-
if (!pages) {
|
|
1169
|
-
(0, extensionLogger_1.log)(generateParameters.logger, {
|
|
1170
|
-
severity: "error" /* LogSeverity.Error */,
|
|
1171
|
-
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
1172
|
-
location: {
|
|
1173
|
-
path: ux_specification_types_1.MANIFESTPATH,
|
|
1174
|
-
range: [ux_specification_types_1.ManifestSection.generic]
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
return appSchema;
|
|
1178
|
-
}
|
|
1179
|
-
const v4Page = (0, utils_2.findPageV4)(pages, templateName, generateParameters.entitySet, contextPath);
|
|
1180
|
-
if (!v4Page) {
|
|
1181
|
-
return appSchema;
|
|
1182
|
-
}
|
|
1183
|
-
addHeaderActions(appSchema, v4Page, generateParameters.logger);
|
|
1184
|
-
addTableAndViews(appSchema, v4Page, generateParameters, alias);
|
|
1185
|
-
// Add "manifestPath" for properties in static nodes
|
|
1186
|
-
addManifestPathsToStaticNodes(appSchema, {
|
|
1187
|
-
pageName: v4Page.id,
|
|
1188
|
-
manifest: generateParameters.manifest
|
|
1189
|
-
});
|
|
1003
|
+
const listReport = new ListReportPage(generateParameters, genericSchema, templateName, contextPath);
|
|
1004
|
+
if (!listReport.app.getManifest()) {
|
|
1005
|
+
listReport.cleanup();
|
|
1006
|
+
return listReport.schema.finalize();
|
|
1190
1007
|
}
|
|
1191
|
-
|
|
1192
|
-
delete appSchema.definitions.Action;
|
|
1193
|
-
(0, common_1.updatePropertyIndices)(appSchema, ROOT_PROPERTIES_ORDER);
|
|
1194
|
-
return appSchema;
|
|
1008
|
+
return listReport.generate();
|
|
1195
1009
|
}
|
|
1196
1010
|
//# sourceMappingURL=listReport.js.map
|