@sap/ux-specification 1.71.46 → 1.71.47
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 +17 -3
- 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/index-min.js +1 -1
- package/dist/src/sync/common/generate/index.d.ts +1 -0
- package/dist/src/sync/common/generate/index.js +1 -0
- package/dist/src/sync/common/generate/index.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +59 -0
- package/dist/src/sync/common/generate/utils.js +192 -0
- package/dist/src/sync/common/generate/utils.js.map +1 -0
- package/dist/src/sync/common/importProject.js +3 -3
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +1 -22
- package/dist/src/sync/common/utils.js +12 -83
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +3 -2
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +6 -3
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +8 -0
- package/dist/src/sync/v2/generate/listReport.js +18 -4
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +16 -11
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sync/common/generate/index.ts"],"names":[],"mappings":";;;;;AAAA,kCAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sync/common/generate/index.ts"],"names":[],"mappings":";;;;;AAAA,kCAA6B;AAC7B,6BAAwB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EntityType } from '@sap-ux/annotation-converter';
|
|
2
|
+
import { AnnotationTerm, ConverterOutput, LineItem, UIAnnotationTerms } from '@sap-ux/vocabularies-types';
|
|
3
|
+
import { FacetSection } from '..';
|
|
4
|
+
/**
|
|
5
|
+
* Adds an enum filled with existing UI annotations of the given list (validAnnotations)
|
|
6
|
+
* @param {EntityType} entityType
|
|
7
|
+
* @param {UIAnnotationTerms[]} validAnnotations
|
|
8
|
+
* @param annoPath - the annotation path property in the app schema where the enum shall be added
|
|
9
|
+
*/
|
|
10
|
+
export declare function addEnumForValidAnnotations(entityType: EntityType, validAnnotations: UIAnnotationTerms[], annoPath: object): void;
|
|
11
|
+
/**
|
|
12
|
+
* Adds an enum filled with existing UI annotations for single-tab variants of a table
|
|
13
|
+
* @param {EntityType} entityType
|
|
14
|
+
* @param appSchema - app specific JSOn schema
|
|
15
|
+
* @param definitionName - name of the definition in the app schema
|
|
16
|
+
*/
|
|
17
|
+
export declare function addEnumForSingleTabVariant(entityType: EntityType, appSchema: object, definitionName: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Adds an enum filled with existing UI annotations for multi-tab variants of a table
|
|
20
|
+
* @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
|
|
21
|
+
* @param appSchema - app specific JSOn schema
|
|
22
|
+
* @param definitionName - name of the definition in the app schema
|
|
23
|
+
*/
|
|
24
|
+
export declare function addEnumForMultiTabVariant(oDataServiceAVT: ConverterOutput, appSchema: object, definitionName: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Adds the enume values for entitySet as part of the multiple view scenario
|
|
27
|
+
* @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
|
|
28
|
+
* @param appSchema - app specific JSOn schema
|
|
29
|
+
* @param definitionName - name of the definition in the app schema
|
|
30
|
+
*/
|
|
31
|
+
export declare function addEnumForVariantEntitySet(oDataServiceAVT: ConverterOutput, appSchema: object, definitionName: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Method adds definition for 'RelatedFacetKeys' as enum with describtion and adds references to 'RelatedFacetKeys' for custom section definitions.
|
|
34
|
+
* @param {object} schema App specific schema that potentially gets enhanced
|
|
35
|
+
* @param {string[]>} sectionDefinitions array of section definitions which should be updated with new reference to 'RelatedFacetKeys' enum.
|
|
36
|
+
* @param {FacetSection[]} facetSections Array of facet section objects which is used to generate enum values.
|
|
37
|
+
* @param {Array<keyof Omit<FacetSection, 'custom'>>} idProperties Array of property names which should be looked up in 'FacetSection' object.
|
|
38
|
+
* Please note that method depends on order and takes first non empty value associated to passed properties.
|
|
39
|
+
*/
|
|
40
|
+
export declare function addDefinitionForRelatedFacetKeys(schema: object, sectionDefinitions: string[], facetSections: FacetSection[], idProperties: Array<keyof Omit<FacetSection, 'custom'>>): void;
|
|
41
|
+
/**
|
|
42
|
+
* Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
|
|
43
|
+
* @param appSchema - the app specific schema that shall get enhanced
|
|
44
|
+
* @param lineItemAnnotation - the UI.LineItem annotation, comprising all records
|
|
45
|
+
* @param entityType - the entity type as part of the AVT ConverterOutput
|
|
46
|
+
* @param lineItemId - line item ID, as comprise in stable ID
|
|
47
|
+
* @returns the actions definition plus the annotation path to the given line item
|
|
48
|
+
*/
|
|
49
|
+
export declare function addCommonLineItemDefinitions(appSchema: object, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, lineItemId: string): {
|
|
50
|
+
actions: object;
|
|
51
|
+
lineItemPath: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Add schema definitions for fields of createWithParameterDialog
|
|
55
|
+
* @param {object} appSchema - Application-specific schema, to be enhanced
|
|
56
|
+
* @param {EntityType} entityType - Given entity type for which entries shall get generated
|
|
57
|
+
* @param {string=} floorplanSuffix - floorplan specific suffix (optional)
|
|
58
|
+
*/
|
|
59
|
+
export declare function addFieldsType(appSchema: object, entityType: EntityType, floorplanSuffix?: string): void;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const __1 = require("..");
|
|
4
|
+
/**
|
|
5
|
+
* Adds an enum filled with existing UI annotations of the given list (validAnnotations)
|
|
6
|
+
* @param {EntityType} entityType
|
|
7
|
+
* @param {UIAnnotationTerms[]} validAnnotations
|
|
8
|
+
* @param annoPath - the annotation path property in the app schema where the enum shall be added
|
|
9
|
+
*/
|
|
10
|
+
function addEnumForValidAnnotations(entityType, validAnnotations, annoPath) {
|
|
11
|
+
const UiAnnotations = entityType.annotations.UI;
|
|
12
|
+
if (!UiAnnotations) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const enumEntries = annoPath['enum'] ? annoPath['enum'] : [];
|
|
16
|
+
for (const key in UiAnnotations) {
|
|
17
|
+
const annotation = UiAnnotations[key];
|
|
18
|
+
if (validAnnotations.indexOf(annotation.term) > -1) {
|
|
19
|
+
const enumEntry = annotation.qualifier
|
|
20
|
+
? `${annotation.term}#${annotation.qualifier}`
|
|
21
|
+
: `${annotation.term}`;
|
|
22
|
+
if (enumEntries.indexOf(enumEntry) === -1) {
|
|
23
|
+
enumEntries.push(enumEntry);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (enumEntries.length > 0) {
|
|
28
|
+
annoPath['enum'] = enumEntries;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.addEnumForValidAnnotations = addEnumForValidAnnotations;
|
|
32
|
+
/**
|
|
33
|
+
* Adds an enum filled with existing UI annotations for single-tab variants of a table
|
|
34
|
+
* @param {EntityType} entityType
|
|
35
|
+
* @param appSchema - app specific JSOn schema
|
|
36
|
+
* @param definitionName - name of the definition in the app schema
|
|
37
|
+
*/
|
|
38
|
+
function addEnumForSingleTabVariant(entityType, appSchema, definitionName) {
|
|
39
|
+
const quickVariant = appSchema['definitions'][definitionName];
|
|
40
|
+
const annoPath = quickVariant.properties.annotationPath;
|
|
41
|
+
const validAnnotations = ["com.sap.vocabularies.UI.v1.SelectionVariant" /* SelectionVariant */, "com.sap.vocabularies.UI.v1.SelectionPresentationVariant" /* SelectionPresentationVariant */];
|
|
42
|
+
addEnumForValidAnnotations(entityType, validAnnotations, annoPath);
|
|
43
|
+
}
|
|
44
|
+
exports.addEnumForSingleTabVariant = addEnumForSingleTabVariant;
|
|
45
|
+
/**
|
|
46
|
+
* Adds an enum filled with existing UI annotations for multi-tab variants of a table
|
|
47
|
+
* @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
|
|
48
|
+
* @param appSchema - app specific JSOn schema
|
|
49
|
+
* @param definitionName - name of the definition in the app schema
|
|
50
|
+
*/
|
|
51
|
+
function addEnumForMultiTabVariant(oDataServiceAVT, appSchema, definitionName) {
|
|
52
|
+
const quickVariant = appSchema['definitions'][definitionName];
|
|
53
|
+
const annoPath = quickVariant.properties.annotationPath;
|
|
54
|
+
const validAnnotations = [
|
|
55
|
+
"com.sap.vocabularies.UI.v1.SelectionVariant" /* SelectionVariant */,
|
|
56
|
+
"com.sap.vocabularies.UI.v1.SelectionPresentationVariant" /* SelectionPresentationVariant */,
|
|
57
|
+
"com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */
|
|
58
|
+
];
|
|
59
|
+
if (oDataServiceAVT.entitySets) {
|
|
60
|
+
oDataServiceAVT.entitySets.forEach((entitySet) => {
|
|
61
|
+
addEnumForValidAnnotations(entitySet.entityType, validAnnotations, annoPath);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.addEnumForMultiTabVariant = addEnumForMultiTabVariant;
|
|
66
|
+
/**
|
|
67
|
+
* Adds the enume values for entitySet as part of the multiple view scenario
|
|
68
|
+
* @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
|
|
69
|
+
* @param appSchema - app specific JSOn schema
|
|
70
|
+
* @param definitionName - name of the definition in the app schema
|
|
71
|
+
*/
|
|
72
|
+
function addEnumForVariantEntitySet(oDataServiceAVT, appSchema, definitionName) {
|
|
73
|
+
const quickVariant = appSchema['definitions'][definitionName];
|
|
74
|
+
const entitySet = quickVariant.properties.entitySet;
|
|
75
|
+
if (oDataServiceAVT.entitySets) {
|
|
76
|
+
const enumEntries = [];
|
|
77
|
+
oDataServiceAVT.entitySets.forEach((es) => {
|
|
78
|
+
enumEntries.push(es.name);
|
|
79
|
+
});
|
|
80
|
+
if (enumEntries.length > 0) {
|
|
81
|
+
entitySet['enum'] = enumEntries;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.addEnumForVariantEntitySet = addEnumForVariantEntitySet;
|
|
86
|
+
/**
|
|
87
|
+
* Method adds definition for 'RelatedFacetKeys' as enum with describtion and adds references to 'RelatedFacetKeys' for custom section definitions.
|
|
88
|
+
* @param {object} schema App specific schema that potentially gets enhanced
|
|
89
|
+
* @param {string[]>} sectionDefinitions array of section definitions which should be updated with new reference to 'RelatedFacetKeys' enum.
|
|
90
|
+
* @param {FacetSection[]} facetSections Array of facet section objects which is used to generate enum values.
|
|
91
|
+
* @param {Array<keyof Omit<FacetSection, 'custom'>>} idProperties Array of property names which should be looked up in 'FacetSection' object.
|
|
92
|
+
* Please note that method depends on order and takes first non empty value associated to passed properties.
|
|
93
|
+
*/
|
|
94
|
+
function addDefinitionForRelatedFacetKeys(schema, sectionDefinitions, facetSections, idProperties) {
|
|
95
|
+
const oneOfSections = facetSections.map((section) => {
|
|
96
|
+
// Loop accaptable properties in received order and find first entry with value
|
|
97
|
+
const propertyName = idProperties.find((property) => !!section[property]);
|
|
98
|
+
const schemaIdForSection = section[propertyName];
|
|
99
|
+
return Object.assign(Object.assign({ const: schemaIdForSection }, (section.label && { description: section.label })), (section.custom && { custom: section.custom }));
|
|
100
|
+
});
|
|
101
|
+
// Change 'relatedFacet' only when we have entries for sections - otherwise use generic.
|
|
102
|
+
if (oneOfSections.length) {
|
|
103
|
+
// Create new definition in schema as 'oneOf'.
|
|
104
|
+
// Simpler way would be to use 'enum', but then there no option to pass description.
|
|
105
|
+
schema['definitions']['RelatedFacetKeys'] = {
|
|
106
|
+
type: 'string',
|
|
107
|
+
oneOf: oneOfSections
|
|
108
|
+
};
|
|
109
|
+
// Add enum definition
|
|
110
|
+
for (const name of sectionDefinitions) {
|
|
111
|
+
const definition = schema['definitions'][name];
|
|
112
|
+
const property = definition['properties']['relatedFacet'];
|
|
113
|
+
definition['properties']['relatedFacet'] = {
|
|
114
|
+
anyOf: [
|
|
115
|
+
{
|
|
116
|
+
$ref: __1.DEFINITION_LINK_PREFIX + 'RelatedFacetKeys'
|
|
117
|
+
},
|
|
118
|
+
property
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.addDefinitionForRelatedFacetKeys = addDefinitionForRelatedFacetKeys;
|
|
125
|
+
/**
|
|
126
|
+
* Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
|
|
127
|
+
* @param appSchema - the app specific schema that shall get enhanced
|
|
128
|
+
* @param lineItemAnnotation - the UI.LineItem annotation, comprising all records
|
|
129
|
+
* @param entityType - the entity type as part of the AVT ConverterOutput
|
|
130
|
+
* @param lineItemId - line item ID, as comprise in stable ID
|
|
131
|
+
* @returns the actions definition plus the annotation path to the given line item
|
|
132
|
+
*/
|
|
133
|
+
function addCommonLineItemDefinitions(appSchema, lineItemAnnotation, entityType, lineItemId) {
|
|
134
|
+
let lineItemPath;
|
|
135
|
+
appSchema['definitions'][lineItemId] = {
|
|
136
|
+
type: 'object',
|
|
137
|
+
properties: {},
|
|
138
|
+
additionalProperties: false,
|
|
139
|
+
isViewNode: true,
|
|
140
|
+
description: 'Columns'
|
|
141
|
+
};
|
|
142
|
+
//Copy toolbar
|
|
143
|
+
const toolBar = lineItemId === 'LineItems' ? 'ToolBar' : 'ObjectPageToolBar';
|
|
144
|
+
const schemaIdForToolBar = `${toolBar}<${lineItemId}>`;
|
|
145
|
+
appSchema['definitions'][schemaIdForToolBar] = JSON.parse(JSON.stringify(appSchema['definitions'][`${toolBar}`]));
|
|
146
|
+
const schemaIdForActions = `Actions<${__1.prepareRef(lineItemId)}>`;
|
|
147
|
+
appSchema['definitions'][schemaIdForToolBar].properties.actions.$ref = __1.DEFINITION_LINK_PREFIX + schemaIdForActions;
|
|
148
|
+
const actionId = lineItemId === 'LineItems' ? 'Actions' : 'ObjectPageToolBarActions';
|
|
149
|
+
const actions = (appSchema['definitions'][schemaIdForActions] = JSON.parse(JSON.stringify(appSchema['definitions'][actionId])));
|
|
150
|
+
actions.properties = {};
|
|
151
|
+
actions.additionalProperties = false;
|
|
152
|
+
//Determine annotation path
|
|
153
|
+
if (lineItemAnnotation) {
|
|
154
|
+
lineItemPath = __1.createAnnotationPath(entityType.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
|
|
155
|
+
appSchema['definitions'][lineItemId].annotationPath = appSchema['definitions'][schemaIdForToolBar].annotationPath = lineItemPath;
|
|
156
|
+
}
|
|
157
|
+
return { actions, lineItemPath };
|
|
158
|
+
}
|
|
159
|
+
exports.addCommonLineItemDefinitions = addCommonLineItemDefinitions;
|
|
160
|
+
/**
|
|
161
|
+
* Add schema definitions for fields of createWithParameterDialog
|
|
162
|
+
* @param {object} appSchema - Application-specific schema, to be enhanced
|
|
163
|
+
* @param {EntityType} entityType - Given entity type for which entries shall get generated
|
|
164
|
+
* @param {string=} floorplanSuffix - floorplan specific suffix (optional)
|
|
165
|
+
*/
|
|
166
|
+
function addFieldsType(appSchema, entityType, floorplanSuffix = '') {
|
|
167
|
+
const propertyNameArray = [], propertyObject = {};
|
|
168
|
+
const fieldPathRef = `FieldPath${__1.prepareRef(floorplanSuffix)}`;
|
|
169
|
+
for (const key of entityType.entityProperties) {
|
|
170
|
+
const propertyName = key.name;
|
|
171
|
+
propertyNameArray.push(propertyName);
|
|
172
|
+
propertyObject[propertyName] = {
|
|
173
|
+
$ref: __1.DEFINITION_LINK_PREFIX + fieldPathRef
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
appSchema['definitions'][entityType.name] = {
|
|
177
|
+
enum: propertyNameArray
|
|
178
|
+
};
|
|
179
|
+
appSchema['definitions'][fieldPathRef].properties.path = {
|
|
180
|
+
$ref: __1.DEFINITION_LINK_PREFIX + entityType.name
|
|
181
|
+
};
|
|
182
|
+
const creationFieldsRef = `CreationFieldKeys${__1.prepareRef(floorplanSuffix)}`;
|
|
183
|
+
appSchema['definitions'][creationFieldsRef] = {
|
|
184
|
+
type: 'object',
|
|
185
|
+
properties: propertyObject,
|
|
186
|
+
additionalProperties: false
|
|
187
|
+
};
|
|
188
|
+
const fields4Dialog = appSchema['definitions'][`Fields4Dialog${floorplanSuffix}`];
|
|
189
|
+
fields4Dialog.properties.fields.$ref = __1.DEFINITION_LINK_PREFIX + creationFieldsRef;
|
|
190
|
+
}
|
|
191
|
+
exports.addFieldsType = addFieldsType;
|
|
192
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/sync/common/generate/utils.ts"],"names":[],"mappings":";;AAEA,0BAA4F;AAE5F;;;;;GAKG;AACH,SAAgB,0BAA0B,CACtC,UAAsB,EACtB,gBAAqC,EACrC,QAAgB;IAEhB,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;IAChD,IAAI,CAAC,aAAa,EAAE;QAChB,OAAO;KACV;IACD,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;QAC7B,MAAM,UAAU,GAAG,aAAa,CAA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M,YAAY,GAAG,YAAY,cAAU,CAAC,eAAe,CAAC,EAAE,CAAC;IAC/D,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,gBAAgB,EAAE;QAC3C,MAAM,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC;QAC9B,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,cAAc,CAAC,YAAY,CAAC,GAAG;YAC3B,IAAI,EAAE,0BAAsB,GAAG,YAAY;SAC9C,CAAC;KACL;IACD,SAAS,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG;QACxC,IAAI,EAAE,iBAAiB;KAC1B,CAAC;IACF,SAAS,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,IAAI,GAAG;QACrD,IAAI,EAAE,0BAAsB,GAAG,UAAU,CAAC,IAAI;KACjD,CAAC;IACF,MAAM,iBAAiB,GAAG,oBAAoB,cAAU,CAAC,eAAe,CAAC,EAAE,CAAC;IAC5E,SAAS,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,GAAG;QAC1C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,cAAc;QAC1B,oBAAoB,EAAE,KAAK;KAC9B,CAAC;IACF,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC,gBAAgB,eAAe,EAAE,CAAC,CAAC;IAClF,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,0BAAsB,GAAG,iBAAiB,CAAC;AACtF,CAAC;AAzBD,sCAyBC"}
|
|
@@ -90,7 +90,7 @@ function generateObjectPageSchemasV2(generateParameters, genericSchemas, appSche
|
|
|
90
90
|
const allPages = appProvider_1.getPages(generateParameters.manifest[common_1.ManifestSection.generic].pages, pageV2.FE_TEMPLATE_V2_OBJECT_PAGE);
|
|
91
91
|
for (const page in allPages) {
|
|
92
92
|
const entitySetName = allPages[page].entitySet;
|
|
93
|
-
const entitySet = getEntitySetByEntitySetName(entitySetName, generateParameters.serviceAVT);
|
|
93
|
+
const entitySet = getEntitySetByEntitySetName(entitySetName, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT);
|
|
94
94
|
const entityTypeName = entitySet && entitySet.entityType && entitySet.entityType.name;
|
|
95
95
|
const schemaFile = utils_1.getSchemaFilePath(common_1.SchemaType.ObjectPage, (entitySet === null || entitySet === void 0 ? void 0 : entitySet.name) || entitySetName);
|
|
96
96
|
const genericSchemaFile = utils_1.getSchemaFilePath(common_1.SchemaType.ObjectPage);
|
|
@@ -112,7 +112,7 @@ function generateAppSchemasV2(generateParameters, genericSchemas, uiEntityTypes,
|
|
|
112
112
|
const allPages = appProvider_1.getPages(generateParameters.manifest[common_1.ManifestSection.generic].pages, pageV2.FE_TEMPLATE_V2_LIST_REPORT);
|
|
113
113
|
for (const page in allPages) {
|
|
114
114
|
const entitySetName = allPages[page].entitySet;
|
|
115
|
-
const entitySet = getEntitySetByEntitySetName(entitySetName, generateParameters.serviceAVT);
|
|
115
|
+
const entitySet = getEntitySetByEntitySetName(entitySetName, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT);
|
|
116
116
|
const entityTypeName = entitySet && entitySet.entityType && entitySet.entityType.name;
|
|
117
117
|
const schemaFile = utils_1.getSchemaFilePath(common_1.SchemaType.ListReport, (entitySet === null || entitySet === void 0 ? void 0 : entitySet.name) || entitySetName);
|
|
118
118
|
const genericSchemaFile = utils_1.getSchemaFilePath(common_1.SchemaType.ListReport);
|
|
@@ -126,7 +126,7 @@ function generateAppSchemasV2(generateParameters, genericSchemas, uiEntityTypes,
|
|
|
126
126
|
const allPages = appProvider_1.getPages(generateParameters.manifest[common_1.ManifestSection.generic].pages, pageV2.FE_TEMPLATE_V2_ALP);
|
|
127
127
|
for (const page in allPages) {
|
|
128
128
|
const entitySetName = allPages[page].entitySet;
|
|
129
|
-
const entitySet = getEntitySetByEntitySetName(entitySetName, generateParameters.serviceAVT);
|
|
129
|
+
const entitySet = getEntitySetByEntitySetName(entitySetName, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT);
|
|
130
130
|
const entityTypeName = (_a = entitySet === null || entitySet === void 0 ? void 0 : entitySet.entityType) === null || _a === void 0 ? void 0 : _a.name;
|
|
131
131
|
const schemaFile = utils_1.getSchemaFilePath(common_1.SchemaType.AnalyticalListPage, (entitySet === null || entitySet === void 0 ? void 0 : entitySet.name) || entitySetName);
|
|
132
132
|
const genericSchemaFile = utils_1.getSchemaFilePath(common_1.SchemaType.AnalyticalListPage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importProject.js","sourceRoot":"","sources":["../../../../src/sync/common/importProject.ts"],"names":[],"mappings":";;;;;;;;;AAGA,uDAAyG;AACzG,mEAAoE;AACpE,2FAA6E;AAC7E,6CAKwB;AACxB,8DAAqF;AACrF,8DAA6D;AAE7D,mCAAgE;AAChE,mCAOiB;AAIjB,0CAA2C;AAW3C;;;;;GAKG;AACH,KAAK,UAAU,iBAAiB,CAC5B,YAA0B,EAC1B,oBAA0C;IAE1C,MAAM,cAAc,GAAY,EAAE,CAAC;IACnC,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,WAAW,GAAG,CAAC,mBAAU,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,YAAY,EAAE;QAClB,KAAK,oBAAY,CAAC,sBAAsB;YACpC,WAAW,CAAC,IAAI,CAAC,mBAAU,CAAC,UAAU,EAAE,mBAAU,CAAC,UAAU,CAAC,CAAC;YAC/D,MAAM;QACV,KAAK,oBAAY,CAAC,oBAAoB;YAClC,WAAW,CAAC,IAAI,CAAC,mBAAU,CAAC,kBAAkB,EAAE,mBAAU,CAAC,UAAU,CAAC,CAAC;YACvE,MAAM;QACV,KAAK,oBAAY,CAAC,cAAc;YAC5B,WAAW,CAAC,IAAI,CAAC,mBAAU,CAAC,YAAY,CAAC,CAAC;YAC1C,MAAM;QACV;YACI,MAAM;KACb;IACD,KAAK,MAAM,UAAU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AAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,uBAAuB,CAAC;IACnF,MAAM,oBAAoB,GAAG,8BAAsB,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,+BAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAErE,MAAM,kBAAkB,GAAgC;QACpD,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,UAAU,EAAE,eAAe;QAC3B,SAAS,EAAE,uBAAuB,CAAC,SAAS;QAC5C,oBAAoB;QACpB,MAAM,EAAE,uBAAuB,CAAC,MAAM;KACzC,CAAC;IACF,MAAM,aAAa,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,mCAA2B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACzF,IAAI,YAAY,EAAE;QACd,MAAM,UAAU,GAAG,MAAM,kBAAkB,CAAC,kBAAkB,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QAC7F,WAAW,GAAG,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACjF,KAAK,GAAG,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;KAChD;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAzBD,oEAyBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FacetConfigs, FileData, FacetConfig, FacetSection, SchemaFilePath } from './types';
|
|
2
|
-
import { AnnotationTerm, CollectionFacet, ConverterOutput,
|
|
2
|
+
import { AnnotationTerm, CollectionFacet, ConverterOutput, DataFieldAbstractTypes, EntityType, PropertyAnnotations, PropertyPath, ReferenceFacet, ReferenceURLFacet } from '@sap-ux/vocabularies-types';
|
|
3
3
|
import { FioriElementsVersion, Manifest, PageType } from '../../specification/common';
|
|
4
4
|
import { SchemaType } from '../../specification/schemaAccess';
|
|
5
5
|
import { ExtensionLogger } from '../../apiTypes';
|
|
@@ -178,27 +178,6 @@ export declare type NextDefinition = {
|
|
|
178
178
|
*/
|
|
179
179
|
export declare function getNextTargetDefinition(appSchema: object, title: string, currentConfigObject: object, propertyDefinition: object, key: string, factory: MetadataInstanceInterface, pageType: PageType): NextDefinition;
|
|
180
180
|
export declare function prepareRef(refInput: string): string;
|
|
181
|
-
/**
|
|
182
|
-
* Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
|
|
183
|
-
* @param appSchema - the app specific schema that shall get enhanced
|
|
184
|
-
* @param lineItemAnnotation - the UI.LineItem annotation, comprising all records
|
|
185
|
-
* @param entityType - the entity type as part of the AVT ConverterOutput
|
|
186
|
-
* @param lineItemId - line item ID, as comprise in stable ID
|
|
187
|
-
* @returns the actions definition plus the annotation path to the given line item
|
|
188
|
-
*/
|
|
189
|
-
export declare function addCommonLineItemDefinitions(appSchema: object, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, lineItemId: string): {
|
|
190
|
-
actions: object;
|
|
191
|
-
lineItemPath: string;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Method adds definition for 'RelatedFacetKeys' as enum with describtion and adds references to 'RelatedFacetKeys' for custom section definitions.
|
|
195
|
-
* @param {object} schema App specific schema that potentially gets enhanced
|
|
196
|
-
* @param {string[]>} sectionDefinitions array of section definitions which should be updated with new reference to 'RelatedFacetKeys' enum.
|
|
197
|
-
* @param {FacetSection[]} facetSections Array of facet section objects which is used to generate enum values.
|
|
198
|
-
* @param {Array<keyof Omit<FacetSection, 'custom'>>} idProperties Array of property names which should be looked up in 'FacetSection' object.
|
|
199
|
-
* Please note that method depends on order and takes first non empty value associated to passed properties.
|
|
200
|
-
*/
|
|
201
|
-
export declare function addDefinitionForRelatedFacetKeys(schema: object, sectionDefinitions: string[], facetSections: FacetSection[], idProperties: Array<keyof Omit<FacetSection, 'custom'>>): void;
|
|
202
181
|
/**
|
|
203
182
|
* Custom array merge function called by deepmerge's merge function
|
|
204
183
|
*
|
|
@@ -41,14 +41,17 @@ exports.createAnnotationPath = (entityTypeName, term, qualifier) => {
|
|
|
41
41
|
*/
|
|
42
42
|
function parseAndMergeAndConvert(annotationFiles, logger) {
|
|
43
43
|
const parseResult = [];
|
|
44
|
+
let converterOutput;
|
|
44
45
|
try {
|
|
45
46
|
if (annotationFiles) {
|
|
46
47
|
annotationFiles.forEach(function (annotationData) {
|
|
47
48
|
parseResult.push(edmx_parser_1.parseEDMX(annotationData.fileContent, annotationData.dataSourceUri));
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
if (parseResult.length > 0) {
|
|
52
|
+
converterOutput = annotation_converter_1.convertTypes(edmx_parser_1.merge(parseResult));
|
|
53
|
+
}
|
|
54
|
+
if (logger && (converterOutput === null || converterOutput === void 0 ? void 0 : converterOutput.diagnostics)) {
|
|
52
55
|
for (const converterMessage of converterOutput.diagnostics) {
|
|
53
56
|
extensionLogger_1.log(logger, {
|
|
54
57
|
severity: "error" /* Error */,
|
|
@@ -889,6 +892,7 @@ function fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject
|
|
|
889
892
|
* @returns {NextDefinition} - Next target definition to process
|
|
890
893
|
*/
|
|
891
894
|
function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition) {
|
|
895
|
+
var _a, _b, _c;
|
|
892
896
|
let nextDefinition = {
|
|
893
897
|
configObject: undefined,
|
|
894
898
|
targetDefinition: {},
|
|
@@ -897,7 +901,7 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
897
901
|
if (definitionArray.length) {
|
|
898
902
|
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
899
903
|
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
900
|
-
if (nextDefinition.targetDefinition['$ref'] || nextDefinition.targetDefinition['type'] === 'array') {
|
|
904
|
+
if (((_a = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _a === void 0 ? void 0 : _a['$ref']) || ((_b = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _b === void 0 ? void 0 : _b['type']) === 'array') {
|
|
901
905
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
902
906
|
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
903
907
|
return nextDefinition;
|
|
@@ -909,12 +913,11 @@ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema,
|
|
|
909
913
|
}
|
|
910
914
|
});
|
|
911
915
|
}
|
|
912
|
-
nextDefinition.title =
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, currentConfigObject, nextDefinition.targetDefinition['controlProperty']);
|
|
916
|
+
nextDefinition.title = ((_c = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _c === void 0 ? void 0 : _c['title']) ? nextDefinition.targetDefinition['title']
|
|
917
|
+
: title;
|
|
918
|
+
const factoryKey = lastDefinition === null || lastDefinition === void 0 ? void 0 : lastDefinition.split('<')[0];
|
|
919
|
+
const targetObject = currentConfigObject ? currentConfigObject : {};
|
|
920
|
+
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject, nextDefinition.targetDefinition['controlProperty']);
|
|
918
921
|
}
|
|
919
922
|
else {
|
|
920
923
|
//e.g. sections ==> loop over all properties = subsections or other
|
|
@@ -954,80 +957,6 @@ function prepareRef(refInput) {
|
|
|
954
957
|
return refInput.replace('#', '::').replace(/\//g, '::');
|
|
955
958
|
}
|
|
956
959
|
exports.prepareRef = prepareRef;
|
|
957
|
-
/**
|
|
958
|
-
* Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
|
|
959
|
-
* @param appSchema - the app specific schema that shall get enhanced
|
|
960
|
-
* @param lineItemAnnotation - the UI.LineItem annotation, comprising all records
|
|
961
|
-
* @param entityType - the entity type as part of the AVT ConverterOutput
|
|
962
|
-
* @param lineItemId - line item ID, as comprise in stable ID
|
|
963
|
-
* @returns the actions definition plus the annotation path to the given line item
|
|
964
|
-
*/
|
|
965
|
-
function addCommonLineItemDefinitions(appSchema, lineItemAnnotation, entityType, lineItemId) {
|
|
966
|
-
let lineItemPath;
|
|
967
|
-
appSchema['definitions'][lineItemId] = {
|
|
968
|
-
type: 'object',
|
|
969
|
-
properties: {},
|
|
970
|
-
additionalProperties: false,
|
|
971
|
-
isViewNode: true,
|
|
972
|
-
description: 'Columns'
|
|
973
|
-
};
|
|
974
|
-
//Copy toolbar
|
|
975
|
-
const toolBar = lineItemId === 'LineItems' ? 'ToolBar' : 'ObjectPageToolBar';
|
|
976
|
-
const schemaIdForToolBar = `${toolBar}<${lineItemId}>`;
|
|
977
|
-
appSchema['definitions'][schemaIdForToolBar] = JSON.parse(JSON.stringify(appSchema['definitions'][`${toolBar}`]));
|
|
978
|
-
const schemaIdForActions = `Actions<${prepareRef(lineItemId)}>`;
|
|
979
|
-
appSchema['definitions'][schemaIdForToolBar].properties.actions.$ref = exports.DEFINITION_LINK_PREFIX + schemaIdForActions;
|
|
980
|
-
const actionId = lineItemId === 'LineItems' ? 'Actions' : 'ObjectPageToolBarActions';
|
|
981
|
-
const actions = (appSchema['definitions'][schemaIdForActions] = JSON.parse(JSON.stringify(appSchema['definitions'][actionId])));
|
|
982
|
-
actions.properties = {};
|
|
983
|
-
actions.additionalProperties = false;
|
|
984
|
-
//Determine annotation path
|
|
985
|
-
if (lineItemAnnotation) {
|
|
986
|
-
lineItemPath = exports.createAnnotationPath(entityType.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
|
|
987
|
-
appSchema['definitions'][lineItemId].annotationPath = appSchema['definitions'][schemaIdForToolBar].annotationPath = lineItemPath;
|
|
988
|
-
}
|
|
989
|
-
return { actions, lineItemPath };
|
|
990
|
-
}
|
|
991
|
-
exports.addCommonLineItemDefinitions = addCommonLineItemDefinitions;
|
|
992
|
-
/**
|
|
993
|
-
* Method adds definition for 'RelatedFacetKeys' as enum with describtion and adds references to 'RelatedFacetKeys' for custom section definitions.
|
|
994
|
-
* @param {object} schema App specific schema that potentially gets enhanced
|
|
995
|
-
* @param {string[]>} sectionDefinitions array of section definitions which should be updated with new reference to 'RelatedFacetKeys' enum.
|
|
996
|
-
* @param {FacetSection[]} facetSections Array of facet section objects which is used to generate enum values.
|
|
997
|
-
* @param {Array<keyof Omit<FacetSection, 'custom'>>} idProperties Array of property names which should be looked up in 'FacetSection' object.
|
|
998
|
-
* Please note that method depends on order and takes first non empty value associated to passed properties.
|
|
999
|
-
*/
|
|
1000
|
-
function addDefinitionForRelatedFacetKeys(schema, sectionDefinitions, facetSections, idProperties) {
|
|
1001
|
-
const oneOfSections = facetSections.map((section) => {
|
|
1002
|
-
// Loop accaptable properties in received order and find first entry with value
|
|
1003
|
-
const propertyName = idProperties.find((property) => !!section[property]);
|
|
1004
|
-
const schemaIdForSection = section[propertyName];
|
|
1005
|
-
return Object.assign(Object.assign({ const: schemaIdForSection }, (section.label && { description: section.label })), (section.custom && { custom: section.custom }));
|
|
1006
|
-
});
|
|
1007
|
-
// Change 'relatedFacet' only when we have entries for sections - otherwise use generic.
|
|
1008
|
-
if (oneOfSections.length) {
|
|
1009
|
-
// Create new definition in schema as 'oneOf'.
|
|
1010
|
-
// Simpler way would be to use 'enum', but then there no option to pass description.
|
|
1011
|
-
schema['definitions']['RelatedFacetKeys'] = {
|
|
1012
|
-
type: 'string',
|
|
1013
|
-
oneOf: oneOfSections
|
|
1014
|
-
};
|
|
1015
|
-
// Add enum definition
|
|
1016
|
-
for (const name of sectionDefinitions) {
|
|
1017
|
-
const definition = schema['definitions'][name];
|
|
1018
|
-
const property = definition['properties']['relatedFacet'];
|
|
1019
|
-
definition['properties']['relatedFacet'] = {
|
|
1020
|
-
anyOf: [
|
|
1021
|
-
{
|
|
1022
|
-
$ref: exports.DEFINITION_LINK_PREFIX + 'RelatedFacetKeys'
|
|
1023
|
-
},
|
|
1024
|
-
property
|
|
1025
|
-
]
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
exports.addDefinitionForRelatedFacetKeys = addDefinitionForRelatedFacetKeys;
|
|
1031
960
|
/**
|
|
1032
961
|
* Custom array merge function called by deepmerge's merge function
|
|
1033
962
|
*
|