@sap/ux-specification 1.84.47 → 1.84.51
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-ListReport.html +1 -1
- package/dist/documentation/v4/v4-ObjectPage.html +1 -1
- package/dist/index-min.js +40 -40
- package/dist/index-min.js.map +3 -3
- 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 +3 -2
- package/dist/src/api.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 -9
- 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.js +10 -3
- 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 +14 -13
- 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 +90 -78
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/i18n.js +15 -2
- package/dist/src/sync/i18n.js.map +1 -1
- package/dist/src/sync/v2/application.d.ts.map +1 -1
- package/dist/src/sync/v2/application.js +33 -16
- package/dist/src/sync/v2/application.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.js +3 -1
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +3 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js +1 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Card.js +1 -0
- package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Field.js +1 -0
- package/dist/src/sync/v2/export/controls/Field.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.js +8 -2
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.js +1 -0
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +8 -8
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +11 -5
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.js +9 -9
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.js +9 -2
- package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ToolBar.js +1 -0
- package/dist/src/sync/v2/export/controls/ToolBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/index.js +30 -23
- package/dist/src/sync/v2/export/controls/index.js.map +1 -1
- package/dist/src/sync/v2/export/export.js +13 -16
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +3 -3
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/factory.js +15 -2
- package/dist/src/sync/v2/export/factory.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts.map +1 -1
- package/dist/src/sync/v2/export/manifest.js +7 -3
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +1 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ListReport.js +1 -0
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ObjectPage.js +1 -0
- package/dist/src/sync/v2/export/pages/ObjectPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.js +1 -0
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/index.js +14 -7
- package/dist/src/sync/v2/export/pages/index.js.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.js +17 -8
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +5 -5
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/generate.js +1 -0
- package/dist/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/src/sync/v2/generate/index.js +8 -7
- package/dist/src/sync/v2/generate/index.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/listReport.js +29 -32
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +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 +1 -2
- package/dist/src/sync/v4/application.d.ts.map +1 -1
- package/dist/src/sync/v4/application.js +40 -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 +33 -10
- package/dist/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.js +145 -68
- 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 +24 -30
- package/dist/src/sync/v4/export/export.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 +73 -31
- 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 +65 -33
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +20 -10
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +1 -0
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.js +39 -22
- 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 +10 -13
- 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/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 +32 -36
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +8 -8
|
@@ -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.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,12 +244,11 @@ 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 (
|
|
251
|
+
else if (v4App?.name === ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE ||
|
|
260
252
|
v4App.viewId ||
|
|
261
253
|
v4App.viewName) {
|
|
262
254
|
return ux_specification_types_1.PageTypeV4.CustomPage;
|
|
@@ -274,7 +266,10 @@ function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = fals
|
|
|
274
266
|
* @returns alias for the given namespace
|
|
275
267
|
*/
|
|
276
268
|
function findAlias(namespace, oDataServiceAVT) {
|
|
277
|
-
|
|
269
|
+
if (!oDataServiceAVT) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
let aliasReference = oDataServiceAVT.references.find((reference) => {
|
|
278
273
|
return reference.namespace === namespace;
|
|
279
274
|
});
|
|
280
275
|
if (!aliasReference) {
|
|
@@ -288,7 +283,7 @@ function findAlias(namespace, oDataServiceAVT) {
|
|
|
288
283
|
namespace.split('SAP__')[namespace.split('SAP__').length - 1].toUpperCase());
|
|
289
284
|
});
|
|
290
285
|
}
|
|
291
|
-
return aliasReference
|
|
286
|
+
return aliasReference?.alias;
|
|
292
287
|
}
|
|
293
288
|
exports.findAlias = findAlias;
|
|
294
289
|
/**
|
|
@@ -299,11 +294,10 @@ exports.findAlias = findAlias;
|
|
|
299
294
|
* @returns the target annotation
|
|
300
295
|
*/
|
|
301
296
|
function determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT) {
|
|
302
|
-
var _a;
|
|
303
297
|
const lastNavigationPart = navigationParts[navigationParts.length - 1];
|
|
304
298
|
const annotation = lastNavigationPart.substring(lastNavigationPart.lastIndexOf('.') + 1, lastNavigationPart.length);
|
|
305
299
|
const alias = findAlias(lastNavigationPart.substring(0, lastNavigationPart.lastIndexOf('.')).replace('@', ''), oDataServiceAVT);
|
|
306
|
-
return
|
|
300
|
+
return entityType?.annotations[alias]?.[annotation];
|
|
307
301
|
}
|
|
308
302
|
/**
|
|
309
303
|
* Adjust key by considering navigation
|
|
@@ -324,12 +318,11 @@ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
|
|
|
324
318
|
return key;
|
|
325
319
|
}
|
|
326
320
|
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
327
|
-
var _a;
|
|
328
321
|
let stopProcessing = false;
|
|
329
322
|
const navigationParts = propertyValue.split('/');
|
|
330
323
|
const navigation = navigationParts.length > 1;
|
|
331
324
|
if (navigation) {
|
|
332
|
-
entityType =
|
|
325
|
+
entityType = entityType.resolvePath(propertyValue.substring(0, propertyValue.lastIndexOf('/')))?.targetType;
|
|
333
326
|
}
|
|
334
327
|
key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
|
|
335
328
|
const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
|
|
@@ -382,7 +375,13 @@ function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, log
|
|
|
382
375
|
}
|
|
383
376
|
key = key.replace(/\//gi, '::');
|
|
384
377
|
return key
|
|
385
|
-
?
|
|
378
|
+
? {
|
|
379
|
+
key,
|
|
380
|
+
...(facetDefinition.Label && { label: facetDefinition.Label.toString() }),
|
|
381
|
+
...(facetDefinition.ID && { ID: facetDefinition.ID.toString() }),
|
|
382
|
+
entityType
|
|
383
|
+
}
|
|
384
|
+
: undefined;
|
|
386
385
|
}
|
|
387
386
|
exports.getSectionFacet = getSectionFacet;
|
|
388
387
|
/**
|
|
@@ -396,7 +395,7 @@ exports.getSectionFacet = getSectionFacet;
|
|
|
396
395
|
* @param {boolean} importScenario - indicates if the function is called for the import, else it is the export
|
|
397
396
|
* @returns returns section of the manifest based on path, generates an empty object in case it does not exists
|
|
398
397
|
*/
|
|
399
|
-
|
|
398
|
+
const getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
400
399
|
if (!path) {
|
|
401
400
|
return undefined;
|
|
402
401
|
}
|
|
@@ -423,6 +422,7 @@ exports.getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAn
|
|
|
423
422
|
}
|
|
424
423
|
return manifestSection;
|
|
425
424
|
};
|
|
425
|
+
exports.getManifestSectionByPathV4 = getManifestSectionByPathV4;
|
|
426
426
|
function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
427
427
|
let schemaKey, target, value;
|
|
428
428
|
switch (lineItemRecord.$Type) {
|
|
@@ -539,7 +539,6 @@ function getAnnotationTerm(path, alias, entityType) {
|
|
|
539
539
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
540
540
|
*/
|
|
541
541
|
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
542
|
const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
|
|
544
543
|
let path = section ? section.key : '';
|
|
545
544
|
const targetEntityType = section.entityType;
|
|
@@ -548,16 +547,15 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
548
547
|
switch (annotationTerm) {
|
|
549
548
|
case "com.sap.vocabularies.UI.v1.Chart" /* Chart */: {
|
|
550
549
|
facets[path] = { base: types_1.FacetBase.Chart };
|
|
551
|
-
facets[path].target =
|
|
550
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
552
551
|
facets[path].entityType = targetEntityType;
|
|
553
552
|
break;
|
|
554
553
|
}
|
|
555
554
|
case "com.sap.vocabularies.UI.v1.Identification" /* Identification */: {
|
|
556
555
|
annotation = path.split('.')[path.split('.').length - 1];
|
|
557
|
-
targetAnnotation = targetEntityType.annotations[alias][annotation];
|
|
558
556
|
facets[path] = { base: types_1.FacetBase.Identification };
|
|
559
557
|
facets[path].entityType = targetEntityType;
|
|
560
|
-
facets[path].target =
|
|
558
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
561
559
|
break;
|
|
562
560
|
}
|
|
563
561
|
case "com.sap.vocabularies.UI.v1.LineItem" /* LineItem */: {
|
|
@@ -567,38 +565,38 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
567
565
|
path = pathParts.join('::');
|
|
568
566
|
}
|
|
569
567
|
facets[path] = { base: types_1.FacetBase.LineItem };
|
|
570
|
-
facets[path].target =
|
|
568
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
571
569
|
facets[path].entityType = targetEntityType;
|
|
572
570
|
break;
|
|
573
571
|
}
|
|
574
572
|
case "com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */: {
|
|
575
573
|
facets[path] = { base: types_1.FacetBase.Form };
|
|
576
|
-
facets[path].target =
|
|
574
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
577
575
|
facets[path].entityType = targetEntityType;
|
|
578
576
|
break;
|
|
579
577
|
}
|
|
580
578
|
case "com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */: {
|
|
581
579
|
facets[path] = { base: types_1.FacetBase.DataPoint };
|
|
582
|
-
facets[path].target =
|
|
580
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
583
581
|
facets[path].entityType = targetEntityType;
|
|
584
|
-
facets[path].Label =
|
|
582
|
+
facets[path].Label = annotationRecord?.Target?.$target['Title'];
|
|
585
583
|
break;
|
|
586
584
|
}
|
|
587
585
|
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */: {
|
|
588
586
|
facets[path] = { base: types_1.FacetBase.PresentationVariant };
|
|
589
|
-
facets[path].target =
|
|
587
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
590
588
|
facets[path].entityType = targetEntityType;
|
|
591
589
|
break;
|
|
592
590
|
}
|
|
593
591
|
case "com.sap.vocabularies.Communication.v1.Contact" /* Contact */: {
|
|
594
592
|
facets[path] = { base: types_1.FacetBase.Contact };
|
|
595
|
-
facets[path].target =
|
|
593
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
596
594
|
facets[path].entityType = targetEntityType;
|
|
597
595
|
break;
|
|
598
596
|
}
|
|
599
597
|
case "com.sap.vocabularies.Communication.v1.Address" /* Address */: {
|
|
600
598
|
facets[path] = { base: types_1.FacetBase.Address };
|
|
601
|
-
facets[path].target =
|
|
599
|
+
facets[path].target = annotationRecord?.Target?.$target;
|
|
602
600
|
facets[path].entityType = targetEntityType;
|
|
603
601
|
break;
|
|
604
602
|
}
|
|
@@ -637,7 +635,6 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
637
635
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
638
636
|
*/
|
|
639
637
|
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
640
|
-
var _a;
|
|
641
638
|
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
642
639
|
if (section) {
|
|
643
640
|
switch (annotationRecord.$Type) {
|
|
@@ -654,7 +651,7 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
654
651
|
annotationPath: annotationPath,
|
|
655
652
|
Label: section.label
|
|
656
653
|
});
|
|
657
|
-
|
|
654
|
+
annotationRecord.Facets?.forEach((collectionItem) => {
|
|
658
655
|
addFacetToConfig(collectionItem, oDataServiceAVT, serviceName, entityType, facet.facets, oDataVersion, logger);
|
|
659
656
|
});
|
|
660
657
|
break;
|
|
@@ -774,27 +771,12 @@ function determineV2Template(manifest, logger) {
|
|
|
774
771
|
}
|
|
775
772
|
exports.determineV2Template = determineV2Template;
|
|
776
773
|
/**
|
|
777
|
-
* Determines the template type of
|
|
778
|
-
* @param
|
|
779
|
-
* @
|
|
780
|
-
* @returns {TemplateType} the template type
|
|
774
|
+
* Determines the template type, based on the given manifest routing target entries of the app
|
|
775
|
+
* @param v4Pages - pages from routing targets
|
|
776
|
+
* @returns {TemplateType | undefined} the template type
|
|
781
777
|
*/
|
|
782
|
-
function
|
|
783
|
-
var _a, _b, _c, _d;
|
|
778
|
+
function determineV4TemplateFromPages(v4Pages) {
|
|
784
779
|
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
780
|
for (const pageKey in v4Pages) {
|
|
799
781
|
const v4Page = v4Pages[pageKey];
|
|
800
782
|
const pageType = getPageTypeV4(v4Page);
|
|
@@ -803,7 +785,7 @@ function determineV4Template(manifest, logger) {
|
|
|
803
785
|
break;
|
|
804
786
|
}
|
|
805
787
|
else if (pageType === ux_specification_types_1.PageTypeV4.ListReport) {
|
|
806
|
-
const viewPath =
|
|
788
|
+
const viewPath = v4Page.options?.settings?.views?.paths?.[0];
|
|
807
789
|
if (viewPath && (viewPath[ux_specification_types_1.ALPViewType.Primary] || viewPath[ux_specification_types_1.ALPViewType.Secondary])) {
|
|
808
790
|
templateType = TemplateType.AnalyticalListPageV4;
|
|
809
791
|
}
|
|
@@ -821,6 +803,31 @@ function determineV4Template(manifest, logger) {
|
|
|
821
803
|
break;
|
|
822
804
|
}
|
|
823
805
|
}
|
|
806
|
+
return templateType;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Determines the template type of a V4 app
|
|
810
|
+
* @param manifest - the manifest.json file
|
|
811
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
812
|
+
* @returns {TemplateType} the template type
|
|
813
|
+
*/
|
|
814
|
+
function determineV4Template(manifest, logger) {
|
|
815
|
+
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
816
|
+
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
817
|
+
// if there are no pages in routing targets, we use LROPV4 as default template type
|
|
818
|
+
if (!v4Pages || Object.keys(v4Pages).length === 0) {
|
|
819
|
+
extensionLogger_1.log(logger, {
|
|
820
|
+
severity: "info" /* Info */,
|
|
821
|
+
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
822
|
+
location: {
|
|
823
|
+
path: types_1.MANIFESTPATH,
|
|
824
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
return TemplateType.ListReportObjectPageV4;
|
|
828
|
+
}
|
|
829
|
+
// else try to determine template type from routing targets
|
|
830
|
+
const templateType = determineV4TemplateFromPages(v4Pages);
|
|
824
831
|
if (!templateType) {
|
|
825
832
|
extensionLogger_1.log(logger, {
|
|
826
833
|
severity: "error" /* Error */,
|
|
@@ -873,17 +880,17 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
|
873
880
|
* @param facetKey - key of the facet
|
|
874
881
|
*/
|
|
875
882
|
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
876
|
-
if (facet
|
|
883
|
+
if (facet?.ID) {
|
|
877
884
|
section.title = types_1.FacetTitlePrefix + facet.ID;
|
|
878
885
|
}
|
|
879
886
|
else {
|
|
880
887
|
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
881
888
|
}
|
|
882
889
|
// Description
|
|
883
|
-
if (facet
|
|
890
|
+
if (facet?.Label) {
|
|
884
891
|
section.description = facet.Label;
|
|
885
892
|
}
|
|
886
|
-
else if (facet
|
|
893
|
+
else if (facet?.ID) {
|
|
887
894
|
section.description = facet.ID;
|
|
888
895
|
}
|
|
889
896
|
else {
|
|
@@ -898,15 +905,14 @@ exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
|
898
905
|
* @param facetKey - key of the facet
|
|
899
906
|
*/
|
|
900
907
|
function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
901
|
-
var _a;
|
|
902
908
|
addSectionTitleAndDescription(facet, section, facetKey);
|
|
903
|
-
if (facet
|
|
904
|
-
section.description = facet
|
|
909
|
+
if (facet?.Label) {
|
|
910
|
+
section.description = facet?.Label;
|
|
905
911
|
}
|
|
906
|
-
else if (facet
|
|
912
|
+
else if (facet?.['Title']) {
|
|
907
913
|
section.description = facet['Title'];
|
|
908
914
|
}
|
|
909
|
-
else if (
|
|
915
|
+
else if (facet?.target?.['Title']) {
|
|
910
916
|
section.description = facet.target['Title'];
|
|
911
917
|
}
|
|
912
918
|
}
|
|
@@ -975,7 +981,7 @@ exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
|
975
981
|
* @param targetAnnotation - target annotation (optional, in case of sections, subsections)
|
|
976
982
|
* @param targetAnnotationEncoded - encoded version of the target annotation, as represented in the manifest
|
|
977
983
|
*/
|
|
978
|
-
|
|
984
|
+
const deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
979
985
|
if (!path) {
|
|
980
986
|
return;
|
|
981
987
|
}
|
|
@@ -1002,6 +1008,7 @@ exports.deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotati
|
|
|
1002
1008
|
manifestSection = manifestSection && manifestSection[decodedElement];
|
|
1003
1009
|
});
|
|
1004
1010
|
};
|
|
1011
|
+
exports.deleteEmptyStructure = deleteEmptyStructure;
|
|
1005
1012
|
/**
|
|
1006
1013
|
* Method which returns generic schema file name.
|
|
1007
1014
|
* @param {SchemaType | PageType} schemaType Schema type or Page type.
|
|
@@ -1019,7 +1026,7 @@ const getGenericSchemaFileName = (schemaType) => {
|
|
|
1019
1026
|
* @param {string} [entitySet] Entity set string.
|
|
1020
1027
|
* @return {SchemaFilePath} File path info.
|
|
1021
1028
|
*/
|
|
1022
|
-
|
|
1029
|
+
const getSchemaFilePath = (schemaType, entitySet) => {
|
|
1023
1030
|
const schemaFile = {
|
|
1024
1031
|
filename: '',
|
|
1025
1032
|
path: ''
|
|
@@ -1054,6 +1061,7 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
|
|
|
1054
1061
|
schemaFile.path += '.json';
|
|
1055
1062
|
return schemaFile;
|
|
1056
1063
|
};
|
|
1064
|
+
exports.getSchemaFilePath = getSchemaFilePath;
|
|
1057
1065
|
/**
|
|
1058
1066
|
* Method which generates id of page according to passed parameters.
|
|
1059
1067
|
* @param appVersion - Fiori Elements version - V2 or V4.
|
|
@@ -1126,7 +1134,6 @@ function fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject
|
|
|
1126
1134
|
* @returns {NextDefinition} - Next target definition to process
|
|
1127
1135
|
*/
|
|
1128
1136
|
function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition) {
|
|
1129
|
-
var _a, _b, _c, _d;
|
|
1130
1137
|
let nextDefinition = {
|
|
1131
1138
|
configObject: undefined,
|
|
1132
1139
|
targetDefinition: {},
|
|
@@ -1135,7 +1142,7 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1135
1142
|
if (definitionArray.length) {
|
|
1136
1143
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1137
1144
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1138
|
-
if (
|
|
1145
|
+
if (nextDefinition?.targetDefinition?.['$ref'] || nextDefinition?.targetDefinition?.['type'] === 'array') {
|
|
1139
1146
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1140
1147
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1141
1148
|
return nextDefinition;
|
|
@@ -1143,15 +1150,19 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1143
1150
|
if (definitionArray.length > 1) {
|
|
1144
1151
|
definitionArray.forEach((element) => {
|
|
1145
1152
|
if (element !== '') {
|
|
1146
|
-
nextDefinition.targetDefinition['properties'] =
|
|
1153
|
+
nextDefinition.targetDefinition['properties'] = {
|
|
1154
|
+
...nextDefinition.targetDefinition['properties'],
|
|
1155
|
+
...appSchema['definitions'][element]['properties']
|
|
1156
|
+
};
|
|
1147
1157
|
}
|
|
1148
1158
|
});
|
|
1149
1159
|
}
|
|
1150
|
-
nextDefinition.title =
|
|
1160
|
+
nextDefinition.title = nextDefinition?.targetDefinition?.['title']
|
|
1161
|
+
? nextDefinition.targetDefinition['title']
|
|
1151
1162
|
: title;
|
|
1152
|
-
const factoryKey = lastDefinition
|
|
1163
|
+
const factoryKey = lastDefinition?.split('<')[0];
|
|
1153
1164
|
const targetObject = currentConfigObject ? currentConfigObject : {};
|
|
1154
|
-
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject,
|
|
1165
|
+
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject, nextDefinition?.targetDefinition?.['controlProperty']);
|
|
1155
1166
|
}
|
|
1156
1167
|
else {
|
|
1157
1168
|
//e.g. sections ==> loop over all properties = subsections or other
|
|
@@ -1195,7 +1206,7 @@ exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
|
1195
1206
|
* @param {*} options options object provided by deepmerge's merge function
|
|
1196
1207
|
* @returns
|
|
1197
1208
|
*/
|
|
1198
|
-
|
|
1209
|
+
const arrayCombineMerge = (target, source, options) => {
|
|
1199
1210
|
const destination = target.slice();
|
|
1200
1211
|
source.forEach((item, index) => {
|
|
1201
1212
|
if (typeof destination[index] === 'undefined') {
|
|
@@ -1210,6 +1221,7 @@ exports.arrayCombineMerge = (target, source, options) => {
|
|
|
1210
1221
|
});
|
|
1211
1222
|
return destination;
|
|
1212
1223
|
};
|
|
1224
|
+
exports.arrayCombineMerge = arrayCombineMerge;
|
|
1213
1225
|
/**
|
|
1214
1226
|
* Converts an enum into a CSV
|
|
1215
1227
|
* @param {object} manifestSection - manifestSection where the key exists
|