@sap/ux-specification 1.90.25 → 1.90.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- 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 +1 -1
- package/dist/schemas/v2/AnalyticalListPageConfig.json +10 -10
- package/dist/schemas/v2/ListReportConfig.json +15 -15
- package/dist/schemas/v2/ObjectPageConfig.json +204 -20
- package/dist/schemas/v4/ListReportConfig.json +22 -2
- package/dist/schemas/v4/ObjectPageConfig.json +36 -0
- package/dist/scripts/to-json-schema.js +1 -1
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/src/apiTypes.d.ts +5 -4
- package/dist/src/project.d.ts +1 -0
- package/dist/src/project.js +2 -2
- package/dist/src/project.js.map +1 -1
- package/dist/src/specification/schemaAccess.js +2 -2
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/specification/v2/controls/Action.d.ts +6 -4
- package/dist/src/specification/v2/controls/Facets.d.ts +2 -1
- package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +3 -2
- package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +44 -9
- package/dist/src/specification/v2/controls/ObjectPageSection.js.map +1 -1
- package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +5 -3
- package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/specification/v2/controls/Table.d.ts +7 -4
- package/dist/src/specification/v2/controls/Table.js.map +1 -1
- package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +22 -1
- package/dist/src/specification/v4/controls/ObjectPageSection.js.map +1 -1
- package/dist/src/specification/v4/controls/Table.d.ts +4 -0
- package/dist/src/sync/common/appProvider.d.ts +1 -1
- package/dist/src/sync/common/appProvider.js +1 -1
- package/dist/src/sync/common/decoration/control.d.ts +1 -1
- package/dist/src/sync/common/decoration/control.js +28 -23
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/decoration/decorators.d.ts +2 -2
- package/dist/src/sync/common/decoration/decorators.js +8 -6
- package/dist/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/src/sync/common/flexUtils.js +1 -2
- package/dist/src/sync/common/flexUtils.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +8 -9
- package/dist/src/sync/common/generate/objectPage.js +13 -13
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +63 -14
- package/dist/src/sync/common/generate/utils.js +125 -23
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/import/utils.d.ts +9 -2
- package/dist/src/sync/common/import/utils.js +25 -6
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.d.ts +2 -3
- package/dist/src/sync/common/importProject.js +20 -19
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +65 -9
- package/dist/src/sync/common/types.js +57 -4
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +30 -23
- package/dist/src/sync/common/utils.js +124 -86
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/application.d.ts +3 -3
- package/dist/src/sync/v2/application.js +4 -4
- package/dist/src/sync/v2/application.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +12 -10
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js +6 -6
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.d.ts +9 -7
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +3 -3
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +6 -4
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +6 -4
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +26 -14
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +57 -5
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +5 -3
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +6 -4
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts +6 -3
- package/dist/src/sync/v2/export/controls/Table.js +90 -49
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts +12 -10
- package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v2/export/export.d.ts +0 -1
- package/dist/src/sync/v2/export/export.js +219 -157
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +34 -33
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.d.ts +6 -0
- package/dist/src/sync/v2/export/manifest.js +50 -35
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.js +18 -16
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +3 -3
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +3 -4
- package/dist/src/sync/v2/generate/listReport.js +1 -1
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +50 -36
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +11 -9
- package/dist/src/sync/v2/generate/utils.js +98 -95
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.d.ts +9 -0
- package/dist/src/sync/v2/import/app/appProvider.js +36 -13
- package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.js +1 -1
- package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.js +5 -5
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +89 -95
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +8 -3
- package/dist/src/sync/v2/types.js +6 -2
- package/dist/src/sync/v2/types.js.map +1 -1
- package/dist/src/sync/v4/application.d.ts +22 -10
- package/dist/src/sync/v4/application.js +67 -18
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js +6 -18
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.d.ts +8 -2
- package/dist/src/sync/v4/export/controls/Table.js +106 -92
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v4/export/controls/TableColumn.js +4 -4
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +305 -172
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/manifest.js +25 -6
- package/dist/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/src/sync/v4/export/pages/ObjectPage.js +3 -2
- package/dist/src/sync/v4/export/pages/ObjectPage.js.map +1 -1
- package/dist/src/sync/v4/export/types.d.ts +5 -5
- package/dist/src/sync/v4/generate/listReport.d.ts +2 -2
- package/dist/src/sync/v4/generate/listReport.js +265 -165
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.d.ts +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +290 -151
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +32 -22
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.js +100 -60
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +13 -0
- package/dist/src/sync/v4/import/pages/objectPage.js +64 -35
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.d.ts +2 -1
- package/dist/src/sync/v4/import/utils.js +1 -1
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/src/sync/v4/types.d.ts +2 -0
- package/dist/src/sync/v4/utils/StableIdHelper.js +13 -10
- package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +9 -8
- package/dist/src/sync/v4/utils/utils.js +26 -26
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +6 -6
|
@@ -3,19 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const i18next_1 = __importDefault(require("i18next"));
|
|
7
|
+
const extensionLogger_1 = require("../../../extensionLogger");
|
|
6
8
|
const common_1 = require("../../../specification/common");
|
|
7
9
|
const v4_1 = require("../../../v4");
|
|
8
10
|
const common_2 = require("../../common");
|
|
9
11
|
const utils_1 = require("../utils/utils");
|
|
10
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
11
|
-
const extensionLogger_1 = require("../../../extensionLogger");
|
|
12
12
|
/**
|
|
13
13
|
* Callback for adding a single action to headerActions of V4
|
|
14
14
|
* @param {EntityType} entityType - current entity type
|
|
15
|
-
* @param {
|
|
16
|
-
* @param actionAnnotation - annotation as present in AVT
|
|
17
|
-
* @param headerActions - list of header actions, to be enhanced
|
|
18
|
-
* @param {
|
|
15
|
+
* @param {Definition} appSchema Schema of the app
|
|
16
|
+
* @param actionAnnotation - annotation as present in AVT ConvertedMetadata
|
|
17
|
+
* @param {Definition} headerActions - list of header actions, to be enhanced
|
|
18
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
19
19
|
*/
|
|
20
20
|
function addHeaderActionCallBackV4(entityType, appSchema, actionAnnotation, headerActions, oDataServiceAVT) {
|
|
21
21
|
return (item, index) => {
|
|
@@ -23,124 +23,259 @@ function addHeaderActionCallBackV4(entityType, appSchema, actionAnnotation, head
|
|
|
23
23
|
item.$Type === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */) {
|
|
24
24
|
const action = common_2.replaceAlias(item.Action, oDataServiceAVT);
|
|
25
25
|
const { actionName, actionId } = common_2.getActionNameAndId(action, entityType);
|
|
26
|
-
const description = item.Label || actionName;
|
|
27
|
-
const actionDefinitionKey = `HeaderAction<${common_2.prepareRef(actionId)}>`;
|
|
28
26
|
const convertedIdentification = actionAnnotation.fullyQualifiedName.replace(`@${"com.sap.vocabularies.UI.v1.Identification" /* Identification */}`, `/@${"com.sap.vocabularies.UI.v1.Identification" /* Identification */}`);
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const actionDefinitionKey = `HeaderAction<${common_2.prepareRef(actionId)}>`;
|
|
28
|
+
const headerAction = (appSchema.definitions[actionDefinitionKey] = {
|
|
31
29
|
type: 'object',
|
|
32
30
|
properties: {},
|
|
33
|
-
description:
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
description: item.Label || actionName
|
|
32
|
+
});
|
|
33
|
+
headerAction[v4_1.SchemaTag.isViewNode] = true;
|
|
34
|
+
headerAction[v4_1.SchemaTag.annotationPath] = `/${convertedIdentification}/${index}`;
|
|
36
35
|
headerActions.properties[actionId] = {
|
|
37
36
|
$ref: `${common_2.DEFINITION_LINK_PREFIX}${actionDefinitionKey}`
|
|
38
37
|
};
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
}
|
|
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_2.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[v4_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
63
|
+
subSections[v4_1.SchemaTag.isViewNode] = true;
|
|
64
|
+
for (const key in facet.facets) {
|
|
65
|
+
addSection(generateParameters, facet.facets, key, subSections, appSchema, sectionPrefix, v4Page);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
42
68
|
/**
|
|
43
69
|
* Adds definitions for line items in object page sections to the app schema
|
|
44
|
-
* @param facet - the given facet from the UI annotations
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
70
|
+
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
71
|
+
* @param {string} facetKey - key of the facet, as used in annotation
|
|
72
|
+
* @param {Definition} appSchema - app schema in general
|
|
73
|
+
* @param {object} lineItemFacet - current lineItem facet
|
|
74
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
50
75
|
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
51
76
|
* @param {ExtensionLogger} logger - logger for exceptions
|
|
52
77
|
*/
|
|
53
|
-
function handleLineItem(facet,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
appSchema['definitions'][schemaIdForOpSection] = JSON.parse(JSON.stringify(appSchema['definitions']['ObjectPageSectionTableV4']));
|
|
58
|
-
const schemaIdForTable = `ObjectPageTable<${facetIdInSchema}>`;
|
|
59
|
-
appSchema['definitions'][schemaIdForOpSection].properties.table.$ref = `${common_2.DEFINITION_LINK_PREFIX}${schemaIdForTable}`;
|
|
60
|
-
appSchema['definitions'][schemaIdForTable] = JSON.parse(JSON.stringify(appSchema['definitions'][v4_1.DefinitionName.ObjectPageTable]));
|
|
61
|
-
appSchema['definitions'][schemaIdForOpSection].annotationPath = facet.annotationPath;
|
|
62
|
-
common_2.addSectionTitleAndDescription(facet, appSchema['definitions'][schemaIdForOpSection], facetIdInSchema);
|
|
63
|
-
appSchema['definitions'][schemaIdForOpSection].properties.table.$ref = `${common_2.DEFINITION_LINK_PREFIX}ObjectPageTable<${facetIdInSchema}>`;
|
|
64
|
-
const idForTable = `ObjectPageTable<${facetIdInSchema}>`;
|
|
65
|
-
appSchema['definitions'][idForTable] = JSON.parse(JSON.stringify(appSchema['definitions'][v4_1.DefinitionName.ObjectPageTable]));
|
|
78
|
+
function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceAVT, v4Page, logger) {
|
|
79
|
+
const lineItemId = common_2.getFacetKeyInSchema(facetKey);
|
|
80
|
+
const annotation = lineItemId.split('::')[1];
|
|
81
|
+
const tableDefinition = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageTable, facetKey, appSchema);
|
|
66
82
|
if (facet.entityType && annotation) {
|
|
67
|
-
|
|
83
|
+
tableDefinition[v4_1.SchemaTag.annotationPath] = `/${facet.entityType.fullyQualifiedName}/${annotation}`;
|
|
68
84
|
}
|
|
69
|
-
|
|
70
|
-
$ref: common_2.DEFINITION_LINK_PREFIX
|
|
85
|
+
tableDefinition.properties.columns = {
|
|
86
|
+
$ref: `${common_2.DEFINITION_LINK_PREFIX}${lineItemId}`
|
|
71
87
|
};
|
|
72
|
-
|
|
88
|
+
tableDefinition.properties.toolBar.$ref = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageToolBar, facetKey);
|
|
73
89
|
//adjust quickVariantSelection
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
common_2.addEnumForSingleTabVariant(facet.entityType, appSchema,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
tableDefinition.properties.quickVariantSelection.$ref = common_2.getFacetDefinitionLink(v4_1.DefinitionName.QuickVariantSelectionV4OP, facetKey);
|
|
91
|
+
const tableQVS = common_2.parseSchemaDefinition(v4_1.DefinitionName.QuickVariantSelectionV4OP, facetKey, appSchema);
|
|
92
|
+
tableQVS.properties.paths['items'].$ref = common_2.getFacetDefinitionLink(v4_1.DefinitionName.AnnotationPathAsObject, facetKey);
|
|
93
|
+
common_2.parseSchemaDefinition(v4_1.DefinitionName.AnnotationPathAsObject, facetKey, appSchema);
|
|
94
|
+
common_2.addEnumForSingleTabVariant(facet.entityType, appSchema, `${v4_1.DefinitionName.AnnotationPathAsObject}<${lineItemId}>`);
|
|
95
|
+
utils_1.addLineItemsType(appSchema, lineItemFacet['target'], lineItemFacet['entityType'], oDataServiceAVT, lineItemId, v4_1.DefinitionName.ObjectPageTableColumn);
|
|
96
|
+
return tableDefinition;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Adds definitions for table section in object page sections to the app schema
|
|
100
|
+
* @param {FacetConfig} facet - current facet.
|
|
101
|
+
* @param {string} facetKey - facet key.
|
|
102
|
+
* @param {Definition} appSchema - app specific schema that potentially gets enhanced.
|
|
103
|
+
* @param {object} lineItemFacet - current lineItem facet
|
|
104
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
105
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
106
|
+
* @param {Definition} sections - schema of current sections definition.
|
|
107
|
+
* @returns {object} sectionTable - section of app schema containing added table section
|
|
108
|
+
*/
|
|
109
|
+
function handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateParameters, v4Page, sections) {
|
|
110
|
+
if (sections) {
|
|
111
|
+
sections.properties[facetKey] = {
|
|
112
|
+
$ref: common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageSectionTableV4, facetKey)
|
|
113
|
+
};
|
|
83
114
|
}
|
|
115
|
+
const sectionTable = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageSectionTableV4, facetKey, appSchema);
|
|
116
|
+
common_2.addSectionTitleAndDescription(facet, sectionTable, common_2.getFacetKeyInSchema(facetKey));
|
|
117
|
+
sectionTable[v4_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
118
|
+
sectionTable.properties.table['$ref'] = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageTable, facetKey);
|
|
119
|
+
const table = handleLineItem(facet, facetKey, appSchema, lineItemFacet, generateParameters.serviceAVT, v4Page, generateParameters.logger);
|
|
120
|
+
return { sectionTable, table };
|
|
84
121
|
}
|
|
85
122
|
/**
|
|
86
123
|
* Adds definitions for Identification and Form facet items in object page sections to the app schema
|
|
87
|
-
* @param {
|
|
124
|
+
* @param {FacetConfig} facet - current facet.
|
|
88
125
|
* @param {string} facetKey - facet key.
|
|
89
126
|
* @param {object} sections - schema of current sections definition.
|
|
90
127
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
91
128
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
92
|
-
* @param {SectionType} formDefinitionKey - key to identify new definition
|
|
93
129
|
*/
|
|
94
|
-
function handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix
|
|
130
|
+
function handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix) {
|
|
131
|
+
let definitionType;
|
|
132
|
+
if (sectionPrefix === v4_1.SectionType.Section) {
|
|
133
|
+
definitionType = v4_1.DefinitionName.ObjectPageSectionForm;
|
|
134
|
+
}
|
|
135
|
+
else if (sectionPrefix === v4_1.SectionType.HeaderSection) {
|
|
136
|
+
definitionType = v4_1.DefinitionName.ObjectPageHeaderSectionForm;
|
|
137
|
+
}
|
|
95
138
|
sections['properties'][facetKey] = {
|
|
96
|
-
$ref:
|
|
139
|
+
$ref: common_2.getFacetDefinitionLink(definitionType, facetKey)
|
|
97
140
|
};
|
|
98
|
-
|
|
141
|
+
const formSection = common_2.parseSchemaDefinition(definitionType, facetKey, appSchema);
|
|
99
142
|
if (!facet.ID) {
|
|
100
|
-
|
|
143
|
+
formSection.properties = {};
|
|
101
144
|
}
|
|
102
|
-
common_2.addSectionTitleAndDescription(facet,
|
|
103
|
-
|
|
104
|
-
|
|
145
|
+
common_2.addSectionTitleAndDescription(facet, formSection, facetKey);
|
|
146
|
+
formSection[v4_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
147
|
+
formSection[v4_1.SchemaTag.isViewNode] = true;
|
|
105
148
|
const withActions = facet.base === common_2.FacetBase.Identification && facetKey.indexOf('#') < 0 ? false : true;
|
|
106
|
-
common_2.handleForm(sectionPrefix, facet,
|
|
149
|
+
common_2.handleForm(sectionPrefix, facet, formSection, appSchema, common_1.FioriElementsVersion.v4, withActions);
|
|
107
150
|
}
|
|
108
151
|
/**
|
|
109
|
-
* Adds definitions for DataPoint
|
|
110
|
-
* @param {
|
|
152
|
+
* Adds definitions for header sections (DataPoint, Chart) in object page sections to the app schema
|
|
153
|
+
* @param {FacetConfig} facet - current facet.
|
|
111
154
|
* @param {string} facetKey - facet key.
|
|
112
155
|
* @param {object} sections - schema of current sections definition.
|
|
113
156
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
114
|
-
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
115
157
|
* @param {SectionType} facetDefinitionKey - key to identify new definition
|
|
116
158
|
*/
|
|
117
|
-
function
|
|
159
|
+
function handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey) {
|
|
118
160
|
sections['properties'][facetKey] = {
|
|
119
161
|
$ref: `${common_2.DEFINITION_LINK_PREFIX}${facetDefinitionKey}`
|
|
120
162
|
};
|
|
121
|
-
|
|
122
|
-
common_2.addTargetTitleAndSectionDescription(facet,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
163
|
+
const sectionFacet = common_2.parseSchemaDefinition(v4_1.DefinitionName.CommonHeaderFacetSettings, facetDefinitionKey, appSchema, false);
|
|
164
|
+
common_2.addTargetTitleAndSectionDescription(facet, sectionFacet, facetKey);
|
|
165
|
+
sectionFacet[v4_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
166
|
+
sectionFacet[v4_1.SchemaTag.dataType] = common_2.determineDataTypeOfTarget(facet === null || facet === void 0 ? void 0 : facet.target);
|
|
167
|
+
sectionFacet[v4_1.SchemaTag.isViewNode] = true;
|
|
126
168
|
}
|
|
127
169
|
/**
|
|
128
|
-
* Adds definitions for
|
|
129
|
-
* @param {
|
|
170
|
+
* Adds definitions for Chart items in object page sections to the app schema
|
|
171
|
+
* @param {FacetConfig | Chart | object} facet - current facet.
|
|
130
172
|
* @param {string} facetKey - facet key.
|
|
131
|
-
* @param {object} sections - schema of current sections definition.
|
|
132
173
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
133
|
-
* @param {
|
|
134
|
-
* @param {SectionType} facetDefinitionKey - key to identify new definition
|
|
174
|
+
* @param {EntityType} entityType - current entity type
|
|
135
175
|
*/
|
|
136
|
-
function
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
176
|
+
function handleChartActions(facet, facetKey, appSchema, entityType) {
|
|
177
|
+
const actions = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageToolBarActions, facetKey, appSchema);
|
|
178
|
+
actions.additionalProperties = false;
|
|
179
|
+
actions.properties = {};
|
|
180
|
+
if (facet.Actions) {
|
|
181
|
+
let i = 0;
|
|
182
|
+
facet.Actions.forEach((actionRecord) => {
|
|
183
|
+
const description = common_2.getDataFieldDescription(actionRecord, entityType);
|
|
184
|
+
const prefix = actionRecord.$Type.split(v4_1.UIVOCABULARYDOT)[1];
|
|
185
|
+
const actionId = actionRecord.Action.replace('/', '??');
|
|
186
|
+
const toolBarActionsProperty = (actions.properties[`${prefix}::${actionRecord.Action}`] = {
|
|
187
|
+
$ref: common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageToolBarAction, actionId),
|
|
188
|
+
description
|
|
189
|
+
});
|
|
190
|
+
toolBarActionsProperty[v4_1.SchemaTag.propertyIndex] = i;
|
|
191
|
+
toolBarActionsProperty[v4_1.SchemaTag.annotationType] = actionRecord.$Type;
|
|
192
|
+
const toolBarAction = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageToolBarAction, common_2.prepareRef(actionId), appSchema);
|
|
193
|
+
toolBarAction[v4_1.SchemaTag.annotationPath] = common_2.getFacetAnnotationPath(actionRecord);
|
|
194
|
+
toolBarAction[v4_1.SchemaTag.dataType] = common_2.determineDataType(actionRecord);
|
|
195
|
+
toolBarAction.properties = {};
|
|
196
|
+
i++;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return actions;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Adds definitions for Chart items in object page sections to the app schema
|
|
203
|
+
* @param {FacetConfig | Chart | object} facet - current facet.
|
|
204
|
+
* @param {string} facetKey - facet key.
|
|
205
|
+
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
206
|
+
* @param {EntityType} entityType - current entity type
|
|
207
|
+
*/
|
|
208
|
+
function handleChart(facet, facetKey, appSchema, entityType) {
|
|
209
|
+
const chart = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageChart, facetKey, appSchema);
|
|
210
|
+
chart.description = facet['Description'];
|
|
211
|
+
chart[v4_1.SchemaTag.annotationPath] = common_2.getFacetAnnotationPath(facet);
|
|
212
|
+
chart[v4_1.SchemaTag.dataType] = common_2.determineDataTypeOfTarget(facet.target || facet);
|
|
213
|
+
chart[v4_1.SchemaTag.isViewNode] = true;
|
|
214
|
+
chart.properties.toolBar['$ref'] = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageToolBar, facetKey);
|
|
215
|
+
const chartToolBar = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageToolBar, facetKey, appSchema);
|
|
216
|
+
chartToolBar.properties.actions['$ref'] = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageToolBarActions, facetKey);
|
|
217
|
+
const chartActions = handleChartActions(facet, facetKey, appSchema, entityType);
|
|
218
|
+
return { chart, chartActions };
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Adds definitions for Chart section in object page sections to the app schema
|
|
222
|
+
* @param {FacetConfig} facet - current facet.
|
|
223
|
+
* @param {string} facetKey - facet key.
|
|
224
|
+
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
225
|
+
* @param {object} sections - schema of current sections definition.
|
|
226
|
+
* @param {EntityType} entityType - current entity type
|
|
227
|
+
*/
|
|
228
|
+
function handleSectionChart(facet, facetKey, appSchema, sections, entityType = facet.entityType) {
|
|
229
|
+
if (sections) {
|
|
230
|
+
sections.properties[facetKey] = {
|
|
231
|
+
$ref: common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageSectionChart, facetKey)
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const sectionChart = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageSectionChart, facetKey, appSchema);
|
|
235
|
+
sectionChart[v4_1.SchemaTag.annotationPath] = common_2.getFacetAnnotationPath(facet);
|
|
236
|
+
sectionChart.properties.chart['$ref'] = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageChart, facetKey);
|
|
237
|
+
const { chart, chartActions } = handleChart(facet.target || facet, facetKey, appSchema, entityType);
|
|
238
|
+
return { sectionChart, chart, chartActions };
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Adds definitions for presentation variants in object page sections to the app schema
|
|
242
|
+
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
243
|
+
* @param {string} facetKey - key of the facet, as used in annotation
|
|
244
|
+
* @param {Definition} appSchema - app schema in general
|
|
245
|
+
* @param {object} sections - schema of current sections definition.
|
|
246
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
247
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
248
|
+
*/
|
|
249
|
+
function handleSectionPresentationVariant(facet, facetKey, appSchema, sections, generateParameters, v4Page) {
|
|
250
|
+
var _a;
|
|
251
|
+
const facetTarget = facet.target.Visualizations
|
|
252
|
+
? (_a = facet.target.Visualizations[0]) === null || _a === void 0 ? void 0 : _a.$target : undefined;
|
|
253
|
+
if (facetTarget) {
|
|
254
|
+
const [namespace, target] = facet.target[v4_1.SchemaTag.fullyQualifiedName].split('@');
|
|
255
|
+
const visualizationKey = `@${facetTarget.fullyQualifiedName.split('@')[1]}`;
|
|
256
|
+
sections.properties[`${facetKey}<${visualizationKey}>`] = {
|
|
257
|
+
$ref: common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageSectionPresentationVariant, visualizationKey)
|
|
258
|
+
};
|
|
259
|
+
const sectionDefinition = common_2.parseSchemaDefinition(v4_1.DefinitionName.ObjectPageSectionPresentationVariant, visualizationKey, appSchema);
|
|
260
|
+
delete sectionDefinition.additionalProperties;
|
|
261
|
+
common_2.addTargetTitleAndSectionDescription(facet, sectionDefinition, facetKey);
|
|
262
|
+
sectionDefinition[v4_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
263
|
+
sectionDefinition[v4_1.SchemaTag.isViewNode] = true;
|
|
264
|
+
const annotationPath = `/${namespace}/@${target}`;
|
|
265
|
+
const visualizationType = visualizationKey.split(v4_1.UIVOCABULARYDOT)[1];
|
|
266
|
+
if (visualizationType.startsWith('Chart')) {
|
|
267
|
+
sectionDefinition.$ref = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageSectionChart, visualizationKey);
|
|
268
|
+
const { sectionChart, chart } = handleSectionChart(facetTarget, visualizationKey, appSchema, undefined, facet.entityType);
|
|
269
|
+
sectionChart[v4_1.SchemaTag.annotationPath] = annotationPath;
|
|
270
|
+
chart[v4_1.SchemaTag.annotationPath] = `/${namespace}/${visualizationKey}`;
|
|
271
|
+
}
|
|
272
|
+
else if (visualizationType.startsWith('LineItem')) {
|
|
273
|
+
sectionDefinition.$ref = common_2.getFacetDefinitionLink(v4_1.DefinitionName.ObjectPageSectionTableV4, visualizationKey);
|
|
274
|
+
const { sectionTable, table } = handleSectionTable(facet, visualizationKey, appSchema, { target: facetTarget, entityType: facet.entityType }, generateParameters, v4Page);
|
|
275
|
+
sectionTable[v4_1.SchemaTag.annotationPath] = annotationPath;
|
|
276
|
+
table[v4_1.SchemaTag.annotationPath] = `/${namespace}/${visualizationKey}`;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
144
279
|
}
|
|
145
280
|
/**
|
|
146
281
|
* Creates a section definition in app schema.
|
|
@@ -149,54 +284,54 @@ function handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefi
|
|
|
149
284
|
* @param {string} facetKey - facet key.
|
|
150
285
|
* @param {object} sections - schema of current sections definition.
|
|
151
286
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
152
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
153
287
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
154
288
|
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
155
289
|
*/
|
|
156
290
|
function addSection(generateParameters, facets, facetKey, sections, appSchema, sectionPrefix, v4Page) {
|
|
157
291
|
const facet = facets[facetKey];
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
292
|
+
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${common_2.getFacetKeyInSchema(facetKey)}>`;
|
|
293
|
+
switch (facet.base) {
|
|
294
|
+
case common_2.FacetBase.PresentationVariant: {
|
|
295
|
+
handleSectionPresentationVariant(facet, facetKey, appSchema, sections, generateParameters, v4Page);
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
case common_2.FacetBase.CollectionFacet: {
|
|
299
|
+
handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case common_2.FacetBase.LineItem: {
|
|
303
|
+
if (sectionPrefix === v4_1.SectionType.Section) {
|
|
304
|
+
const lineItemFacet = facets[facetKey];
|
|
305
|
+
handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateParameters, v4Page, sections);
|
|
170
306
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
case common_2.FacetBase.Form:
|
|
310
|
+
case common_2.FacetBase.Identification: {
|
|
311
|
+
handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix);
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
case common_2.FacetBase.DataPoint: {
|
|
315
|
+
handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
case common_2.FacetBase.Chart: {
|
|
319
|
+
if (sectionPrefix === v4_1.SectionType.HeaderSection) {
|
|
320
|
+
handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
321
|
+
}
|
|
322
|
+
else if (sectionPrefix === v4_1.SectionType.Section) {
|
|
323
|
+
handleSectionChart(facet, facetKey, appSchema, sections);
|
|
324
|
+
}
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case common_2.FacetBase.Address:
|
|
328
|
+
case common_2.FacetBase.Contact: {
|
|
329
|
+
common_2.handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefix);
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
default: {
|
|
333
|
+
sections['properties'][facetKey] = common_2.createDefaultSection(appSchema, facet, facetKey);
|
|
175
334
|
}
|
|
176
|
-
}
|
|
177
|
-
else if (facet.base === common_2.FacetBase.LineItem && sectionPrefix === v4_1.SectionType.Section) {
|
|
178
|
-
const tableDefinitionKey = `ObjectPage${sectionPrefix}TableV4<${facetKeyInSchema}>`;
|
|
179
|
-
//handle reference facet (if comprising line item)
|
|
180
|
-
sections['properties'][facetKey] = {
|
|
181
|
-
$ref: `${common_2.DEFINITION_LINK_PREFIX}${tableDefinitionKey}`
|
|
182
|
-
};
|
|
183
|
-
handleLineItem(facet, facetKey, facetKeyInSchema, facets, appSchema, generateParameters.serviceAVT, v4Page, generateParameters.logger);
|
|
184
|
-
}
|
|
185
|
-
else if (facet.base === common_2.FacetBase.Form || facet.base === common_2.FacetBase.Identification) {
|
|
186
|
-
const formDefinitionKey = `ObjectPage${sectionPrefix}Form<${facetKeyInSchema}>`;
|
|
187
|
-
handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix, formDefinitionKey);
|
|
188
|
-
}
|
|
189
|
-
else if (facet.base === common_2.FacetBase.DataPoint ||
|
|
190
|
-
(facet.base === common_2.FacetBase.Chart && sectionPrefix === v4_1.SectionType.HeaderSection)) {
|
|
191
|
-
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${facetKeyInSchema}>`;
|
|
192
|
-
handleChartAndDataPoint(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
193
|
-
}
|
|
194
|
-
else if (facet.base === common_2.FacetBase.Address || facet.base === common_2.FacetBase.Contact) {
|
|
195
|
-
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${facetKeyInSchema}>`;
|
|
196
|
-
handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefix, facetDefinitionKey);
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
sections['properties'][facetKey] = common_2.createSectionWithoutProperties(facet, facetKey);
|
|
200
335
|
}
|
|
201
336
|
}
|
|
202
337
|
/**
|
|
@@ -210,16 +345,16 @@ function addSections(generateParameters, appSchema, entityType, v4Page) {
|
|
|
210
345
|
// Get facet annotations
|
|
211
346
|
const facets = common_2.getObjectPageFacets(entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, common_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
212
347
|
if (!facets) {
|
|
213
|
-
delete appSchema
|
|
348
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSubSections];
|
|
214
349
|
return;
|
|
215
350
|
}
|
|
216
|
-
const sections = appSchema
|
|
351
|
+
const sections = appSchema.definitions[v4_1.DefinitionName.Sections];
|
|
217
352
|
for (const facetKey in facets) {
|
|
218
353
|
addSection(generateParameters, facets, facetKey, sections, appSchema, v4_1.SectionType.Section, v4Page);
|
|
219
354
|
}
|
|
220
355
|
// Custom sections as part of sections
|
|
221
|
-
if (appSchema
|
|
222
|
-
sections.properties = Object.assign(Object.assign({}, sections.properties), appSchema
|
|
356
|
+
if (appSchema.definitions[v4_1.DefinitionName.CustomSections]) {
|
|
357
|
+
sections.properties = Object.assign(Object.assign({}, sections.properties), appSchema.definitions[v4_1.DefinitionName.CustomSections].properties);
|
|
223
358
|
}
|
|
224
359
|
}
|
|
225
360
|
/**
|
|
@@ -232,7 +367,7 @@ function addSections(generateParameters, appSchema, entityType, v4Page) {
|
|
|
232
367
|
function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
233
368
|
// Get facet annotations
|
|
234
369
|
const facets = common_2.getObjectPageHeaderFacets(entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, common_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
235
|
-
const sections = appSchema
|
|
370
|
+
const sections = appSchema.definitions[v4_1.DefinitionName.HeaderSections];
|
|
236
371
|
sections.properties = {};
|
|
237
372
|
sections.additionalProperties = false;
|
|
238
373
|
if (!facets) {
|
|
@@ -242,11 +377,11 @@ function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
|
242
377
|
addSection(generateParameters, facets, facetKey, sections, appSchema, v4_1.SectionType.HeaderSection, v4Page);
|
|
243
378
|
}
|
|
244
379
|
//delete generic definitions
|
|
245
|
-
delete appSchema
|
|
246
|
-
delete appSchema
|
|
247
|
-
delete appSchema
|
|
248
|
-
delete appSchema
|
|
249
|
-
delete appSchema
|
|
380
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageHeaderSectionForm];
|
|
381
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageHeaderSectionChart];
|
|
382
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageHeaderSectionDataPoint];
|
|
383
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageHeaderSectionContact];
|
|
384
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageHeaderSectionAddress];
|
|
250
385
|
}
|
|
251
386
|
/**
|
|
252
387
|
* Adds the related facets keys 'enum' to the app schema
|
|
@@ -282,7 +417,7 @@ function addRelatedFacetKeysType(generateParameters, schema, entityType, entityS
|
|
|
282
417
|
});
|
|
283
418
|
}
|
|
284
419
|
// Update schema definition
|
|
285
|
-
common_2.addDefinitionForRelatedFacetKeys(schema, [
|
|
420
|
+
common_2.addDefinitionForRelatedFacetKeys(schema, [v4_1.DefinitionName.ObjectPageCustomSectionFragment], facetSections, [
|
|
286
421
|
'ID',
|
|
287
422
|
'label',
|
|
288
423
|
'key'
|
|
@@ -302,7 +437,7 @@ function addHeader(generateParameters, appSchema, entityType, v4Page) {
|
|
|
302
437
|
// Add header actions
|
|
303
438
|
common_2.addHeaderActions(appSchema, entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, addHeaderActionCallBackV4);
|
|
304
439
|
// Add header sections
|
|
305
|
-
appSchema
|
|
440
|
+
appSchema.definitions[v4_1.DefinitionName.HeaderSections][v4_1.SchemaTag.annotationPath] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.HeaderFacets" /* HeaderFacets */}`;
|
|
306
441
|
addHeaderSections(generateParameters, appSchema, entityType, v4Page);
|
|
307
442
|
}
|
|
308
443
|
/**
|
|
@@ -318,8 +453,8 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
318
453
|
var _a, _b;
|
|
319
454
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
320
455
|
// Change reference to generated sections
|
|
321
|
-
appSchema
|
|
322
|
-
$ref: common_2.DEFINITION_LINK_PREFIX
|
|
456
|
+
appSchema.properties.sections = {
|
|
457
|
+
$ref: `${common_2.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.Sections}`
|
|
323
458
|
};
|
|
324
459
|
const entitySet = (_b = (_a = generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT) === null || _a === void 0 ? void 0 : _a.entitySets) === null || _b === void 0 ? void 0 : _b.find((es) => es.entityType.name === entityTypeName);
|
|
325
460
|
if (!entitySet) {
|
|
@@ -344,13 +479,13 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
344
479
|
return appSchema;
|
|
345
480
|
}
|
|
346
481
|
//initialize sections
|
|
347
|
-
appSchema
|
|
482
|
+
const sections = (appSchema.definitions[v4_1.DefinitionName.Sections] = {
|
|
348
483
|
type: 'object',
|
|
349
484
|
properties: {},
|
|
350
485
|
additionalProperties: false,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
486
|
+
description: v4_1.DefinitionName.Sections
|
|
487
|
+
});
|
|
488
|
+
sections[v4_1.SchemaTag.isViewNode] = true;
|
|
354
489
|
if (entitySet) {
|
|
355
490
|
const pages = generateParameters.manifest[common_1.ManifestSection.ui5].routing.targets;
|
|
356
491
|
if (!pages) {
|
|
@@ -371,7 +506,8 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
371
506
|
// Add Header
|
|
372
507
|
addHeader(generateParameters, appSchema, entityType, v4Page);
|
|
373
508
|
// Add sections
|
|
374
|
-
|
|
509
|
+
sections[v4_1.SchemaTag.isViewNode] = true;
|
|
510
|
+
sections[v4_1.SchemaTag.annotationPath] = `/${entitySet.entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`;
|
|
375
511
|
addSections(generateParameters, appSchema, entityType, v4Page);
|
|
376
512
|
// Custom Section facets
|
|
377
513
|
addRelatedFacetKeysType(generateParameters, appSchema, entityType, entitySet.name, pages);
|
|
@@ -379,20 +515,23 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
379
515
|
common_2.addFooterActions(appSchema, entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT);
|
|
380
516
|
}
|
|
381
517
|
// Delete generic definitions from schema
|
|
382
|
-
delete appSchema
|
|
383
|
-
delete appSchema
|
|
384
|
-
delete appSchema
|
|
385
|
-
delete appSchema
|
|
386
|
-
delete appSchema
|
|
387
|
-
delete appSchema
|
|
388
|
-
delete appSchema
|
|
389
|
-
delete appSchema
|
|
390
|
-
delete appSchema
|
|
391
|
-
delete appSchema
|
|
392
|
-
delete appSchema
|
|
393
|
-
delete appSchema
|
|
394
|
-
delete appSchema
|
|
395
|
-
delete appSchema
|
|
518
|
+
delete appSchema.definitions[v4_1.DefinitionName.CommonHeaderFacetSettings];
|
|
519
|
+
delete appSchema.definitions[v4_1.DefinitionName.GenericColumnsOP];
|
|
520
|
+
delete appSchema.definitions[v4_1.DefinitionName.GenericSections];
|
|
521
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageChart];
|
|
522
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionAddress];
|
|
523
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionChart];
|
|
524
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionContact];
|
|
525
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionDataPoint];
|
|
526
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionForm];
|
|
527
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionTableV4];
|
|
528
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSectionPresentationVariant];
|
|
529
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageSubSections];
|
|
530
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageTable];
|
|
531
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageToolBar];
|
|
532
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageToolBarAction];
|
|
533
|
+
delete appSchema.definitions[v4_1.DefinitionName.ObjectPageToolBarActions];
|
|
534
|
+
delete appSchema.definitions[v4_1.DefinitionName.QuickVariantSelectionV4OP];
|
|
396
535
|
return appSchema;
|
|
397
536
|
}
|
|
398
537
|
exports.generateObjectPageSchemaV4 = generateObjectPageSchemaV4;
|