@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
|
@@ -9,6 +9,7 @@ const extensionLogger_1 = require("../../../extensionLogger");
|
|
|
9
9
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
10
10
|
const common_1 = require("../../common");
|
|
11
11
|
const utils_1 = require("../utils/utils");
|
|
12
|
+
const StableIdHelper_1 = require("../utils/StableIdHelper");
|
|
12
13
|
/**
|
|
13
14
|
* Callback for adding a single action to headerActions of V4
|
|
14
15
|
* @param {EntityType} entityType - current entity type
|
|
@@ -21,50 +22,31 @@ function addHeaderActionCallBackV4(entityType, appSchema, actionAnnotation, head
|
|
|
21
22
|
return (item, index) => {
|
|
22
23
|
if ((!item['Determining'] && item.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */) ||
|
|
23
24
|
item.$Type === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */) {
|
|
24
|
-
const
|
|
25
|
-
|
|
25
|
+
const { actionName, actionId, namespace } = common_1.getActionNameAndId(item, oDataServiceAVT);
|
|
26
|
+
if (!actionId) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const stableId = StableIdHelper_1.getStableIdPartFromDataField(item);
|
|
30
|
+
//stableId is used as key in V4, as the DataFieldForAction:: prefix shall be present in manifest settings
|
|
26
31
|
const convertedIdentification = actionAnnotation.fullyQualifiedName.replace(`@${"com.sap.vocabularies.UI.v1.Identification" /* Identification */}`, `/@${"com.sap.vocabularies.UI.v1.Identification" /* Identification */}`);
|
|
27
|
-
const actionDefinitionKey = `HeaderAction<${common_1.prepareRef(
|
|
32
|
+
const actionDefinitionKey = `HeaderAction<${common_1.prepareRef(stableId)}>`;
|
|
28
33
|
const headerAction = (appSchema.definitions[actionDefinitionKey] = {
|
|
29
34
|
type: 'object',
|
|
30
35
|
properties: {},
|
|
31
36
|
description: item.Label || actionName
|
|
32
37
|
});
|
|
33
|
-
headerAction[
|
|
34
|
-
headerAction[
|
|
35
|
-
|
|
38
|
+
headerAction[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
39
|
+
headerAction[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.action, value: actionName }];
|
|
40
|
+
if (namespace) {
|
|
41
|
+
appSchema.definitions[actionDefinitionKey][ux_specification_types_1.SchemaTag.target] = namespace;
|
|
42
|
+
}
|
|
43
|
+
headerAction[ux_specification_types_1.SchemaTag.annotationPath] = `/${convertedIdentification}/${index}`;
|
|
44
|
+
headerActions.properties[stableId] = {
|
|
36
45
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${actionDefinitionKey}`
|
|
37
46
|
};
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
49
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Adds definitions for collections in object page sections to the app schema
|
|
43
|
-
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
44
|
-
* @param {string} facetKey - key of the facet, as used in annotation
|
|
45
|
-
* @param {Definition} appSchema - app schema in general
|
|
46
|
-
* @param {Definition} sections - schema of current sections definition.
|
|
47
|
-
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
48
|
-
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
49
|
-
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
50
|
-
*/
|
|
51
|
-
function handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page) {
|
|
52
|
-
const collectionFacet = (sections.properties[facetKey] = common_1.createDefaultSection(appSchema, facet, facetKey));
|
|
53
|
-
collectionFacet.properties = {
|
|
54
|
-
subsections: {
|
|
55
|
-
additionalProperties: false,
|
|
56
|
-
type: 'object',
|
|
57
|
-
properties: {},
|
|
58
|
-
description: 'Subsections'
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const subSections = collectionFacet.properties.subsections;
|
|
62
|
-
subSections[common_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
63
|
-
subSections[common_1.SchemaTag.isViewNode] = true;
|
|
64
|
-
for (const key in facet.facets) {
|
|
65
|
-
addSection(generateParameters, facet.facets, key, subSections, appSchema, sectionPrefix, v4Page);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
50
|
/**
|
|
69
51
|
* Adds definitions for line items in object page sections to the app schema
|
|
70
52
|
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
@@ -79,20 +61,20 @@ function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceA
|
|
|
79
61
|
const lineItemId = common_1.getFacetKeyInSchema(facetKey);
|
|
80
62
|
const index = facetKey.lastIndexOf('::');
|
|
81
63
|
const annotation = index > -1 ? facetKey.substring(index + 2) : facetKey;
|
|
82
|
-
const tableDefinition = common_1.parseSchemaDefinition(
|
|
64
|
+
const tableDefinition = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageTable, facetKey, appSchema);
|
|
83
65
|
if (facet.entityType && annotation) {
|
|
84
|
-
tableDefinition[
|
|
66
|
+
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `/${facet.entityType.fullyQualifiedName}/${annotation}`;
|
|
85
67
|
}
|
|
86
68
|
tableDefinition.properties.columns = {
|
|
87
69
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${lineItemId}`
|
|
88
70
|
};
|
|
89
|
-
tableDefinition.properties.toolBar.$ref = common_1.getFacetDefinitionLink(
|
|
71
|
+
tableDefinition.properties.toolBar.$ref = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBar, facetKey);
|
|
90
72
|
//adjust quickVariantSelection
|
|
91
|
-
tableDefinition.properties.quickVariantSelection.$ref = common_1.getFacetDefinitionLink(
|
|
92
|
-
const tableQVS = common_1.parseSchemaDefinition(
|
|
93
|
-
tableQVS.properties.paths['items'].$ref = common_1.getFacetDefinitionLink(
|
|
94
|
-
common_1.parseSchemaDefinition(
|
|
95
|
-
common_1.addEnumForSingleTabVariant(facet.entityType, appSchema, `${
|
|
73
|
+
tableDefinition.properties.quickVariantSelection.$ref = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.QuickVariantSelectionV4OP, facetKey);
|
|
74
|
+
const tableQVS = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.QuickVariantSelectionV4OP, facetKey, appSchema);
|
|
75
|
+
tableQVS.properties.paths['items'].$ref = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.AnnotationPathAsObject, facetKey);
|
|
76
|
+
common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.AnnotationPathAsObject, facetKey, appSchema);
|
|
77
|
+
common_1.addEnumForSingleTabVariant(facet.entityType, appSchema, `${ux_specification_types_1.DefinitionName.AnnotationPathAsObject}<${lineItemId}>`);
|
|
96
78
|
const dataForLineItem = {
|
|
97
79
|
appSchema,
|
|
98
80
|
lineItemAnnotation: lineItemFacet['target'],
|
|
@@ -100,7 +82,7 @@ function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceA
|
|
|
100
82
|
oDataServiceAVT,
|
|
101
83
|
lineItemId
|
|
102
84
|
};
|
|
103
|
-
utils_1.addLineItemsTypeToSchema(dataForLineItem,
|
|
85
|
+
utils_1.addLineItemsTypeToSchema(dataForLineItem, ux_specification_types_1.DefinitionName.ObjectPageTableColumn);
|
|
104
86
|
return tableDefinition;
|
|
105
87
|
}
|
|
106
88
|
/**
|
|
@@ -117,31 +99,33 @@ function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceA
|
|
|
117
99
|
function handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateParameters, sections) {
|
|
118
100
|
if (sections) {
|
|
119
101
|
sections.properties[facetKey] = {
|
|
120
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
102
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4, facetKey)
|
|
121
103
|
};
|
|
122
104
|
}
|
|
123
|
-
const sectionTable = common_1.parseSchemaDefinition(
|
|
105
|
+
const sectionTable = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4, facetKey, appSchema);
|
|
124
106
|
common_1.addSectionTitleAndDescription(facet, sectionTable, common_1.getFacetKeyInSchema(facetKey));
|
|
125
|
-
sectionTable[
|
|
126
|
-
sectionTable.
|
|
107
|
+
sectionTable[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
108
|
+
sectionTable[ux_specification_types_1.SchemaTag.target] = facet.namespace;
|
|
109
|
+
sectionTable.properties.table['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageTable, facetKey);
|
|
127
110
|
const table = handleLineItem(facet, facetKey, appSchema, lineItemFacet, generateParameters.serviceAVT);
|
|
128
111
|
return { sectionTable, table };
|
|
129
112
|
}
|
|
130
113
|
/**
|
|
131
114
|
* Adds definitions for Identification and Form facet items in object page sections to the app schema
|
|
132
|
-
* @param {FacetConfig} facet - current facet
|
|
133
|
-
* @param {
|
|
134
|
-
* @param {
|
|
135
|
-
* @param {object}
|
|
115
|
+
* @param {FacetConfig} facet - current facet
|
|
116
|
+
* @param {v4.SapUiAppPageV4} v4Page Current page in manifest
|
|
117
|
+
* @param {string} facetKey - facet key
|
|
118
|
+
* @param {object} sections - schema of current sections definition
|
|
119
|
+
* @param {object} appSchema - app specific schema that potentially gets enhanced
|
|
136
120
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
137
121
|
*/
|
|
138
122
|
function handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix) {
|
|
139
123
|
let definitionType;
|
|
140
124
|
if (sectionPrefix === ux_specification_types_1.SectionType.Section) {
|
|
141
|
-
definitionType =
|
|
125
|
+
definitionType = ux_specification_types_1.DefinitionName.ObjectPageSectionForm;
|
|
142
126
|
}
|
|
143
127
|
else if (sectionPrefix === ux_specification_types_1.SectionType.HeaderSection) {
|
|
144
|
-
definitionType =
|
|
128
|
+
definitionType = ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionForm;
|
|
145
129
|
}
|
|
146
130
|
sections['properties'][facetKey] = {
|
|
147
131
|
$ref: common_1.getFacetDefinitionLink(definitionType, facetKey)
|
|
@@ -151,10 +135,10 @@ function handleFormIdentification(facet, facetKey, sections, appSchema, sectionP
|
|
|
151
135
|
formSection.properties = {};
|
|
152
136
|
}
|
|
153
137
|
common_1.addSectionTitleAndDescription(facet, formSection, facetKey);
|
|
154
|
-
formSection[
|
|
155
|
-
formSection[
|
|
156
|
-
|
|
157
|
-
common_1.handleForm(sectionPrefix, facet, formSection, appSchema, ux_specification_types_1.FioriElementsVersion.v4,
|
|
138
|
+
formSection[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
139
|
+
formSection[ux_specification_types_1.SchemaTag.target] = facet.namespace;
|
|
140
|
+
formSection[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
141
|
+
common_1.handleForm(sectionPrefix, facet, formSection, appSchema, ux_specification_types_1.FioriElementsVersion.v4, facetKey);
|
|
158
142
|
}
|
|
159
143
|
/**
|
|
160
144
|
* Adds definitions for header sections (DataPoint, Chart) in object page sections to the app schema
|
|
@@ -168,11 +152,12 @@ function handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinition
|
|
|
168
152
|
sections['properties'][facetKey] = {
|
|
169
153
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${facetDefinitionKey}`
|
|
170
154
|
};
|
|
171
|
-
const sectionFacet = common_1.parseSchemaDefinition(
|
|
155
|
+
const sectionFacet = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.CommonHeaderFacetSettings, facetDefinitionKey, appSchema, false);
|
|
172
156
|
common_1.addTargetTitleAndSectionDescription(facet, sectionFacet, facetKey);
|
|
173
|
-
sectionFacet[
|
|
174
|
-
sectionFacet[
|
|
175
|
-
sectionFacet[
|
|
157
|
+
sectionFacet[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
158
|
+
sectionFacet[ux_specification_types_1.SchemaTag.target] = facet.namespace;
|
|
159
|
+
sectionFacet[ux_specification_types_1.SchemaTag.dataType] = common_1.determineDataTypeOfTarget(facet?.target);
|
|
160
|
+
sectionFacet[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
176
161
|
}
|
|
177
162
|
/**
|
|
178
163
|
* Adds definitions for Chart items in object page sections to the app schema
|
|
@@ -182,24 +167,24 @@ function handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinition
|
|
|
182
167
|
* @param {EntityType} entityType - current entity type
|
|
183
168
|
*/
|
|
184
169
|
function handleChartActions(facet, facetKey, appSchema, entityType) {
|
|
185
|
-
const actions = common_1.parseSchemaDefinition(
|
|
170
|
+
const actions = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageToolBarActions, facetKey, appSchema);
|
|
186
171
|
actions.additionalProperties = false;
|
|
187
172
|
actions.properties = {};
|
|
188
173
|
if (facet.Actions) {
|
|
189
174
|
let i = 0;
|
|
190
175
|
facet.Actions.forEach((actionRecord) => {
|
|
191
176
|
const description = common_1.getDataFieldDescription(actionRecord, entityType);
|
|
192
|
-
const prefix = actionRecord.$Type.split(
|
|
177
|
+
const prefix = actionRecord.$Type.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
193
178
|
const actionId = actionRecord.Action.replace('/', '??');
|
|
194
179
|
const toolBarActionsProperty = (actions.properties[`${prefix}::${actionRecord.Action}`] = {
|
|
195
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
180
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBarAction, actionId),
|
|
196
181
|
description
|
|
197
182
|
});
|
|
198
|
-
toolBarActionsProperty[
|
|
199
|
-
toolBarActionsProperty[
|
|
200
|
-
const toolBarAction = common_1.parseSchemaDefinition(
|
|
201
|
-
toolBarAction[
|
|
202
|
-
toolBarAction[
|
|
183
|
+
toolBarActionsProperty[ux_specification_types_1.SchemaTag.propertyIndex] = i;
|
|
184
|
+
toolBarActionsProperty[ux_specification_types_1.SchemaTag.annotationType] = actionRecord.$Type;
|
|
185
|
+
const toolBarAction = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageToolBarAction, common_1.prepareRef(actionId), appSchema);
|
|
186
|
+
toolBarAction[ux_specification_types_1.SchemaTag.annotationPath] = common_1.getFacetAnnotationPath(actionRecord);
|
|
187
|
+
toolBarAction[ux_specification_types_1.SchemaTag.dataType] = common_1.determineDataType(actionRecord);
|
|
203
188
|
toolBarAction.properties = {};
|
|
204
189
|
i++;
|
|
205
190
|
});
|
|
@@ -214,16 +199,16 @@ function handleChartActions(facet, facetKey, appSchema, entityType) {
|
|
|
214
199
|
* @param {EntityType} entityType - current entity type
|
|
215
200
|
*/
|
|
216
201
|
function handleChart(facet, facetKey, appSchema, entityType) {
|
|
217
|
-
const chart = common_1.parseSchemaDefinition(
|
|
202
|
+
const chart = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageChart, facetKey, appSchema);
|
|
218
203
|
if (facet['Title']) {
|
|
219
204
|
chart.description = facet['Title'];
|
|
220
205
|
}
|
|
221
|
-
chart[
|
|
222
|
-
chart[
|
|
223
|
-
chart[
|
|
224
|
-
chart.properties.toolBar['$ref'] = common_1.getFacetDefinitionLink(
|
|
225
|
-
const chartToolBar = common_1.parseSchemaDefinition(
|
|
226
|
-
chartToolBar.properties.actions['$ref'] = common_1.getFacetDefinitionLink(
|
|
206
|
+
chart[ux_specification_types_1.SchemaTag.annotationPath] = common_1.getFacetAnnotationPath(facet);
|
|
207
|
+
chart[ux_specification_types_1.SchemaTag.dataType] = common_1.determineDataTypeOfTarget(facet.target || facet);
|
|
208
|
+
chart[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
209
|
+
chart.properties.toolBar['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBar, facetKey);
|
|
210
|
+
const chartToolBar = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageToolBar, facetKey, appSchema);
|
|
211
|
+
chartToolBar.properties.actions['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBarActions, facetKey);
|
|
227
212
|
const chartActions = handleChartActions(facet, facetKey, appSchema, entityType);
|
|
228
213
|
return { chart, chartActions };
|
|
229
214
|
}
|
|
@@ -238,13 +223,13 @@ function handleChart(facet, facetKey, appSchema, entityType) {
|
|
|
238
223
|
function handleSectionChart(facet, facetKey, appSchema, sections, entityType = facet.entityType) {
|
|
239
224
|
if (sections) {
|
|
240
225
|
sections.properties[facetKey] = {
|
|
241
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
226
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionChart, facetKey)
|
|
242
227
|
};
|
|
243
228
|
}
|
|
244
|
-
const sectionChart = common_1.parseSchemaDefinition(
|
|
229
|
+
const sectionChart = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageSectionChart, facetKey, appSchema);
|
|
245
230
|
common_1.addTargetTitleAndSectionDescription(facet, sectionChart, facetKey);
|
|
246
|
-
sectionChart[
|
|
247
|
-
sectionChart.properties.chart['$ref'] = common_1.getFacetDefinitionLink(
|
|
231
|
+
sectionChart[ux_specification_types_1.SchemaTag.annotationPath] = common_1.getFacetAnnotationPath(facet);
|
|
232
|
+
sectionChart.properties.chart['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageChart, facetKey);
|
|
248
233
|
const { chart, chartActions } = handleChart(facet.target || facet, facetKey, appSchema, entityType);
|
|
249
234
|
return { sectionChart, chart, chartActions };
|
|
250
235
|
}
|
|
@@ -276,31 +261,33 @@ function handleSectionPresentationVariant(facet, facetKey, appSchema, sections,
|
|
|
276
261
|
return prop.name === navPath;
|
|
277
262
|
});
|
|
278
263
|
const targetType = navigationProp.targetType;
|
|
279
|
-
target = targetType.annotations.UI[visualizationKey.split(
|
|
264
|
+
target = targetType.annotations.UI[visualizationKey.split(ux_specification_types_1.UIVOCABULARYDOT)[1]];
|
|
280
265
|
}
|
|
281
266
|
}
|
|
282
267
|
if (facetTarget) {
|
|
283
|
-
const visualizationType = visualizationKey.split(
|
|
284
|
-
const namespace = facet.target[
|
|
268
|
+
const visualizationType = visualizationKey.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
269
|
+
const namespace = facet.target[ux_specification_types_1.SchemaTag.fullyQualifiedName].split('@')[0];
|
|
285
270
|
const fullVisualizationKey = navPath ? `${navPath}::${visualizationKey}` : visualizationKey;
|
|
286
271
|
if (visualizationType.startsWith(ux_specification_types_1.Visualization.Chart)) {
|
|
287
272
|
sections.properties[`${facetKey}<${visualizationKey}>`] = {
|
|
288
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
273
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionChart, fullVisualizationKey)
|
|
289
274
|
};
|
|
290
275
|
const { sectionChart, chart } = handleSectionChart(facetTarget, fullVisualizationKey, appSchema, undefined, facet.entityType);
|
|
291
|
-
sectionChart[
|
|
276
|
+
sectionChart[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
292
277
|
common_1.addTargetTitleAndSectionDescription(facet, sectionChart, facetKey);
|
|
293
|
-
chart[
|
|
278
|
+
chart[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/${visualizationKey}`;
|
|
279
|
+
chart[ux_specification_types_1.SchemaTag.target] = namespace;
|
|
294
280
|
}
|
|
295
281
|
else if (visualizationType.startsWith(ux_specification_types_1.Visualization.LineItem)) {
|
|
296
282
|
sections.properties[`${facetKey}<${visualizationKey}>`] = {
|
|
297
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
283
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4, fullVisualizationKey)
|
|
298
284
|
};
|
|
299
285
|
const { sectionTable, table } = handleSectionTable(facet, fullVisualizationKey, appSchema, { target, entityType: facet.entityType }, generateParameters);
|
|
300
|
-
sectionTable[
|
|
286
|
+
sectionTable[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
301
287
|
common_1.addTargetTitleAndSectionDescription(facet, sectionTable, facetKey);
|
|
302
|
-
delete sectionTable[
|
|
303
|
-
table[
|
|
288
|
+
delete sectionTable[ux_specification_types_1.SchemaTag.isViewNode];
|
|
289
|
+
table[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/${visualizationKey}`;
|
|
290
|
+
table[ux_specification_types_1.SchemaTag.target] = namespace;
|
|
304
291
|
}
|
|
305
292
|
}
|
|
306
293
|
}
|
|
@@ -318,31 +305,31 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
318
305
|
const facet = facets[facetKey];
|
|
319
306
|
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${common_1.getFacetKeyInSchema(facetKey)}>`;
|
|
320
307
|
switch (facet.base) {
|
|
321
|
-
case
|
|
308
|
+
case ux_specification_types_1.FacetBase.PresentationVariant: {
|
|
322
309
|
handleSectionPresentationVariant(facet, facetKey, appSchema, sections, generateParameters);
|
|
323
310
|
break;
|
|
324
311
|
}
|
|
325
|
-
case
|
|
312
|
+
case ux_specification_types_1.FacetBase.CollectionFacet: {
|
|
326
313
|
handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page);
|
|
327
314
|
break;
|
|
328
315
|
}
|
|
329
|
-
case
|
|
316
|
+
case ux_specification_types_1.FacetBase.LineItem: {
|
|
330
317
|
if (sectionPrefix === ux_specification_types_1.SectionType.Section) {
|
|
331
318
|
const lineItemFacet = facets[facetKey];
|
|
332
319
|
handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateParameters, sections);
|
|
333
320
|
}
|
|
334
321
|
break;
|
|
335
322
|
}
|
|
336
|
-
case
|
|
337
|
-
case
|
|
323
|
+
case ux_specification_types_1.FacetBase.Form:
|
|
324
|
+
case ux_specification_types_1.FacetBase.Identification: {
|
|
338
325
|
handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix);
|
|
339
326
|
break;
|
|
340
327
|
}
|
|
341
|
-
case
|
|
328
|
+
case ux_specification_types_1.FacetBase.DataPoint: {
|
|
342
329
|
handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
343
330
|
break;
|
|
344
331
|
}
|
|
345
|
-
case
|
|
332
|
+
case ux_specification_types_1.FacetBase.Chart: {
|
|
346
333
|
if (sectionPrefix === ux_specification_types_1.SectionType.HeaderSection) {
|
|
347
334
|
handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
348
335
|
}
|
|
@@ -351,8 +338,8 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
351
338
|
}
|
|
352
339
|
break;
|
|
353
340
|
}
|
|
354
|
-
case
|
|
355
|
-
case
|
|
341
|
+
case ux_specification_types_1.FacetBase.Address:
|
|
342
|
+
case ux_specification_types_1.FacetBase.Contact: {
|
|
356
343
|
common_1.handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefix);
|
|
357
344
|
break;
|
|
358
345
|
}
|
|
@@ -361,6 +348,40 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
361
348
|
}
|
|
362
349
|
}
|
|
363
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Adds definitions for collections in object page sections to the app schema
|
|
353
|
+
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
354
|
+
* @param {string} facetKey - key of the facet, as used in annotation
|
|
355
|
+
* @param {Definition} appSchema - app schema in general
|
|
356
|
+
* @param {Definition} sections - schema of current sections definition.
|
|
357
|
+
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
358
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
359
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
360
|
+
*/
|
|
361
|
+
function handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page) {
|
|
362
|
+
const collectionFacet = (sections.properties[facetKey] = common_1.createDefaultSection(appSchema, facet, facetKey));
|
|
363
|
+
collectionFacet.properties = {
|
|
364
|
+
subsections: {
|
|
365
|
+
additionalProperties: false,
|
|
366
|
+
type: 'object',
|
|
367
|
+
properties: {},
|
|
368
|
+
description: 'Subsections'
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
const subSections = collectionFacet.properties.subsections;
|
|
372
|
+
subSections[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
373
|
+
subSections[ux_specification_types_1.SchemaTag.target] = facet.namespace;
|
|
374
|
+
subSections[ux_specification_types_1.SchemaTag.keys] = [
|
|
375
|
+
{
|
|
376
|
+
name: ux_specification_types_1.SchemaKeyName.id,
|
|
377
|
+
value: facet.ID
|
|
378
|
+
}
|
|
379
|
+
];
|
|
380
|
+
subSections[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
381
|
+
for (const key in facet.facets) {
|
|
382
|
+
addSection(generateParameters, facet.facets, key, subSections, appSchema, sectionPrefix, v4Page);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
364
385
|
/**
|
|
365
386
|
* Derives the sections from the UI.Facets annotation and adds them to the schema
|
|
366
387
|
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
@@ -371,18 +392,18 @@ function addSections(generateParameters, appSchema, v4Page) {
|
|
|
371
392
|
// Get facet annotations
|
|
372
393
|
const facets = common_1.getObjectPageFacets(generateParameters.entitySet.entityType, generateParameters.serviceAVT, ux_specification_types_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
373
394
|
if (!facets) {
|
|
374
|
-
delete appSchema.definitions[
|
|
395
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSubSections];
|
|
375
396
|
return;
|
|
376
397
|
}
|
|
377
|
-
const sections = appSchema.definitions[
|
|
398
|
+
const sections = appSchema.definitions[ux_specification_types_1.DefinitionName.Sections];
|
|
378
399
|
for (const facetKey in facets) {
|
|
379
400
|
addSection(generateParameters, facets, facetKey, sections, appSchema, ux_specification_types_1.SectionType.Section, v4Page);
|
|
380
401
|
}
|
|
381
402
|
// Custom sections as part of sections
|
|
382
|
-
if (appSchema.definitions[
|
|
403
|
+
if (appSchema.definitions[ux_specification_types_1.DefinitionName.CustomSections]) {
|
|
383
404
|
sections.properties = {
|
|
384
405
|
...sections.properties,
|
|
385
|
-
...appSchema.definitions[
|
|
406
|
+
...appSchema.definitions[ux_specification_types_1.DefinitionName.CustomSections].properties
|
|
386
407
|
};
|
|
387
408
|
}
|
|
388
409
|
}
|
|
@@ -396,7 +417,7 @@ function addSections(generateParameters, appSchema, v4Page) {
|
|
|
396
417
|
function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
397
418
|
// Get facet annotations
|
|
398
419
|
const facets = common_1.getObjectPageHeaderFacets(entityType, generateParameters.serviceAVT, ux_specification_types_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
399
|
-
const sections = appSchema.definitions[
|
|
420
|
+
const sections = appSchema.definitions[ux_specification_types_1.DefinitionName.HeaderSections];
|
|
400
421
|
sections.properties = {};
|
|
401
422
|
sections.additionalProperties = false;
|
|
402
423
|
if (!facets) {
|
|
@@ -406,11 +427,11 @@ function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
|
406
427
|
addSection(generateParameters, facets, facetKey, sections, appSchema, ux_specification_types_1.SectionType.HeaderSection, v4Page);
|
|
407
428
|
}
|
|
408
429
|
//delete generic definitions
|
|
409
|
-
delete appSchema.definitions[
|
|
410
|
-
delete appSchema.definitions[
|
|
411
|
-
delete appSchema.definitions[
|
|
412
|
-
delete appSchema.definitions[
|
|
413
|
-
delete appSchema.definitions[
|
|
430
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionForm];
|
|
431
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionChart];
|
|
432
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionDataPoint];
|
|
433
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionContact];
|
|
434
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionAddress];
|
|
414
435
|
}
|
|
415
436
|
/**
|
|
416
437
|
* Adds the related facets keys 'enum' to the app schema
|
|
@@ -445,7 +466,7 @@ function addRelatedFacetKeysType(generateParameters, schema, entitySetName, page
|
|
|
445
466
|
});
|
|
446
467
|
}
|
|
447
468
|
// Update schema definition
|
|
448
|
-
common_1.addDefinitionForRelatedFacetKeys(schema, [
|
|
469
|
+
common_1.addDefinitionForRelatedFacetKeys(schema, [ux_specification_types_1.DefinitionName.ObjectPageCustomSectionFragment], facetSections, [
|
|
449
470
|
'ID',
|
|
450
471
|
'label',
|
|
451
472
|
'key'
|
|
@@ -465,7 +486,7 @@ function addHeader(generateParameters, appSchema, v4Page) {
|
|
|
465
486
|
// Add header actions
|
|
466
487
|
common_1.addHeaderActions(appSchema, entityType, generateParameters.serviceAVT, addHeaderActionCallBackV4);
|
|
467
488
|
// Add header sections
|
|
468
|
-
appSchema.definitions[
|
|
489
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.HeaderSections][ux_specification_types_1.SchemaTag.annotationPath] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.HeaderFacets" /* HeaderFacets */}`;
|
|
469
490
|
addHeaderSections(generateParameters, appSchema, entityType, v4Page);
|
|
470
491
|
}
|
|
471
492
|
/**
|
|
@@ -481,7 +502,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
481
502
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
482
503
|
// Change reference to generated sections
|
|
483
504
|
appSchema.properties.sections = {
|
|
484
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}${
|
|
505
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.Sections}`
|
|
485
506
|
};
|
|
486
507
|
const entitySet = generateParameters.serviceAVT?.entitySets?.find((es) => es.entityType.name === entityTypeName);
|
|
487
508
|
if (!entitySet) {
|
|
@@ -489,7 +510,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
489
510
|
severity: "error" /* Error */,
|
|
490
511
|
message: i18next_1.default.t('NOENTITYSET4NAME', { entityType: entityTypeName }),
|
|
491
512
|
location: {
|
|
492
|
-
path:
|
|
513
|
+
path: ux_specification_types_1.METADATAPATH
|
|
493
514
|
}
|
|
494
515
|
});
|
|
495
516
|
}
|
|
@@ -500,19 +521,19 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
500
521
|
severity: "error" /* Error */,
|
|
501
522
|
message: i18next_1.default.t('NOROUTING'),
|
|
502
523
|
location: {
|
|
503
|
-
path:
|
|
524
|
+
path: ux_specification_types_1.MANIFESTPATH
|
|
504
525
|
}
|
|
505
526
|
});
|
|
506
527
|
return appSchema;
|
|
507
528
|
}
|
|
508
529
|
//initialize sections
|
|
509
|
-
const sections = (appSchema.definitions[
|
|
530
|
+
const sections = (appSchema.definitions[ux_specification_types_1.DefinitionName.Sections] = {
|
|
510
531
|
type: 'object',
|
|
511
532
|
properties: {},
|
|
512
533
|
additionalProperties: false,
|
|
513
|
-
description:
|
|
534
|
+
description: ux_specification_types_1.DefinitionName.Sections
|
|
514
535
|
});
|
|
515
|
-
sections[
|
|
536
|
+
sections[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
516
537
|
if (entitySet) {
|
|
517
538
|
const pages = generateParameters.manifest[ux_specification_types_1.ManifestSection.ui5].routing
|
|
518
539
|
.targets;
|
|
@@ -521,7 +542,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
521
542
|
severity: "error" /* Error */,
|
|
522
543
|
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
523
544
|
location: {
|
|
524
|
-
path:
|
|
545
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
525
546
|
range: [ux_specification_types_1.ManifestSection.generic]
|
|
526
547
|
}
|
|
527
548
|
});
|
|
@@ -534,8 +555,8 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
534
555
|
// Add Header
|
|
535
556
|
addHeader(generateParameters, appSchema, v4Page);
|
|
536
557
|
// Add sections
|
|
537
|
-
sections[
|
|
538
|
-
sections[
|
|
558
|
+
sections[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
559
|
+
sections[ux_specification_types_1.SchemaTag.annotationPath] = `/${entitySet.entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`;
|
|
539
560
|
addSections(generateParameters, appSchema, v4Page);
|
|
540
561
|
// Custom Section facets
|
|
541
562
|
addRelatedFacetKeysType(generateParameters, appSchema, entitySet.name, pages);
|
|
@@ -543,23 +564,23 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
543
564
|
common_1.addFooterActions(appSchema, generateParameters);
|
|
544
565
|
}
|
|
545
566
|
// Delete generic definitions from schema
|
|
546
|
-
delete appSchema.definitions[
|
|
547
|
-
delete appSchema.definitions[
|
|
548
|
-
delete appSchema.definitions[
|
|
549
|
-
delete appSchema.definitions[
|
|
550
|
-
delete appSchema.definitions[
|
|
551
|
-
delete appSchema.definitions[
|
|
552
|
-
delete appSchema.definitions[
|
|
553
|
-
delete appSchema.definitions[
|
|
554
|
-
delete appSchema.definitions[
|
|
555
|
-
delete appSchema.definitions[
|
|
556
|
-
delete appSchema.definitions[
|
|
557
|
-
delete appSchema.definitions[
|
|
558
|
-
delete appSchema.definitions[
|
|
559
|
-
delete appSchema.definitions[
|
|
560
|
-
delete appSchema.definitions[
|
|
561
|
-
delete appSchema.definitions[
|
|
562
|
-
delete appSchema.definitions[
|
|
567
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.CommonHeaderFacetSettings];
|
|
568
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.GenericColumnsOP];
|
|
569
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.GenericSections];
|
|
570
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageChart];
|
|
571
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionAddress];
|
|
572
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionChart];
|
|
573
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionContact];
|
|
574
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionDataPoint];
|
|
575
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionForm];
|
|
576
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4];
|
|
577
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionPresentationVariant];
|
|
578
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSubSections];
|
|
579
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageTable];
|
|
580
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageToolBar];
|
|
581
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageToolBarAction];
|
|
582
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageToolBarActions];
|
|
583
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.QuickVariantSelectionV4OP];
|
|
563
584
|
return appSchema;
|
|
564
585
|
}
|
|
565
586
|
exports.generateObjectPageSchemaV4 = generateObjectPageSchemaV4;
|