@sap/ux-specification 1.71.118 → 1.71.120
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 +53 -0
- package/dist/documentation/runDocu-min.js.map +3 -3
- 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-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/index-min.js +34 -34
- package/dist/index-min.js.map +3 -3
- package/dist/specification/package.json +5 -5
- package/dist/specification/scripts/documentation/components/filter.js +1 -3
- package/dist/specification/scripts/documentation/components/filter.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/TreeUI.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/TreeUI.js +2 -1
- package/dist/specification/scripts/documentation/components/ui/TreeUI.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/keyboardNavigation.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/keyboardNavigation.js +4 -4
- package/dist/specification/scripts/documentation/components/ui/keyboardNavigation.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/search.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/search.js +8 -6
- package/dist/specification/scripts/documentation/components/ui/search.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/toggle.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/toggle.js +10 -8
- package/dist/specification/scripts/documentation/components/ui/toggle.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/tooltip.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/tooltip.js +17 -13
- package/dist/specification/scripts/documentation/components/ui/tooltip.js.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/utils.d.ts.map +1 -1
- package/dist/specification/scripts/documentation/components/ui/utils.js +14 -11
- package/dist/specification/scripts/documentation/components/ui/utils.js.map +1 -1
- package/dist/specification/scripts/extractDocu.js +22 -11
- package/dist/specification/scripts/extractDocu.js.map +1 -1
- package/dist/specification/scripts/to-json-schema.js +2 -3
- package/dist/specification/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/src/api.js +10 -10
- package/dist/specification/src/api.js.map +1 -1
- package/dist/specification/src/extensionLogger.js +2 -2
- package/dist/specification/src/i18n/i18n.js +1 -2
- package/dist/specification/src/i18n/i18n.js.map +1 -1
- package/dist/specification/src/project.d.ts.map +1 -1
- package/dist/specification/src/specification/schemaAccess.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/control.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/control.js +5 -5
- package/dist/specification/src/sync/common/decoration/control.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +3 -3
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/flex.js +1 -2
- package/dist/specification/src/sync/common/decoration/flex.js.map +1 -1
- package/dist/specification/src/sync/common/flexUtils.js +4 -5
- package/dist/specification/src/sync/common/flexUtils.js.map +1 -1
- package/dist/specification/src/sync/common/generate/objectPage.js +7 -8
- package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +30 -30
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/import/utils.js +6 -7
- package/dist/specification/src/sync/common/import/utils.js.map +1 -1
- package/dist/specification/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/specification/src/sync/common/importProject.js +6 -7
- package/dist/specification/src/sync/common/importProject.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +2 -3
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +101 -97
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/i18n.js +1 -2
- package/dist/specification/src/sync/i18n.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Card.js +2 -2
- package/dist/specification/src/sync/v2/export/controls/Card.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/Fragment.js +4 -4
- package/dist/specification/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/specification/src/sync/v2/export/controls/ObjectPageHeaderSection.js +6 -6
- package/dist/specification/src/sync/v2/export/controls/Table.js +3 -3
- package/dist/specification/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/export.js +4 -10
- package/dist/specification/src/sync/v2/export/export.js.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPage.js +6 -7
- package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/specification/src/sync/v2/export/factory.js +8 -8
- package/dist/specification/src/sync/v2/export/manifest.js +2 -3
- package/dist/specification/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/specification/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +2 -3
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/generate.js +4 -5
- package/dist/specification/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.js +2 -3
- package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.js +4 -5
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.js +3 -4
- package/dist/specification/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/utils.js +12 -15
- package/dist/specification/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.js +2 -2
- package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/specification/src/sync/v2/import/common/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/common/index.js +10 -9
- package/dist/specification/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/specification/src/sync/v2/import/controls/table.js +1 -2
- package/dist/specification/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js +1 -2
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.js +1 -2
- package/dist/specification/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.js +8 -10
- package/dist/specification/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/overviewPage.js +1 -2
- package/dist/specification/src/sync/v2/import/pages/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/utils.js +8 -9
- package/dist/specification/src/sync/v2/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js +3 -3
- package/dist/specification/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/types/src/common/page.d.ts +1 -1
- package/dist/types/src/common/page.d.ts.map +1 -1
- package/dist/types/src/common/page.js.map +1 -1
- package/dist/types/src/common/types.d.ts +3 -3
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +4 -4
- package/dist/types/src/common/types.js.map +1 -1
- package/package.json +5 -5
|
@@ -3,9 +3,37 @@ 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.
|
|
6
|
+
exports.arrayCombineMerge = exports.getSchemaFilePath = exports.deleteEmptyStructure = exports.getManifestSectionByPathV4 = exports.getAnnotationPropertyValue = exports.createAnnotationPath = exports.arrayIncludes = exports.DEFINITION_LINK_PREFIX = void 0;
|
|
7
|
+
exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
|
|
8
|
+
exports.evaluateCommonLabel = evaluateCommonLabel;
|
|
9
|
+
exports.getLabelForPropertyPath = getLabelForPropertyPath;
|
|
10
|
+
exports.getLabelForDataField = getLabelForDataField;
|
|
11
|
+
exports.getDatafieldDescription = getDatafieldDescription;
|
|
12
|
+
exports.prepareRef = prepareRef;
|
|
13
|
+
exports.getPageTypeV2 = getPageTypeV2;
|
|
14
|
+
exports.findAlias = findAlias;
|
|
15
|
+
exports.getSectionFacet = getSectionFacet;
|
|
16
|
+
exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
|
|
17
|
+
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
18
|
+
exports.getObjectPageFacets = getObjectPageFacets;
|
|
19
|
+
exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
20
|
+
exports.getMainService = getMainService;
|
|
21
|
+
exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
22
|
+
exports.determineV2Template = determineV2Template;
|
|
23
|
+
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
24
|
+
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
25
|
+
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
26
|
+
exports.createDefaultSection = createDefaultSection;
|
|
27
|
+
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
28
|
+
exports.generatePageId = generatePageId;
|
|
29
|
+
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
30
|
+
exports.convertEnumToCSV = convertEnumToCSV;
|
|
31
|
+
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
32
|
+
exports.updatePropertyIndices = updatePropertyIndices;
|
|
33
|
+
exports.removeNamespaces = removeNamespaces;
|
|
34
|
+
exports.replaceNamespaces = replaceNamespaces;
|
|
35
|
+
exports.getErrorMessage = getErrorMessage;
|
|
7
36
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
8
|
-
const ux_specification_types_2 = require("@sap/ux-specification-types");
|
|
9
37
|
const i18next_1 = __importDefault(require("i18next"));
|
|
10
38
|
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
11
39
|
const annotation_converter_1 = require("@sap-ux/annotation-converter");
|
|
@@ -60,7 +88,6 @@ function parseAndMergeAndConvert(annotationFiles, logger) {
|
|
|
60
88
|
}
|
|
61
89
|
return converterOutput;
|
|
62
90
|
}
|
|
63
|
-
exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
|
|
64
91
|
const getAnnotationPropertyValue = (annotationProperty) => annotationProperty?.value || annotationProperty?.path;
|
|
65
92
|
exports.getAnnotationPropertyValue = getAnnotationPropertyValue;
|
|
66
93
|
/**
|
|
@@ -89,7 +116,6 @@ function evaluateCommonLabel(annotations, entityType, label) {
|
|
|
89
116
|
}
|
|
90
117
|
return label;
|
|
91
118
|
}
|
|
92
|
-
exports.evaluateCommonLabel = evaluateCommonLabel;
|
|
93
119
|
/**
|
|
94
120
|
* Determines the label for a property path
|
|
95
121
|
* @param {PropertyPath} propertyPath - property path
|
|
@@ -103,7 +129,6 @@ function getLabelForPropertyPath(propertyPath, entityType) {
|
|
|
103
129
|
}
|
|
104
130
|
return label;
|
|
105
131
|
}
|
|
106
|
-
exports.getLabelForPropertyPath = getLabelForPropertyPath;
|
|
107
132
|
/**
|
|
108
133
|
* Determines the label for a LineItem record
|
|
109
134
|
* @param {DataFieldAbstractType} field - Line item record
|
|
@@ -131,7 +156,6 @@ function getLabelForDataField(field, entityType) {
|
|
|
131
156
|
}
|
|
132
157
|
return label;
|
|
133
158
|
}
|
|
134
|
-
exports.getLabelForDataField = getLabelForDataField;
|
|
135
159
|
/**
|
|
136
160
|
* Function to resolve the dataField label
|
|
137
161
|
* @param dataFieldLabel - Given dataField label; might be of type string, or an object in case of a path reference
|
|
@@ -221,31 +245,29 @@ function getDatafieldDescription(dataFieldAbstract, entityType) {
|
|
|
221
245
|
}
|
|
222
246
|
return title;
|
|
223
247
|
}
|
|
224
|
-
catch
|
|
248
|
+
catch {
|
|
225
249
|
return title;
|
|
226
250
|
}
|
|
227
251
|
}
|
|
228
|
-
exports.getDatafieldDescription = getDatafieldDescription;
|
|
229
252
|
/**
|
|
230
253
|
* Prepare string for reference use in schema
|
|
231
254
|
* @param refInput string to be character checked and replaced
|
|
232
255
|
* @returns string with replaced characters
|
|
233
256
|
*/
|
|
257
|
+
//@typescript-eslint/no-wrapper-object-types turned off tor prevent conversion String > string; String is used by AVT
|
|
234
258
|
function prepareRef(refInput) {
|
|
235
259
|
return refInput.replace('#', '::').replace(/\//g, ':2f');
|
|
236
260
|
}
|
|
237
|
-
exports.prepareRef = prepareRef;
|
|
238
261
|
/**
|
|
239
262
|
* Return the page type for a given V2 page in manifest
|
|
240
263
|
* @param name - page component name
|
|
241
264
|
*/
|
|
242
265
|
function getPageTypeV2(name) {
|
|
243
266
|
if (name) {
|
|
244
|
-
const templatePart = `${
|
|
267
|
+
const templatePart = `${ux_specification_types_1.v2.FE_TEMPLATE_V2}.`;
|
|
245
268
|
return name.split(templatePart)[1];
|
|
246
269
|
}
|
|
247
270
|
}
|
|
248
|
-
exports.getPageTypeV2 = getPageTypeV2;
|
|
249
271
|
function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = false) {
|
|
250
272
|
const termWithQualifier = `${targetAnnotation.term}#${targetAnnotation.qualifier}`;
|
|
251
273
|
return `${!keyForRelatedFacetKeys ? '@' : ''}${targetAnnotation.qualifier ? termWithQualifier : targetAnnotation.term}`;
|
|
@@ -276,7 +298,6 @@ function findAlias(namespace, oDataServiceAVT) {
|
|
|
276
298
|
}
|
|
277
299
|
return aliasReference?.alias;
|
|
278
300
|
}
|
|
279
|
-
exports.findAlias = findAlias;
|
|
280
301
|
/**
|
|
281
302
|
* Determines the target annotation
|
|
282
303
|
* @param navigationParts - parts of the target annotation path
|
|
@@ -304,11 +325,11 @@ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
|
|
|
304
325
|
key = pathParts.join('::');
|
|
305
326
|
}
|
|
306
327
|
else {
|
|
307
|
-
key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}${
|
|
328
|
+
key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}${ux_specification_types_1.UIVOCABULARY}`);
|
|
308
329
|
}
|
|
309
330
|
return key;
|
|
310
331
|
}
|
|
311
|
-
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion =
|
|
332
|
+
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
312
333
|
let stopProcessing = false;
|
|
313
334
|
let namespace;
|
|
314
335
|
const navigationParts = propertyValue.split('/');
|
|
@@ -319,7 +340,7 @@ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, p
|
|
|
319
340
|
key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
|
|
320
341
|
const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
|
|
321
342
|
if (targetAnnotation) {
|
|
322
|
-
const separator = oDataVersion ===
|
|
343
|
+
const separator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '#';
|
|
323
344
|
key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
|
|
324
345
|
namespace = targetAnnotation.fullyQualifiedName?.split('@')[0];
|
|
325
346
|
}
|
|
@@ -328,7 +349,7 @@ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, p
|
|
|
328
349
|
return { key, entityType, stopProcessing, namespace };
|
|
329
350
|
}
|
|
330
351
|
if (navigation) {
|
|
331
|
-
const navSeparator = oDataVersion ===
|
|
352
|
+
const navSeparator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '/';
|
|
332
353
|
navigationParts.pop();
|
|
333
354
|
const navigationIDs = [...navigationParts].join(navSeparator);
|
|
334
355
|
key = `${navigationIDs}${navSeparator}${key}`;
|
|
@@ -344,7 +365,7 @@ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, p
|
|
|
344
365
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
345
366
|
* @returns {FacetSection} - object comprising the relevant facet information
|
|
346
367
|
*/
|
|
347
|
-
function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion =
|
|
368
|
+
function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
348
369
|
//Take facet ID as fallback
|
|
349
370
|
const facetName = facetDefinition.fullyQualifiedName?.substring(facetDefinition.fullyQualifiedName?.lastIndexOf('@'));
|
|
350
371
|
let key = facetDefinition.ID ? facetDefinition.ID.toString() : facetName;
|
|
@@ -382,7 +403,6 @@ function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, log
|
|
|
382
403
|
return undefined;
|
|
383
404
|
}
|
|
384
405
|
}
|
|
385
|
-
exports.getSectionFacet = getSectionFacet;
|
|
386
406
|
/**
|
|
387
407
|
* Finds the alias for a given namespace in the references' section of the converted service metadata.
|
|
388
408
|
* An empty object is created if the path element does not exist yet.
|
|
@@ -440,7 +460,7 @@ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
|
440
460
|
schemaKey =
|
|
441
461
|
'DataFieldForAnnotation:::sTarget::' +
|
|
442
462
|
target
|
|
443
|
-
.replace('@UI', `@${
|
|
463
|
+
.replace('@UI', `@${ux_specification_types_1.UIVOCABULARY}`)
|
|
444
464
|
.replace('@Communication', '@com.sap.vocabularies.Communication.v1')
|
|
445
465
|
.replace('@Contact', '@com.sap.vocabularies.Contact.v1');
|
|
446
466
|
}
|
|
@@ -469,7 +489,6 @@ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
|
469
489
|
}
|
|
470
490
|
return schemaKey;
|
|
471
491
|
}
|
|
472
|
-
exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
|
|
473
492
|
/**
|
|
474
493
|
* Determines if type of given annotation term is of UIAnnotationTerm
|
|
475
494
|
* @param {string} path path in manifest
|
|
@@ -536,20 +555,20 @@ function getAnnotationTerm(path, alias, entityType) {
|
|
|
536
555
|
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
537
556
|
*/
|
|
538
557
|
function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT) {
|
|
539
|
-
const alias = findAlias(
|
|
558
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
540
559
|
let path = section ? section.key : '';
|
|
541
560
|
const targetEntityType = section.entityType;
|
|
542
561
|
const annotationTerm = getAnnotationTerm(path, alias, entityType);
|
|
543
562
|
switch (annotationTerm) {
|
|
544
563
|
case "com.sap.vocabularies.UI.v1.Chart" /* UIAnnotationTerms.Chart */: {
|
|
545
|
-
facets[path] = { base:
|
|
564
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Chart };
|
|
546
565
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
547
566
|
facets[path].entityType = targetEntityType;
|
|
548
567
|
facets[path].namespace = section.namespace;
|
|
549
568
|
break;
|
|
550
569
|
}
|
|
551
570
|
case "com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */: {
|
|
552
|
-
facets[path] = { base:
|
|
571
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Identification };
|
|
553
572
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
554
573
|
facets[path].entityType = targetEntityType;
|
|
555
574
|
facets[path].namespace = section.namespace;
|
|
@@ -561,21 +580,21 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
561
580
|
pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
562
581
|
path = pathParts.join('::');
|
|
563
582
|
}
|
|
564
|
-
facets[path] = { base:
|
|
583
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.LineItem };
|
|
565
584
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
566
585
|
facets[path].entityType = targetEntityType;
|
|
567
586
|
facets[path].namespace = section.namespace;
|
|
568
587
|
break;
|
|
569
588
|
}
|
|
570
589
|
case "com.sap.vocabularies.UI.v1.FieldGroup" /* UIAnnotationTerms.FieldGroup */: {
|
|
571
|
-
facets[path] = { base:
|
|
590
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Form };
|
|
572
591
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
573
592
|
facets[path].entityType = targetEntityType;
|
|
574
593
|
facets[path].namespace = section.namespace;
|
|
575
594
|
break;
|
|
576
595
|
}
|
|
577
596
|
case "com.sap.vocabularies.UI.v1.DataPoint" /* UIAnnotationTerms.DataPoint */: {
|
|
578
|
-
facets[path] = { base:
|
|
597
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.DataPoint };
|
|
579
598
|
facets[path].Label = annotationRecord?.Target?.$target['Title'];
|
|
580
599
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
581
600
|
facets[path].entityType = targetEntityType;
|
|
@@ -583,32 +602,32 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
583
602
|
break;
|
|
584
603
|
}
|
|
585
604
|
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* UIAnnotationTerms.PresentationVariant */: {
|
|
586
|
-
facets[path] = { base:
|
|
605
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.PresentationVariant };
|
|
587
606
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
588
607
|
facets[path].entityType = targetEntityType;
|
|
589
608
|
facets[path].namespace = section.namespace;
|
|
590
609
|
break;
|
|
591
610
|
}
|
|
592
611
|
case "com.sap.vocabularies.Communication.v1.Contact" /* CommunicationAnnotationTerms.Contact */: {
|
|
593
|
-
facets[path] = { base:
|
|
612
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Contact };
|
|
594
613
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
595
614
|
facets[path].entityType = targetEntityType;
|
|
596
615
|
facets[path].namespace = section.namespace;
|
|
597
616
|
break;
|
|
598
617
|
}
|
|
599
618
|
case "com.sap.vocabularies.Communication.v1.Address" /* CommunicationAnnotationTerms.Address */: {
|
|
600
|
-
facets[path] = { base:
|
|
619
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Address };
|
|
601
620
|
facets[path].target = annotationRecord?.Target?.$target;
|
|
602
621
|
facets[path].entityType = targetEntityType;
|
|
603
622
|
facets[path].namespace = section.namespace;
|
|
604
623
|
break;
|
|
605
624
|
}
|
|
606
625
|
default: {
|
|
607
|
-
facets[path] = { base:
|
|
626
|
+
facets[path] = { base: ux_specification_types_1.FacetBase.Unknown };
|
|
608
627
|
}
|
|
609
628
|
}
|
|
610
629
|
if (facets[path]) {
|
|
611
|
-
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies',
|
|
630
|
+
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', ux_specification_types_1.VOCWITHSLASH)}`;
|
|
612
631
|
if (annotationRecord.Label) {
|
|
613
632
|
facets[path].Label = annotationRecord.Label;
|
|
614
633
|
}
|
|
@@ -631,7 +650,7 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
|
|
|
631
650
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
632
651
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
633
652
|
*/
|
|
634
|
-
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion =
|
|
653
|
+
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
635
654
|
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
636
655
|
if (section) {
|
|
637
656
|
switch (annotationRecord.$Type) {
|
|
@@ -642,7 +661,7 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
642
661
|
case "com.sap.vocabularies.UI.v1.CollectionFacet" /* UIAnnotationTypes.CollectionFacet */: {
|
|
643
662
|
const annotationPath = `/${entityType.fullyQualifiedName}/${annotationRecord.fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
|
|
644
663
|
const facet = (facets[section.key] = {
|
|
645
|
-
base:
|
|
664
|
+
base: ux_specification_types_1.FacetBase.CollectionFacet,
|
|
646
665
|
facets: {},
|
|
647
666
|
ID: section.ID,
|
|
648
667
|
annotationPath: annotationPath,
|
|
@@ -664,12 +683,12 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
|
|
|
664
683
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
665
684
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
666
685
|
*/
|
|
667
|
-
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
686
|
+
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
668
687
|
const facets = {};
|
|
669
688
|
if (!entityType || !entityType.annotations) {
|
|
670
689
|
return;
|
|
671
690
|
}
|
|
672
|
-
const alias = findAlias(
|
|
691
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
673
692
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.HeaderFacets;
|
|
674
693
|
if (facetAnnotation) {
|
|
675
694
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -681,7 +700,6 @@ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = u
|
|
|
681
700
|
}
|
|
682
701
|
return facets;
|
|
683
702
|
}
|
|
684
|
-
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
685
703
|
/**
|
|
686
704
|
* Retrieve facet configurations that can be used to generate ObjectPage schemas
|
|
687
705
|
* @param {QualifiedName} entityTypeName - the name of the actual entity type
|
|
@@ -689,12 +707,12 @@ exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
|
689
707
|
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
690
708
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
691
709
|
*/
|
|
692
|
-
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion =
|
|
710
|
+
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
693
711
|
const facets = {};
|
|
694
712
|
if (!entityType || !entityType.annotations) {
|
|
695
713
|
return;
|
|
696
714
|
}
|
|
697
|
-
const alias = findAlias(
|
|
715
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
698
716
|
const facetAnnotation = alias && entityType?.annotations[alias]?.Facets;
|
|
699
717
|
if (facetAnnotation) {
|
|
700
718
|
const lastDot = entityType && entityType.fullyQualifiedName.lastIndexOf('.');
|
|
@@ -706,20 +724,18 @@ function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_spec
|
|
|
706
724
|
}
|
|
707
725
|
return facets;
|
|
708
726
|
}
|
|
709
|
-
exports.getObjectPageFacets = getObjectPageFacets;
|
|
710
727
|
/**
|
|
711
728
|
* Returns the version of Fiori elements (v2/v4) from a given manifest
|
|
712
729
|
* @param manifest - the manifest.json file
|
|
713
730
|
*/
|
|
714
731
|
function getFEVersionFromManifest(manifest) {
|
|
715
|
-
if (manifest[
|
|
716
|
-
return
|
|
732
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic] || manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
733
|
+
return ux_specification_types_1.FioriElementsVersion.v2;
|
|
717
734
|
}
|
|
718
735
|
else {
|
|
719
|
-
return
|
|
736
|
+
return ux_specification_types_1.FioriElementsVersion.v4;
|
|
720
737
|
}
|
|
721
738
|
}
|
|
722
|
-
exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
723
739
|
/**
|
|
724
740
|
* Get the main service name from the manifest.
|
|
725
741
|
* LROP: by definition the service name can be read from the UI5 model with "" as name.
|
|
@@ -729,14 +745,13 @@ exports.getFEVersionFromManifest = getFEVersionFromManifest;
|
|
|
729
745
|
* @returns - main service name
|
|
730
746
|
*/
|
|
731
747
|
function getMainService(manifest) {
|
|
732
|
-
const model = typeof manifest?.[
|
|
733
|
-
? manifest[
|
|
748
|
+
const model = typeof manifest?.[ux_specification_types_1.ManifestSection.ovp]?.globalFilterModel === 'string'
|
|
749
|
+
? manifest[ux_specification_types_1.ManifestSection.ovp].globalFilterModel
|
|
734
750
|
: '';
|
|
735
|
-
return typeof manifest?.[
|
|
736
|
-
? manifest[
|
|
751
|
+
return typeof manifest?.[ux_specification_types_1.ManifestSection.ui5]?.models?.[model]?.dataSource === 'string'
|
|
752
|
+
? manifest[ux_specification_types_1.ManifestSection.ui5].models[model].dataSource
|
|
737
753
|
: undefined;
|
|
738
754
|
}
|
|
739
|
-
exports.getMainService = getMainService;
|
|
740
755
|
/**
|
|
741
756
|
* Returns the oData version of the service (if any) from a given manifest
|
|
742
757
|
* @param manifest - the manifest.json file
|
|
@@ -747,10 +762,9 @@ function getODataVersionFromManifest(manifest) {
|
|
|
747
762
|
if (!mainService) {
|
|
748
763
|
return ux_specification_types_1.OdataVersion.v2;
|
|
749
764
|
}
|
|
750
|
-
const dataSource = manifest[
|
|
765
|
+
const dataSource = manifest[ux_specification_types_1.ManifestSection.app].dataSources?.[mainService];
|
|
751
766
|
return dataSource?.settings?.odataVersion === '4.0' ? ux_specification_types_1.OdataVersion.v4 : ux_specification_types_1.OdataVersion.v2;
|
|
752
767
|
}
|
|
753
|
-
exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
754
768
|
/**
|
|
755
769
|
* Determines the template type of a V2 app
|
|
756
770
|
* @param manifest - the manifest.json file
|
|
@@ -759,27 +773,27 @@ exports.getODataVersionFromManifest = getODataVersionFromManifest;
|
|
|
759
773
|
*/
|
|
760
774
|
function determineV2Template(manifest, logger) {
|
|
761
775
|
let templateType;
|
|
762
|
-
if (manifest[
|
|
763
|
-
const v2Pages = manifest[
|
|
776
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic]) {
|
|
777
|
+
const v2Pages = manifest[ux_specification_types_1.ManifestSection.generic].pages;
|
|
764
778
|
if (!v2Pages) {
|
|
765
779
|
(0, extensionLogger_1.log)(logger, {
|
|
766
780
|
severity: "error" /* LogSeverity.Error */,
|
|
767
781
|
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
768
782
|
location: {
|
|
769
|
-
path:
|
|
770
|
-
range: [
|
|
783
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
784
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
771
785
|
}
|
|
772
786
|
});
|
|
773
787
|
return;
|
|
774
788
|
}
|
|
775
789
|
for (const pageKey in v2Pages) {
|
|
776
790
|
const v2Page = v2Pages[pageKey];
|
|
777
|
-
if (getPageTypeV2(v2Page.component?.name) ===
|
|
778
|
-
templateType =
|
|
791
|
+
if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.AnalyticalListPage) {
|
|
792
|
+
templateType = ux_specification_types_1.TemplateType.AnalyticalListPageV2;
|
|
779
793
|
break;
|
|
780
794
|
}
|
|
781
|
-
else if (getPageTypeV2(v2Page.component?.name) ===
|
|
782
|
-
templateType =
|
|
795
|
+
else if (getPageTypeV2(v2Page.component?.name) === ux_specification_types_1.PageTypeV2.ListReport) {
|
|
796
|
+
templateType = ux_specification_types_1.TemplateType.ListReportObjectPageV2;
|
|
783
797
|
break;
|
|
784
798
|
}
|
|
785
799
|
}
|
|
@@ -788,17 +802,16 @@ function determineV2Template(manifest, logger) {
|
|
|
788
802
|
if (!templateType) {
|
|
789
803
|
(0, extensionLogger_1.log)(logger, {
|
|
790
804
|
severity: "error" /* LogSeverity.Error */,
|
|
791
|
-
message: i18next_1.default.t('NOTEMPLATE', { section:
|
|
805
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.generic }),
|
|
792
806
|
location: {
|
|
793
|
-
path:
|
|
794
|
-
range: [
|
|
807
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
808
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
795
809
|
}
|
|
796
810
|
});
|
|
797
811
|
}
|
|
798
812
|
}
|
|
799
813
|
return templateType;
|
|
800
814
|
}
|
|
801
|
-
exports.determineV2Template = determineV2Template;
|
|
802
815
|
/**
|
|
803
816
|
* Determines the template type, based on the given manifest entries of the app
|
|
804
817
|
* @param manifest - the manifest.json file
|
|
@@ -808,15 +821,14 @@ exports.determineV2Template = determineV2Template;
|
|
|
808
821
|
*/
|
|
809
822
|
function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
|
|
810
823
|
let templateType;
|
|
811
|
-
if (manifest[
|
|
812
|
-
templateType =
|
|
824
|
+
if (manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
825
|
+
templateType = ux_specification_types_1.TemplateType.OverviewPageV2;
|
|
813
826
|
}
|
|
814
|
-
else if (fioriElementsVersion ===
|
|
827
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v2) {
|
|
815
828
|
templateType = determineV2Template(manifest, logger);
|
|
816
829
|
}
|
|
817
830
|
return templateType;
|
|
818
831
|
}
|
|
819
|
-
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
820
832
|
/**
|
|
821
833
|
* Adds title and description to a section or header section in an app schema
|
|
822
834
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -825,12 +837,12 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
|
825
837
|
*/
|
|
826
838
|
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
827
839
|
if (facet?.ID) {
|
|
828
|
-
section.title =
|
|
829
|
-
section[
|
|
840
|
+
section.title = ux_specification_types_1.FACETTITLEPREFIX + facet.ID;
|
|
841
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facet.ID }];
|
|
830
842
|
}
|
|
831
843
|
else {
|
|
832
844
|
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
833
|
-
section[
|
|
845
|
+
section[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.id, value: facetKey.replace(ux_specification_types_1.UIVOCABULARYALPHADOT, '') }];
|
|
834
846
|
}
|
|
835
847
|
// Description
|
|
836
848
|
if (facet?.Label) {
|
|
@@ -843,7 +855,6 @@ function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
|
843
855
|
section.description = facetKey.substring(facetKey.lastIndexOf('.') + 1);
|
|
844
856
|
}
|
|
845
857
|
}
|
|
846
|
-
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
847
858
|
/**
|
|
848
859
|
* Adds target title or description to a section or header section in an app schema
|
|
849
860
|
* @param facet - intermediate facet structure comprising annotation information
|
|
@@ -865,7 +876,6 @@ function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
|
865
876
|
section.description = facet.target['Label'];
|
|
866
877
|
}
|
|
867
878
|
}
|
|
868
|
-
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
869
879
|
/**
|
|
870
880
|
* Creates a default object for a new section or subsection, and adds the ID as title if present.
|
|
871
881
|
* @param facet Facet configuration, to be analyzed
|
|
@@ -877,12 +887,11 @@ function createDefaultSection(appSchema, facet, facetKey) {
|
|
|
877
887
|
properties: {},
|
|
878
888
|
additionalProperties: false
|
|
879
889
|
};
|
|
880
|
-
section[
|
|
881
|
-
section[
|
|
890
|
+
section[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
891
|
+
section[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
882
892
|
addTargetTitleAndSectionDescription(facet, section, facetKey);
|
|
883
893
|
return section;
|
|
884
894
|
}
|
|
885
|
-
exports.createDefaultSection = createDefaultSection;
|
|
886
895
|
/**
|
|
887
896
|
* Retrieve page section data(so far id/key and label/description).
|
|
888
897
|
* @param {EntityType} entityType The actual entityType
|
|
@@ -892,8 +901,8 @@ exports.createDefaultSection = createDefaultSection;
|
|
|
892
901
|
* @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
|
|
893
902
|
* @returns {FacetSection[]} - Array of facets or sections
|
|
894
903
|
*/
|
|
895
|
-
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion =
|
|
896
|
-
const alias = findAlias(
|
|
904
|
+
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
|
|
905
|
+
const alias = findAlias(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
897
906
|
let sections = [];
|
|
898
907
|
if (entityType) {
|
|
899
908
|
const facetAnnotation = alias && entityType?.annotations?.[alias]?.Facets;
|
|
@@ -912,7 +921,6 @@ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVer
|
|
|
912
921
|
return sections;
|
|
913
922
|
}
|
|
914
923
|
}
|
|
915
|
-
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
916
924
|
/**
|
|
917
925
|
* Cleans empty sub-structures from the export result for manifest
|
|
918
926
|
* @param {object} manifest - manifest.json part of the export result
|
|
@@ -930,11 +938,16 @@ const deleteEmptyStructure = (manifest, path, deletionRequest, entityPathArray,
|
|
|
930
938
|
let manifestSection = manifest;
|
|
931
939
|
const pathArray = path.split('/');
|
|
932
940
|
pathArray.forEach(function (element) {
|
|
933
|
-
|
|
941
|
+
let decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
|
|
934
942
|
? targetAnnotation
|
|
935
943
|
: element.replace('??', '/');
|
|
936
944
|
if (!manifestSection[decodedElement]) {
|
|
937
|
-
|
|
945
|
+
if (targetAnnotationEncoded === element) {
|
|
946
|
+
decodedElement = targetAnnotationEncoded;
|
|
947
|
+
}
|
|
948
|
+
if (!manifestSection[decodedElement]) {
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
938
951
|
}
|
|
939
952
|
if (Object.keys(manifestSection[decodedElement]).length === 0 ||
|
|
940
953
|
//deletion explicitly requested by using entityPath
|
|
@@ -974,20 +987,20 @@ const getSchemaFilePath = (schemaType, entitySet) => {
|
|
|
974
987
|
};
|
|
975
988
|
switch (schemaType) {
|
|
976
989
|
// Application schema
|
|
977
|
-
case
|
|
990
|
+
case ux_specification_types_1.SchemaType.Application: {
|
|
978
991
|
// File name
|
|
979
992
|
schemaFile.filename = `App`;
|
|
980
993
|
// Full path
|
|
981
|
-
schemaFile.path = `./${
|
|
994
|
+
schemaFile.path = `./${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
982
995
|
break;
|
|
983
996
|
}
|
|
984
997
|
// List report and object page
|
|
985
|
-
case
|
|
986
|
-
case
|
|
998
|
+
case ux_specification_types_1.SchemaType.ListReport:
|
|
999
|
+
case ux_specification_types_1.SchemaType.ObjectPage: {
|
|
987
1000
|
// File name
|
|
988
1001
|
schemaFile.filename = entitySet ? `${schemaType}_${entitySet}` : getGenericSchemaFileName(schemaType);
|
|
989
1002
|
// Full path
|
|
990
|
-
schemaFile.path = `../${
|
|
1003
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
991
1004
|
break;
|
|
992
1005
|
}
|
|
993
1006
|
// Other page configs
|
|
@@ -995,7 +1008,7 @@ const getSchemaFilePath = (schemaType, entitySet) => {
|
|
|
995
1008
|
// File name
|
|
996
1009
|
schemaFile.filename = getGenericSchemaFileName(schemaType);
|
|
997
1010
|
// Full path
|
|
998
|
-
schemaFile.path = `../${
|
|
1011
|
+
schemaFile.path = `../${ux_specification_types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
999
1012
|
break;
|
|
1000
1013
|
}
|
|
1001
1014
|
}
|
|
@@ -1013,7 +1026,7 @@ exports.getSchemaFilePath = getSchemaFilePath;
|
|
|
1013
1026
|
* @returns {string} Generated page id
|
|
1014
1027
|
*/
|
|
1015
1028
|
function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
1016
|
-
if (pageType ===
|
|
1029
|
+
if (pageType === ux_specification_types_1.PageTypeV2.CustomPage) {
|
|
1017
1030
|
const names = viewId && viewId.split('.');
|
|
1018
1031
|
return names && names[names.length - 1] + 'Page';
|
|
1019
1032
|
}
|
|
@@ -1027,7 +1040,6 @@ function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
|
1027
1040
|
}
|
|
1028
1041
|
return parts.join('_');
|
|
1029
1042
|
}
|
|
1030
|
-
exports.generatePageId = generatePageId;
|
|
1031
1043
|
function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
|
|
1032
1044
|
const $ref = element.$ref;
|
|
1033
1045
|
if ($ref) {
|
|
@@ -1088,7 +1100,6 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
1088
1100
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1089
1101
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1090
1102
|
if (nextDefinition?.targetDefinition?.['$ref'] || nextDefinition?.targetDefinition?.['type'] === 'array') {
|
|
1091
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1092
1103
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1093
1104
|
return nextDefinition;
|
|
1094
1105
|
}
|
|
@@ -1142,7 +1153,6 @@ function getNextTargetDefinition(appSchema, title, currentConfigObject, property
|
|
|
1142
1153
|
nextDefinition = determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition);
|
|
1143
1154
|
return nextDefinition;
|
|
1144
1155
|
}
|
|
1145
|
-
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
1146
1156
|
/**
|
|
1147
1157
|
* Custom array merge function called by deepmerge's merge function
|
|
1148
1158
|
*
|
|
@@ -1179,7 +1189,6 @@ function convertEnumToCSV(manifestSection, configPart, key) {
|
|
|
1179
1189
|
const field = configPart[key];
|
|
1180
1190
|
manifestSection[key] = field.join();
|
|
1181
1191
|
}
|
|
1182
|
-
exports.convertEnumToCSV = convertEnumToCSV;
|
|
1183
1192
|
/**
|
|
1184
1193
|
* Converts an action ID from the internal format (schema, config) to the stable ID representation
|
|
1185
1194
|
* @param actionId - the (unique) internal format of the action ID
|
|
@@ -1191,7 +1200,6 @@ function convertActionKeyToStableId(actionId) {
|
|
|
1191
1200
|
}
|
|
1192
1201
|
return (actionId.indexOf('??') > -1 ? actionId.split('??')[1] : actionId).replace(/@/g, '::');
|
|
1193
1202
|
}
|
|
1194
|
-
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
1195
1203
|
/**
|
|
1196
1204
|
* Method adds indices (propertyIndex property) to app-specific JSON schema properties.
|
|
1197
1205
|
*
|
|
@@ -1206,29 +1214,26 @@ function updatePropertyIndices(schema, order) {
|
|
|
1206
1214
|
}
|
|
1207
1215
|
});
|
|
1208
1216
|
}
|
|
1209
|
-
exports.updatePropertyIndices = updatePropertyIndices;
|
|
1210
1217
|
/**
|
|
1211
1218
|
* Method to remove namespaces
|
|
1212
1219
|
* @param {string } [sId]
|
|
1213
1220
|
* @returns {string} modified string without namespace
|
|
1214
1221
|
*/
|
|
1215
1222
|
function removeNamespaces(sId) {
|
|
1216
|
-
sId = sId.replace(
|
|
1223
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARYDOT, '');
|
|
1217
1224
|
sId = sId.replace('com.sap.vocabularies.Communication.v1.', '');
|
|
1218
1225
|
return sId;
|
|
1219
1226
|
}
|
|
1220
|
-
exports.removeNamespaces = removeNamespaces;
|
|
1221
1227
|
/**
|
|
1222
1228
|
* Method to replace namespaces with short hand form
|
|
1223
1229
|
* @param {string } [sId]
|
|
1224
1230
|
* @returns {string} modified string with replaced namespaces
|
|
1225
1231
|
*/
|
|
1226
1232
|
function replaceNamespaces(sId) {
|
|
1227
|
-
sId = sId.replace(
|
|
1233
|
+
sId = sId.replace(ux_specification_types_1.UIVOCABULARY, 'UI');
|
|
1228
1234
|
sId = sId.replace('com.sap.vocabularies.Communication.v1', 'Communication');
|
|
1229
1235
|
return sId;
|
|
1230
1236
|
}
|
|
1231
|
-
exports.replaceNamespaces = replaceNamespaces;
|
|
1232
1237
|
/**
|
|
1233
1238
|
* Returns the message property if the error is an instance of `Error` else a string representation of the error.
|
|
1234
1239
|
*
|
|
@@ -1238,5 +1243,4 @@ exports.replaceNamespaces = replaceNamespaces;
|
|
|
1238
1243
|
function getErrorMessage(error) {
|
|
1239
1244
|
return error instanceof Error ? error.message : String(error);
|
|
1240
1245
|
}
|
|
1241
|
-
exports.getErrorMessage = getErrorMessage;
|
|
1242
1246
|
//# sourceMappingURL=utils.js.map
|