@sap/ux-specification 1.84.51 → 1.84.53
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/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 +47 -47
- package/dist/index-min.js.map +3 -3
- package/dist/schemas/v2/AnalyticalListPageConfig.json +9 -0
- package/dist/schemas/v2/ListReportConfig.json +9 -0
- package/dist/schemas/v2/ObjectPageConfig.json +9 -0
- package/dist/schemas/v4/ListReportConfig.json +8 -8
- package/dist/scripts/to-json-schema.d.ts.map +1 -1
- package/dist/scripts/to-json-schema.js +9 -1
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/src/api.d.ts +1 -2
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/api.js +3 -3
- package/dist/src/api.js.map +1 -1
- package/dist/src/extensionLogger.d.ts +1 -24
- package/dist/src/extensionLogger.d.ts.map +1 -1
- package/dist/src/extensionLogger.js +5 -15
- package/dist/src/extensionLogger.js.map +1 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/project.d.ts +1 -2
- package/dist/src/project.d.ts.map +1 -1
- package/dist/src/project.js.map +1 -1
- package/dist/src/sync/common/appProvider.d.ts +1 -3
- package/dist/src/sync/common/appProvider.d.ts.map +1 -1
- package/dist/src/sync/common/appProvider.js +2 -3
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/decoration/control.d.ts +1 -1
- package/dist/src/sync/common/decoration/control.d.ts.map +1 -1
- package/dist/src/sync/common/decoration/control.js +12 -12
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/decoration/decorators.d.ts +1 -1
- package/dist/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/src/sync/common/decoration/flex.d.ts +1 -2
- package/dist/src/sync/common/decoration/flex.d.ts.map +1 -1
- package/dist/src/sync/common/decoration/flex.js.map +1 -1
- package/dist/src/sync/common/flexUtils.d.ts +1 -4
- package/dist/src/sync/common/flexUtils.d.ts.map +1 -1
- package/dist/src/sync/common/flexUtils.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +7 -6
- package/dist/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +258 -74
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +20 -4
- package/dist/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/common/generate/utils.js +93 -27
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/import/utils.d.ts +1 -2
- package/dist/src/sync/common/import/utils.d.ts.map +1 -1
- package/dist/src/sync/common/import/utils.js +4 -3
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.d.ts +1 -2
- package/dist/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/src/sync/common/importProject.js +22 -23
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/index.d.ts +0 -1
- package/dist/src/sync/common/index.d.ts.map +1 -1
- package/dist/src/sync/common/index.js +0 -1
- package/dist/src/sync/common/index.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +2 -12
- package/dist/src/sync/common/utils.d.ts.map +1 -1
- package/dist/src/sync/common/utils.js +65 -59
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/application.d.ts.map +1 -1
- package/dist/src/sync/v2/application.js +1 -2
- package/dist/src/sync/v2/application.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 +1 -2
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Field.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Field.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.js +4 -5
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts +2 -4
- package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +12 -13
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +1 -3
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +2 -3
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +1 -2
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +3 -3
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts +1 -2
- package/dist/src/sync/v2/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.js +17 -17
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.js +1 -1
- package/dist/src/sync/v2/export/export.d.ts +1 -1
- package/dist/src/sync/v2/export/export.d.ts.map +1 -1
- package/dist/src/sync/v2/export/export.js +6 -6
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.d.ts +1 -2
- package/dist/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +1 -1
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.d.ts +1 -2
- package/dist/src/sync/v2/export/view-controller-generator.d.ts.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.js +2 -2
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +10 -10
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/generate.d.ts +1 -2
- package/dist/src/sync/v2/generate/generate.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/generate.js +3 -3
- package/dist/src/sync/v2/generate/generate.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 +4 -4
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +55 -46
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +3 -4
- package/dist/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/utils.js +53 -40
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.d.ts +1 -3
- package/dist/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.d.ts +1 -2
- package/dist/src/sync/v2/import/app/ovpProvider.d.ts.map +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.d.ts +1 -3
- package/dist/src/sync/v2/import/common/index.d.ts.map +1 -1
- package/dist/src/sync/v2/import/common/index.js +9 -9
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/controls/table.d.ts.map +1 -1
- package/dist/src/sync/v2/import/controls/table.js +3 -4
- package/dist/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts +1 -2
- package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +16 -16
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.d.ts +1 -2
- package/dist/src/sync/v2/import/pages/listReport.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.js +15 -15
- package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.d.ts +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +31 -31
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.d.ts.map +1 -1
- package/dist/src/sync/v2/import/utils.js +1 -1
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v4/application.js +2 -2
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js +4 -4
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.js +2 -1
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v4/export/export.d.ts +1 -3
- package/dist/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/src/sync/v4/export/export.js +50 -49
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/types.d.ts +1 -3
- package/dist/src/sync/v4/export/types.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/freestylePage.d.ts +1 -1
- package/dist/src/sync/v4/generate/freestylePage.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/generate.d.ts +2 -3
- package/dist/src/sync/v4/generate/generate.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/generate.js +2 -2
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/listReport.d.ts +1 -1
- package/dist/src/sync/v4/generate/listReport.d.ts.map +1 -1
- package/dist/src/sync/v4/generate/listReport.js +118 -101
- 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 +157 -136
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.d.ts +1 -2
- package/dist/src/sync/v4/import/app/appProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts +2 -5
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.js +3 -3
- package/dist/src/sync/v4/import/app/baseAppProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts +1 -2
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts.map +1 -1
- package/dist/src/sync/v4/import/app/freestyleProvider.js.map +1 -1
- package/dist/src/sync/v4/import/fragment.d.ts +1 -2
- package/dist/src/sync/v4/import/fragment.d.ts.map +1 -1
- package/dist/src/sync/v4/import/fragment.js.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.d.ts +1 -2
- package/dist/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.js +39 -39
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +1 -2
- package/dist/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.js +24 -24
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/utils/StableIdHelper.d.ts +4 -0
- package/dist/src/sync/v4/utils/StableIdHelper.d.ts.map +1 -1
- package/dist/src/sync/v4/utils/StableIdHelper.js +3 -11
- package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +2 -3
- package/dist/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/src/sync/v4/utils/utils.js +37 -31
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +2 -18
- package/dist/src/apiTypes.d.ts +0 -312
- package/dist/src/apiTypes.d.ts.map +0 -1
- package/dist/src/apiTypes.js +0 -3
- package/dist/src/apiTypes.js.map +0 -1
- package/dist/src/sync/common/types.d.ts +0 -300
- package/dist/src/sync/common/types.d.ts.map +0 -1
- package/dist/src/sync/common/types.js +0 -170
- package/dist/src/sync/common/types.js.map +0 -1
|
@@ -16,13 +16,13 @@ const common_1 = require("../../common");
|
|
|
16
16
|
* @param selectionFieldsAnnotation - the UI.SelectionField annotation
|
|
17
17
|
*/
|
|
18
18
|
function addSelectionFields(entityType, appSchema, selectionFieldsAnnotation) {
|
|
19
|
-
const selectionFieldsDefinition = appSchema
|
|
19
|
+
const selectionFieldsDefinition = appSchema.definitions.SelectionFields;
|
|
20
20
|
selectionFieldsDefinition.additionalProperties = false;
|
|
21
21
|
selectionFieldsDefinition.properties = {};
|
|
22
22
|
if (!entityType) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
selectionFieldsDefinition[
|
|
25
|
+
selectionFieldsDefinition[ux_specification_types_1.SchemaTag.annotationPath] = common_1.createAnnotationPath(entityType.fullyQualifiedName, "com.sap.vocabularies.UI.v1.SelectionFields" /* SelectionFields */);
|
|
26
26
|
if (!selectionFieldsAnnotation) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
@@ -33,21 +33,33 @@ function addSelectionFields(entityType, appSchema, selectionFieldsAnnotation) {
|
|
|
33
33
|
if (selectionField.type === 'PropertyPath') {
|
|
34
34
|
description = common_1.getLabelForPropertyPath(selectionField, entityType);
|
|
35
35
|
}
|
|
36
|
-
selectionFieldsDefinition
|
|
36
|
+
selectionFieldsDefinition.properties[fieldDefinition] = {
|
|
37
37
|
$ref: common_1.DEFINITION_LINK_PREFIX + fieldDefinition
|
|
38
38
|
};
|
|
39
|
-
selectionFieldsDefinition
|
|
39
|
+
selectionFieldsDefinition.properties[fieldDefinition][ux_specification_types_1.SchemaTag.propertyIndex] = i;
|
|
40
40
|
const dataType = common_1.determineDataType(selectionField);
|
|
41
|
-
appSchema
|
|
41
|
+
appSchema.definitions[fieldDefinition] = {
|
|
42
42
|
type: 'object',
|
|
43
43
|
properties: {},
|
|
44
44
|
description,
|
|
45
|
-
annotationPath: `${selectionFieldsDefinition[common_1.SchemaTag.annotationPath]}/${i}`,
|
|
46
|
-
isViewNode: true,
|
|
47
45
|
additionalProperties: false,
|
|
48
|
-
annotationType: selectionField?.type,
|
|
49
46
|
...(dataType && { dataType })
|
|
50
47
|
};
|
|
48
|
+
appSchema.definitions[fieldDefinition][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
49
|
+
appSchema.definitions[fieldDefinition][ux_specification_types_1.SchemaTag.keys] = [
|
|
50
|
+
{ name: ux_specification_types_1.SchemaKeyName.value, value: `${selectionField.value}` }
|
|
51
|
+
];
|
|
52
|
+
if (selectionField.$target?.fullyQualifiedName.indexOf('@') > -1) {
|
|
53
|
+
appSchema.definitions[fieldDefinition][ux_specification_types_1.SchemaTag.target] = selectionField.$target.fullyQualifiedName
|
|
54
|
+
.split('@')[0]
|
|
55
|
+
.split('/')[0];
|
|
56
|
+
}
|
|
57
|
+
else if (selectionField.$target?.fullyQualifiedName) {
|
|
58
|
+
appSchema.definitions[fieldDefinition][ux_specification_types_1.SchemaTag.target] =
|
|
59
|
+
selectionField.$target.fullyQualifiedName.split('/')[0];
|
|
60
|
+
}
|
|
61
|
+
appSchema.definitions[fieldDefinition][ux_specification_types_1.SchemaTag.annotationType] = selectionField?.type;
|
|
62
|
+
appSchema.definitions[fieldDefinition][ux_specification_types_1.SchemaTag.annotationPath] = `${selectionFieldsDefinition[ux_specification_types_1.SchemaTag.annotationPath]}/${i}`;
|
|
51
63
|
i++;
|
|
52
64
|
});
|
|
53
65
|
}
|
|
@@ -70,25 +82,25 @@ function defineActions(appSchema, schemaIdForActions, annotations, targetAnnotat
|
|
|
70
82
|
const actions = appSchema.definitions[schemaIdForActions];
|
|
71
83
|
actions.properties = {};
|
|
72
84
|
actions.additionalProperties = false;
|
|
73
|
-
const chartAnnotation = annotations[targetAnnotation?.split(`${
|
|
85
|
+
const chartAnnotation = annotations[targetAnnotation?.split(`${ux_specification_types_1.UIVOCABULARY}.`)[1]];
|
|
74
86
|
if (chartAnnotation && chartAnnotation.Actions) {
|
|
75
87
|
let i = 0;
|
|
76
88
|
chartAnnotation.Actions.forEach((actionRecord) => {
|
|
77
|
-
const actionDefinition = common_1.prepareRef(`${
|
|
89
|
+
const actionDefinition = common_1.prepareRef(`${ux_specification_types_1.DefinitionName.ChartToolBarAction}<${actionRecord.Action}>`);
|
|
78
90
|
const description = common_1.getDataFieldDescription(actionRecord, entityType);
|
|
79
|
-
const prefix = actionRecord.$Type.split(`${
|
|
91
|
+
const prefix = actionRecord.$Type.split(`${ux_specification_types_1.UIVOCABULARY}.`)[1];
|
|
80
92
|
const action = (actions.properties[`${prefix}::${actionRecord.Action}`] = {
|
|
81
93
|
$ref: common_1.DEFINITION_LINK_PREFIX + actionDefinition,
|
|
82
94
|
description
|
|
83
95
|
});
|
|
84
96
|
//Add tags
|
|
85
|
-
action[
|
|
86
|
-
action[
|
|
87
|
-
action[
|
|
97
|
+
action[ux_specification_types_1.SchemaTag.propertyIndex] = i;
|
|
98
|
+
action[ux_specification_types_1.SchemaTag.annotationType] = actionRecord.$Type;
|
|
99
|
+
action[ux_specification_types_1.SchemaTag.annotationPath] = `/${actionRecord.fullyQualifiedName}`;
|
|
88
100
|
//as ChartToolBarAction is an empty object, copy ViewToolBarAction and remove properties
|
|
89
|
-
appSchema.definitions[actionDefinition] = JSON.parse(JSON.stringify(appSchema.definitions[
|
|
101
|
+
appSchema.definitions[actionDefinition] = JSON.parse(JSON.stringify(appSchema.definitions[ux_specification_types_1.DefinitionName.ViewToolBarAction]));
|
|
90
102
|
appSchema.definitions[actionDefinition].properties = {};
|
|
91
|
-
appSchema.definitions[actionDefinition][
|
|
103
|
+
appSchema.definitions[actionDefinition][ux_specification_types_1.SchemaTag.annotationPath] = actionRecord.fullyQualifiedName;
|
|
92
104
|
i++;
|
|
93
105
|
});
|
|
94
106
|
}
|
|
@@ -112,7 +124,7 @@ function findTheRightVisualization(allVisualizations, alias, namespace, viewKey,
|
|
|
112
124
|
}
|
|
113
125
|
else if (viewKey === 'secondary') {
|
|
114
126
|
visualizationObject = allVisualizations.find((vis) => {
|
|
115
|
-
return vis['value'].indexOf(
|
|
127
|
+
return vis['value'].indexOf(ux_specification_types_1.FacetBase.LineItem) > -1;
|
|
116
128
|
});
|
|
117
129
|
}
|
|
118
130
|
else {
|
|
@@ -128,7 +140,7 @@ function findTheRightVisualization(allVisualizations, alias, namespace, viewKey,
|
|
|
128
140
|
targetAnnotation = `/${namespace}/${visualizationObject['$target'].fullyQualifiedName.split(namespace)[1]}`;
|
|
129
141
|
}
|
|
130
142
|
else if (visualization) {
|
|
131
|
-
targetAnnotation = `/${namespace}/` + visualization.replace(`UI`,
|
|
143
|
+
targetAnnotation = `/${namespace}/` + visualization.replace(`UI`, ux_specification_types_1.UIVOCABULARY);
|
|
132
144
|
}
|
|
133
145
|
}
|
|
134
146
|
return { visualization, targetAnnotation };
|
|
@@ -164,14 +176,14 @@ function analyzeChartAnnotation(namespace, annotationPath, annotationAVT, viewKe
|
|
|
164
176
|
function analyzeViewAnnotation(annotationPath, uIAnnotations, generateParameters, viewKey, visualizationType) {
|
|
165
177
|
let namespace = undefined, title;
|
|
166
178
|
const UILINEITEM = '@UI.LineItem';
|
|
167
|
-
const annotationInManifest = annotationPath?.split(`${
|
|
179
|
+
const annotationInManifest = annotationPath?.split(`${ux_specification_types_1.UIVOCABULARY}.`)[1];
|
|
168
180
|
const annotationAVT = annotationInManifest && uIAnnotations[annotationInManifest];
|
|
169
181
|
if (!annotationAVT) {
|
|
170
182
|
return { visualization: undefined, targetAnnotation: undefined, namespace, title: `View (${viewKey})` };
|
|
171
183
|
}
|
|
172
184
|
title = annotationAVT.Text;
|
|
173
185
|
namespace = annotationAVT.fullyQualifiedName.split('@com.sap.vocabularies.UI.v1.')[0];
|
|
174
|
-
const alias = common_1.findAlias(
|
|
186
|
+
const alias = common_1.findAlias(ux_specification_types_1.UIVOCABULARY, generateParameters.serviceAVT);
|
|
175
187
|
if (annotationInManifest.startsWith('PresentationVariant')) {
|
|
176
188
|
const { visualization, targetAnnotation } = findTheRightVisualization(annotationAVT.Visualizations, alias, namespace, viewKey, visualizationType);
|
|
177
189
|
title = title || `View (${viewKey})`;
|
|
@@ -181,7 +193,7 @@ function analyzeViewAnnotation(annotationPath, uIAnnotations, generateParameters
|
|
|
181
193
|
let { visualization, targetAnnotation } = findTheRightVisualization(annotationAVT.PresentationVariant.Visualizations, alias, namespace, viewKey, visualizationType);
|
|
182
194
|
if (!visualization) {
|
|
183
195
|
visualization = UILINEITEM; // default visualization
|
|
184
|
-
targetAnnotation = `/${namespace}/` + visualization.replace(`UI`,
|
|
196
|
+
targetAnnotation = `/${namespace}/` + visualization.replace(`UI`, ux_specification_types_1.UIVOCABULARY); // default targetAnnotation
|
|
185
197
|
}
|
|
186
198
|
title = title || `View (${viewKey})`;
|
|
187
199
|
return { visualization, targetAnnotation, namespace, title };
|
|
@@ -211,25 +223,26 @@ function analyzeViewAnnotation(annotationPath, uIAnnotations, generateParameters
|
|
|
211
223
|
* @param annotations - UI annotations, as determined by AVT
|
|
212
224
|
*/
|
|
213
225
|
function addALPChartView(appSchema, chartAnnotationPath, targetAnnotation, annotations) {
|
|
214
|
-
const chartView = appSchema.definitions[
|
|
215
|
-
appSchema.definitions[
|
|
216
|
-
delete appSchema.definitions[
|
|
226
|
+
const chartView = appSchema.definitions[ux_specification_types_1.DefinitionName.ALPChartView];
|
|
227
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPChart] = JSON.parse(JSON.stringify(chartView));
|
|
228
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ALPChart][ux_specification_types_1.SchemaTag.isViewNode];
|
|
217
229
|
if (targetAnnotation) {
|
|
218
|
-
appSchema.definitions[
|
|
230
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPChart][ux_specification_types_1.SchemaTag.annotationPath] = targetAnnotation;
|
|
219
231
|
}
|
|
220
|
-
appSchema.definitions[
|
|
221
|
-
chartView.properties.annotationPath[
|
|
232
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPChart].properties.annotationPath[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
233
|
+
chartView.properties.annotationPath[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
222
234
|
chartView.additionalProperties = false;
|
|
223
235
|
chartView.description = `Chart (key: primary)`;
|
|
224
236
|
chartView.title = `Chart`;
|
|
225
|
-
chartView.$ref = `${common_1.DEFINITION_LINK_PREFIX}${
|
|
237
|
+
chartView.$ref = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ALPChart}`;
|
|
226
238
|
if (chartAnnotationPath) {
|
|
227
|
-
const viewAnnotation = chartAnnotationPath.split(
|
|
239
|
+
const viewAnnotation = chartAnnotationPath.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
228
240
|
const pathParts = annotations[viewAnnotation].fullyQualifiedName.split('@');
|
|
229
|
-
chartView[
|
|
241
|
+
chartView[ux_specification_types_1.SchemaTag.annotationPath] = `/${pathParts[0]}/@${pathParts[1]}`;
|
|
230
242
|
}
|
|
231
|
-
chartView[
|
|
232
|
-
chartView[
|
|
243
|
+
chartView[ux_specification_types_1.SchemaTag.artifactType] = ux_specification_types_1.ArtifactType.Manifest;
|
|
244
|
+
chartView[ux_specification_types_1.SchemaTag.key] = 'primary';
|
|
245
|
+
chartView[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: 'primary' }];
|
|
233
246
|
}
|
|
234
247
|
/**
|
|
235
248
|
* Adds the ALP views to the app-specific schema
|
|
@@ -242,49 +255,49 @@ function addALPChartView(appSchema, chartAnnotationPath, targetAnnotation, annot
|
|
|
242
255
|
function addALPViews(appSchema, viewsPaths, entityType, generateParameters, templateAnnotation, tableDefinitionName) {
|
|
243
256
|
const annotations = entityType.annotations.UI;
|
|
244
257
|
//1. Chart View
|
|
245
|
-
const chartAnnotationPath = viewsPaths?.[0]?.['primary']?.[0]?.[
|
|
258
|
+
const chartAnnotationPath = viewsPaths?.[0]?.['primary']?.[0]?.[ux_specification_types_1.SchemaTag.annotationPath];
|
|
246
259
|
const { targetAnnotation } = analyzeViewAnnotation(chartAnnotationPath, annotations, generateParameters, 'primary');
|
|
247
260
|
addALPChartView(appSchema, chartAnnotationPath, targetAnnotation, annotations);
|
|
248
261
|
// Copy toolbar
|
|
249
262
|
const schemaIdForActions = `Actions<ALPChart>`;
|
|
250
|
-
appSchema.definitions[
|
|
263
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ViewChartToolBar].properties.actions['$ref'] =
|
|
251
264
|
common_1.DEFINITION_LINK_PREFIX + schemaIdForActions;
|
|
252
265
|
defineActions(appSchema, schemaIdForActions, annotations, targetAnnotation, entityType);
|
|
253
266
|
//2. Table View
|
|
254
|
-
const { visualization: tableVisualization, targetAnnotation: target } = analyzeViewAnnotation(viewsPaths?.[0]?.['secondary']?.[0]?.[
|
|
267
|
+
const { visualization: tableVisualization, targetAnnotation: target } = analyzeViewAnnotation(viewsPaths?.[0]?.['secondary']?.[0]?.[ux_specification_types_1.SchemaTag.annotationPath], annotations, generateParameters, 'secondary');
|
|
255
268
|
const tableDefinition = appSchema.definitions[tableDefinitionName];
|
|
256
269
|
if (tableVisualization || templateAnnotation) {
|
|
257
|
-
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${
|
|
270
|
+
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ToolBarLR}`;
|
|
258
271
|
// Switch from generic column to specific definition
|
|
259
272
|
tableDefinition.properties['columns'] = {
|
|
260
|
-
$ref: common_1.DEFINITION_LINK_PREFIX +
|
|
273
|
+
$ref: common_1.DEFINITION_LINK_PREFIX + ux_specification_types_1.DefinitionName.LineItems
|
|
261
274
|
};
|
|
262
|
-
tableDefinition.properties.annotationPath[
|
|
275
|
+
tableDefinition.properties.annotationPath[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
263
276
|
}
|
|
264
277
|
else {
|
|
265
278
|
tableDefinition.properties = {};
|
|
266
279
|
}
|
|
267
|
-
const tableView = appSchema.definitions[
|
|
268
|
-
appSchema.definitions[
|
|
269
|
-
delete appSchema.definitions[
|
|
280
|
+
const tableView = appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTableView];
|
|
281
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTable] = JSON.parse(JSON.stringify(tableView));
|
|
282
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTable][ux_specification_types_1.SchemaTag.isViewNode];
|
|
270
283
|
tableView.additionalProperties = false;
|
|
271
284
|
tableView.description = `Table (key: secondary)`;
|
|
272
285
|
tableView.title = `Table`;
|
|
273
286
|
if (tableVisualization) {
|
|
274
287
|
delete tableView.properties;
|
|
275
|
-
tableView.$ref = `${common_1.DEFINITION_LINK_PREFIX}${
|
|
288
|
+
tableView.$ref = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ALPTable}`;
|
|
276
289
|
}
|
|
277
290
|
else if (!templateAnnotation) {
|
|
278
291
|
tableView.properties = {};
|
|
279
292
|
}
|
|
280
|
-
tableView[
|
|
293
|
+
tableView[ux_specification_types_1.SchemaTag.artifactType] = ux_specification_types_1.ArtifactType.Manifest;
|
|
281
294
|
let annotationTerm, viewAnnotation;
|
|
282
|
-
if (tableVisualization && tableVisualization.indexOf(
|
|
295
|
+
if (tableVisualization && tableVisualization.indexOf(ux_specification_types_1.FacetBase.LineItem) > -1) {
|
|
283
296
|
annotationTerm = tableVisualization.split('.')[1];
|
|
284
|
-
viewAnnotation = viewsPaths[0]['secondary'][0].annotationPath.split(
|
|
297
|
+
viewAnnotation = viewsPaths[0]['secondary'][0].annotationPath.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
285
298
|
}
|
|
286
299
|
else if (templateAnnotation) {
|
|
287
|
-
annotationTerm = viewAnnotation = templateAnnotation.split(
|
|
300
|
+
annotationTerm = viewAnnotation = templateAnnotation.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
288
301
|
}
|
|
289
302
|
if (annotationTerm) {
|
|
290
303
|
const dataForLineItem = {
|
|
@@ -292,13 +305,16 @@ function addALPViews(appSchema, viewsPaths, entityType, generateParameters, temp
|
|
|
292
305
|
lineItemAnnotation: entityType.annotations.UI[annotationTerm],
|
|
293
306
|
entityType,
|
|
294
307
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
295
|
-
lineItemId:
|
|
308
|
+
lineItemId: ux_specification_types_1.DefinitionName.LineItems
|
|
296
309
|
};
|
|
297
|
-
utils_1.addLineItemsTypeToSchema(dataForLineItem,
|
|
298
|
-
|
|
310
|
+
utils_1.addLineItemsTypeToSchema(dataForLineItem, ux_specification_types_1.DefinitionName.ViewTableColumn);
|
|
311
|
+
if (target) {
|
|
312
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTable][ux_specification_types_1.SchemaTag.annotationPath] = target;
|
|
313
|
+
}
|
|
299
314
|
const pathParts = annotations[viewAnnotation].fullyQualifiedName.split('@');
|
|
300
|
-
tableView[
|
|
301
|
-
tableView[
|
|
315
|
+
tableView[ux_specification_types_1.SchemaTag.annotationPath] = `/${pathParts[0]}/@${pathParts[1]}`;
|
|
316
|
+
tableView[ux_specification_types_1.SchemaTag.key] = 'secondary';
|
|
317
|
+
tableView[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: 'secondary' }];
|
|
302
318
|
}
|
|
303
319
|
}
|
|
304
320
|
/**
|
|
@@ -308,21 +324,21 @@ function addALPViews(appSchema, viewsPaths, entityType, generateParameters, temp
|
|
|
308
324
|
* @returns the ID for the chart view in schema
|
|
309
325
|
*/
|
|
310
326
|
function addViewChartDefinitions(inputParameters, annotations) {
|
|
311
|
-
const idForChart = `${
|
|
312
|
-
inputParameters.appSchema.definitions[idForChart] = JSON.parse(JSON.stringify(inputParameters.appSchema.definitions[
|
|
313
|
-
delete inputParameters.appSchema.definitions[idForChart][
|
|
314
|
-
inputParameters.appSchema.definitions[idForChart][
|
|
327
|
+
const idForChart = `${ux_specification_types_1.DefinitionName.LRChartView}<${inputParameters.viewKey}>`;
|
|
328
|
+
inputParameters.appSchema.definitions[idForChart] = JSON.parse(JSON.stringify(inputParameters.appSchema.definitions[ux_specification_types_1.DefinitionName.LRChartView]));
|
|
329
|
+
delete inputParameters.appSchema.definitions[idForChart][ux_specification_types_1.SchemaTag.isViewNode];
|
|
330
|
+
inputParameters.appSchema.definitions[idForChart][ux_specification_types_1.SchemaTag.annotationPath] = inputParameters.targetAnnotation;
|
|
315
331
|
if (inputParameters.navPropName) {
|
|
316
332
|
inputParameters.appSchema.definitions[idForChart]['navigationProperty'] = inputParameters.navPropName;
|
|
317
333
|
}
|
|
318
334
|
//Copy toolbar
|
|
319
|
-
const idForToolbar = `${
|
|
320
|
-
inputParameters.appSchema.definitions[idForToolbar] = JSON.parse(JSON.stringify(inputParameters.appSchema.definitions[
|
|
335
|
+
const idForToolbar = `${ux_specification_types_1.DefinitionName.ViewChartToolBar}<${inputParameters.viewKey}>`;
|
|
336
|
+
inputParameters.appSchema.definitions[idForToolbar] = JSON.parse(JSON.stringify(inputParameters.appSchema.definitions[ux_specification_types_1.DefinitionName.ViewChartToolBar]));
|
|
321
337
|
inputParameters.appSchema.definitions[idForChart]['properties'].toolBar.$ref = `${common_1.DEFINITION_LINK_PREFIX}${idForToolbar}`;
|
|
322
338
|
//Copy actions
|
|
323
|
-
const schemaIdForActions = `${
|
|
339
|
+
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.Actions}<${inputParameters.viewKey}>`;
|
|
324
340
|
defineActions(inputParameters.appSchema, schemaIdForActions, annotations, inputParameters.targetAnnotation, inputParameters.targetEntityType);
|
|
325
|
-
inputParameters.appSchema.definitions[idForToolbar]['properties'][
|
|
341
|
+
inputParameters.appSchema.definitions[idForToolbar]['properties'][ux_specification_types_1.PropertyName.actions]['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${schemaIdForActions}`;
|
|
326
342
|
return idForChart;
|
|
327
343
|
}
|
|
328
344
|
/**
|
|
@@ -336,9 +352,9 @@ function addViewChartDefinitions(inputParameters, annotations) {
|
|
|
336
352
|
*/
|
|
337
353
|
function addViewChart(inputParameters, UIAnnotations, appSchema, viewsDefinition, viewKey, title) {
|
|
338
354
|
const idForChart = addViewChartDefinitions(inputParameters, UIAnnotations);
|
|
339
|
-
appSchema.definitions[idForChart].properties.annotationPath[
|
|
340
|
-
appSchema.definitions[idForChart].properties.index[
|
|
341
|
-
appSchema.definitions[idForChart].properties.entitySet[
|
|
355
|
+
appSchema.definitions[idForChart].properties.annotationPath[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
356
|
+
appSchema.definitions[idForChart].properties.index[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
357
|
+
appSchema.definitions[idForChart].properties.entitySet[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
342
358
|
const titleOnHover = `Chart View (key: ${viewKey})`;
|
|
343
359
|
viewsDefinition.properties[viewKey] = {
|
|
344
360
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${idForChart}`,
|
|
@@ -355,16 +371,16 @@ function addViewChart(inputParameters, UIAnnotations, appSchema, viewsDefinition
|
|
|
355
371
|
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
356
372
|
*/
|
|
357
373
|
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, generateParameters) {
|
|
358
|
-
const tableId = `${
|
|
359
|
-
const viewId = `${
|
|
360
|
-
const lrTableView = common_1.parseSchemaDefinition(
|
|
361
|
-
delete lrTableView[
|
|
362
|
-
lrTableView[
|
|
374
|
+
const tableId = `${ux_specification_types_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
|
|
375
|
+
const viewId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`;
|
|
376
|
+
const lrTableView = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.LRTableView, inputParameters.viewKey, inputParameters.appSchema);
|
|
377
|
+
delete lrTableView[ux_specification_types_1.SchemaTag.isViewNode];
|
|
378
|
+
lrTableView[ux_specification_types_1.SchemaTag.annotationPath] = inputParameters.targetAnnotation;
|
|
363
379
|
if (inputParameters.navPropName) {
|
|
364
380
|
lrTableView['navigationProperty'] = inputParameters.navPropName;
|
|
365
381
|
}
|
|
366
382
|
//Copy toolbar
|
|
367
|
-
common_1.addDefinitionRef(lrTableView.properties.toolBar,
|
|
383
|
+
common_1.addDefinitionRef(lrTableView.properties.toolBar, ux_specification_types_1.DefinitionName.ToolBar, viewId);
|
|
368
384
|
const title = `Table View (key: ${inputParameters.viewKey})`;
|
|
369
385
|
viewsDefinition.properties[inputParameters.viewKey] = {
|
|
370
386
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${tableId}`,
|
|
@@ -372,10 +388,10 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
|
|
|
372
388
|
title
|
|
373
389
|
};
|
|
374
390
|
common_1.addDefinitionRef(lrTableView.properties.columns, viewId);
|
|
375
|
-
lrTableView.properties.annotationPath[
|
|
376
|
-
lrTableView.properties.index[
|
|
377
|
-
lrTableView.properties.entitySet[
|
|
378
|
-
const annotationTerm = visualization?.split('.')[1] || templateAnnotation.split(
|
|
391
|
+
lrTableView.properties.annotationPath[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
392
|
+
lrTableView.properties.index[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
393
|
+
lrTableView.properties.entitySet[ux_specification_types_1.SchemaTag.hidden] = true;
|
|
394
|
+
const annotationTerm = visualization?.split('.')[1] || templateAnnotation.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
379
395
|
const dataForLineItem = {
|
|
380
396
|
appSchema: inputParameters.appSchema,
|
|
381
397
|
lineItemAnnotation: inputParameters.targetEntityType.annotations.UI[annotationTerm],
|
|
@@ -383,7 +399,7 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
|
|
|
383
399
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
384
400
|
lineItemId: viewId
|
|
385
401
|
};
|
|
386
|
-
utils_1.addLineItemsTypeToSchema(dataForLineItem,
|
|
402
|
+
utils_1.addLineItemsTypeToSchema(dataForLineItem, ux_specification_types_1.DefinitionName.ViewTableColumn);
|
|
387
403
|
}
|
|
388
404
|
/**
|
|
389
405
|
* Adds the schema tags to a given view
|
|
@@ -393,12 +409,13 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
|
|
|
393
409
|
* @param view - the given view
|
|
394
410
|
*/
|
|
395
411
|
function addTagsToView(viewsDefinition, viewKey, namespace, view) {
|
|
396
|
-
viewsDefinition.properties[viewKey][
|
|
397
|
-
viewsDefinition.properties[viewKey][
|
|
398
|
-
? `/${namespace}/@${view[
|
|
412
|
+
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
413
|
+
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.annotationPath] = namespace
|
|
414
|
+
? `/${namespace}/@${view[ux_specification_types_1.SchemaTag.annotationPath]}`
|
|
399
415
|
: undefined;
|
|
400
|
-
viewsDefinition.properties[viewKey][
|
|
401
|
-
viewsDefinition.properties[viewKey][
|
|
416
|
+
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.artifactType] = ux_specification_types_1.ArtifactType.Manifest;
|
|
417
|
+
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.key] = viewKey;
|
|
418
|
+
viewsDefinition.properties[viewKey][ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: viewKey }];
|
|
402
419
|
}
|
|
403
420
|
/**
|
|
404
421
|
* Adjusts the entity type if a different entity set is maintained for a view
|
|
@@ -445,7 +462,7 @@ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, g
|
|
|
445
462
|
description: commonInputParameters.title || titleOnHover,
|
|
446
463
|
title: titleOnHover,
|
|
447
464
|
// Default view - use table view reference as default
|
|
448
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}${
|
|
465
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.TableViewExtension}`
|
|
449
466
|
};
|
|
450
467
|
}
|
|
451
468
|
else {
|
|
@@ -454,7 +471,7 @@ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, g
|
|
|
454
471
|
description: commonInputParameters.title || titleOnHover,
|
|
455
472
|
title: titleOnHover,
|
|
456
473
|
// Default view - use table view reference as default
|
|
457
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}${
|
|
474
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.LRTableView}`
|
|
458
475
|
};
|
|
459
476
|
}
|
|
460
477
|
}
|
|
@@ -477,19 +494,19 @@ function addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParame
|
|
|
477
494
|
};
|
|
478
495
|
const viewsDefinition = appSchema.definitions.MultiTableModeV4;
|
|
479
496
|
for (const view of viewsPaths) {
|
|
480
|
-
if (!view[
|
|
497
|
+
if (!view[ux_specification_types_1.SchemaTag.key]) {
|
|
481
498
|
continue;
|
|
482
499
|
}
|
|
483
500
|
let navPropName = undefined;
|
|
484
501
|
const targetEntityType = getTargetEntityType(entitySet, view, generateParameters, entityType);
|
|
485
502
|
const uiAnnotations = targetEntityType.annotations.UI;
|
|
486
|
-
const { visualization, targetAnnotation, namespace, title } = analyzeViewAnnotation(view?.[
|
|
503
|
+
const { visualization, targetAnnotation, namespace, title } = analyzeViewAnnotation(view?.[ux_specification_types_1.SchemaTag.annotationPath], uiAnnotations, generateParameters, view[ux_specification_types_1.SchemaTag.key]);
|
|
487
504
|
if (view['entitySet']) {
|
|
488
505
|
navPropName = entityType.navigationProperties.find((np) => {
|
|
489
506
|
return np.targetTypeName === namespace;
|
|
490
507
|
})?.name;
|
|
491
508
|
}
|
|
492
|
-
const viewKey = common_1.prepareRef(view[
|
|
509
|
+
const viewKey = common_1.prepareRef(view[ux_specification_types_1.SchemaTag.key]);
|
|
493
510
|
const commonInputParameters = {
|
|
494
511
|
viewKey,
|
|
495
512
|
appSchema,
|
|
@@ -517,17 +534,17 @@ function adaptTableDefinition(appSchema, entityType, generateParameters, templat
|
|
|
517
534
|
const { visualization, targetAnnotation, namespace } = analyzeViewAnnotation(templateAnnotation, entityType.annotations.UI, generateParameters, undefined, ux_specification_types_1.Visualization.LineItem);
|
|
518
535
|
if (visualization) {
|
|
519
536
|
const annotationTerm = visualization.split('.')[1];
|
|
520
|
-
const annotationTermInSchema = `${
|
|
537
|
+
const annotationTermInSchema = `${ux_specification_types_1.DefinitionName.LineItems}OfSPV::${common_1.prepareRef(annotationTerm)}`;
|
|
521
538
|
const spvTable = (appSchema.definitions[`${tableDefinitionName}SPV`] = JSON.parse(JSON.stringify(appSchema.definitions[tableDefinitionName])));
|
|
522
|
-
delete spvTable[
|
|
523
|
-
common_1.addDefinitionRef(spvTable.properties.toolBar,
|
|
539
|
+
delete spvTable[ux_specification_types_1.SchemaTag.isViewNode];
|
|
540
|
+
common_1.addDefinitionRef(spvTable.properties.toolBar, ux_specification_types_1.DefinitionName.ToolBar, annotationTermInSchema);
|
|
524
541
|
// Switch from generic column to specific definition
|
|
525
|
-
spvTable[
|
|
542
|
+
spvTable[ux_specification_types_1.SchemaTag.annotationPath] = targetAnnotation;
|
|
526
543
|
spvTable.properties.columns = {};
|
|
527
544
|
common_1.addDefinitionRef(spvTable.properties.columns, annotationTermInSchema);
|
|
528
545
|
delete tableDefinition.properties;
|
|
529
546
|
common_1.addDefinitionRef(tableDefinition, `${tableDefinitionName}SPV`);
|
|
530
|
-
tableDefinition[
|
|
547
|
+
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/@${templateAnnotation}`;
|
|
531
548
|
const lineItemAnnotation = entityType.annotations.UI[annotationTerm];
|
|
532
549
|
const dataForLineItem = {
|
|
533
550
|
appSchema,
|
|
@@ -539,20 +556,20 @@ function adaptTableDefinition(appSchema, entityType, generateParameters, templat
|
|
|
539
556
|
utils_1.addLineItemsTypeToSchema(dataForLineItem);
|
|
540
557
|
}
|
|
541
558
|
else {
|
|
542
|
-
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${
|
|
559
|
+
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ToolBarLR}`;
|
|
543
560
|
// Switch from generic column to specific definition
|
|
544
|
-
common_1.addDefinitionRef(tableDefinition.properties.columns,
|
|
561
|
+
common_1.addDefinitionRef(tableDefinition.properties.columns, ux_specification_types_1.DefinitionName.LineItems);
|
|
545
562
|
const lineItemAnnotation = entityType?.annotations?.[alias]?.LineItem;
|
|
546
563
|
const dataForLineItem = {
|
|
547
564
|
appSchema,
|
|
548
565
|
lineItemAnnotation,
|
|
549
566
|
entityType,
|
|
550
567
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
551
|
-
lineItemId:
|
|
568
|
+
lineItemId: ux_specification_types_1.DefinitionName.LineItems
|
|
552
569
|
};
|
|
553
570
|
utils_1.addLineItemsTypeToSchema(dataForLineItem);
|
|
554
571
|
if (lineItemAnnotation) {
|
|
555
|
-
tableDefinition[
|
|
572
|
+
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = common_1.createAnnotationPath(entityType.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
|
|
556
573
|
}
|
|
557
574
|
}
|
|
558
575
|
}
|
|
@@ -563,13 +580,13 @@ function adaptTableDefinition(appSchema, entityType, generateParameters, templat
|
|
|
563
580
|
* @returns {string} annotation term
|
|
564
581
|
*/
|
|
565
582
|
function getDefaultAnnotationPath(v4Page, entityType, templateType) {
|
|
566
|
-
if (v4Page.options.settings?.views?.paths && templateType ===
|
|
583
|
+
if (v4Page.options.settings?.views?.paths && templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
567
584
|
return;
|
|
568
585
|
}
|
|
569
586
|
if (v4Page.options.settings?.defaultTemplateAnnotationPath) {
|
|
570
587
|
return v4Page.options.settings.defaultTemplateAnnotationPath;
|
|
571
588
|
}
|
|
572
|
-
if (templateType ===
|
|
589
|
+
if (templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
573
590
|
return (entityType.annotations.UI?.SelectionPresentationVariant?.term ||
|
|
574
591
|
entityType.annotations.UI?.PresentationVariant?.term);
|
|
575
592
|
}
|
|
@@ -586,7 +603,7 @@ function addTableAndViews(appSchema, v4Page, entityType, entitySet, generatePara
|
|
|
586
603
|
const viewsPaths = v4Page.options?.settings?.views?.paths;
|
|
587
604
|
const defaultAnnotation = getDefaultAnnotationPath(v4Page, entityType, generateParameters.templateType);
|
|
588
605
|
const tableDefinitionName = utils_1.alignSchemaWithTemplateType(appSchema, generateParameters);
|
|
589
|
-
if (generateParameters.templateType ===
|
|
606
|
+
if (generateParameters.templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
590
607
|
if (viewsPaths) {
|
|
591
608
|
addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParameters, v4Page, tableDefinitionName);
|
|
592
609
|
}
|
|
@@ -596,9 +613,9 @@ function addTableAndViews(appSchema, v4Page, entityType, entitySet, generatePara
|
|
|
596
613
|
}
|
|
597
614
|
adaptTableDefinition(appSchema, entityType, generateParameters, defaultAnnotation, v4Page, alias, tableDefinitionName);
|
|
598
615
|
}
|
|
599
|
-
appSchema.properties[
|
|
616
|
+
appSchema.properties[ux_specification_types_1.PropertyName.chart][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
600
617
|
}
|
|
601
|
-
else if (generateParameters.templateType ===
|
|
618
|
+
else if (generateParameters.templateType === ux_specification_types_1.TemplateType.AnalyticalListPageV4) {
|
|
602
619
|
addALPViews(appSchema, viewsPaths, entityType, generateParameters, defaultAnnotation, tableDefinitionName);
|
|
603
620
|
}
|
|
604
621
|
}
|
|
@@ -615,13 +632,13 @@ function addTableAndViews(appSchema, v4Page, entityType, entitySet, generatePara
|
|
|
615
632
|
function generateListReportSchemaV4(generateParameters, genericSchema, entitySet, templateName) {
|
|
616
633
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
617
634
|
const entityType = entitySet?.entityType;
|
|
618
|
-
const alias = generateParameters.serviceAVT && common_1.findAlias(
|
|
635
|
+
const alias = generateParameters.serviceAVT && common_1.findAlias(ux_specification_types_1.UIVOCABULARY, generateParameters.serviceAVT);
|
|
619
636
|
//Add selection fields
|
|
620
637
|
const selectionFieldAnnotation = alias && entityType?.annotations?.[alias]?.SelectionFields;
|
|
621
638
|
addSelectionFields(entityType, appSchema, selectionFieldAnnotation);
|
|
622
|
-
appSchema.properties[
|
|
639
|
+
appSchema.properties[ux_specification_types_1.PropertyName.defaultTemplateAnnotationPath][ux_specification_types_1.SchemaTag.hidden] = true;
|
|
623
640
|
//enum for annotation path as part of QuickVariantSelection
|
|
624
|
-
common_1.addEnumForSingleTabVariant(entityType, appSchema,
|
|
641
|
+
common_1.addEnumForSingleTabVariant(entityType, appSchema, ux_specification_types_1.DefinitionName.AnnotationPathAsObject);
|
|
625
642
|
if (generateParameters.manifest) {
|
|
626
643
|
//Find page in targets
|
|
627
644
|
const pages = generateParameters.manifest[ux_specification_types_1.ManifestSection.ui5].routing
|
|
@@ -631,7 +648,7 @@ function generateListReportSchemaV4(generateParameters, genericSchema, entitySet
|
|
|
631
648
|
severity: "error" /* Error */,
|
|
632
649
|
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
633
650
|
location: {
|
|
634
|
-
path:
|
|
651
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
635
652
|
range: [ux_specification_types_1.ManifestSection.generic]
|
|
636
653
|
}
|
|
637
654
|
});
|