@sap/ux-specification 1.96.21 → 1.96.24
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/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
- package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
- package/dist/documentation/v2/v2-ListReport.html +1 -1
- package/dist/documentation/v2/v2-ObjectPage.html +1 -1
- package/dist/documentation/v2/v2-OverviewPage.html +1 -1
- package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
- package/dist/documentation/v4/v4-FreestylePage.html +1 -1
- package/dist/documentation/v4/v4-ListReport.html +1 -1
- package/dist/documentation/v4/v4-ObjectPage.html +1 -1
- package/dist/index-min.js +35 -35
- package/dist/index-min.js.map +3 -3
- package/dist/schemas/v4/ApplicationV4.json +26 -0
- package/dist/schemas/v4/ListReportConfig.json +20 -20
- package/dist/scripts/extractDocu.js +15 -3
- package/dist/scripts/extractDocu.js.map +1 -1
- package/dist/scripts/spec.js +1 -2
- package/dist/scripts/spec.js.map +1 -1
- package/dist/scripts/to-json-schema.js +17 -3
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/src/api.js +4 -3
- package/dist/src/api.js.map +1 -1
- package/dist/src/apiTypes.d.ts +4 -3
- package/dist/src/apiTypes.d.ts.map +1 -1
- package/dist/src/apiTypes.js +5 -2
- package/dist/src/apiTypes.js.map +1 -1
- package/dist/src/extensionLogger.d.ts +1 -1
- package/dist/src/extensionLogger.d.ts.map +1 -1
- package/dist/src/extensionLogger.js +3 -1
- package/dist/src/extensionLogger.js.map +1 -1
- package/dist/src/i18n/i18n.js +1 -0
- package/dist/src/i18n/i18n.js.map +1 -1
- package/dist/src/index.js +17 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/project.d.ts.map +1 -1
- package/dist/src/project.js +14 -10
- package/dist/src/project.js.map +1 -1
- package/dist/src/specification/schemaAccess.d.ts +1 -1
- package/dist/src/specification/schemaAccess.d.ts.map +1 -1
- package/dist/src/specification/schemaAccess.js +5 -2
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/sync/common/appProvider.d.ts +2 -2
- package/dist/src/sync/common/appProvider.d.ts.map +1 -1
- package/dist/src/sync/common/appProvider.js +18 -27
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/decoration/control.d.ts +2 -2
- package/dist/src/sync/common/decoration/control.d.ts.map +1 -1
- package/dist/src/sync/common/decoration/control.js +15 -7
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/src/sync/common/decoration/decorators.js +13 -6
- package/dist/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/src/sync/common/decoration/factory.js +1 -0
- package/dist/src/sync/common/decoration/factory.js.map +1 -1
- package/dist/src/sync/common/decoration/flex.js +1 -0
- package/dist/src/sync/common/decoration/flex.js.map +1 -1
- package/dist/src/sync/common/decoration/index.js +13 -6
- package/dist/src/sync/common/decoration/index.js.map +1 -1
- package/dist/src/sync/common/flexUtils.js +15 -2
- package/dist/src/sync/common/flexUtils.js.map +1 -1
- package/dist/src/sync/common/generate/index.js +12 -5
- package/dist/src/sync/common/generate/index.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +9 -7
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.js +15 -12
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/import/utils.js +1 -0
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/src/sync/common/importProject.js +21 -24
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/index.js +19 -11
- package/dist/src/sync/common/index.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +1 -1
- package/dist/src/sync/common/types.d.ts.map +1 -1
- package/dist/src/sync/common/types.js +1 -0
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +3 -3
- package/dist/src/sync/common/utils.d.ts.map +1 -1
- package/dist/src/sync/common/utils.js +97 -78
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/i18n.js +15 -2
- package/dist/src/sync/i18n.js.map +1 -1
- package/dist/src/sync/v2/application.d.ts.map +1 -1
- package/dist/src/sync/v2/application.js +33 -16
- package/dist/src/sync/v2/application.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.js +3 -1
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +3 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js +1 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Card.js +1 -0
- package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Field.js +1 -0
- package/dist/src/sync/v2/export/controls/Field.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.js +8 -2
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.js +1 -0
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +8 -8
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +11 -5
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.js +9 -9
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.js +9 -2
- package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ToolBar.js +1 -0
- package/dist/src/sync/v2/export/controls/ToolBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/index.js +30 -23
- package/dist/src/sync/v2/export/controls/index.js.map +1 -1
- package/dist/src/sync/v2/export/export.js +13 -16
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +3 -3
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/factory.js +15 -2
- package/dist/src/sync/v2/export/factory.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts.map +1 -1
- package/dist/src/sync/v2/export/manifest.js +7 -3
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +1 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ListReport.js +1 -0
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ObjectPage.js +1 -0
- package/dist/src/sync/v2/export/pages/ObjectPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.js +1 -0
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/index.js +14 -7
- package/dist/src/sync/v2/export/pages/index.js.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.js +17 -8
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +5 -5
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/generate.js +1 -0
- package/dist/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/src/sync/v2/generate/index.js +8 -7
- package/dist/src/sync/v2/generate/index.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/listReport.js +29 -32
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +8 -6
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/overviewPage.js +1 -0
- package/dist/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.js +17 -8
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.js +7 -1
- package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.js +1 -0
- package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.js +24 -17
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/controls/table.js +2 -1
- package/dist/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/src/sync/v2/import/index.js +15 -8
- package/dist/src/sync/v2/import/index.js.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +1 -0
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.js +5 -1
- package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +36 -36
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/overviewPage.js +2 -1
- package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.js +5 -7
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v2/types.js +1 -0
- package/dist/src/sync/v2/types.js.map +1 -1
- package/dist/src/sync/v4/application.d.ts +2 -2
- package/dist/src/sync/v4/application.d.ts.map +1 -1
- package/dist/src/sync/v4/application.js +44 -37
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/controls/FilterBar.js +1 -0
- package/dist/src/sync/v4/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.js +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.d.ts +25 -10
- package/dist/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.js +132 -69
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v4/export/controls/TableColumn.js +1 -0
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ToolBar.js +1 -0
- package/dist/src/sync/v4/export/controls/ToolBar.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ToolBarAction.js +1 -0
- package/dist/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
- package/dist/src/sync/v4/export/controls/index.js +22 -15
- package/dist/src/sync/v4/export/controls/index.js.map +1 -1
- package/dist/src/sync/v4/export/export.d.ts +3 -2
- package/dist/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/src/sync/v4/export/export.js +45 -37
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/exportCustomColumn.js +11 -1
- package/dist/src/sync/v4/export/exportCustomColumn.js.map +1 -1
- package/dist/src/sync/v4/export/factory.js +15 -2
- package/dist/src/sync/v4/export/factory.js.map +1 -1
- package/dist/src/sync/v4/export/flexibleColumnLayout.d.ts.map +1 -1
- package/dist/src/sync/v4/export/flexibleColumnLayout.js +8 -7
- package/dist/src/sync/v4/export/flexibleColumnLayout.js.map +1 -1
- package/dist/src/sync/v4/export/manifest.d.ts.map +1 -1
- package/dist/src/sync/v4/export/manifest.js +89 -44
- package/dist/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/src/sync/v4/export/pages/FreestylePage.js +1 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.js.map +1 -1
- package/dist/src/sync/v4/export/pages/ListReport.js +2 -2
- package/dist/src/sync/v4/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v4/export/pages/ObjectPage.js +1 -0
- package/dist/src/sync/v4/export/pages/ObjectPage.js.map +1 -1
- package/dist/src/sync/v4/export/pages/index.js +13 -6
- package/dist/src/sync/v4/export/pages/index.js.map +1 -1
- package/dist/src/sync/v4/export/utils.js +1 -0
- package/dist/src/sync/v4/export/utils.js.map +1 -1
- package/dist/src/sync/v4/generate/freestylePage.js +1 -0
- package/dist/src/sync/v4/generate/freestylePage.js.map +1 -1
- package/dist/src/sync/v4/generate/generate.js +1 -0
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/index.js +7 -6
- package/dist/src/sync/v4/generate/index.js.map +1 -1
- package/dist/src/sync/v4/generate/listReport.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/listReport.js +65 -33
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +20 -10
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +1 -0
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.js +51 -23
- package/dist/src/sync/v4/import/app/baseAppProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/freestyleProvider.js +1 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/index.js +7 -6
- package/dist/src/sync/v4/import/app/index.js.map +1 -1
- package/dist/src/sync/v4/import/fragment.js +8 -10
- package/dist/src/sync/v4/import/fragment.js.map +1 -1
- package/dist/src/sync/v4/import/index.js +12 -5
- package/dist/src/sync/v4/import/index.js.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.js +5 -5
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.js +9 -11
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.js +3 -2
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/src/sync/v4/sync-rules/controllerExtensions.d.ts +9 -0
- package/dist/src/sync/v4/sync-rules/controllerExtensions.d.ts.map +1 -0
- package/dist/src/sync/v4/sync-rules/controllerExtensions.js +104 -0
- package/dist/src/sync/v4/sync-rules/controllerExtensions.js.map +1 -0
- package/dist/src/sync/v4/utils/StableIdHelper.d.ts +1 -1
- package/dist/src/sync/v4/utils/StableIdHelper.d.ts.map +1 -1
- package/dist/src/sync/v4/utils/StableIdHelper.js +13 -24
- package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +16 -18
- package/dist/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/src/sync/v4/utils/utils.js +41 -51
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { v4 } from '@sap/ux-specification-types';
|
|
2
|
+
export declare const controllerExtensions: {
|
|
3
|
+
manifest: {
|
|
4
|
+
path: () => string;
|
|
5
|
+
import: (extensions: v4.SapUi5ControllerExtensionsV4) => v4.ControllerExtensions | undefined;
|
|
6
|
+
export: (manifestSection: v4.SapUi5ControllerExtensionsV4, configObject: v4.ApplicationV4, key: string) => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=controllerExtensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controllerExtensions.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v4/sync-rules/controllerExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAsE3D,eAAO,MAAM,oBAAoB;;oBAEf,MAAM;6BACK,GAAG,4BAA4B,KAAG,GAAG,oBAAoB,GAAG,SAAS;kCAcrE,GAAG,4BAA4B,gBAClC,GAAG,aAAa,OACzB,MAAM,KACZ,IAAI;;CAoBd,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.controllerExtensions = void 0;
|
|
4
|
+
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
5
|
+
const PAGE_TYPE_TO_CONTROLLER_EXTENSION_MAP = new Map([
|
|
6
|
+
[ux_specification_types_1.PageType.ListReport, ux_specification_types_1.v4.SAPUI5_VIEW_EXTENSION_LIST_REPORT],
|
|
7
|
+
[ux_specification_types_1.PageType.ObjectPage, ux_specification_types_1.v4.SAPUI5_VIEW_EXTENSION_OBJECT_PAGE]
|
|
8
|
+
]);
|
|
9
|
+
/**
|
|
10
|
+
* Method transfers values of 'controllerNames' and 'controllerName' from source to target.
|
|
11
|
+
* Method can be uses in both ways - import or export.
|
|
12
|
+
* @param {SapUi5ControllerExtensionV4} source - source object
|
|
13
|
+
* @param {SapUi5ControllerExtensionV4} target - target object
|
|
14
|
+
*/
|
|
15
|
+
const applyControllerNameProperties = (source, target) => {
|
|
16
|
+
const properties = ['controllerNames', 'controllerName'];
|
|
17
|
+
for (const property of properties) {
|
|
18
|
+
if (property in source) {
|
|
19
|
+
target[property] = source[property];
|
|
20
|
+
}
|
|
21
|
+
else if (property in target) {
|
|
22
|
+
// Deletion of property happens
|
|
23
|
+
delete target[property];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Method returns extension key for import(page.json).
|
|
29
|
+
* @param {string} manifestKey - extension name in manifest.
|
|
30
|
+
* @returns - extension key for import.
|
|
31
|
+
*/
|
|
32
|
+
const getExtensionKeyForImport = (manifestKey) => {
|
|
33
|
+
for (const [pageType, key] of PAGE_TYPE_TO_CONTROLLER_EXTENSION_MAP) {
|
|
34
|
+
if (manifestKey.startsWith(key)) {
|
|
35
|
+
// Replace SAPUI5 specific key like 'sap.fe.templates.ObjectPage.ObjectPageController' with more readable PageType
|
|
36
|
+
let configKey = pageType;
|
|
37
|
+
if (manifestKey.includes('#')) {
|
|
38
|
+
// Append with page id
|
|
39
|
+
const id = manifestKey.split('#')[1]?.split('::')[1];
|
|
40
|
+
configKey += `#${id}`;
|
|
41
|
+
}
|
|
42
|
+
return configKey;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Method returns extension key for export(manifest.json).
|
|
49
|
+
* @param {string} configKey - extension name in config.
|
|
50
|
+
* @param {string} appId - application id.
|
|
51
|
+
* @returns - extension key for export.
|
|
52
|
+
*/
|
|
53
|
+
const getExtensionKeyForExport = (configKey, appId) => {
|
|
54
|
+
let manifestKey = '';
|
|
55
|
+
for (const [pageType, key] of PAGE_TYPE_TO_CONTROLLER_EXTENSION_MAP) {
|
|
56
|
+
if (configKey.startsWith(pageType)) {
|
|
57
|
+
manifestKey = key;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const idParts = configKey.split('#');
|
|
61
|
+
if (idParts.length > 1) {
|
|
62
|
+
const pageId = idParts[1];
|
|
63
|
+
manifestKey = `${manifestKey}#${appId}::${pageId}`;
|
|
64
|
+
}
|
|
65
|
+
return manifestKey;
|
|
66
|
+
};
|
|
67
|
+
exports.controllerExtensions = {
|
|
68
|
+
manifest: {
|
|
69
|
+
path: () => `sap.ui5/extends/extensions/${ux_specification_types_1.v4.SAPUI5_CONTROLLER_EXTENSION}`,
|
|
70
|
+
import: (extensions) => {
|
|
71
|
+
const result = {};
|
|
72
|
+
if (extensions && typeof extensions === 'object') {
|
|
73
|
+
for (const manifestKey in extensions) {
|
|
74
|
+
const configKey = getExtensionKeyForImport(manifestKey);
|
|
75
|
+
if (configKey) {
|
|
76
|
+
result[configKey] = {};
|
|
77
|
+
applyControllerNameProperties(extensions[manifestKey], result[configKey]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return Object.keys(result).length ? result : undefined;
|
|
82
|
+
},
|
|
83
|
+
export: (manifestSection, configObject, key) => {
|
|
84
|
+
const appId = configObject?.id || '';
|
|
85
|
+
const configExtensions = configObject?.settings?.[key] || {};
|
|
86
|
+
// Go through all config extensions
|
|
87
|
+
for (const configKey in configExtensions) {
|
|
88
|
+
const manifestKey = getExtensionKeyForExport(configKey, appId);
|
|
89
|
+
if (!manifestSection[manifestKey]) {
|
|
90
|
+
manifestSection[manifestKey] = {};
|
|
91
|
+
}
|
|
92
|
+
applyControllerNameProperties(configExtensions[configKey], manifestSection[manifestKey]);
|
|
93
|
+
}
|
|
94
|
+
// Handle removed extensions
|
|
95
|
+
for (const manifestKey in manifestSection) {
|
|
96
|
+
const configKey = getExtensionKeyForImport(manifestKey);
|
|
97
|
+
if (configKey && !configExtensions[configKey]) {
|
|
98
|
+
delete manifestSection[manifestKey];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=controllerExtensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controllerExtensions.js","sourceRoot":"","sources":["../../../../../src/sync/v4/sync-rules/controllerExtensions.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AAC;QACD,MAAM,EAAE,CACJ,eAAgD,EAChD,YAA8B,EAC9B,GAAW,EACP,EAAE;YACN,MAAM,KAAK,GAAG,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC;YACrC,MAAM,gBAAgB,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAC7D,mCAAmC;YACnC,KAAK,MAAM,SAAS,IAAI,gBAAgB,EAAE;gBACtC,MAAM,WAAW,GAAG,wBAAwB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC/D,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE;oBAC/B,eAAe,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;iBACrC;gBACD,6BAA6B,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;aAC5F;YACD,4BAA4B;YAC5B,KAAK,MAAM,WAAW,IAAI,eAAe,EAAE;gBACvC,MAAM,SAAS,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;gBACxD,IAAI,SAAS,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE;oBAC3C,OAAO,eAAe,CAAC,WAAW,CAAC,CAAC;iBACvC;aACJ;QACL,CAAC;KACJ;CACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function replaceSpecialChars(sId: string): string;
|
|
2
2
|
export declare const prepareId: (sId: string) => string;
|
|
3
3
|
export declare const getStableIdPartFromSemanticObjectAndAction: (oDataField: any) => string;
|
|
4
|
-
export declare const getStableIdPartFromDataField: (oDataField: any) => string;
|
|
4
|
+
export declare const getStableIdPartFromDataField: (oDataField: any) => string | undefined;
|
|
5
5
|
//# sourceMappingURL=StableIdHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StableIdHelper.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v4/utils/StableIdHelper.ts"],"names":[],"mappings":"AAgBA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"StableIdHelper.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v4/utils/StableIdHelper.ts"],"names":[],"mappings":"AAgBA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAoBvD;AAQD,eAAO,MAAM,SAAS,QAAkB,MAAM,KAAG,MAEhD,CAAC;AA+BF,eAAO,MAAM,0CAA0C,eAAyB,GAAG,KAAG,MAgBrF,CAAC;AAEF,eAAO,MAAM,4BAA4B,eAAyB,GAAG,KAAG,MAAM,GAAG,SA+ChF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStableIdPartFromDataField = exports.getStableIdPartFromSemanticObjectAndAction = exports.prepareId = exports.replaceSpecialChars = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Stable Id helper (parts copied from sap.fe.core/helpers/StableIdHelper.ts)
|
|
5
6
|
*/
|
|
@@ -16,9 +17,6 @@ function replaceSpecialChars(sId) {
|
|
|
16
17
|
if (typeof sId !== 'string') {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
if (sId.indexOf(' ') >= 0) {
|
|
20
|
-
throw sId + ' - Spaces are not allowed in ID parts.';
|
|
21
|
-
}
|
|
22
20
|
sId = sId
|
|
23
21
|
.replace(/^\/|^@|^#|^\*/, '') // remove special characters from the beginning of the string
|
|
24
22
|
.replace(/\/$|@$|#$|\*$/, '') // remove special characters from the end of the string
|
|
@@ -39,47 +37,36 @@ function removeNamespaces(sId) {
|
|
|
39
37
|
sId = sId.replace('com.sap.vocabularies.Communication.v1.', '');
|
|
40
38
|
return sId;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (isValid(sId)) {
|
|
45
|
-
return sId;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
throw sId + ' - Stable Id could not be generated due to insufficient information.';
|
|
49
|
-
}
|
|
40
|
+
const prepareId = function (sId) {
|
|
41
|
+
return replaceSpecialChars(removeNamespaces(sId));
|
|
50
42
|
};
|
|
43
|
+
exports.prepareId = prepareId;
|
|
51
44
|
function evaluateConcat(oValue) {
|
|
52
45
|
let sPathConcat = '';
|
|
53
|
-
for (const applyValue of oValue
|
|
54
|
-
if (applyValue
|
|
46
|
+
for (const applyValue of oValue.Apply.Path) {
|
|
47
|
+
if (applyValue._text) {
|
|
55
48
|
if (sPathConcat) {
|
|
56
49
|
sPathConcat += '::';
|
|
57
50
|
}
|
|
58
|
-
sPathConcat += applyValue
|
|
51
|
+
sPathConcat += applyValue._text;
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
54
|
return sPathConcat;
|
|
62
55
|
}
|
|
63
56
|
function getStableIdPartFromValue(oValue) {
|
|
64
|
-
|
|
65
|
-
if ((oValue === null || oValue === void 0 ? void 0 : oValue.$Path) || (oValue === null || oValue === void 0 ? void 0 : oValue.path)) {
|
|
57
|
+
if (oValue?.$Path || oValue?.path) {
|
|
66
58
|
return oValue.$Path || oValue.path;
|
|
67
59
|
}
|
|
68
|
-
if (
|
|
60
|
+
if (oValue?.Apply?._attributes.Function === 'odata.concat') {
|
|
69
61
|
return evaluateConcat(oValue);
|
|
70
62
|
}
|
|
71
63
|
if (oValue) {
|
|
72
64
|
if (typeof oValue === 'string') {
|
|
73
|
-
//old AVT format
|
|
74
65
|
return replaceSpecialChars(oValue.replace(/ /g, '_'));
|
|
75
66
|
}
|
|
76
|
-
else {
|
|
77
|
-
//new AVT format
|
|
78
|
-
return replaceSpecialChars((_b = (_a = oValue === null || oValue === void 0 ? void 0 : oValue.value) === null || _a === void 0 ? void 0 : _a.String) === null || _b === void 0 ? void 0 : _b.replace(/ /g, '_'));
|
|
79
|
-
}
|
|
80
67
|
}
|
|
81
68
|
}
|
|
82
|
-
|
|
69
|
+
const getStableIdPartFromSemanticObjectAndAction = function (oDataField) {
|
|
83
70
|
let sIdPart = '';
|
|
84
71
|
if (typeof oDataField.SemanticObject === 'string') {
|
|
85
72
|
sIdPart += oDataField.SemanticObject;
|
|
@@ -98,7 +85,8 @@ exports.getStableIdPartFromSemanticObjectAndAction = function (oDataField) {
|
|
|
98
85
|
}
|
|
99
86
|
return sIdPart;
|
|
100
87
|
};
|
|
101
|
-
exports.
|
|
88
|
+
exports.getStableIdPartFromSemanticObjectAndAction = getStableIdPartFromSemanticObjectAndAction;
|
|
89
|
+
const getStableIdPartFromDataField = function (oDataField) {
|
|
102
90
|
let sIdPart = '';
|
|
103
91
|
if (oDataField.$Type && oDataField.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */) {
|
|
104
92
|
sIdPart = 'DataFieldForAction::';
|
|
@@ -153,4 +141,5 @@ exports.getStableIdPartFromDataField = function (oDataField) {
|
|
|
153
141
|
}
|
|
154
142
|
return undefined;
|
|
155
143
|
};
|
|
144
|
+
exports.getStableIdPartFromDataField = getStableIdPartFromDataField;
|
|
156
145
|
//# sourceMappingURL=StableIdHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StableIdHelper.js","sourceRoot":"","sources":["../../../../../src/sync/v4/utils/StableIdHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StableIdHelper.js","sourceRoot":"","sources":["../../../../../src/sync/v4/utils/StableIdHelper.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AAEH;;;;;GAKG;AACH,SAAS,OAAO,CAAC,MAAc;IAC3B,OAAO,+BAA+B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,mBAAmB,CAAC,GAAW;IAC3C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QACzB,OAAO;KACV;IACD,GAAG,GAAG,GAAG;SACJ,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CA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OAAO,GAAG,sCAAsC,CAAC;QACjD,OAAO,IAAI,wBAAwB,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;QAC7D,OAAO,IAAI,kDAA0C,CAAC,UAAU,CAAC,CAAC;QAClE,OAAO,iBAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;SAAM,IAAI,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,+FAAkD,EAAE;QAC/F,OAAO,GAAG,+BAA+B,CAAC;QAC1C,OAAO,IAAI,wBAAwB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;YACnE,OAAO,IAAI,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;SAClE;QACD,OAAO,iBAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;SAAM,IAAI,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,yEAAuC,EAAE;QACpF,OAAO,GAAG,oBAAoB,CAAC;QAC/B,OAAO,IAAI,wBAAwB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtD,OAAO,iBAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;SAAM;QACH,0CAA0C;QAC1C,8FAA8F;KACjG;IACD,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AA/CW,QAAA,4BAA4B,gCA+CvC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionLogger, GenerateAppSchemaParameters } from '../../..';
|
|
2
|
-
import type { LineItem
|
|
2
|
+
import type { LineItem } from '@sap-ux/vocabularies-types/vocabularies/UI';
|
|
3
3
|
import type { AnnotationTerm, ConvertedMetadata, EntitySet, EntityType } from '@sap-ux/vocabularies-types';
|
|
4
4
|
import { DefinitionName } from '../../common';
|
|
5
5
|
import { v4 } from '@sap/ux-specification-types';
|
|
@@ -14,28 +14,26 @@ import type { Definition } from 'typescript-json-schema';
|
|
|
14
14
|
* @param sectionIdInManifest - identifier of the current object page section in manifest
|
|
15
15
|
*/
|
|
16
16
|
export declare function addCustomColumnDefinition(appSchema: Definition, v4Page: v4.SapUiAppPageV4, logger: ExtensionLogger, customColumnDefinitionName?: string, sectionId?: string, sectionIdInManifest?: string): void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @param recordIndex - record index in the collection
|
|
25
|
-
*/
|
|
26
|
-
export declare function handleActionRecord(appSchema: Definition, entityType: EntityType, actionsDefinition: Definition, lineItemPath: string, lineItemRecord: DataFieldForActionAbstractTypes, lineItemId: string, recordIndex: number): void;
|
|
17
|
+
export declare type LineItemDataForSchema = {
|
|
18
|
+
appSchema: Definition;
|
|
19
|
+
lineItemAnnotation: AnnotationTerm<LineItem>;
|
|
20
|
+
entityType: EntityType;
|
|
21
|
+
oDataServiceAVT: ConvertedMetadata;
|
|
22
|
+
lineItemId: string;
|
|
23
|
+
};
|
|
27
24
|
/**
|
|
28
25
|
* Adds the line item definition, columns and actions to the app schema (for the list report or an object page section comprising a table)
|
|
29
|
-
* @param
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
26
|
+
* @param {LineItemDataForSchema} data: structure comprising
|
|
27
|
+
* - appSchema - the app specific schema that shall get enhanced
|
|
28
|
+
* - lineItemAnnotation - the UI.LineItem annotation, comprising all records
|
|
29
|
+
* - entityType - the entity type as part of the AVT ConvertedMetadata
|
|
30
|
+
* - oDataServiceAVT - complete service information, as returned by Annotation Vocabularies Tool
|
|
31
|
+
* - lineItemId - in case of OP the parameter must be passed to distinguish the OP tables;
|
|
32
|
+
* in case of LR or ALP 'LineItems' is passed.
|
|
35
33
|
* @param columnDefinitionName - name of the column definition, i.e. TableColumn or ObjectPageTableColumn
|
|
36
34
|
* @param customColumnDefinitionName - name of the custom column definition
|
|
37
35
|
*/
|
|
38
|
-
export declare function
|
|
36
|
+
export declare function addLineItemsTypeToSchema(data: LineItemDataForSchema, columnDefinitionName?: string, customColumnDefinitionName?: string, customActionDefinitionName?: string): void;
|
|
39
37
|
/**
|
|
40
38
|
* Adds an enum or value help to position > anchor of custom column
|
|
41
39
|
* @param appSchema - app specific JSON schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v4/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v4/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EACR,QAAQ,EAGX,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI3G,OAAO,EASH,cAAc,EAEjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,EAAE,EAAiC,MAAM,6BAA6B,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAuB,MAAM,wBAAwB,CAAC;AAwL9E;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,EAAE,CAAC,cAAc,EACzB,MAAM,EAAE,eAAe,EACvB,0BAA0B,GAAE,MAAoC,EAChE,SAAS,CAAC,EAAE,MAAM,EAClB,mBAAmB,CAAC,EAAE,MAAM,GAC7B,IAAI,CA8BN;AA8ED,oBAAY,qBAAqB,GAAG;IAChC,SAAS,EAAE,UAAU,CAAC;IACtB,kBAAkB,EAAE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Default = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.addCustomActionDefinition = exports.alignSchemaWithTemplateType = exports.findPageV4 = exports.addEnumForActionAnchor = exports.addFragmentEnumForAnchor = exports.addLineItemsTypeToSchema = exports.addCustomColumnDefinition = void 0;
|
|
6
7
|
const utils_1 = require("../../common/utils");
|
|
7
8
|
const StableIdHelper_1 = require("./StableIdHelper");
|
|
8
9
|
const common_1 = require("../../common");
|
|
@@ -47,8 +48,7 @@ function getExtensionText(extension) {
|
|
|
47
48
|
* @param newExtensionReference - schema reference of the new extension
|
|
48
49
|
*/
|
|
49
50
|
function addExtensionToSortedArray(extension, sortedExtensionsArray, targetIndex, extId, newExtensionReference) {
|
|
50
|
-
|
|
51
|
-
const placement = ((_a = extension.position) === null || _a === void 0 ? void 0 : _a.placement) || ux_specification_types_1.v4.Placement.After;
|
|
51
|
+
const placement = extension.position?.placement || ux_specification_types_1.v4.Placement.After;
|
|
52
52
|
if (placement === ux_specification_types_1.v4.Placement.Before) {
|
|
53
53
|
sortedExtensionsArray.splice(targetIndex, 0, [extId, newExtensionReference]);
|
|
54
54
|
}
|
|
@@ -64,7 +64,6 @@ function addExtensionToSortedArray(extension, sortedExtensionsArray, targetIndex
|
|
|
64
64
|
* @param logger - logger for error messages
|
|
65
65
|
*/
|
|
66
66
|
function adjustCustomExtReferringToCustomExt(remainingExtensions, extensionDefinitionName, sortedExtArray, logger) {
|
|
67
|
-
var _a, _b;
|
|
68
67
|
for (const extId in remainingExtensions) {
|
|
69
68
|
const extension = remainingExtensions[extId];
|
|
70
69
|
// Detect description based on extension in manifest
|
|
@@ -73,7 +72,7 @@ function adjustCustomExtReferringToCustomExt(remainingExtensions, extensionDefin
|
|
|
73
72
|
$ref: `${utils_1.DEFINITION_LINK_PREFIX}${extensionDefinitionName}`,
|
|
74
73
|
description
|
|
75
74
|
};
|
|
76
|
-
if (
|
|
75
|
+
if (extension.position?.anchor && extension.position?.placement) {
|
|
77
76
|
const targetIndex = sortedExtArray.findIndex((element) => element[0] === extension.position.anchor);
|
|
78
77
|
if (targetIndex > -1) {
|
|
79
78
|
addExtensionToSortedArray(extension, sortedExtArray, targetIndex, extId, newCustomExt);
|
|
@@ -106,10 +105,9 @@ function adjustCustomExtReferringToCustomExt(remainingExtensions, extensionDefin
|
|
|
106
105
|
* @param sortedExtensionsArray - sorted array of annotation-based nodes, to be enhanced by extensions
|
|
107
106
|
*/
|
|
108
107
|
function getExtensionAnchor(extension, sortedExtensionsArray) {
|
|
109
|
-
var _a, _b;
|
|
110
108
|
// Default placement is After
|
|
111
|
-
const placement =
|
|
112
|
-
let anchor =
|
|
109
|
+
const placement = extension.position?.placement || ux_specification_types_1.v4.Placement.After;
|
|
110
|
+
let anchor = extension.position?.anchor;
|
|
113
111
|
if (!anchor) {
|
|
114
112
|
// Simulate runtime behavior - if there no anchor, then logic uses first or last annotation node
|
|
115
113
|
// In some cases last extension can be previously inserted extension - in such case we still need use annotation node
|
|
@@ -127,7 +125,7 @@ function getExtensionAnchor(extension, sortedExtensionsArray) {
|
|
|
127
125
|
*/
|
|
128
126
|
function addExtensionToArray(extensions, sortedExtensionsArray, extensionDefinitionName, templatePropertyName = 'template', logger) {
|
|
129
127
|
const annotationEntries = [...sortedExtensionsArray];
|
|
130
|
-
const localExtensions =
|
|
128
|
+
const localExtensions = { ...extensions };
|
|
131
129
|
for (const extensionId in localExtensions) {
|
|
132
130
|
const extension = localExtensions[extensionId];
|
|
133
131
|
if (!(templatePropertyName in extension)) {
|
|
@@ -169,7 +167,6 @@ function addExtensionToArray(extensions, sortedExtensionsArray, extensionDefinit
|
|
|
169
167
|
* @param sectionIdInManifest - identifier of the current object page section in manifest
|
|
170
168
|
*/
|
|
171
169
|
function addCustomColumnDefinition(appSchema, v4Page, logger, customColumnDefinitionName = common_1.DefinitionName.CustomColumn, sectionId, sectionIdInManifest) {
|
|
172
|
-
var _a, _b, _c, _d;
|
|
173
170
|
const lineItemId = sectionId || common_1.DefinitionName.LineItems;
|
|
174
171
|
const lineItems = appSchema.definitions[lineItemId];
|
|
175
172
|
if (!lineItems) {
|
|
@@ -178,7 +175,7 @@ function addCustomColumnDefinition(appSchema, v4Page, logger, customColumnDefini
|
|
|
178
175
|
//sort line items
|
|
179
176
|
let sortedColumnsArray = sortPropertiesRecords(lineItems);
|
|
180
177
|
const id = sectionIdInManifest ? sectionIdInManifest.replace(/::/g, '/') : `@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
|
|
181
|
-
const columns =
|
|
178
|
+
const columns = v4Page.options?.settings?.controlConfiguration?.[id]?.['columns'];
|
|
182
179
|
if (columns) {
|
|
183
180
|
sortedColumnsArray = addExtensionToArray(columns, sortedColumnsArray, customColumnDefinitionName, undefined, logger);
|
|
184
181
|
}
|
|
@@ -195,29 +192,28 @@ function addCustomColumnDefinition(appSchema, v4Page, logger, customColumnDefini
|
|
|
195
192
|
exports.addCustomColumnDefinition = addCustomColumnDefinition;
|
|
196
193
|
/**
|
|
197
194
|
* Processes a LineItem record of type DataFieldForAction during app schema generation
|
|
198
|
-
* @param
|
|
199
|
-
* @param entityType - the entity type as part of the AVT ConvertedMetadata
|
|
195
|
+
* @param {LineItemDataForSchema} data: structure of input data
|
|
200
196
|
* @param actions - actions definition in schema, parent object
|
|
201
197
|
* @param lineItemPath - annotation path to the line item
|
|
202
198
|
* @param lineItemRecord - actual record of the line item collection
|
|
203
199
|
* @param recordIndex - record index in the collection
|
|
204
200
|
*/
|
|
205
|
-
function
|
|
201
|
+
function addActionRecordToSchema(data, actionsDefinition, lineItemPath, lineItemRecord, recordIndex) {
|
|
206
202
|
// Action but not inline action
|
|
207
203
|
if (lineItemRecord.Determining !== true) {
|
|
208
204
|
//no footer bar -> toolbar action
|
|
209
205
|
let actionDefinitionName;
|
|
210
|
-
if (lineItemId.startsWith(common_1.DefinitionName.LineItemsOfView)) {
|
|
206
|
+
if (data.lineItemId.startsWith(common_1.DefinitionName.LineItemsOfView)) {
|
|
211
207
|
actionDefinitionName = common_1.DefinitionName.ViewToolBarAction;
|
|
212
208
|
}
|
|
213
|
-
else if (lineItemId.startsWith(common_1.DefinitionName.LineItems)) {
|
|
209
|
+
else if (data.lineItemId.startsWith(common_1.DefinitionName.LineItems)) {
|
|
214
210
|
actionDefinitionName = common_1.DefinitionName.ToolBarAction;
|
|
215
211
|
}
|
|
216
212
|
else {
|
|
217
213
|
actionDefinitionName = common_1.DefinitionName.ObjectPageToolBarAction;
|
|
218
214
|
}
|
|
219
215
|
const actionId = lineItemRecord.Action.replace('/', '??');
|
|
220
|
-
const description = utils_1.getDataFieldDescription(lineItemRecord, entityType);
|
|
216
|
+
const description = utils_1.getDataFieldDescription(lineItemRecord, data.entityType);
|
|
221
217
|
const prefix = lineItemRecord.$Type.split(`${common_1.UIVOCABULARY}.`)[1];
|
|
222
218
|
const actions = (actionsDefinition.properties[`${prefix}::${lineItemRecord.Action}`] = {
|
|
223
219
|
$ref: common_1.getFacetDefinitionLink(actionDefinitionName, common_1.prepareRef(actionId)),
|
|
@@ -225,78 +221,75 @@ function handleActionRecord(appSchema, entityType, actionsDefinition, lineItemPa
|
|
|
225
221
|
});
|
|
226
222
|
actions[common_1.SchemaTag.propertyIndex] = recordIndex;
|
|
227
223
|
actions[common_1.SchemaTag.annotationType] = lineItemRecord.$Type;
|
|
228
|
-
const action = common_1.parseSchemaDefinition(actionDefinitionName, common_1.prepareRef(actionId), appSchema);
|
|
224
|
+
const action = common_1.parseSchemaDefinition(actionDefinitionName, common_1.prepareRef(actionId), data.appSchema);
|
|
229
225
|
action[common_1.SchemaTag.annotationPath] = `${lineItemPath}/${recordIndex}`;
|
|
230
226
|
}
|
|
231
227
|
}
|
|
232
|
-
exports.handleActionRecord = handleActionRecord;
|
|
233
228
|
/**
|
|
234
229
|
* Processes a LineItem record of type DataField during app schema generation
|
|
230
|
+
* @param {LineItemDataForSchema} data: structure of input data
|
|
235
231
|
* @param lineItem - object comprising the line item information:
|
|
236
232
|
* { lineItemRecord, lineItemId, lineItemPath }
|
|
237
|
-
* @param appSchema - the app specific schema that shall get enhanced
|
|
238
233
|
* @param columnDefinitionName - Schema definition name for the column
|
|
239
|
-
* @param entityType - the entity type as part of the AVT ConvertedMetadata
|
|
240
234
|
* @param recordIndex - record index in the collection
|
|
241
|
-
* @param {ConvertedMetadata} oDataServiceAVT - AVT information
|
|
242
235
|
*/
|
|
243
|
-
function
|
|
244
|
-
var _a, _b, _c, _d, _e;
|
|
236
|
+
function addLineItemRecordToSchema(data, lineItem, columnDefinitionName, recordIndex) {
|
|
245
237
|
const lineItemId = lineItem['lineItemId'];
|
|
246
238
|
const lineItemRecord = lineItem['lineItemRecord'];
|
|
247
|
-
if (
|
|
248
|
-
const regex = `@${utils_1.findAlias(common_1.UIVOCABULARY, oDataServiceAVT)}.`;
|
|
239
|
+
if (lineItemRecord['Target']?.['value']) {
|
|
240
|
+
const regex = `@${utils_1.findAlias(common_1.UIVOCABULARY, data.oDataServiceAVT)}.`;
|
|
249
241
|
lineItemRecord['Target']['value'] = lineItemRecord['Target']['value'].replace(regex, '@');
|
|
250
242
|
}
|
|
251
243
|
const schemaKey = StableIdHelper_1.getStableIdPartFromDataField(lineItemRecord);
|
|
252
244
|
if (schemaKey) {
|
|
253
|
-
const properties = appSchema.definitions[lineItemId].properties;
|
|
245
|
+
const properties = data.appSchema.definitions[lineItemId].properties;
|
|
254
246
|
properties[schemaKey] = {
|
|
255
247
|
$ref: utils_1.DEFINITION_LINK_PREFIX + columnDefinitionName,
|
|
256
|
-
description: utils_1.getDataFieldDescription(lineItemRecord, entityType)
|
|
248
|
+
description: utils_1.getDataFieldDescription(lineItemRecord, data.entityType)
|
|
257
249
|
};
|
|
258
|
-
properties[schemaKey][common_1.SchemaTag.annotationType] = lineItemRecord
|
|
250
|
+
properties[schemaKey][common_1.SchemaTag.annotationType] = lineItemRecord?.$Type;
|
|
259
251
|
properties[schemaKey][common_1.SchemaTag.annotationPath] = `${lineItem['lineItemPath']}/${recordIndex}`;
|
|
260
252
|
properties[schemaKey][common_1.SchemaTag.propertyIndex] = recordIndex;
|
|
261
|
-
if (
|
|
262
|
-
properties[schemaKey][common_1.SchemaTag.dataType] =
|
|
253
|
+
if (lineItemRecord['Value']?.$target?.type) {
|
|
254
|
+
properties[schemaKey][common_1.SchemaTag.dataType] = lineItemRecord['Value']?.$target?.type.replace('Edm.', '');
|
|
263
255
|
}
|
|
264
256
|
}
|
|
265
257
|
}
|
|
266
258
|
/**
|
|
267
259
|
* Adds the line item definition, columns and actions to the app schema (for the list report or an object page section comprising a table)
|
|
268
|
-
* @param
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
260
|
+
* @param {LineItemDataForSchema} data: structure comprising
|
|
261
|
+
* - appSchema - the app specific schema that shall get enhanced
|
|
262
|
+
* - lineItemAnnotation - the UI.LineItem annotation, comprising all records
|
|
263
|
+
* - entityType - the entity type as part of the AVT ConvertedMetadata
|
|
264
|
+
* - oDataServiceAVT - complete service information, as returned by Annotation Vocabularies Tool
|
|
265
|
+
* - lineItemId - in case of OP the parameter must be passed to distinguish the OP tables;
|
|
266
|
+
* in case of LR or ALP 'LineItems' is passed.
|
|
274
267
|
* @param columnDefinitionName - name of the column definition, i.e. TableColumn or ObjectPageTableColumn
|
|
275
268
|
* @param customColumnDefinitionName - name of the custom column definition
|
|
276
269
|
*/
|
|
277
|
-
function
|
|
278
|
-
const { actions, lineItemPath } = common_1.addCommonLineItemDefinitions(appSchema, lineItemAnnotation, entityType, lineItemId, customColumnDefinitionName, customActionDefinitionName);
|
|
279
|
-
if (!lineItemAnnotation) {
|
|
270
|
+
function addLineItemsTypeToSchema(data, columnDefinitionName = common_1.DefinitionName.TableColumn, customColumnDefinitionName = common_1.DefinitionName.CustomColumn, customActionDefinitionName = common_1.DefinitionName.CustomAction) {
|
|
271
|
+
const { actions, lineItemPath } = common_1.addCommonLineItemDefinitions(data.appSchema, data.lineItemAnnotation, data.entityType, data.lineItemId, customColumnDefinitionName, customActionDefinitionName);
|
|
272
|
+
if (!data.lineItemAnnotation) {
|
|
280
273
|
return;
|
|
281
274
|
}
|
|
282
275
|
let i = 0;
|
|
283
|
-
lineItemAnnotation.forEach((lineItemRecord) => {
|
|
276
|
+
data.lineItemAnnotation.forEach((lineItemRecord) => {
|
|
284
277
|
if ((lineItemRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */ ||
|
|
285
278
|
lineItemRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */) &&
|
|
286
279
|
(lineItemRecord.Inline !== true || lineItemRecord.Determining === true)) {
|
|
287
|
-
|
|
280
|
+
addActionRecordToSchema(data, actions, lineItemPath, lineItemRecord, i);
|
|
288
281
|
}
|
|
289
282
|
else {
|
|
290
|
-
const lineItem = { lineItemRecord, lineItemId, lineItemPath };
|
|
283
|
+
const lineItem = { lineItemRecord, lineItemId: data.lineItemId, lineItemPath };
|
|
291
284
|
const columnDefinition = lineItemRecord.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */
|
|
292
285
|
? `${columnDefinitionName}Action`
|
|
293
286
|
: columnDefinitionName;
|
|
294
|
-
|
|
287
|
+
addLineItemRecordToSchema(data, lineItem, columnDefinition, i);
|
|
295
288
|
}
|
|
296
289
|
i++;
|
|
297
290
|
});
|
|
298
291
|
}
|
|
299
|
-
exports.
|
|
292
|
+
exports.addLineItemsTypeToSchema = addLineItemsTypeToSchema;
|
|
300
293
|
/**
|
|
301
294
|
* Adds an enum or value help to position > anchor of custom column
|
|
302
295
|
* @param appSchema - app specific JSON schema
|
|
@@ -306,8 +299,7 @@ exports.addLineItemsType = addLineItemsType;
|
|
|
306
299
|
* @param sectionIdInManifest - identifier of the current object page section in manifest
|
|
307
300
|
*/
|
|
308
301
|
function addFragmentEnumForAnchor(appSchema, lineItemId, v4Page, positionName = common_1.DefinitionName.Position, sectionIdInManifest) {
|
|
309
|
-
|
|
310
|
-
const columns = (_a = appSchema.definitions[lineItemId]) === null || _a === void 0 ? void 0 : _a.properties;
|
|
302
|
+
const columns = appSchema.definitions[lineItemId]?.properties;
|
|
311
303
|
const enumEntries = [];
|
|
312
304
|
if (columns) {
|
|
313
305
|
for (const key in columns) {
|
|
@@ -317,7 +309,7 @@ function addFragmentEnumForAnchor(appSchema, lineItemId, v4Page, positionName =
|
|
|
317
309
|
}
|
|
318
310
|
}
|
|
319
311
|
const id = lineItemId !== common_1.DefinitionName.LineItems ? sectionIdInManifest : `@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
|
|
320
|
-
const columnsInManifest =
|
|
312
|
+
const columnsInManifest = v4Page.options?.settings?.controlConfiguration?.[id]?.['columns'];
|
|
321
313
|
if (columnsInManifest) {
|
|
322
314
|
for (const key in columnsInManifest) {
|
|
323
315
|
if (enumEntries.indexOf(key) === -1) {
|
|
@@ -352,11 +344,10 @@ exports.addEnumForActionAnchor = addEnumForActionAnchor;
|
|
|
352
344
|
* @returns the page definition in manifest (if found)
|
|
353
345
|
*/
|
|
354
346
|
function findPageV4(pages, pageName, entitySet, logger) {
|
|
355
|
-
var _a, _b;
|
|
356
347
|
let v4Page;
|
|
357
348
|
if (entitySet) {
|
|
358
349
|
for (const i in pages) {
|
|
359
|
-
if (
|
|
350
|
+
if (pages[i].options?.settings?.entitySet === entitySet.name &&
|
|
360
351
|
(pages[i].name === pageName ||
|
|
361
352
|
(pageName === ux_specification_types_1.v4.FE_TEMPLATE_V4_ALP && pages[i].name === ux_specification_types_1.v4.FE_TEMPLATE_V4_LIST_REPORT))) {
|
|
362
353
|
v4Page = pages[i];
|
|
@@ -416,7 +407,6 @@ exports.alignSchemaWithTemplateType = alignSchemaWithTemplateType;
|
|
|
416
407
|
* @param sectionIdInManifest - identifier of the current object page section in manifest
|
|
417
408
|
*/
|
|
418
409
|
function addCustomActionDefinition(appSchema, v4Page, logger, customColumnDefinitionName = common_1.DefinitionName.CustomAction, sectionId = '', sectionIdInManifest = '') {
|
|
419
|
-
var _a, _b, _c, _d;
|
|
420
410
|
const definition = appSchema.definitions[sectionId];
|
|
421
411
|
if (!definition) {
|
|
422
412
|
return;
|
|
@@ -424,7 +414,7 @@ function addCustomActionDefinition(appSchema, v4Page, logger, customColumnDefini
|
|
|
424
414
|
// Sort existing actions
|
|
425
415
|
let sortedActionsArray = sortPropertiesRecords(definition);
|
|
426
416
|
const id = sectionIdInManifest ? sectionIdInManifest.replace(/::/g, '/') : `@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
|
|
427
|
-
const actions =
|
|
417
|
+
const actions = v4Page.options?.settings?.controlConfiguration?.[id]?.['actions'];
|
|
428
418
|
if (actions) {
|
|
429
419
|
sortedActionsArray = addExtensionToArray(actions, sortedActionsArray, customColumnDefinitionName, 'press', logger);
|
|
430
420
|
}
|