@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
|
@@ -55,11 +55,15 @@ exports.findPageV4 = findPageV4;
|
|
|
55
55
|
exports.alignSchemaWithTemplateType = alignSchemaWithTemplateType;
|
|
56
56
|
exports.addCustomActionDefinition = addCustomActionDefinition;
|
|
57
57
|
exports.addHeaderFooterCustomActionDefinition = addHeaderFooterCustomActionDefinition;
|
|
58
|
+
exports.parseDefinitionName = parseDefinitionName;
|
|
58
59
|
exports.getManifestPage = getManifestPage;
|
|
59
60
|
exports.getPageCustomExtensionFile = getPageCustomExtensionFile;
|
|
60
61
|
exports.getPageCustomViewFile = getPageCustomViewFile;
|
|
61
62
|
exports.addCustomSectionDefinition = addCustomSectionDefinition;
|
|
62
63
|
exports.addCustomFilterFieldDefinition = addCustomFilterFieldDefinition;
|
|
64
|
+
exports.importSingleActionSettingsOfReference = importSingleActionSettingsOfReference;
|
|
65
|
+
exports.importGroupActionSettingsOfReference = importGroupActionSettingsOfReference;
|
|
66
|
+
exports.importManifestBasedActionMenuSettingsOfReference = importManifestBasedActionMenuSettingsOfReference;
|
|
63
67
|
exports.importActionSettingsOfReference = importActionSettingsOfReference;
|
|
64
68
|
exports.addCustomFieldDefinition = addCustomFieldDefinition;
|
|
65
69
|
exports.addManifestPathsToProperties = addManifestPathsToProperties;
|
|
@@ -80,6 +84,36 @@ exports.DATA_FIELD_FOR_ACTION_GROUP = 'DataFieldForActionGroup';
|
|
|
80
84
|
const UI_ANNOTATION_KEY = 'UI';
|
|
81
85
|
exports.FIELD_SEPARATOR = '::';
|
|
82
86
|
exports.QUALIFIER_SEPARATOR = '#';
|
|
87
|
+
const ACTION_TYPE = 'actionType';
|
|
88
|
+
const strategyTypeMap = new Map([
|
|
89
|
+
['', "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */],
|
|
90
|
+
['DataFieldForAction', "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */],
|
|
91
|
+
['DataFieldForActionGroup', "com.sap.vocabularies.UI.v1.DataFieldForActionGroup" /* UIAnnotationTypes.DataFieldForActionGroup */],
|
|
92
|
+
['CustomMenu', ux_specification_types_1.CustomUIAnnotationTypes.ManifestBasedActionMenu]
|
|
93
|
+
]);
|
|
94
|
+
const OP_ACTION_MENU_DEFINITION = {
|
|
95
|
+
actionMenuDefinitionName: ux_specification_types_1.DefinitionName.ObjectPageCustomActionMenu,
|
|
96
|
+
actionMenuActionsDefinitionName: ux_specification_types_1.DefinitionName.ObjectPageCustomActionMenuActions
|
|
97
|
+
};
|
|
98
|
+
const OP_HEADER_ACTION_MENU_DEFINITION = {
|
|
99
|
+
actionMenuDefinitionName: ux_specification_types_1.DefinitionName.ObjectPageHeaderCustomActionMenu,
|
|
100
|
+
actionMenuActionsDefinitionName: ux_specification_types_1.DefinitionName.ObjectPageHeaderCustomActionMenuActions
|
|
101
|
+
};
|
|
102
|
+
const LR_ACTION_MENU_DEFINITION = {
|
|
103
|
+
actionMenuDefinitionName: ux_specification_types_1.DefinitionName.CustomActionMenu,
|
|
104
|
+
actionMenuActionsDefinitionName: ux_specification_types_1.DefinitionName.CustomActionMenuActions
|
|
105
|
+
};
|
|
106
|
+
const LR_ACTION_VIEW_MENU_DEFINITION = {
|
|
107
|
+
actionMenuDefinitionName: ux_specification_types_1.DefinitionName.ViewCustomActionMenu,
|
|
108
|
+
actionMenuActionsDefinitionName: ux_specification_types_1.DefinitionName.ViewCustomActionMenuActions
|
|
109
|
+
};
|
|
110
|
+
const actionMenuDefinitionNameMap = new Map([
|
|
111
|
+
[ux_specification_types_1.DefinitionName.CustomTableActionOP, OP_ACTION_MENU_DEFINITION],
|
|
112
|
+
[ux_specification_types_1.DefinitionName.CustomFormActionOP, OP_ACTION_MENU_DEFINITION],
|
|
113
|
+
[ux_specification_types_1.DefinitionName.CustomTableAction, LR_ACTION_MENU_DEFINITION],
|
|
114
|
+
[ux_specification_types_1.DefinitionName.CustomHeaderActionOP, OP_HEADER_ACTION_MENU_DEFINITION],
|
|
115
|
+
[ux_specification_types_1.DefinitionName.ViewCustomAction, LR_ACTION_VIEW_MENU_DEFINITION]
|
|
116
|
+
]);
|
|
83
117
|
/**
|
|
84
118
|
* Returns a comparator function to sort objects by their property index.
|
|
85
119
|
*
|
|
@@ -194,18 +228,24 @@ function getExtensionDetails(extension, extensionDefinitionName, extId, actionTy
|
|
|
194
228
|
/**
|
|
195
229
|
* Post-processing of custom extensions that are left after the first loop of adding extensions, i.e. custom extensions referring to other custom extensions.
|
|
196
230
|
*
|
|
197
|
-
* @param remainingExtensions -
|
|
198
|
-
* @param extensionDefinitionName -
|
|
199
|
-
* @param sortedExtArray - sorted array of
|
|
200
|
-
* @param logger - logger for
|
|
201
|
-
* @param {boolean} forceAdd -
|
|
231
|
+
* @param {CustomExtensions} remainingExtensions - An object containing the remaining extensions to process.
|
|
232
|
+
* @param {string} extensionDefinitionName - The name of the extension definition to refer to.
|
|
233
|
+
* @param {[string, unknown][]} sortedExtArray - A sorted array of existing extensions represented as key-value pairs.
|
|
234
|
+
* @param {ExtensionLogger} logger - The logger used for logging errors and warnings during the adjustment process.
|
|
235
|
+
* @param {boolean} [forceAdd=false] - Flag indicating whether to force adding extensions even if proper anchor/placement is not found.
|
|
202
236
|
*/
|
|
203
237
|
function adjustCustomExtReferringToCustomExt(remainingExtensions, extensionDefinitionName, sortedExtArray, logger, forceAdd = false) {
|
|
204
238
|
const initialRemaining = Object.entries(remainingExtensions).length;
|
|
205
239
|
for (const extId of Object.keys(remainingExtensions)) {
|
|
240
|
+
// make sure that we do not add the same extension twice
|
|
241
|
+
const isAlreadyAdded = sortedExtArray.find((element) => element[0] === extId) !== undefined;
|
|
242
|
+
if (isAlreadyAdded) {
|
|
243
|
+
delete remainingExtensions[extId];
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
206
246
|
const extension = remainingExtensions[extId];
|
|
207
247
|
// Detect description based on extension in manifest
|
|
208
|
-
const newCustomExt = getExtensionDetails(extension, extensionDefinitionName, extId);
|
|
248
|
+
const newCustomExt = getExtensionDetails(extension, extensionDefinitionName, extId, ux_specification_types_1.ActionType.Custom);
|
|
209
249
|
if (extension.position?.anchor && extension.position?.placement) {
|
|
210
250
|
const targetIndex = sortedExtArray.findIndex((element) => element[0] === extension.position.anchor);
|
|
211
251
|
if (targetIndex > -1) {
|
|
@@ -365,17 +405,20 @@ function handleInvalidExtension(logger, extensionId, sortedExtensionsArray, newE
|
|
|
365
405
|
delete localExtensions[extensionId];
|
|
366
406
|
}
|
|
367
407
|
/**
|
|
368
|
-
* Adds extension
|
|
408
|
+
* Adds extension entries to a sorted array of extensions based on specific rules,
|
|
409
|
+
* including using anchors, callbacks, and custom templates.
|
|
369
410
|
*
|
|
370
|
-
* @param extensions -
|
|
371
|
-
* @param sortedExtensionsArray -
|
|
372
|
-
* @param extensionDefinitionName -
|
|
373
|
-
* @param
|
|
374
|
-
*
|
|
375
|
-
* @param
|
|
376
|
-
* @
|
|
411
|
+
* @param {CustomExtensions} extensions - The object containing custom extensions to be added to the array.
|
|
412
|
+
* @param {ActionDetails[]} sortedExtensionsArray - The array of sorted extensions to which new extensions will be added.
|
|
413
|
+
* @param {string} extensionDefinitionName - The definition name associated with the extensions being added.
|
|
414
|
+
* @param {TemplatePropertyName | TemplatePropertyName[]} [templatePropertyName=TemplatePropertyName.Template] -
|
|
415
|
+
* The property name(s) to check for existence in an extension; used to determine compatibility.
|
|
416
|
+
* @param {ExtensionLogger} [logger] - An optional logger to handle logging of invalid extensions or other events.
|
|
417
|
+
* @param {boolean} [ignoreAnnotationAnchors=false] - A flag to indicate whether extension anchors should be ignored.
|
|
418
|
+
* @returns {ActionDetails[]} The updated sorted extensions array, including newly added and valid extensions.
|
|
377
419
|
*/
|
|
378
|
-
function addExtensionToArray(extensions, sortedExtensionsArray, extensionDefinitionName, templatePropertyName =
|
|
420
|
+
function addExtensionToArray(extensions, sortedExtensionsArray, extensionDefinitionName, templatePropertyName = ux_specification_types_1.TemplatePropertyName.Template, logger, ignoreAnnotationAnchors = false) {
|
|
421
|
+
templatePropertyName = Array.isArray(templatePropertyName) ? templatePropertyName : [templatePropertyName];
|
|
379
422
|
const annotationEntries = [...sortedExtensionsArray];
|
|
380
423
|
const localExtensions = { ...extensions };
|
|
381
424
|
const localExtensionsToSkip = getLocalExtensionsToSkip(localExtensions, annotationEntries);
|
|
@@ -392,7 +435,8 @@ function addExtensionToArray(extensions, sortedExtensionsArray, extensionDefinit
|
|
|
392
435
|
handleInvalidExtension(logger, extensionId, sortedExtensionsArray, newExtensionReference, localExtensions);
|
|
393
436
|
continue;
|
|
394
437
|
}
|
|
395
|
-
|
|
438
|
+
const hasUnsupportedExtensionType = templatePropertyName.every((propertyName) => !(propertyName in extension));
|
|
439
|
+
if (hasUnsupportedExtensionType) {
|
|
396
440
|
// Skip regular entries(columns, actions, etc.)
|
|
397
441
|
delete localExtensions[extensionId];
|
|
398
442
|
continue;
|
|
@@ -413,7 +457,7 @@ function addExtensionToArray(extensions, sortedExtensionsArray, extensionDefinit
|
|
|
413
457
|
}
|
|
414
458
|
if (Object.keys(localExtensions).length > 0) {
|
|
415
459
|
//Second loop is necessary for custom columns that refer to custom columns
|
|
416
|
-
adjustCustomExtReferringToCustomExt(localExtensions, extensionDefinitionName, sortedExtensionsArray, logger);
|
|
460
|
+
adjustCustomExtReferringToCustomExt(localExtensions, extensionDefinitionName, sortedExtensionsArray, logger, false);
|
|
417
461
|
}
|
|
418
462
|
return sortedExtensionsArray;
|
|
419
463
|
}
|
|
@@ -608,7 +652,6 @@ function addTargetAndKeysOfAction(actionDefinition, lineItemRecord, actionId) {
|
|
|
608
652
|
* @param {AddLineItemDefinitionParams} lineItemDefinitionParams - The parameters describing the line item definition, including data, actions, path, record, and index.
|
|
609
653
|
* @param {boolean} [createRef] - A flag indicating whether to create a reference for the action definition.
|
|
610
654
|
* @param {boolean} isInnerAction - Whether the action belongs to the action group.
|
|
611
|
-
* @returns {void} This function does not return a value.
|
|
612
655
|
*/
|
|
613
656
|
function addActionRecordToSchema(lineItemDefinitionParams, createRef = true, isInnerAction = false) {
|
|
614
657
|
const { lineItemData: data, actions: actionsDefinition, lineItemPath, lineItemRecord, index: recordIndex } = lineItemDefinitionParams;
|
|
@@ -654,7 +697,6 @@ function addActionRecordToSchema(lineItemDefinitionParams, createRef = true, isI
|
|
|
654
697
|
*
|
|
655
698
|
* @param {AddLineItemDefinitionParams} lineItemDefinitionParams - Parameters that define the line item, including data, record, path, index, and actions.
|
|
656
699
|
* @param {boolean} [createRef] - Indicates whether to create a reference for the action definition or to use an inline object.
|
|
657
|
-
* @returns {void} - Does not return any value.
|
|
658
700
|
*/
|
|
659
701
|
function addGroupActionRecordToSchema(lineItemDefinitionParams, createRef = true) {
|
|
660
702
|
const { lineItemData, lineItemRecord, lineItemPath, index, actions } = lineItemDefinitionParams;
|
|
@@ -700,7 +742,6 @@ function addGroupActionRecordToSchema(lineItemDefinitionParams, createRef = true
|
|
|
700
742
|
* @param {boolean} data.lineItemRecord.Inline - Indicates whether the line item is inline.
|
|
701
743
|
* @param {boolean} data.lineItemRecord.Determining - Indicates if the line item is determining.
|
|
702
744
|
* @param {boolean} data.lineItemDefinition - Indicates whether the line item definition is present.
|
|
703
|
-
* @returns {void} This method does not return a value.
|
|
704
745
|
*/
|
|
705
746
|
function addLineItemActionDefinition(data) {
|
|
706
747
|
const { lineItemRecord, lineItemDefinition } = data;
|
|
@@ -715,7 +756,6 @@ function addLineItemActionDefinition(data) {
|
|
|
715
756
|
* Adds a line item record to the provided schema based on the definition parameters.
|
|
716
757
|
*
|
|
717
758
|
* @param {AddLineItemDefinitionParams} lineItemDefinitionParams - The parameters defining the line item data, schema information, and record.
|
|
718
|
-
* @returns {void} This function does not return a value.
|
|
719
759
|
*/
|
|
720
760
|
function addLineItemRecordToSchema(lineItemDefinitionParams) {
|
|
721
761
|
const { lineItemData, lineItemRecord, lineItemDefinition, lineItemPath, index, columnDefinitionName } = lineItemDefinitionParams;
|
|
@@ -862,7 +902,6 @@ function addEnumForActionAnchor(appSchema, definitionId, positionName = ux_speci
|
|
|
862
902
|
* @param {string} tableDefinitionName - The name of the table definition in the schema.
|
|
863
903
|
* @param {string} columnsDefinitionName - The name of the columns definition used to extract column enumerations.
|
|
864
904
|
* @param {EntityType} [entityType] - Optional entity type for additional context when retrieving column definitions.
|
|
865
|
-
* @returns {void} No return value as this function modifies the schema in place.
|
|
866
905
|
*/
|
|
867
906
|
function addEnumForEnableMassEdit(appSchema, tableDefinitionName, columnsDefinitionName, entityType) {
|
|
868
907
|
const FIELD_PROPERTIES = ['visibleFields', 'ignoredFields'];
|
|
@@ -920,7 +959,10 @@ function initializeCreationModeSchema(appSchema, lineItemId, entityType, definit
|
|
|
920
959
|
const specificCreationModeDefinitionName = (0, common_1.getFacetDefinitionKey)(definitionName, lineItemId);
|
|
921
960
|
const specificCreationModeDefinition = (appSchema.definitions[specificCreationModeDefinitionName] = structuredClone(appSchema.definitions[definitionName]));
|
|
922
961
|
const creationFieldsDefinition = specificCreationModeDefinition.properties[ux_specification_types_1.PropertyName.creationFields];
|
|
923
|
-
creationFieldsDefinition.items
|
|
962
|
+
const creationFieldsDefinitionItems = creationFieldsDefinition.items;
|
|
963
|
+
creationFieldsDefinitionItems['oneOf'] = [...columnOneOfEnums, ...fieldGroups];
|
|
964
|
+
// Entries of one of are translatable using 'service' i18n bundle
|
|
965
|
+
creationFieldsDefinitionItems.i18nBundle = 'service';
|
|
924
966
|
creationFieldsDefinition.uniqueItems = true;
|
|
925
967
|
return specificCreationModeDefinitionName;
|
|
926
968
|
}
|
|
@@ -978,13 +1020,13 @@ function findPageV4(pages, templateName, entitySet, contextPath) {
|
|
|
978
1020
|
* Depending on the template type, strip down the app schema so that only the relevant views are part of it.
|
|
979
1021
|
*
|
|
980
1022
|
* @param {Definition} appSchema - app specific JSON schema, to be adjusted
|
|
981
|
-
* @param
|
|
1023
|
+
* @param templateType - template type of the current page
|
|
982
1024
|
* @returns the right definition name for the table in the schema
|
|
983
1025
|
*/
|
|
984
|
-
function alignSchemaWithTemplateType(appSchema,
|
|
1026
|
+
function alignSchemaWithTemplateType(appSchema, templateType) {
|
|
985
1027
|
let tableDefinitionName;
|
|
986
1028
|
const tableDefinition = appSchema.properties[ux_specification_types_1.PropertyName.table];
|
|
987
|
-
if (
|
|
1029
|
+
if (templateType === ux_specification_types_1.TemplateType.AnalyticalListPageV4) {
|
|
988
1030
|
tableDefinitionName = ux_specification_types_1.DefinitionName.ALPTableView;
|
|
989
1031
|
delete tableDefinition.anyOf;
|
|
990
1032
|
tableDefinition.$ref = `${utils_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ALPTableView}`;
|
|
@@ -993,7 +1035,7 @@ function alignSchemaWithTemplateType(appSchema, generateParameters) {
|
|
|
993
1035
|
delete appSchema.definitions[ux_specification_types_1.DefinitionName.LRTableView];
|
|
994
1036
|
delete appSchema.definitions[ux_specification_types_1.DefinitionName.MultiTableModeV4];
|
|
995
1037
|
}
|
|
996
|
-
else if (
|
|
1038
|
+
else if (templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
997
1039
|
tableDefinitionName = ux_specification_types_1.DefinitionName.Table;
|
|
998
1040
|
delete tableDefinition.anyOf;
|
|
999
1041
|
tableDefinition.$ref = `${utils_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.Table}`;
|
|
@@ -1006,14 +1048,15 @@ function alignSchemaWithTemplateType(appSchema, generateParameters) {
|
|
|
1006
1048
|
/**
|
|
1007
1049
|
* Common function for enhancing LineItems, FieldGroups and Custom Section definitions of app schema by custom action definitions.
|
|
1008
1050
|
*
|
|
1009
|
-
* @param appSchema
|
|
1010
|
-
* @param v4Page
|
|
1011
|
-
* @param logger
|
|
1012
|
-
* @param customActionDefinitionName
|
|
1013
|
-
* @param sectionDefinitionName
|
|
1014
|
-
* @param sectionIdInManifest
|
|
1051
|
+
* @param appSchema The application schema where the custom action definition will be added.
|
|
1052
|
+
* @param v4Page The V4 page configuration object that contains metadata and settings for the page.
|
|
1053
|
+
* @param logger A logging instance for logging warnings or errors during the processing.
|
|
1054
|
+
* @param customActionDefinitionName The name of the custom action definition to be added. Defaults to `DefinitionName.CustomTableAction`.
|
|
1055
|
+
* @param sectionDefinitionName The name of the section definition within the schema to which the action definition will be added.
|
|
1056
|
+
* @param sectionIdInManifest Optional: The section ID in the manifest, used to derive the configuration ID.
|
|
1057
|
+
* @param lineItemId Optional: The ID of the line item, if applicable.
|
|
1015
1058
|
*/
|
|
1016
|
-
function addCustomActionDefinition(appSchema, v4Page, logger, customActionDefinitionName = ux_specification_types_1.DefinitionName.CustomTableAction, sectionDefinitionName = '', sectionIdInManifest = '') {
|
|
1059
|
+
function addCustomActionDefinition(appSchema, v4Page, logger, customActionDefinitionName = ux_specification_types_1.DefinitionName.CustomTableAction, sectionDefinitionName = '', sectionIdInManifest = '', lineItemId) {
|
|
1017
1060
|
const definition = appSchema.definitions[sectionDefinitionName];
|
|
1018
1061
|
if (!definition) {
|
|
1019
1062
|
return;
|
|
@@ -1045,7 +1088,16 @@ function addCustomActionDefinition(appSchema, v4Page, logger, customActionDefini
|
|
|
1045
1088
|
actions = v4Page.options?.settings?.controlConfiguration?.[configId]?.['actions'];
|
|
1046
1089
|
}
|
|
1047
1090
|
if (actions) {
|
|
1048
|
-
|
|
1091
|
+
// Add custom actions and custom action menus to the actions array
|
|
1092
|
+
const parameters = {
|
|
1093
|
+
extensions: actions,
|
|
1094
|
+
appSchema,
|
|
1095
|
+
customActionDefinitionName,
|
|
1096
|
+
initialActionDetailsList: sortedActionsArray,
|
|
1097
|
+
logger,
|
|
1098
|
+
lineItemId
|
|
1099
|
+
};
|
|
1100
|
+
sortedActionsArray = addActionsToArray(parameters);
|
|
1049
1101
|
}
|
|
1050
1102
|
// Adjust propertyIndex
|
|
1051
1103
|
if (sortedActionsArray) {
|
|
@@ -1081,7 +1133,15 @@ function addHeaderFooterCustomActionDefinition(appSchema, v4Page, logger, custom
|
|
|
1081
1133
|
actions = v4Page.options?.settings?.content?.footer?.['actions'];
|
|
1082
1134
|
}
|
|
1083
1135
|
if (actions) {
|
|
1084
|
-
|
|
1136
|
+
// Add custom actions and custom action menus to the actions array
|
|
1137
|
+
const parameters = {
|
|
1138
|
+
extensions: actions,
|
|
1139
|
+
appSchema,
|
|
1140
|
+
customActionDefinitionName,
|
|
1141
|
+
initialActionDetailsList: sortedActionsArray,
|
|
1142
|
+
logger
|
|
1143
|
+
};
|
|
1144
|
+
sortedActionsArray = addActionsToArray(parameters);
|
|
1085
1145
|
}
|
|
1086
1146
|
// Adjust propertyIndex
|
|
1087
1147
|
const sortedActionsAsObject = {};
|
|
@@ -1093,6 +1153,196 @@ function addHeaderFooterCustomActionDefinition(appSchema, v4Page, logger, custom
|
|
|
1093
1153
|
}
|
|
1094
1154
|
appSchema.definitions[sectionId].properties = sortedActionsAsObject;
|
|
1095
1155
|
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Adds actions and custom action menus to an array of initial actions using specified parameters.
|
|
1158
|
+
*
|
|
1159
|
+
* @param params - An object containing the parameters for adding actions to the array:
|
|
1160
|
+
* - actions: The original actions to be processed.
|
|
1161
|
+
* - initialActionsArray: The array to which actions should be added.
|
|
1162
|
+
* - customActionDefinitionName: The name of the custom action definition.
|
|
1163
|
+
* - appSchema: The application schema used for processing.
|
|
1164
|
+
* - logger: An object used for logging information during processing.
|
|
1165
|
+
* @returns An array of action details after processing and adding extensions.
|
|
1166
|
+
*/
|
|
1167
|
+
function addActionsToArray(params) {
|
|
1168
|
+
const { extensions, initialActionDetailsList, customActionDefinitionName, logger } = params;
|
|
1169
|
+
// Add custom actions
|
|
1170
|
+
let actionDetailsList = addExtensionToArray(extensions, initialActionDetailsList, customActionDefinitionName, [ux_specification_types_1.TemplatePropertyName.Press, ux_specification_types_1.TemplatePropertyName.Menu], logger);
|
|
1171
|
+
const processActionMenusParams = {
|
|
1172
|
+
...params,
|
|
1173
|
+
initialActionDetailsList: actionDetailsList
|
|
1174
|
+
};
|
|
1175
|
+
actionDetailsList = processActionMenus(processActionMenusParams);
|
|
1176
|
+
return actionDetailsList;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Processes action menus by identifying menu-type actions within the provided extensions and updating the list of action details accordingly.
|
|
1180
|
+
*
|
|
1181
|
+
* @param {ActionProcessingParameters} params - An object containing required parameters for processing action menus. It includes:
|
|
1182
|
+
* - extensions: A map of extension data where the keys are extension IDs and the values are extension definitions.
|
|
1183
|
+
* - initialActionDetailsList: A list of action details, each represented as a tuple with the action ID and action definition.
|
|
1184
|
+
* @returns {Array} An updated list of action details after processing any menu-type actions.
|
|
1185
|
+
*/
|
|
1186
|
+
function processActionMenus(params) {
|
|
1187
|
+
const { extensions, initialActionDetailsList } = params;
|
|
1188
|
+
let actionDetailsList = [...initialActionDetailsList];
|
|
1189
|
+
// Currently, all actions were initialized as custom actions. We need to check if the action is a menu and if so,
|
|
1190
|
+
// we need to process it differently.
|
|
1191
|
+
for (const extensionId in extensions) {
|
|
1192
|
+
const extension = extensions[extensionId];
|
|
1193
|
+
const actionDetails = actionDetailsList.find(([actionId]) => actionId === extensionId);
|
|
1194
|
+
if (Object.keys(extension).includes(ux_specification_types_1.PropertyName.menu) && actionDetails) {
|
|
1195
|
+
const [, actionDefinition] = actionDetails;
|
|
1196
|
+
actionDetailsList = processActionMenu(params, extension, actionDefinition, actionDetailsList, extensionId);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
return actionDetailsList;
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* Retrieves a reference to a menu entry definition based on the provided parameters.
|
|
1203
|
+
*
|
|
1204
|
+
* @param {string} $ref - The reference string used to identify the menu entry definition.
|
|
1205
|
+
* @param {string} actionMenuDefinitionName - The name of the action menu definition.
|
|
1206
|
+
* @param {Definition} appSchema - The application schema containing the definitions.
|
|
1207
|
+
* @returns {string} The constructed link or reference for the specified menu entry definition.
|
|
1208
|
+
*/
|
|
1209
|
+
function getMenuEntryDefinitionLink($ref, actionMenuDefinitionName, appSchema) {
|
|
1210
|
+
const definitionName = (0, utils_1.getDefinitionKey)($ref);
|
|
1211
|
+
const { baseDefinitionName, definitionQualifier } = parseDefinitionName(definitionName);
|
|
1212
|
+
// incorrect definition name - probably a reference to an intent based navigation action
|
|
1213
|
+
if (baseDefinitionName.includes(exports.FIELD_SEPARATOR)) {
|
|
1214
|
+
return $ref;
|
|
1215
|
+
}
|
|
1216
|
+
const menuEntryDefinitionQualifier = definitionQualifier
|
|
1217
|
+
? `${actionMenuDefinitionName}${exports.FIELD_SEPARATOR}${definitionQualifier}`
|
|
1218
|
+
: actionMenuDefinitionName;
|
|
1219
|
+
const menuEntryDefinitionRef = (0, common_1.getFacetDefinitionKey)(baseDefinitionName, menuEntryDefinitionQualifier);
|
|
1220
|
+
const menuEntryDefinitionLink = (0, common_1.getFacetDefinitionLink)(baseDefinitionName, menuEntryDefinitionQualifier);
|
|
1221
|
+
const menuEntryDefinition = appSchema.definitions[menuEntryDefinitionRef];
|
|
1222
|
+
if (!menuEntryDefinition) {
|
|
1223
|
+
const originalDefinition = appSchema.definitions[definitionName];
|
|
1224
|
+
const menuEntryDefinition = (0, common_1.parseSchemaDefinition)(baseDefinitionName, menuEntryDefinitionQualifier, appSchema);
|
|
1225
|
+
for (const originalDefinitionKey of Object.keys(originalDefinition)) {
|
|
1226
|
+
if (menuEntryDefinition[originalDefinitionKey] === undefined) {
|
|
1227
|
+
menuEntryDefinition[originalDefinitionKey] = originalDefinition[originalDefinitionKey];
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
// some properties doesn't make sense for menu entries
|
|
1231
|
+
delete menuEntryDefinition.properties[ux_specification_types_1.PropertyName.position];
|
|
1232
|
+
delete menuEntryDefinition.properties[ux_specification_types_1.PropertyName.overflowGroup];
|
|
1233
|
+
delete menuEntryDefinition.properties[ux_specification_types_1.PropertyName.priority];
|
|
1234
|
+
}
|
|
1235
|
+
return menuEntryDefinitionLink;
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Determines the appropriate action menu definition name based on a custom action definition name.
|
|
1239
|
+
*
|
|
1240
|
+
* @param {string} customActionDefinitionName - The custom action definition name to be parsed and matched.
|
|
1241
|
+
* @returns {ActionMenuDefinitionName} The corresponding action menu definition name, or a default value if not found.
|
|
1242
|
+
*/
|
|
1243
|
+
function determineActionMenuDefinitionName(customActionDefinitionName) {
|
|
1244
|
+
const { baseDefinitionName } = parseDefinitionName(customActionDefinitionName);
|
|
1245
|
+
return actionMenuDefinitionNameMap.get(baseDefinitionName) ?? LR_ACTION_MENU_DEFINITION;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Parses a given definition name into its base name and optional qualifier.
|
|
1249
|
+
*
|
|
1250
|
+
* @param definitionName The definition name to parse. This should be a string in the format "BaseName" or "BaseName<Qualifier>".
|
|
1251
|
+
* @returns An object containing the base definition name and, if applicable, its qualifier.
|
|
1252
|
+
* If there is no qualifier, it will return undefined for the qualifier field.
|
|
1253
|
+
*/
|
|
1254
|
+
function parseDefinitionName(definitionName = '') {
|
|
1255
|
+
const match = /^([^<]*)(?:<(.*)>)?$/.exec(definitionName);
|
|
1256
|
+
if (!match) {
|
|
1257
|
+
return { baseDefinitionName: definitionName };
|
|
1258
|
+
}
|
|
1259
|
+
const [, baseDefinitionName, definitionQualifier] = match;
|
|
1260
|
+
return {
|
|
1261
|
+
baseDefinitionName: baseDefinitionName,
|
|
1262
|
+
definitionQualifier: definitionQualifier ?? undefined
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Updates the custom menu's default action to include a list of valid options based on the provided menu schema.
|
|
1267
|
+
*
|
|
1268
|
+
* @param {Definition} customMenuDefinition - The definition object for the custom menu, where the default action will be updated.
|
|
1269
|
+
* @param {Record<string, SchemaDefinition>} [menu={}] - A mapping of menu items to their schema definitions, used to generate valid options for the default action.
|
|
1270
|
+
*/
|
|
1271
|
+
function setCustomMenuDefaultAction(customMenuDefinition, menu = {}) {
|
|
1272
|
+
if (customMenuDefinition.properties[ux_specification_types_1.PropertyName.defaultAction]) {
|
|
1273
|
+
const menuOneOfValues = Object.keys(menu).map((value) => ({
|
|
1274
|
+
const: value,
|
|
1275
|
+
description: menu[value].description
|
|
1276
|
+
}));
|
|
1277
|
+
customMenuDefinition.properties[ux_specification_types_1.PropertyName.defaultAction][ux_specification_types_1.PropertyName.oneOf] = menuOneOfValues;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Retrieves the description of a menu entry from its schema definition.
|
|
1282
|
+
*
|
|
1283
|
+
* @param menuEntryDefinition The schema definition of the menu entry, including its reference information.
|
|
1284
|
+
* @param appSchema The complete application schema containing definitions for the menu entries.
|
|
1285
|
+
* @returns The description of the menu entry if found, or an empty string if no description is available.
|
|
1286
|
+
*/
|
|
1287
|
+
function getMenuEntryDescription(menuEntryDefinition, appSchema) {
|
|
1288
|
+
const definitionKey = (0, utils_1.getDefinitionKey)(menuEntryDefinition.$ref);
|
|
1289
|
+
const definition = appSchema.definitions[definitionKey];
|
|
1290
|
+
return menuEntryDefinition?.description ?? definition?.description ?? '';
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Processes an action menu for a custom extension, updating the schema definition and action details list accordingly.
|
|
1294
|
+
*
|
|
1295
|
+
* @param {ActionProcessingParameters} params The parameters required for action menu processing, including `actionMenu`, `actionMenuActions`, `appSchema`, and `lineItemId`.
|
|
1296
|
+
* @param {CustomExtension} extension The custom extension that contains the action menu configuration.
|
|
1297
|
+
* @param {SchemaDefinition} actionDefinition The schema definition object to be populated with details of the custom action menu.
|
|
1298
|
+
* @param {ActionDetails[]} initialDetailsList The initial list of action details to be processed and modified.
|
|
1299
|
+
* @param {string} extensionId The unique identifier for the extension being processed.
|
|
1300
|
+
* @returns {ActionDetails[] | undefined} Returns the updated list of action details if processing occurs; otherwise, returns `undefined` if the extension is not a custom action menu.
|
|
1301
|
+
*/
|
|
1302
|
+
function processActionMenu(params, extension, actionDefinition, initialDetailsList, extensionId) {
|
|
1303
|
+
// if the extension isn't a custom action menu, don't do anything
|
|
1304
|
+
if (!(ux_specification_types_1.TemplatePropertyName.Menu in extension)) {
|
|
1305
|
+
return undefined;
|
|
1306
|
+
}
|
|
1307
|
+
const { customActionDefinitionName, appSchema, lineItemId } = params;
|
|
1308
|
+
const detailsList = [...initialDetailsList];
|
|
1309
|
+
const { actionMenuDefinitionName, actionMenuActionsDefinitionName } = determineActionMenuDefinitionName(customActionDefinitionName);
|
|
1310
|
+
// Prepare submenu entries to be processed
|
|
1311
|
+
const menu = extension[ux_specification_types_1.TemplatePropertyName.Menu] ?? [];
|
|
1312
|
+
const properties = {};
|
|
1313
|
+
// For forms and tables, the id should contain both the section and action names
|
|
1314
|
+
const extendedExtensionId = lineItemId ? `${extensionId}${exports.FIELD_SEPARATOR}${lineItemId}` : extensionId;
|
|
1315
|
+
// Create the specific action menu definition in the schema based on the generic action menu definition
|
|
1316
|
+
const customMenuDefinition = (0, common_1.parseSchemaDefinition)(actionMenuDefinitionName, extendedExtensionId, appSchema);
|
|
1317
|
+
actionDefinition.$ref = (0, common_1.getFacetDefinitionLink)(actionMenuDefinitionName, extendedExtensionId);
|
|
1318
|
+
actionDefinition[ux_specification_types_1.SchemaTag.actionType] = ux_specification_types_1.ActionType.CustomMenu;
|
|
1319
|
+
const customMenuActionsDefinition = (0, common_1.parseSchemaDefinition)(actionMenuActionsDefinitionName, extendedExtensionId, appSchema);
|
|
1320
|
+
const customMenuActionsDefinitionLink = (0, common_1.getFacetDefinitionLink)(actionMenuActionsDefinitionName, extendedExtensionId);
|
|
1321
|
+
// for manifest based menu actions, we need to store the menu entries from the manifest
|
|
1322
|
+
actionDefinition[ux_specification_types_1.PropertyName.menu] = menu;
|
|
1323
|
+
// Add the menu items to the action menu definition
|
|
1324
|
+
menu.forEach((menuEntry, propertyIndex) => {
|
|
1325
|
+
const sortedExtensionIndex = detailsList.findIndex(([entry]) => entry === menuEntry);
|
|
1326
|
+
// If the list of actions contains the menu entry, add the menu entry to the properties of the custom action menu
|
|
1327
|
+
// and remove the extension reference from the list of actions
|
|
1328
|
+
if (sortedExtensionIndex !== -1) {
|
|
1329
|
+
const menuEntryDefinition = detailsList[sortedExtensionIndex][1];
|
|
1330
|
+
menuEntryDefinition.propertyIndex = propertyIndex;
|
|
1331
|
+
menuEntryDefinition.isViewNode = true;
|
|
1332
|
+
menuEntryDefinition.$ref = getMenuEntryDefinitionLink(menuEntryDefinition.$ref, actionMenuDefinitionName, appSchema);
|
|
1333
|
+
menuEntryDefinition.description = getMenuEntryDescription(menuEntryDefinition, appSchema);
|
|
1334
|
+
properties[menuEntry] = menuEntryDefinition;
|
|
1335
|
+
detailsList.splice(sortedExtensionIndex, 1);
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
customMenuDefinition.description = actionDefinition.description;
|
|
1339
|
+
// Update the properties of the custom action menu definition with the menu items
|
|
1340
|
+
const actions = customMenuDefinition.properties[ux_specification_types_1.PropertyName.actions];
|
|
1341
|
+
setCustomMenuDefaultAction(customMenuDefinition, properties);
|
|
1342
|
+
customMenuActionsDefinition.properties = properties;
|
|
1343
|
+
actions.$ref = customMenuActionsDefinitionLink;
|
|
1344
|
+
return detailsList;
|
|
1345
|
+
}
|
|
1096
1346
|
/**
|
|
1097
1347
|
* Method returns page from manifest by passed page key.
|
|
1098
1348
|
*
|
|
@@ -1154,7 +1404,7 @@ function getPageCustomExtensionFile(files, page, manifest, xmlType, extensionNam
|
|
|
1154
1404
|
let baseName = fileParts.pop();
|
|
1155
1405
|
baseName = `${baseName}.${xmlType}.${fileExtension}`;
|
|
1156
1406
|
const extPath = (0, path_1.join)(...fileParts, baseName);
|
|
1157
|
-
const file = files.find((file) => file.dataSourceUri.endsWith(extPath));
|
|
1407
|
+
const file = (files ?? []).find((file) => file.dataSourceUri.endsWith(extPath));
|
|
1158
1408
|
if (file) {
|
|
1159
1409
|
const settings = page.options?.settings;
|
|
1160
1410
|
return {
|
|
@@ -1213,7 +1463,7 @@ function addCustomSectionDefinition(appSchema, definition, v4Page, customSection
|
|
|
1213
1463
|
const section = v4Page.options?.settings?.content?.body?.sections?.[facetKey];
|
|
1214
1464
|
if (section && 'subSections' in section) {
|
|
1215
1465
|
// add extension to subsection of section
|
|
1216
|
-
sortedSectionsArray = addExtensionToArray(section.subSections, sortedSectionsArray, customSectionRef,
|
|
1466
|
+
sortedSectionsArray = addExtensionToArray(section.subSections, sortedSectionsArray, customSectionRef, ux_specification_types_1.TemplatePropertyName.Template, logger, isMergedSections);
|
|
1217
1467
|
}
|
|
1218
1468
|
}
|
|
1219
1469
|
else if (customSectionRef.includes(ux_specification_types_1.DefinitionName.ObjectPageCustomHeaderSectionFragment)) {
|
|
@@ -1221,7 +1471,7 @@ function addCustomSectionDefinition(appSchema, definition, v4Page, customSection
|
|
|
1221
1471
|
const header = v4Page.options?.settings?.content?.header;
|
|
1222
1472
|
if (header && 'facets' in header) {
|
|
1223
1473
|
// add extension to header section
|
|
1224
|
-
sortedSectionsArray = addExtensionToArray(header.facets, sortedSectionsArray, customSectionRef,
|
|
1474
|
+
sortedSectionsArray = addExtensionToArray(header.facets, sortedSectionsArray, customSectionRef, ux_specification_types_1.TemplatePropertyName.Template, logger, isMergedSections);
|
|
1225
1475
|
}
|
|
1226
1476
|
}
|
|
1227
1477
|
else {
|
|
@@ -1229,7 +1479,7 @@ function addCustomSectionDefinition(appSchema, definition, v4Page, customSection
|
|
|
1229
1479
|
const sections = v4Page.options?.settings?.content?.body?.sections;
|
|
1230
1480
|
if (sections) {
|
|
1231
1481
|
// add extension to sections section
|
|
1232
|
-
sortedSectionsArray = addExtensionToArray(sections, sortedSectionsArray, customSectionRef,
|
|
1482
|
+
sortedSectionsArray = addExtensionToArray(sections, sortedSectionsArray, customSectionRef, ux_specification_types_1.TemplatePropertyName.Template, logger, isMergedSections);
|
|
1233
1483
|
}
|
|
1234
1484
|
}
|
|
1235
1485
|
// Adjust propertyIndex
|
|
@@ -1266,7 +1516,7 @@ function addCustomFilterFieldDefinition(appSchema, definition, v4Page) {
|
|
|
1266
1516
|
const selectionFieldsEntry = v4Page.options?.settings?.controlConfiguration?.[`@${"com.sap.vocabularies.UI.v1.SelectionFields" /* UIAnnotationTerms.SelectionFields */}`];
|
|
1267
1517
|
if (typeof selectionFieldsEntry === 'object' && 'filterFields' in selectionFieldsEntry) {
|
|
1268
1518
|
// add extension to subsection of section
|
|
1269
|
-
sortedFilterFieldsArray = addExtensionToArray(selectionFieldsEntry.filterFields, sortedFilterFieldsArray, ux_specification_types_1.DefinitionName.CustomFilterField,
|
|
1519
|
+
sortedFilterFieldsArray = addExtensionToArray(selectionFieldsEntry.filterFields, sortedFilterFieldsArray, ux_specification_types_1.DefinitionName.CustomFilterField, ux_specification_types_1.TemplatePropertyName.Template);
|
|
1270
1520
|
}
|
|
1271
1521
|
// Adjust propertyIndex
|
|
1272
1522
|
for (let index = 0; index < sortedFilterFieldsArray.length; index++) {
|
|
@@ -1285,7 +1535,6 @@ function addCustomFilterFieldDefinition(appSchema, definition, v4Page) {
|
|
|
1285
1535
|
* @param {object} importActionParams - Parameters required for importing action settings, including schema, factory, and action specifications.
|
|
1286
1536
|
* @param {string} key - The key used to identify the specific configuration or schema definition.
|
|
1287
1537
|
* @param {boolean} [keepEmptyAction] - Determines whether to keep empty actions in the configuration object.
|
|
1288
|
-
* @returns {void} This method does not return any value.
|
|
1289
1538
|
*/
|
|
1290
1539
|
function importActionToConfigurationObject(importActionParams, key, keepEmptyAction = false) {
|
|
1291
1540
|
const { appSchema, factory, actionsInConfig, actionKey, manifest, routingId, manifestSectionId, targetAnnotation } = importActionParams;
|
|
@@ -1308,7 +1557,6 @@ function importActionToConfigurationObject(importActionParams, key, keepEmptyAct
|
|
|
1308
1557
|
*
|
|
1309
1558
|
* @param {ImportActionSettingsOfReferenceParams} importActionParams - The parameters required for importing action settings, including property definitions.
|
|
1310
1559
|
* @param {Definition} definitionOfReference - The reference definition object used to resolve the action.
|
|
1311
|
-
* @returns {void} This function does not return a value.
|
|
1312
1560
|
*/
|
|
1313
1561
|
function importSingleActionSettingsOfReference(importActionParams, definitionOfReference) {
|
|
1314
1562
|
const { actionPropertyDefinition } = importActionParams;
|
|
@@ -1318,20 +1566,26 @@ function importSingleActionSettingsOfReference(importActionParams, definitionOfR
|
|
|
1318
1566
|
/**
|
|
1319
1567
|
* Imports and processes the settings for a group of actions based on a reference definition.
|
|
1320
1568
|
*
|
|
1321
|
-
* @param {ImportActionSettingsOfReferenceParams} importActionParams -
|
|
1322
|
-
* @param {Definition} definitionOfReference - The
|
|
1569
|
+
* @param {ImportActionSettingsOfReferenceParams} importActionParams - Parameters containing details required to import group action settings, such as action property definitions, application schema, action configurations, and action keys.
|
|
1570
|
+
* @param {Definition} definitionOfReference - The definition object that serves as the reference for importing group action settings.
|
|
1323
1571
|
* @param {string} definitionKey - Optional, the reference definition key from which the action group settings are imported.
|
|
1324
|
-
* @returns {void} This function does not return a value; it modifies the configurations directly.
|
|
1325
1572
|
*/
|
|
1326
1573
|
function importGroupActionSettingsOfReference(importActionParams, definitionOfReference, definitionKey) {
|
|
1327
1574
|
const { actionPropertyDefinition, appSchema, actionsInConfig, actionKey } = importActionParams;
|
|
1575
|
+
let resolvedDefinitionOfReference = definitionOfReference;
|
|
1576
|
+
let resolvedDefinitionKey = (0, utils_1.getDefinitionKey)(resolvedDefinitionOfReference.$ref ?? actionPropertyDefinition.$ref);
|
|
1577
|
+
/* Some action groups (e.g. form group actions) have wrapper definition in the schema, in such cases we need to use the referenced definition. */
|
|
1578
|
+
const hasActionGroupWrapper = (0, utils_1.getDefinitionKey)(definitionOfReference.$ref) === `ObjectPageFormActionGroup<${definitionKey}>`;
|
|
1579
|
+
if (hasActionGroupWrapper) {
|
|
1580
|
+
resolvedDefinitionKey = (0, utils_1.getDefinitionKey)(definitionOfReference.$ref);
|
|
1581
|
+
resolvedDefinitionOfReference = appSchema.definitions[resolvedDefinitionKey];
|
|
1582
|
+
}
|
|
1328
1583
|
// create an instance of the action group in the configuration object
|
|
1329
|
-
|
|
1330
|
-
importActionToConfigurationObject(importActionParams, key, true);
|
|
1584
|
+
importActionToConfigurationObject(importActionParams, resolvedDefinitionKey, true);
|
|
1331
1585
|
// newly created action group instance is available in the actionsInConfig object
|
|
1332
1586
|
const actionGroup = actionsInConfig[actionKey];
|
|
1333
1587
|
// fill the action group with the action settings of the group action
|
|
1334
|
-
const { properties } =
|
|
1588
|
+
const { properties } = resolvedDefinitionOfReference;
|
|
1335
1589
|
for (const propertyKey in properties) {
|
|
1336
1590
|
const actionInGroupProperty = properties[propertyKey];
|
|
1337
1591
|
if (actionInGroupProperty['$ref']) {
|
|
@@ -1342,41 +1596,73 @@ function importGroupActionSettingsOfReference(importActionParams, definitionOfRe
|
|
|
1342
1596
|
...importActionParams,
|
|
1343
1597
|
actionsInConfig: actionGroup,
|
|
1344
1598
|
actionKey: propertyKey
|
|
1345
|
-
// targetAnnotation: undefined
|
|
1346
1599
|
};
|
|
1347
1600
|
importActionToConfigurationObject(importGroupedActionParams, key);
|
|
1348
1601
|
}
|
|
1349
1602
|
}
|
|
1350
1603
|
(0, common_1.removeEmptyStructure)(actionsInConfig, actionKey);
|
|
1351
1604
|
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Imports and updates the action menu settings in a configuration object based on a given reference definition and related action parameters.
|
|
1607
|
+
*
|
|
1608
|
+
* @param {ImportActionSettingsOfReferenceParams} importActionParams - An object containing details such as the action property definition, application schema, actions configuration, and action key. These parameters are used for resolving and importing the settings.
|
|
1609
|
+
* @param {Definition} definitionOfReference - The reference definition object which includes properties and other settings required to define action menus and their related configurations.
|
|
1610
|
+
*/
|
|
1611
|
+
function importManifestBasedActionMenuSettingsOfReference(importActionParams, definitionOfReference) {
|
|
1612
|
+
const { actionPropertyDefinition, appSchema, actionsInConfig, actionKey } = importActionParams;
|
|
1613
|
+
// create an instance of the menu action in the configuration object
|
|
1614
|
+
const key = (0, utils_1.getDefinitionKey)(definitionOfReference.$ref ?? actionPropertyDefinition.$ref);
|
|
1615
|
+
importActionToConfigurationObject(importActionParams, key, true);
|
|
1616
|
+
// newly created menu action instance is available in the actionsInConfig object
|
|
1617
|
+
const menuAction = actionsInConfig[actionKey];
|
|
1618
|
+
menuAction[ux_specification_types_1.PropertyName.menu] = actionPropertyDefinition[ux_specification_types_1.PropertyName.menu];
|
|
1619
|
+
menuAction[ux_specification_types_1.PropertyName.actions] = {};
|
|
1620
|
+
menuAction[ux_specification_types_1.PropertyName.text] = definitionOfReference.description;
|
|
1621
|
+
const actionsDefinitionKey = (0, utils_1.getDefinitionKey)(definitionOfReference?.properties?.[ux_specification_types_1.PropertyName.actions]?.$ref);
|
|
1622
|
+
const actionsDefinition = appSchema.definitions[actionsDefinitionKey];
|
|
1623
|
+
// fill the action menu with the action settings of the menu action
|
|
1624
|
+
const actions = actionsDefinition?.properties ?? {};
|
|
1625
|
+
for (const action in actions) {
|
|
1626
|
+
const actionInMenuActionProperty = actions[action];
|
|
1627
|
+
const actionInMenuActionPropertyKey = (0, utils_1.getDefinitionKey)(actionInMenuActionProperty['$ref']);
|
|
1628
|
+
const actionInMenuActionDefinition = appSchema.definitions[actionInMenuActionPropertyKey];
|
|
1629
|
+
const key = (0, utils_1.getDefinitionKey)(actionInMenuActionDefinition?.$ref ?? actionInMenuActionProperty['$ref']);
|
|
1630
|
+
const importMenuActionParams = {
|
|
1631
|
+
...importActionParams,
|
|
1632
|
+
actionsInConfig: menuAction[ux_specification_types_1.PropertyName.actions],
|
|
1633
|
+
actionKey: action
|
|
1634
|
+
};
|
|
1635
|
+
importActionToConfigurationObject(importMenuActionParams, key);
|
|
1636
|
+
}
|
|
1637
|
+
(0, common_1.removeEmptyStructure)(actionsInConfig, actionKey);
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Determines the strategy type for action settings based on the provided data type and action type.
|
|
1641
|
+
*
|
|
1642
|
+
* @param {string} [dataType=''] - The data type associated with the action settings. Defaults to an empty string.
|
|
1643
|
+
* @param {string} [actionType=''] - The action type within the context of the action settings. Defaults to an empty string.
|
|
1644
|
+
* @returns {DataFieldStrategyTypes} The corresponding strategy type for the given data type and action type.
|
|
1645
|
+
*/
|
|
1646
|
+
function determineActionStrategyType(dataType = '', actionType = '') {
|
|
1647
|
+
const key = `${dataType}${actionType}`;
|
|
1648
|
+
return strategyTypeMap.get(key) || "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */;
|
|
1649
|
+
}
|
|
1352
1650
|
/**
|
|
1353
1651
|
* Imports the action settings of a specified reference based on the given parameters.
|
|
1354
1652
|
*
|
|
1355
1653
|
* @param {object} importActionParams - The parameters required for importing action settings.
|
|
1356
1654
|
* @param {object} importActionParams.actionPropertyDefinition - The action property definition containing the $ref to the reference.
|
|
1357
1655
|
* @param {object} importActionParams.appSchema - The application schema containing definitions and other related metadata.
|
|
1358
|
-
* @returns {void} This function does not return a value.
|
|
1359
1656
|
*/
|
|
1360
1657
|
function importActionSettingsOfReference(importActionParams) {
|
|
1361
1658
|
const { actionPropertyDefinition, appSchema } = importActionParams;
|
|
1362
1659
|
const definitionKey = (0, utils_1.getDefinitionKey)(actionPropertyDefinition.$ref);
|
|
1363
1660
|
const definitionOfReference = appSchema.definitions[definitionKey];
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
const definitionKey = (0, utils_1.getDefinitionKey)(definitionOfReference.$ref);
|
|
1370
|
-
const actualAtionGroupDefinition = appSchema.definitions[definitionKey];
|
|
1371
|
-
importGroupActionSettingsOfReference(importActionParams, actualAtionGroupDefinition, definitionKey);
|
|
1372
|
-
}
|
|
1373
|
-
else {
|
|
1374
|
-
importGroupActionSettingsOfReference(importActionParams, definitionOfReference);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
else {
|
|
1378
|
-
importSingleActionSettingsOfReference(importActionParams, definitionOfReference);
|
|
1379
|
-
}
|
|
1661
|
+
const dataType = definitionOfReference?.['dataType'];
|
|
1662
|
+
const actionType = actionPropertyDefinition?.[ACTION_TYPE];
|
|
1663
|
+
const strategyType = determineActionStrategyType(dataType, actionType);
|
|
1664
|
+
const strategy = DataFieldStrategy_1.dataFieldStrategyContext.getStrategy(strategyType);
|
|
1665
|
+
strategy.importActionSettingsOfReference(importActionParams, definitionOfReference, definitionKey);
|
|
1380
1666
|
}
|
|
1381
1667
|
/**
|
|
1382
1668
|
* Enhances the application schema with custom field definitions for Object Page sections.
|
|
@@ -1398,7 +1684,7 @@ function addCustomFieldDefinition(appSchema, v4Page, fieldGroupInManifest, logge
|
|
|
1398
1684
|
const configId = fieldGroupInManifest.replace(/::/g, '#');
|
|
1399
1685
|
const fields = v4Page.options?.settings?.controlConfiguration?.[configId]?.['fields'];
|
|
1400
1686
|
if (fields) {
|
|
1401
|
-
sortedFieldsArray = addExtensionToArray(fields, sortedFieldsArray, customFieldDefinitionName,
|
|
1687
|
+
sortedFieldsArray = addExtensionToArray(fields, sortedFieldsArray, customFieldDefinitionName, ux_specification_types_1.TemplatePropertyName.Template, logger);
|
|
1402
1688
|
}
|
|
1403
1689
|
// Adjust propertyIndex
|
|
1404
1690
|
if (sortedFieldsArray) {
|
|
@@ -1418,55 +1704,8 @@ function addCustomFieldDefinition(appSchema, v4Page, fieldGroupInManifest, logge
|
|
|
1418
1704
|
* If `undefined`, the function attempts to resolve the definition name from the `$ref` property of the provided definition.
|
|
1419
1705
|
* @param {Definition} definition - The definition object containing property schemas.
|
|
1420
1706
|
* @param {ManifestPathParams} pathParams - Additional context required to compute manifest paths.
|
|
1421
|
-
* @param {ManifestPropertyResolution} [parentProperty] - Information about the parent property used when resolving
|
|
1422
|
-
* nested or inherited manifest paths (e.g. parent property name and resolved rule path).
|
|
1423
1707
|
*/
|
|
1424
|
-
function addManifestPathsToProperties(appSchema, definitionName, definition, pathParams
|
|
1425
|
-
|
|
1426
|
-
if (definitionName === undefined && definition.$ref) {
|
|
1427
|
-
const innerDefinitionKey = (0, utils_1.getDefinitionKey)(definition.$ref);
|
|
1428
|
-
const innerDefinition = appSchema.definitions[innerDefinitionKey];
|
|
1429
|
-
if (innerDefinition && !innerDefinition.isViewNode) {
|
|
1430
|
-
definition = innerDefinition;
|
|
1431
|
-
// Resolve root definition name in case if reference has syntax like `definitionName<annotation>`
|
|
1432
|
-
definitionName = innerDefinitionKey?.split('<')[0];
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
const classControl = v4controls[definitionName] ?? pages[definitionName];
|
|
1436
|
-
if (!classControl) {
|
|
1437
|
-
return;
|
|
1438
|
-
}
|
|
1439
|
-
if (!definition.properties && definition.$ref) {
|
|
1440
|
-
const innerDefinition = (0, utils_1.getDefinitionKey)(definition.$ref);
|
|
1441
|
-
definition = appSchema.definitions?.[innerDefinition] ?? definition;
|
|
1442
|
-
}
|
|
1443
|
-
for (const property in definition.properties ?? {}) {
|
|
1444
|
-
const rule = (0, common_1.getReflectMetadata)(classControl.prototype, property);
|
|
1445
|
-
const propertySchema = definition.properties[property];
|
|
1446
|
-
const propertyPath = {
|
|
1447
|
-
name: property
|
|
1448
|
-
};
|
|
1449
|
-
if (rule?.manifest?.path) {
|
|
1450
|
-
let rulePath = rule?.manifest?.path([pathParams.pageName], pathParams.manifest, ...pathParams.pathsParts);
|
|
1451
|
-
if (rulePath === parentProperty?.rulePath) {
|
|
1452
|
-
rulePath = `${rulePath}/${parentProperty.name}`;
|
|
1453
|
-
}
|
|
1454
|
-
const manifestPath = `${rulePath}/${property}`;
|
|
1455
|
-
propertySchema.manifestPath = (0, utils_1.convertSyncRulePathToJsonPath)(manifestPath, pathParams.targetAnnotation, pathParams.targetAnnotationEncoded);
|
|
1456
|
-
propertyPath.rulePath = rulePath;
|
|
1457
|
-
}
|
|
1458
|
-
// Recursively apply manifest paths to properties referenced via `$ref`
|
|
1459
|
-
if (propertySchema.$ref) {
|
|
1460
|
-
addManifestPathsToProperties(appSchema, undefined, propertySchema, pathParams, propertyPath);
|
|
1461
|
-
}
|
|
1462
|
-
// Recursively apply manifest paths to properties inside `anyOf` variants
|
|
1463
|
-
if (propertySchema.anyOf) {
|
|
1464
|
-
for (const schemaVariant of propertySchema.anyOf) {
|
|
1465
|
-
if (typeof schemaVariant === 'object') {
|
|
1466
|
-
addManifestPathsToProperties(appSchema, undefined, schemaVariant, pathParams, propertyPath);
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1708
|
+
function addManifestPathsToProperties(appSchema, definitionName, definition, pathParams) {
|
|
1709
|
+
(0, utils_1.addManifestPathsToProperties)([v4controls, pages], appSchema, definitionName, definition, pathParams);
|
|
1471
1710
|
}
|
|
1472
1711
|
//# sourceMappingURL=utils.js.map
|