@sap/ux-specification 1.96.21 → 1.96.25
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/runDocu-min.js +5 -5
- package/dist/documentation/runDocu-min.js.map +2 -2
- 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 +37 -37
- 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 +18 -5
- 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 +10 -8
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/common/generate/utils.js +19 -16
- 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 +22 -27
- 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 +4 -4
- package/dist/src/sync/common/utils.d.ts.map +1 -1
- package/dist/src/sync/common/utils.js +101 -80
- 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 +9 -7
- 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 +37 -37
- 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 +2 -1
- 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 +66 -34
- 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 +9 -9
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDefinitionKey = exports.convertActionKeyToStableId = exports.convertEnumToCSV = exports.arrayCombineMerge = exports.getNextTargetDefinition = exports.generatePageId = exports.getSchemaFilePath = exports.deleteEmptyStructure = exports.getObjectPageFacetSection = exports.createDefaultSection = exports.addTargetTitleAndSectionDescription = exports.addSectionTitleAndDescription = exports.getTemplateTypeFromManifest = exports.determineV4Template = exports.determineV2Template = exports.getVersionFromManifest = exports.getObjectPageFacets = exports.getObjectPageHeaderFacets = exports.getSchemaKeyOfLineItemRecord = exports.getManifestSectionByPathV4 = exports.getSectionFacet = exports.findAlias = exports.getPageTypeV4 = exports.getPageTypeV2 = exports.prepareRef = exports.getDataFieldDescription = exports.getLabelForDataField = exports.getLabelForPropertyPath = exports.evaluateCommonLabel = exports.getAnnotationPropertyValue = exports.parseAndMergeAndConvert = exports.createAnnotationPath = exports.DEFINITION_LINK_PREFIX = exports.TemplateType = void 0;
|
|
6
7
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
7
8
|
const i18next_1 = __importDefault(require("i18next"));
|
|
8
9
|
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
@@ -27,13 +28,14 @@ exports.DEFINITION_LINK_PREFIX = '#/definitions/';
|
|
|
27
28
|
* @param qualifier - Annotation qualifier.
|
|
28
29
|
* @returns Annotation path based on received params
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
const createAnnotationPath = (entityTypeName, term, qualifier) => {
|
|
31
32
|
let annotationPath = `/${entityTypeName}/@${term}`;
|
|
32
33
|
if (qualifier) {
|
|
33
34
|
annotationPath += `#${qualifier}`;
|
|
34
35
|
}
|
|
35
36
|
return annotationPath;
|
|
36
37
|
};
|
|
38
|
+
exports.createAnnotationPath = createAnnotationPath;
|
|
37
39
|
/**
|
|
38
40
|
* Parses, merges, and converts a list of annotation files with aid of tools from annotation-vocabularies-tools
|
|
39
41
|
* @param annotationFiles - The list of all annotation files, in JSON format
|
|
@@ -51,14 +53,6 @@ function parseAndMergeAndConvert(annotationFiles, logger) {
|
|
|
51
53
|
if (parseResult.length > 0) {
|
|
52
54
|
converterOutput = annotation_converter_1.convert(edmx_parser_1.merge(...parseResult));
|
|
53
55
|
}
|
|
54
|
-
if (logger && (converterOutput === null || converterOutput === void 0 ? void 0 : converterOutput.diagnostics)) {
|
|
55
|
-
for (const converterMessage of converterOutput.diagnostics) {
|
|
56
|
-
extensionLogger_1.log(logger, {
|
|
57
|
-
severity: "error" /* Error */,
|
|
58
|
-
message: converterMessage.message
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
56
|
}
|
|
63
57
|
catch (error) {
|
|
64
58
|
extensionLogger_1.log(logger, {
|
|
@@ -69,7 +63,8 @@ function parseAndMergeAndConvert(annotationFiles, logger) {
|
|
|
69
63
|
return converterOutput;
|
|
70
64
|
}
|
|
71
65
|
exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
|
|
72
|
-
|
|
66
|
+
const getAnnotationPropertyValue = (annotationProperty) => annotationProperty?.value || annotationProperty?.path;
|
|
67
|
+
exports.getAnnotationPropertyValue = getAnnotationPropertyValue;
|
|
73
68
|
/**
|
|
74
69
|
* Checks for Common.Label and overwrites the label from it if present
|
|
75
70
|
* @param {PropertyAnnotations} annotations - property annotations
|
|
@@ -77,8 +72,7 @@ exports.getAnnotationPropertyValue = (annotationProperty) => (annotationProperty
|
|
|
77
72
|
* @param {string} label - label, to be actualized
|
|
78
73
|
*/
|
|
79
74
|
function evaluateCommonLabel(annotations, entityType, label) {
|
|
80
|
-
|
|
81
|
-
if ((_a = annotations === null || annotations === void 0 ? void 0 : annotations.Common) === null || _a === void 0 ? void 0 : _a.Label) {
|
|
75
|
+
if (annotations?.Common?.Label) {
|
|
82
76
|
if (typeof annotations.Common.Label === 'string') {
|
|
83
77
|
label = annotations.Common.Label;
|
|
84
78
|
}
|
|
@@ -87,11 +81,11 @@ function evaluateCommonLabel(annotations, entityType, label) {
|
|
|
87
81
|
if (targetProperty.value) {
|
|
88
82
|
label = targetProperty.value;
|
|
89
83
|
}
|
|
90
|
-
else if (typeof
|
|
84
|
+
else if (typeof targetProperty.Common?.Label === 'string') {
|
|
91
85
|
label = targetProperty.annotations.Common.Label;
|
|
92
86
|
}
|
|
93
87
|
}
|
|
94
|
-
else if (typeof
|
|
88
|
+
else if (typeof annotations.Common?.Label?.toString() === 'string') {
|
|
95
89
|
label = annotations.Common.Label.toString();
|
|
96
90
|
}
|
|
97
91
|
}
|
|
@@ -119,7 +113,6 @@ exports.getLabelForPropertyPath = getLabelForPropertyPath;
|
|
|
119
113
|
* @returns label, derived from Common.Label or from property value
|
|
120
114
|
*/
|
|
121
115
|
function getLabelForDataField(field, entityType) {
|
|
122
|
-
var _a, _b;
|
|
123
116
|
let label, property;
|
|
124
117
|
if (field['Value']) {
|
|
125
118
|
if (typeof field['Value'] === 'string') {
|
|
@@ -135,7 +128,7 @@ function getLabelForDataField(field, entityType) {
|
|
|
135
128
|
else if (field['Target'] && field['Target'].$target && field['Target'].$target.Value) {
|
|
136
129
|
property = field['Target'].$target.Value.$target;
|
|
137
130
|
}
|
|
138
|
-
if (
|
|
131
|
+
if (property?.annotations?.Common?.Label) {
|
|
139
132
|
label = evaluateCommonLabel(property.annotations, entityType, label);
|
|
140
133
|
}
|
|
141
134
|
return label;
|
|
@@ -148,7 +141,6 @@ exports.getLabelForDataField = getLabelForDataField;
|
|
|
148
141
|
* @returns undefined or the right string value
|
|
149
142
|
*/
|
|
150
143
|
function getLabel(dataFieldLabel, entityType) {
|
|
151
|
-
var _a, _b;
|
|
152
144
|
if (typeof dataFieldLabel === 'string') {
|
|
153
145
|
return dataFieldLabel;
|
|
154
146
|
}
|
|
@@ -159,7 +151,7 @@ function getLabel(dataFieldLabel, entityType) {
|
|
|
159
151
|
}
|
|
160
152
|
else {
|
|
161
153
|
const singleProperty = property[0];
|
|
162
|
-
if (
|
|
154
|
+
if (singleProperty?.annotations?.Common?.Label) {
|
|
163
155
|
const label = dataFieldLabel;
|
|
164
156
|
return evaluateCommonLabel(singleProperty.annotations, entityType, label);
|
|
165
157
|
}
|
|
@@ -202,6 +194,7 @@ function getDataFieldDescription(dataFieldAbstract, entityType) {
|
|
|
202
194
|
title = dataFieldLabel || propertyCommonLabel || dataField.Target.$target.Title || dataField.Target.value;
|
|
203
195
|
break;
|
|
204
196
|
case "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */:
|
|
197
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithAction" /* DataFieldWithAction */:
|
|
205
198
|
case "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */:
|
|
206
199
|
dataField = dataFieldAbstract;
|
|
207
200
|
if (dataFieldLabel) {
|
|
@@ -251,13 +244,14 @@ exports.getPageTypeV2 = getPageTypeV2;
|
|
|
251
244
|
* @param name - page component name
|
|
252
245
|
*/
|
|
253
246
|
function getPageTypeV4(v4App) {
|
|
254
|
-
var _a;
|
|
255
247
|
if (v4App.name && v4App.name !== ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE) {
|
|
256
248
|
const templatePart = `${ux_specification_types_1.v4.FE_TEMPLATE_V4}.`;
|
|
257
249
|
return v4App.name.split(templatePart)[1];
|
|
258
250
|
}
|
|
259
|
-
else if (
|
|
260
|
-
|
|
251
|
+
else if (v4App?.name === ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE) {
|
|
252
|
+
return ux_specification_types_1.PageTypeV4.FPMCustomPage;
|
|
253
|
+
}
|
|
254
|
+
else if (v4App.viewId ||
|
|
261
255
|
v4App.viewName) {
|
|
262
256
|
return ux_specification_types_1.PageTypeV4.CustomPage;
|
|
263
257
|
}
|
|
@@ -274,7 +268,10 @@ function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = fals
|
|
|
274
268
|
* @returns alias for the given namespace
|
|
275
269
|
*/
|
|
276
270
|
function findAlias(namespace, oDataServiceAVT) {
|
|
277
|
-
|
|
271
|
+
if (!oDataServiceAVT) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
let aliasReference = oDataServiceAVT.references.find((reference) => {
|
|
278
275
|
return reference.namespace === namespace;
|
|
279
276
|
});
|
|
280
277
|
if (!aliasReference) {
|
|
@@ -288,7 +285,7 @@ function findAlias(namespace, oDataServiceAVT) {
|
|
|
288
285
|
namespace.split('SAP__')[namespace.split('SAP__').length - 1].toUpperCase());
|
|
289
286
|
});
|
|
290
287
|
}
|
|
291
|
-
return aliasReference
|
|
288
|
+
return aliasReference?.alias;
|
|
292
289
|
}
|
|
293
290
|
exports.findAlias = findAlias;
|
|
294
291
|
/**
|
|
@@ -299,11 +296,10 @@ exports.findAlias = findAlias;
|
|
|
299
296
|
* @returns the target annotation
|
|
300
297
|
*/
|
|
301
298
|
function determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT) {
|
|
302
|
-
var _a;
|
|
303
299
|
const lastNavigationPart = navigationParts[navigationParts.length - 1];
|
|
304
300
|
const annotation = lastNavigationPart.substring(lastNavigationPart.lastIndexOf('.') + 1, lastNavigationPart.length);
|
|
305
301
|
const alias = findAlias(lastNavigationPart.substring(0, lastNavigationPart.lastIndexOf('.')).replace('@', ''), oDataServiceAVT);
|
|
306
|
-
return
|
|
302
|
+
return entityType?.annotations[alias]?.[annotation];
|
|
307
303
|
}
|
|
308
304
|
/**
|
|
309
305
|
* Adjust key by considering navigation
|
|
@@ -324,12 +320,11 @@ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
|
|
|
324
320
|
return key;
|
|
325
321
|
}
|
|
326
322
|
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
327
|
-
var _a;
|
|
328
323
|
let stopProcessing = false;
|
|
329
324
|
const navigationParts = propertyValue.split('/');
|
|
330
325
|
const navigation = navigationParts.length > 1;
|
|
331
326
|
if (navigation) {
|
|
332
|
-
entityType =
|
|
327
|
+
entityType = entityType.resolvePath(propertyValue.substring(0, propertyValue.lastIndexOf('/')))?.targetType;
|
|
333
328
|
}
|
|
334
329
|
key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
|
|
335
330
|
const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
|
|
@@ -382,7 +377,13 @@ function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, log
|
|
|
382
377
|
}
|
|
383
378
|
key = key.replace(/\//gi, '::');
|
|
384
379
|
return key
|
|
385
|
-
?
|
|
380
|
+
? {
|
|
381
|
+
key,
|
|
382
|
+
...(facetDefinition.Label && { label: facetDefinition.Label.toString() }),
|
|
383
|
+
...(facetDefinition.ID && { ID: facetDefinition.ID.toString() }),
|
|
384
|
+
entityType
|
|
385
|
+
}
|
|
386
|
+
: undefined;
|
|
386
387
|
}
|
|
387
388
|
exports.getSectionFacet = getSectionFacet;
|
|
388
389
|
/**
|
|
@@ -396,7 +397,7 @@ exports.getSectionFacet = getSectionFacet;
|
|
|
396
397
|
* @param {boolean} importScenario - indicates if the function is called for the import, else it is the export
|
|
397
398
|
* @returns returns section of the manifest based on path, generates an empty object in case it does not exists
|
|
398
399
|
*/
|
|
399
|
-
|
|
400
|
+
const getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
400
401
|
if (!path) {
|
|
401
402
|
return undefined;
|
|
402
403
|
}
|
|
@@ -423,6 +424,7 @@ exports.getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAn
|
|
|
423
424
|
}
|
|
424
425
|
return manifestSection;
|
|
425
426
|
};
|
|
427
|
+
exports.getManifestSectionByPathV4 = getManifestSectionByPathV4;
|
|
426
428
|
function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
427
429
|
let schemaKey, target, value;
|
|
428
430
|
switch (lineItemRecord.$Type) {
|
|
@@ -539,7 +541,6 @@ function getAnnotationTerm(path, alias, entityType) {
|
|
|
539
541
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
540
542
|
*/
|
|
541
543
|
function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
542
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
543
544
|
const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
|
|
544
545
|
let path = section ? section.key : '';
|
|
545
546
|
const targetEntityType = section.entityType;
|
|
@@ -548,16 +549,15 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
548
549
|
switch (annotationTerm) {
|
|
549
550
|
case "com.sap.vocabularies.UI.v1.Chart" /* Chart */: {
|
|
550
551
|
facets[path] = { base: types_1.FacetBase.Chart };
|
|
551
|
-
facets[path].target =
|
|
552
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
552
553
|
facets[path].entityType = targetEntityType;
|
|
553
554
|
break;
|
|
554
555
|
}
|
|
555
556
|
case "com.sap.vocabularies.UI.v1.Identification" /* Identification */: {
|
|
556
557
|
annotation = path.split('.')[path.split('.').length - 1];
|
|
557
|
-
targetAnnotation = targetEntityType.annotations[alias][annotation];
|
|
558
558
|
facets[path] = { base: types_1.FacetBase.Identification };
|
|
559
559
|
facets[path].entityType = targetEntityType;
|
|
560
|
-
facets[path].target =
|
|
560
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
561
561
|
break;
|
|
562
562
|
}
|
|
563
563
|
case "com.sap.vocabularies.UI.v1.LineItem" /* LineItem */: {
|
|
@@ -567,38 +567,38 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
567
567
|
path = pathParts.join('::');
|
|
568
568
|
}
|
|
569
569
|
facets[path] = { base: types_1.FacetBase.LineItem };
|
|
570
|
-
facets[path].target =
|
|
570
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
571
571
|
facets[path].entityType = targetEntityType;
|
|
572
572
|
break;
|
|
573
573
|
}
|
|
574
574
|
case "com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */: {
|
|
575
575
|
facets[path] = { base: types_1.FacetBase.Form };
|
|
576
|
-
facets[path].target =
|
|
576
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
577
577
|
facets[path].entityType = targetEntityType;
|
|
578
578
|
break;
|
|
579
579
|
}
|
|
580
580
|
case "com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */: {
|
|
581
581
|
facets[path] = { base: types_1.FacetBase.DataPoint };
|
|
582
|
-
facets[path].target =
|
|
582
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
583
583
|
facets[path].entityType = targetEntityType;
|
|
584
|
-
facets[path].Label =
|
|
584
|
+
facets[path].Label = annotationRecord?.Target?.$target['Title'];
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
587
|
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */: {
|
|
588
588
|
facets[path] = { base: types_1.FacetBase.PresentationVariant };
|
|
589
|
-
facets[path].target =
|
|
589
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
590
590
|
facets[path].entityType = targetEntityType;
|
|
591
591
|
break;
|
|
592
592
|
}
|
|
593
593
|
case "com.sap.vocabularies.Communication.v1.Contact" /* Contact */: {
|
|
594
594
|
facets[path] = { base: types_1.FacetBase.Contact };
|
|
595
|
-
facets[path].target =
|
|
595
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
596
596
|
facets[path].entityType = targetEntityType;
|
|
597
597
|
break;
|
|
598
598
|
}
|
|
599
599
|
case "com.sap.vocabularies.Communication.v1.Address" /* Address */: {
|
|
600
600
|
facets[path] = { base: types_1.FacetBase.Address };
|
|
601
|
-
facets[path].target =
|
|
601
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
602
602
|
facets[path].entityType = targetEntityType;
|
|
603
603
|
break;
|
|
604
604
|
}
|
|
@@ -637,7 +637,6 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
637
637
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
638
638
|
*/
|
|
639
639
|
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
640
|
-
var _a;
|
|
641
640
|
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
642
641
|
if (section) {
|
|
643
642
|
switch (annotationRecord.$Type) {
|
|
@@ -654,7 +653,7 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
654
653
|
annotationPath: annotationPath,
|
|
655
654
|
Label: section.label
|
|
656
655
|
});
|
|
657
|
-
|
|
656
|
+
annotationRecord.Facets?.forEach((collectionItem) => {
|
|
658
657
|
addFacetToConfig(collectionItem, oDataServiceAVT, serviceName, entityType, facet.facets, oDataVersion, logger);
|
|
659
658
|
});
|
|
660
659
|
break;
|
|
@@ -774,27 +773,12 @@ function determineV2Template(manifest, logger) {
|
|
|
774
773
|
}
|
|
775
774
|
exports.determineV2Template = determineV2Template;
|
|
776
775
|
/**
|
|
777
|
-
* Determines the template type of
|
|
778
|
-
* @param
|
|
779
|
-
* @
|
|
780
|
-
* @returns {TemplateType} the template type
|
|
776
|
+
* Determines the template type, based on the given manifest routing target entries of the app
|
|
777
|
+
* @param v4Pages - pages from routing targets
|
|
778
|
+
* @returns {TemplateType | undefined} the template type
|
|
781
779
|
*/
|
|
782
|
-
function
|
|
783
|
-
var _a, _b, _c, _d;
|
|
780
|
+
function determineV4TemplateFromPages(v4Pages) {
|
|
784
781
|
let templateType;
|
|
785
|
-
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
786
|
-
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
787
|
-
if (!v4Pages) {
|
|
788
|
-
extensionLogger_1.log(logger, {
|
|
789
|
-
severity: "error" /* Error */,
|
|
790
|
-
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
791
|
-
location: {
|
|
792
|
-
path: types_1.MANIFESTPATH,
|
|
793
|
-
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
return;
|
|
797
|
-
}
|
|
798
782
|
for (const pageKey in v4Pages) {
|
|
799
783
|
const v4Page = v4Pages[pageKey];
|
|
800
784
|
const pageType = getPageTypeV4(v4Page);
|
|
@@ -803,7 +787,7 @@ function determineV4Template(manifest, logger) {
|
|
|
803
787
|
break;
|
|
804
788
|
}
|
|
805
789
|
else if (pageType === ux_specification_types_1.PageTypeV4.ListReport) {
|
|
806
|
-
const viewPath =
|
|
790
|
+
const viewPath = v4Page.options?.settings?.views?.paths?.[0];
|
|
807
791
|
if (viewPath && (viewPath[ux_specification_types_1.ALPViewType.Primary] || viewPath[ux_specification_types_1.ALPViewType.Secondary])) {
|
|
808
792
|
templateType = TemplateType.AnalyticalListPageV4;
|
|
809
793
|
}
|
|
@@ -816,11 +800,36 @@ function determineV4Template(manifest, logger) {
|
|
|
816
800
|
templateType = TemplateType.ListReportObjectPageV4;
|
|
817
801
|
//fixed now for FEOP scenario, bit continue to check if LR/ALP exists
|
|
818
802
|
}
|
|
819
|
-
else if (
|
|
803
|
+
else if ([ux_specification_types_1.PageTypeV4.CustomPage, ux_specification_types_1.PageTypeV4.FPMCustomPage].includes(pageType)) {
|
|
820
804
|
templateType = TemplateType.FreestylePageV4;
|
|
821
805
|
break;
|
|
822
806
|
}
|
|
823
807
|
}
|
|
808
|
+
return templateType;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Determines the template type of a V4 app
|
|
812
|
+
* @param manifest - the manifest.json file
|
|
813
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
814
|
+
* @returns {TemplateType} the template type
|
|
815
|
+
*/
|
|
816
|
+
function determineV4Template(manifest, logger) {
|
|
817
|
+
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
818
|
+
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
819
|
+
// if there are no pages in routing targets, we use LROPV4 as default template type
|
|
820
|
+
if (!v4Pages || Object.keys(v4Pages).length === 0) {
|
|
821
|
+
extensionLogger_1.log(logger, {
|
|
822
|
+
severity: "info" /* Info */,
|
|
823
|
+
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
824
|
+
location: {
|
|
825
|
+
path: types_1.MANIFESTPATH,
|
|
826
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
return TemplateType.ListReportObjectPageV4;
|
|
830
|
+
}
|
|
831
|
+
// else try to determine template type from routing targets
|
|
832
|
+
const templateType = determineV4TemplateFromPages(v4Pages);
|
|
824
833
|
if (!templateType) {
|
|
825
834
|
extensionLogger_1.log(logger, {
|
|
826
835
|
severity: "error" /* Error */,
|
|
@@ -873,17 +882,17 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
|
873
882
|
* @param facetKey - key of the facet
|
|
874
883
|
*/
|
|
875
884
|
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
876
|
-
if (facet
|
|
885
|
+
if (facet?.ID) {
|
|
877
886
|
section.title = types_1.FacetTitlePrefix + facet.ID;
|
|
878
887
|
}
|
|
879
888
|
else {
|
|
880
889
|
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
881
890
|
}
|
|
882
891
|
// Description
|
|
883
|
-
if (facet
|
|
892
|
+
if (facet?.Label) {
|
|
884
893
|
section.description = facet.Label;
|
|
885
894
|
}
|
|
886
|
-
else if (facet
|
|
895
|
+
else if (facet?.ID) {
|
|
887
896
|
section.description = facet.ID;
|
|
888
897
|
}
|
|
889
898
|
else {
|
|
@@ -898,15 +907,14 @@ exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
|
898
907
|
* @param facetKey - key of the facet
|
|
899
908
|
*/
|
|
900
909
|
function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
901
|
-
var _a;
|
|
902
910
|
addSectionTitleAndDescription(facet, section, facetKey);
|
|
903
|
-
if (facet
|
|
904
|
-
section.description = facet
|
|
911
|
+
if (facet?.Label) {
|
|
912
|
+
section.description = facet?.Label;
|
|
905
913
|
}
|
|
906
|
-
else if (facet
|
|
914
|
+
else if (facet?.['Title']) {
|
|
907
915
|
section.description = facet['Title'];
|
|
908
916
|
}
|
|
909
|
-
else if (
|
|
917
|
+
else if (facet?.target?.['Title']) {
|
|
910
918
|
section.description = facet.target['Title'];
|
|
911
919
|
}
|
|
912
920
|
}
|
|
@@ -975,7 +983,7 @@ exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
|
975
983
|
* @param targetAnnotation - target annotation (optional, in case of sections, subsections)
|
|
976
984
|
* @param targetAnnotationEncoded - encoded version of the target annotation, as represented in the manifest
|
|
977
985
|
*/
|
|
978
|
-
|
|
986
|
+
const deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
979
987
|
if (!path) {
|
|
980
988
|
return;
|
|
981
989
|
}
|
|
@@ -1002,6 +1010,7 @@ exports.deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotati
|
|
|
1002
1010
|
manifestSection = manifestSection && manifestSection[decodedElement];
|
|
1003
1011
|
});
|
|
1004
1012
|
};
|
|
1013
|
+
exports.deleteEmptyStructure = deleteEmptyStructure;
|
|
1005
1014
|
/**
|
|
1006
1015
|
* Method which returns generic schema file name.
|
|
1007
1016
|
* @param {SchemaType | PageType} schemaType Schema type or Page type.
|
|
@@ -1019,7 +1028,7 @@ const getGenericSchemaFileName = (schemaType) => {
|
|
|
1019
1028
|
* @param {string} [entitySet] Entity set string.
|
|
1020
1029
|
* @return {SchemaFilePath} File path info.
|
|
1021
1030
|
*/
|
|
1022
|
-
|
|
1031
|
+
const getSchemaFilePath = (schemaType, entitySet) => {
|
|
1023
1032
|
const schemaFile = {
|
|
1024
1033
|
filename: '',
|
|
1025
1034
|
path: ''
|
|
@@ -1042,6 +1051,13 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
|
|
|
1042
1051
|
schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1043
1052
|
break;
|
|
1044
1053
|
}
|
|
1054
|
+
case ux_specification_types_1.PageTypeV4.FPMCustomPage: {
|
|
1055
|
+
// File name
|
|
1056
|
+
schemaFile.filename = getGenericSchemaFileName(ux_specification_types_1.PageTypeV4.CustomPage);
|
|
1057
|
+
// Full path
|
|
1058
|
+
schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1045
1061
|
// Other page configs
|
|
1046
1062
|
default: {
|
|
1047
1063
|
// File name
|
|
@@ -1054,6 +1070,7 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
|
|
|
1054
1070
|
schemaFile.path += '.json';
|
|
1055
1071
|
return schemaFile;
|
|
1056
1072
|
};
|
|
1073
|
+
exports.getSchemaFilePath = getSchemaFilePath;
|
|
1057
1074
|
/**
|
|
1058
1075
|
* Method which generates id of page according to passed parameters.
|
|
1059
1076
|
* @param appVersion - Fiori Elements version - V2 or V4.
|
|
@@ -1126,7 +1143,6 @@ function fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject
|
|
|
1126
1143
|
* @returns {NextDefinition} - Next target definition to process
|
|
1127
1144
|
*/
|
|
1128
1145
|
function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition) {
|
|
1129
|
-
var _a, _b, _c, _d;
|
|
1130
1146
|
let nextDefinition = {
|
|
1131
1147
|
configObject: undefined,
|
|
1132
1148
|
targetDefinition: {},
|
|
@@ -1135,7 +1151,7 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1135
1151
|
if (definitionArray.length) {
|
|
1136
1152
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1137
1153
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1138
|
-
if (
|
|
1154
|
+
if (nextDefinition?.targetDefinition?.['$ref'] || nextDefinition?.targetDefinition?.['type'] === 'array') {
|
|
1139
1155
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1140
1156
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1141
1157
|
return nextDefinition;
|
|
@@ -1143,15 +1159,19 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1143
1159
|
if (definitionArray.length > 1) {
|
|
1144
1160
|
definitionArray.forEach((element) => {
|
|
1145
1161
|
if (element !== '') {
|
|
1146
|
-
nextDefinition.targetDefinition['properties'] =
|
|
1162
|
+
nextDefinition.targetDefinition['properties'] = {
|
|
1163
|
+
...nextDefinition.targetDefinition['properties'],
|
|
1164
|
+
...appSchema['definitions'][element]['properties']
|
|
1165
|
+
};
|
|
1147
1166
|
}
|
|
1148
1167
|
});
|
|
1149
1168
|
}
|
|
1150
|
-
nextDefinition.title =
|
|
1169
|
+
nextDefinition.title = nextDefinition?.targetDefinition?.['title']
|
|
1170
|
+
? nextDefinition.targetDefinition['title']
|
|
1151
1171
|
: title;
|
|
1152
|
-
const factoryKey = lastDefinition
|
|
1172
|
+
const factoryKey = lastDefinition?.split('<')[0];
|
|
1153
1173
|
const targetObject = currentConfigObject ? currentConfigObject : {};
|
|
1154
|
-
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject,
|
|
1174
|
+
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject, nextDefinition?.targetDefinition?.['controlProperty']);
|
|
1155
1175
|
}
|
|
1156
1176
|
else {
|
|
1157
1177
|
//e.g. sections ==> loop over all properties = subsections or other
|
|
@@ -1195,7 +1215,7 @@ exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
|
1195
1215
|
* @param {*} options options object provided by deepmerge's merge function
|
|
1196
1216
|
* @returns
|
|
1197
1217
|
*/
|
|
1198
|
-
|
|
1218
|
+
const arrayCombineMerge = (target, source, options) => {
|
|
1199
1219
|
const destination = target.slice();
|
|
1200
1220
|
source.forEach((item, index) => {
|
|
1201
1221
|
if (typeof destination[index] === 'undefined') {
|
|
@@ -1210,6 +1230,7 @@ exports.arrayCombineMerge = (target, source, options) => {
|
|
|
1210
1230
|
});
|
|
1211
1231
|
return destination;
|
|
1212
1232
|
};
|
|
1233
|
+
exports.arrayCombineMerge = arrayCombineMerge;
|
|
1213
1234
|
/**
|
|
1214
1235
|
* Converts an enum into a CSV
|
|
1215
1236
|
* @param {object} manifestSection - manifestSection where the key exists
|