@sap/ux-specification 1.96.25 → 1.96.26
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-FreestylePage.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 +41 -41
- 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 +32 -32
- package/dist/schemas/v4/ObjectPageConfig.json +99 -23
- 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 +13 -5
- 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 +3 -4
- 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 +3 -3
- package/dist/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +45 -43
- 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 +85 -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 +38 -49
- 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 +6 -6
- 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 +5 -5
- 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 +43 -41
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +2 -3
- package/dist/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/utils.js +34 -24
- 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/ObjectPageForm.d.ts +9 -0
- package/dist/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageForm.js +10 -0
- package/dist/src/sync/v4/export/controls/ObjectPageForm.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageFormAction.d.ts +10 -0
- package/dist/src/sync/v4/export/controls/ObjectPageFormAction.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageFormAction.js +68 -0
- package/dist/src/sync/v4/export/controls/ObjectPageFormAction.js.map +1 -0
- 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/controls/index.d.ts +2 -0
- package/dist/src/sync/v4/export/controls/index.d.ts.map +1 -1
- package/dist/src/sync/v4/export/controls/index.js +2 -0
- package/dist/src/sync/v4/export/controls/index.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 +36 -36
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/exportCustomColumn.d.ts +1 -1
- package/dist/src/sync/v4/export/exportCustomColumn.d.ts.map +1 -1
- package/dist/src/sync/v4/export/exportCustomColumn.js +3 -4
- package/dist/src/sync/v4/export/exportCustomColumn.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 +116 -115
- 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 +189 -148
- 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 -4
- 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 +36 -36
- 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 +78 -22
- 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 +5 -6
- package/dist/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/src/sync/v4/utils/utils.js +109 -68
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +2 -18
- package/dist/src/apiTypes.d.ts +0 -335
- package/dist/src/apiTypes.d.ts.map +0 -1
- package/dist/src/apiTypes.js +0 -25
- package/dist/src/apiTypes.js.map +0 -1
- package/dist/src/sync/common/types.d.ts +0 -306
- package/dist/src/sync/common/types.d.ts.map +0 -1
- package/dist/src/sync/common/types.js +0 -176
- package/dist/src/sync/common/types.js.map +0 -1
|
@@ -30,8 +30,9 @@ function addHeaderActionCallBackV4(entityType, appSchema, actionAnnotation, head
|
|
|
30
30
|
properties: {},
|
|
31
31
|
description: item.Label || actionName
|
|
32
32
|
});
|
|
33
|
-
headerAction[
|
|
34
|
-
headerAction[
|
|
33
|
+
headerAction[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
34
|
+
headerAction[ux_specification_types_1.SchemaTag.key] = `Action: ${actionName}`;
|
|
35
|
+
headerAction[ux_specification_types_1.SchemaTag.annotationPath] = `/${convertedIdentification}/${index}`;
|
|
35
36
|
headerActions.properties[actionId] = {
|
|
36
37
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${actionDefinitionKey}`
|
|
37
38
|
};
|
|
@@ -48,21 +49,21 @@ function addHeaderActionCallBackV4(entityType, appSchema, actionAnnotation, head
|
|
|
48
49
|
*/
|
|
49
50
|
function addCustomColumnsOP(appSchema, v4Page, lineItemId, facetIdInManifest, logger) {
|
|
50
51
|
// Create type specific copy of 'TableCustomColumnOP'
|
|
51
|
-
const useDefinitionAsKey = lineItemId !==
|
|
52
|
+
const useDefinitionAsKey = lineItemId !== ux_specification_types_1.DefinitionName.LineItems &&
|
|
52
53
|
lineItemId !== 'LineItemsOfSPV::LineItem' &&
|
|
53
54
|
lineItemId !== '@com.sap.vocabularies.UI.v1.LineItem';
|
|
54
55
|
const customColumDefinitionKey = useDefinitionAsKey
|
|
55
|
-
? `${
|
|
56
|
-
:
|
|
56
|
+
? `${ux_specification_types_1.DefinitionName.CustomColumnOP}<${lineItemId}>`
|
|
57
|
+
: ux_specification_types_1.DefinitionName.CustomColumnOP;
|
|
57
58
|
const customColumnDefinition = appSchema.definitions[customColumDefinitionKey];
|
|
58
|
-
customColumnDefinition[
|
|
59
|
+
customColumnDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
59
60
|
customColumnDefinition.description = 'Custom Column';
|
|
60
61
|
// Update definitions for type specific custom columns
|
|
61
|
-
const schemaId = `${
|
|
62
|
+
const schemaId = `${ux_specification_types_1.DefinitionName.CustomColumnOP}<${lineItemId}>`;
|
|
62
63
|
utils_1.addCustomColumnDefinition(appSchema, v4Page, logger, schemaId, lineItemId, facetIdInManifest);
|
|
63
|
-
const facetKey = useDefinitionAsKey ? lineItemId :
|
|
64
|
-
common_1.parseSchemaDefinition(
|
|
65
|
-
const positionId = useDefinitionAsKey ? `${
|
|
64
|
+
const facetKey = useDefinitionAsKey ? lineItemId : ux_specification_types_1.DefinitionName.PositionOP;
|
|
65
|
+
common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.PositionOP, facetKey, appSchema, useDefinitionAsKey);
|
|
66
|
+
const positionId = useDefinitionAsKey ? `${ux_specification_types_1.DefinitionName.PositionOP}<${lineItemId}>` : ux_specification_types_1.DefinitionName.PositionOP;
|
|
66
67
|
customColumnDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${positionId}`;
|
|
67
68
|
utils_1.addFragmentEnumForAnchor(appSchema, lineItemId, v4Page, positionId, facetIdInManifest.replace(/::/g, '/'));
|
|
68
69
|
}
|
|
@@ -76,28 +77,61 @@ function addCustomColumnsOP(appSchema, v4Page, lineItemId, facetIdInManifest, lo
|
|
|
76
77
|
*/
|
|
77
78
|
function addCustomActionsOP(appSchema, v4Page, lineItemId, facetIdInManifest, logger) {
|
|
78
79
|
// Create type specific copy of 'TableCustomActionOP'
|
|
79
|
-
const useDefinitionAsKey = lineItemId !==
|
|
80
|
+
const useDefinitionAsKey = lineItemId !== ux_specification_types_1.DefinitionName.LineItems &&
|
|
80
81
|
lineItemId !== 'LineItemsOfSPV::LineItem' &&
|
|
81
82
|
lineItemId !== '@com.sap.vocabularies.UI.v1.LineItem';
|
|
82
83
|
const customActionDefinitionKey = useDefinitionAsKey
|
|
83
|
-
? `${
|
|
84
|
-
:
|
|
84
|
+
? `${ux_specification_types_1.DefinitionName.CustomActionOP}<${lineItemId}>`
|
|
85
|
+
: ux_specification_types_1.DefinitionName.CustomActionOP;
|
|
85
86
|
const customActionDefinition = appSchema.definitions[customActionDefinitionKey];
|
|
86
|
-
customActionDefinition[
|
|
87
|
+
customActionDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
87
88
|
customActionDefinition.description = 'Custom Action';
|
|
88
89
|
// Update definitions for type specific custom columns
|
|
89
|
-
const schemaId = `${
|
|
90
|
-
const schemaIdForActions = `${
|
|
90
|
+
const schemaId = `${ux_specification_types_1.DefinitionName.CustomActionOP}<${lineItemId}>`;
|
|
91
|
+
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.Actions}<${common_1.prepareRef(lineItemId)}>`;
|
|
91
92
|
utils_1.addCustomActionDefinition(appSchema, v4Page, logger, schemaId, schemaIdForActions, facetIdInManifest);
|
|
92
|
-
const facetKey = useDefinitionAsKey ? lineItemId :
|
|
93
|
-
common_1.parseSchemaDefinition(
|
|
93
|
+
const facetKey = useDefinitionAsKey ? lineItemId : ux_specification_types_1.DefinitionName.CustomActionPositionOP;
|
|
94
|
+
common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.CustomActionPositionOP, facetKey, appSchema, useDefinitionAsKey);
|
|
94
95
|
// Anchor selection
|
|
95
96
|
const positionId = useDefinitionAsKey
|
|
96
|
-
? `${
|
|
97
|
-
:
|
|
97
|
+
? `${ux_specification_types_1.DefinitionName.CustomActionPositionOP}<${lineItemId}>`
|
|
98
|
+
: ux_specification_types_1.DefinitionName.CustomActionPositionOP;
|
|
98
99
|
customActionDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${positionId}`;
|
|
99
100
|
utils_1.addEnumForActionAnchor(appSchema, schemaIdForActions, positionId);
|
|
100
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Object Page specific enhancements to handleFormIdentification
|
|
104
|
+
* @param {object} appSchema App schema in general
|
|
105
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
106
|
+
* @param {string} formItemId - identifier of the current form in schema
|
|
107
|
+
* @param {string} facetIdInManifest - identifier of the current object page section in manifest
|
|
108
|
+
* @param {ExtensionLogger} logger - logger for exceptions
|
|
109
|
+
*/
|
|
110
|
+
function addFormCustomActionsOP(appSchema, v4Page, formItemId, facetIdInManifest, logger) {
|
|
111
|
+
const useDefinitionAsKey = true;
|
|
112
|
+
const customActionDefinitionKey = useDefinitionAsKey
|
|
113
|
+
? `${ux_specification_types_1.DefinitionName.FormCustomActionOP}<${formItemId}>`
|
|
114
|
+
: ux_specification_types_1.DefinitionName.FormCustomActionOP;
|
|
115
|
+
const customActionDefinition = appSchema.definitions[customActionDefinitionKey];
|
|
116
|
+
customActionDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
117
|
+
customActionDefinition.description = 'Custom Action';
|
|
118
|
+
const schemaId = `${ux_specification_types_1.DefinitionName.FormCustomActionOP}<${formItemId}>`;
|
|
119
|
+
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.SectionActions}<${common_1.prepareRef(formItemId)}>`;
|
|
120
|
+
utils_1.addCustomActionDefinition(appSchema, v4Page, logger, schemaId, schemaIdForActions, facetIdInManifest);
|
|
121
|
+
const facetKey = useDefinitionAsKey ? formItemId : ux_specification_types_1.DefinitionName.CustomActionPositionOP;
|
|
122
|
+
common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.CustomActionPositionOP, facetKey, appSchema, useDefinitionAsKey);
|
|
123
|
+
// Anchor selection
|
|
124
|
+
const positionId = useDefinitionAsKey
|
|
125
|
+
? `${ux_specification_types_1.DefinitionName.CustomActionPositionOP}<${formItemId}>`
|
|
126
|
+
: ux_specification_types_1.DefinitionName.CustomActionPositionOP;
|
|
127
|
+
customActionDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${positionId}`;
|
|
128
|
+
utils_1.addEnumForActionAnchor(appSchema, schemaIdForActions, positionId);
|
|
129
|
+
if (appSchema.definitions[schemaIdForActions]) {
|
|
130
|
+
appSchema.definitions[schemaIdForActions].additionalProperties = {
|
|
131
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${customActionDefinitionKey}`
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
101
135
|
/**
|
|
102
136
|
* Adds definitions for line items in object page sections to the app schema
|
|
103
137
|
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
@@ -112,20 +146,20 @@ function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceA
|
|
|
112
146
|
const lineItemId = common_1.getFacetKeyInSchema(facetKey);
|
|
113
147
|
const index = facetKey.lastIndexOf('::');
|
|
114
148
|
const annotation = index > -1 ? facetKey.substring(index + 2) : facetKey;
|
|
115
|
-
const tableDefinition = common_1.parseSchemaDefinition(
|
|
149
|
+
const tableDefinition = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageTable, facetKey, appSchema);
|
|
116
150
|
if (facet.entityType && annotation) {
|
|
117
|
-
tableDefinition[
|
|
151
|
+
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = `/${facet.entityType.fullyQualifiedName}/${annotation}`;
|
|
118
152
|
}
|
|
119
153
|
tableDefinition.properties.columns = {
|
|
120
154
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${lineItemId}`
|
|
121
155
|
};
|
|
122
|
-
tableDefinition.properties.toolBar.$ref = common_1.getFacetDefinitionLink(
|
|
156
|
+
tableDefinition.properties.toolBar.$ref = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBar, facetKey);
|
|
123
157
|
//adjust quickVariantSelection
|
|
124
|
-
tableDefinition.properties.quickVariantSelection.$ref = common_1.getFacetDefinitionLink(
|
|
125
|
-
const tableQVS = common_1.parseSchemaDefinition(
|
|
126
|
-
tableQVS.properties.paths['items'].$ref = common_1.getFacetDefinitionLink(
|
|
127
|
-
common_1.parseSchemaDefinition(
|
|
128
|
-
common_1.addEnumForSingleTabVariant(facet.entityType, appSchema, `${
|
|
158
|
+
tableDefinition.properties.quickVariantSelection.$ref = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.QuickVariantSelectionV4OP, facetKey);
|
|
159
|
+
const tableQVS = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.QuickVariantSelectionV4OP, facetKey, appSchema);
|
|
160
|
+
tableQVS.properties.paths['items'].$ref = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.AnnotationPathAsObject, facetKey);
|
|
161
|
+
common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.AnnotationPathAsObject, facetKey, appSchema);
|
|
162
|
+
common_1.addEnumForSingleTabVariant(facet.entityType, appSchema, `${ux_specification_types_1.DefinitionName.AnnotationPathAsObject}<${lineItemId}>`);
|
|
129
163
|
const dataForLineItem = {
|
|
130
164
|
appSchema,
|
|
131
165
|
lineItemAnnotation: lineItemFacet['target'],
|
|
@@ -133,7 +167,7 @@ function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceA
|
|
|
133
167
|
oDataServiceAVT,
|
|
134
168
|
lineItemId
|
|
135
169
|
};
|
|
136
|
-
utils_1.addLineItemsTypeToSchema(dataForLineItem,
|
|
170
|
+
utils_1.addLineItemsTypeToSchema(dataForLineItem, ux_specification_types_1.DefinitionName.ObjectPageTableColumn, ux_specification_types_1.DefinitionName.CustomColumnOP, ux_specification_types_1.DefinitionName.CustomActionOP);
|
|
137
171
|
addCustomColumnsOP(appSchema, v4Page, lineItemId, facetKey, logger);
|
|
138
172
|
addCustomActionsOP(appSchema, v4Page, lineItemId, facetKey, logger);
|
|
139
173
|
return tableDefinition;
|
|
@@ -152,31 +186,33 @@ function handleLineItem(facet, facetKey, appSchema, lineItemFacet, oDataServiceA
|
|
|
152
186
|
function handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateParameters, v4Page, sections) {
|
|
153
187
|
if (sections) {
|
|
154
188
|
sections.properties[facetKey] = {
|
|
155
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
189
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4, facetKey)
|
|
156
190
|
};
|
|
157
191
|
}
|
|
158
|
-
const sectionTable = common_1.parseSchemaDefinition(
|
|
192
|
+
const sectionTable = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4, facetKey, appSchema);
|
|
159
193
|
common_1.addSectionTitleAndDescription(facet, sectionTable, common_1.getFacetKeyInSchema(facetKey));
|
|
160
|
-
sectionTable[
|
|
161
|
-
sectionTable.properties.table['$ref'] = common_1.getFacetDefinitionLink(
|
|
194
|
+
sectionTable[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
195
|
+
sectionTable.properties.table['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageTable, facetKey);
|
|
162
196
|
const table = handleLineItem(facet, facetKey, appSchema, lineItemFacet, generateParameters.serviceAVT, v4Page, generateParameters.logger);
|
|
163
197
|
return { sectionTable, table };
|
|
164
198
|
}
|
|
165
199
|
/**
|
|
166
200
|
* Adds definitions for Identification and Form facet items in object page sections to the app schema
|
|
167
201
|
* @param {FacetConfig} facet - current facet.
|
|
202
|
+
* @param {v4.SapUiAppPageV4} v4Page Current page in manifest.
|
|
168
203
|
* @param {string} facetKey - facet key.
|
|
169
204
|
* @param {object} sections - schema of current sections definition.
|
|
170
205
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
171
206
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
207
|
+
* @param {ExtensionLogger} logger - logger for exceptions
|
|
172
208
|
*/
|
|
173
|
-
function handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix) {
|
|
209
|
+
function handleFormIdentification(facet, v4Page, facetKey, sections, appSchema, sectionPrefix, logger) {
|
|
174
210
|
let definitionType;
|
|
175
211
|
if (sectionPrefix === ux_specification_types_1.SectionType.Section) {
|
|
176
|
-
definitionType =
|
|
212
|
+
definitionType = ux_specification_types_1.DefinitionName.ObjectPageSectionForm;
|
|
177
213
|
}
|
|
178
214
|
else if (sectionPrefix === ux_specification_types_1.SectionType.HeaderSection) {
|
|
179
|
-
definitionType =
|
|
215
|
+
definitionType = ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionForm;
|
|
180
216
|
}
|
|
181
217
|
sections['properties'][facetKey] = {
|
|
182
218
|
$ref: common_1.getFacetDefinitionLink(definitionType, facetKey)
|
|
@@ -186,10 +222,15 @@ function handleFormIdentification(facet, facetKey, sections, appSchema, sectionP
|
|
|
186
222
|
formSection.properties = {};
|
|
187
223
|
}
|
|
188
224
|
common_1.addSectionTitleAndDescription(facet, formSection, facetKey);
|
|
189
|
-
formSection[
|
|
190
|
-
formSection[
|
|
191
|
-
const withActions = facet.base ===
|
|
192
|
-
common_1.handleForm(sectionPrefix, facet, formSection, appSchema, ux_specification_types_1.FioriElementsVersion.v4, withActions);
|
|
225
|
+
formSection[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
226
|
+
formSection[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
227
|
+
const withActions = facet.base === ux_specification_types_1.FacetBase.Identification && facetKey.indexOf('#') < 0 ? false : true;
|
|
228
|
+
const targetId = common_1.handleForm(sectionPrefix, facet, formSection, appSchema, ux_specification_types_1.FioriElementsVersion.v4, withActions);
|
|
229
|
+
if (facet.base === ux_specification_types_1.FacetBase.Form) {
|
|
230
|
+
const formItemId = common_1.getFacetKeyInSchema(facetKey);
|
|
231
|
+
common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.FormCustomActionOP, targetId, appSchema);
|
|
232
|
+
addFormCustomActionsOP(appSchema, v4Page, targetId, formItemId, logger);
|
|
233
|
+
}
|
|
193
234
|
}
|
|
194
235
|
/**
|
|
195
236
|
* Adds definitions for header sections (DataPoint, Chart) in object page sections to the app schema
|
|
@@ -203,11 +244,11 @@ function handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinition
|
|
|
203
244
|
sections['properties'][facetKey] = {
|
|
204
245
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${facetDefinitionKey}`
|
|
205
246
|
};
|
|
206
|
-
const sectionFacet = common_1.parseSchemaDefinition(
|
|
247
|
+
const sectionFacet = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.CommonHeaderFacetSettings, facetDefinitionKey, appSchema, false);
|
|
207
248
|
common_1.addTargetTitleAndSectionDescription(facet, sectionFacet, facetKey);
|
|
208
|
-
sectionFacet[
|
|
209
|
-
sectionFacet[
|
|
210
|
-
sectionFacet[
|
|
249
|
+
sectionFacet[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
250
|
+
sectionFacet[ux_specification_types_1.SchemaTag.dataType] = common_1.determineDataTypeOfTarget(facet?.target);
|
|
251
|
+
sectionFacet[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
211
252
|
}
|
|
212
253
|
/**
|
|
213
254
|
* Adds definitions for Chart items in object page sections to the app schema
|
|
@@ -217,24 +258,24 @@ function handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinition
|
|
|
217
258
|
* @param {EntityType} entityType - current entity type
|
|
218
259
|
*/
|
|
219
260
|
function handleChartActions(facet, facetKey, appSchema, entityType) {
|
|
220
|
-
const actions = common_1.parseSchemaDefinition(
|
|
261
|
+
const actions = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageToolBarActions, facetKey, appSchema);
|
|
221
262
|
actions.additionalProperties = false;
|
|
222
263
|
actions.properties = {};
|
|
223
264
|
if (facet.Actions) {
|
|
224
265
|
let i = 0;
|
|
225
266
|
facet.Actions.forEach((actionRecord) => {
|
|
226
267
|
const description = common_1.getDataFieldDescription(actionRecord, entityType);
|
|
227
|
-
const prefix = actionRecord.$Type.split(
|
|
268
|
+
const prefix = actionRecord.$Type.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
228
269
|
const actionId = actionRecord.Action.replace('/', '??');
|
|
229
270
|
const toolBarActionsProperty = (actions.properties[`${prefix}::${actionRecord.Action}`] = {
|
|
230
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
271
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBarAction, actionId),
|
|
231
272
|
description
|
|
232
273
|
});
|
|
233
|
-
toolBarActionsProperty[
|
|
234
|
-
toolBarActionsProperty[
|
|
235
|
-
const toolBarAction = common_1.parseSchemaDefinition(
|
|
236
|
-
toolBarAction[
|
|
237
|
-
toolBarAction[
|
|
274
|
+
toolBarActionsProperty[ux_specification_types_1.SchemaTag.propertyIndex] = i;
|
|
275
|
+
toolBarActionsProperty[ux_specification_types_1.SchemaTag.annotationType] = actionRecord.$Type;
|
|
276
|
+
const toolBarAction = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageToolBarAction, common_1.prepareRef(actionId), appSchema);
|
|
277
|
+
toolBarAction[ux_specification_types_1.SchemaTag.annotationPath] = common_1.getFacetAnnotationPath(actionRecord);
|
|
278
|
+
toolBarAction[ux_specification_types_1.SchemaTag.dataType] = common_1.determineDataType(actionRecord);
|
|
238
279
|
toolBarAction.properties = {};
|
|
239
280
|
i++;
|
|
240
281
|
});
|
|
@@ -249,16 +290,16 @@ function handleChartActions(facet, facetKey, appSchema, entityType) {
|
|
|
249
290
|
* @param {EntityType} entityType - current entity type
|
|
250
291
|
*/
|
|
251
292
|
function handleChart(facet, facetKey, appSchema, entityType) {
|
|
252
|
-
const chart = common_1.parseSchemaDefinition(
|
|
293
|
+
const chart = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageChart, facetKey, appSchema);
|
|
253
294
|
if (facet['Title']) {
|
|
254
295
|
chart.description = facet['Title'];
|
|
255
296
|
}
|
|
256
|
-
chart[
|
|
257
|
-
chart[
|
|
258
|
-
chart[
|
|
259
|
-
chart.properties.toolBar['$ref'] = common_1.getFacetDefinitionLink(
|
|
260
|
-
const chartToolBar = common_1.parseSchemaDefinition(
|
|
261
|
-
chartToolBar.properties.actions['$ref'] = common_1.getFacetDefinitionLink(
|
|
297
|
+
chart[ux_specification_types_1.SchemaTag.annotationPath] = common_1.getFacetAnnotationPath(facet);
|
|
298
|
+
chart[ux_specification_types_1.SchemaTag.dataType] = common_1.determineDataTypeOfTarget(facet.target || facet);
|
|
299
|
+
chart[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
300
|
+
chart.properties.toolBar['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBar, facetKey);
|
|
301
|
+
const chartToolBar = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageToolBar, facetKey, appSchema);
|
|
302
|
+
chartToolBar.properties.actions['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageToolBarActions, facetKey);
|
|
262
303
|
const chartActions = handleChartActions(facet, facetKey, appSchema, entityType);
|
|
263
304
|
return { chart, chartActions };
|
|
264
305
|
}
|
|
@@ -273,13 +314,13 @@ function handleChart(facet, facetKey, appSchema, entityType) {
|
|
|
273
314
|
function handleSectionChart(facet, facetKey, appSchema, sections, entityType = facet.entityType) {
|
|
274
315
|
if (sections) {
|
|
275
316
|
sections.properties[facetKey] = {
|
|
276
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
317
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionChart, facetKey)
|
|
277
318
|
};
|
|
278
319
|
}
|
|
279
|
-
const sectionChart = common_1.parseSchemaDefinition(
|
|
320
|
+
const sectionChart = common_1.parseSchemaDefinition(ux_specification_types_1.DefinitionName.ObjectPageSectionChart, facetKey, appSchema);
|
|
280
321
|
common_1.addTargetTitleAndSectionDescription(facet, sectionChart, facetKey);
|
|
281
|
-
sectionChart[
|
|
282
|
-
sectionChart.properties.chart['$ref'] = common_1.getFacetDefinitionLink(
|
|
322
|
+
sectionChart[ux_specification_types_1.SchemaTag.annotationPath] = common_1.getFacetAnnotationPath(facet);
|
|
323
|
+
sectionChart.properties.chart['$ref'] = common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageChart, facetKey);
|
|
283
324
|
const { chart, chartActions } = handleChart(facet.target || facet, facetKey, appSchema, entityType);
|
|
284
325
|
return { sectionChart, chart, chartActions };
|
|
285
326
|
}
|
|
@@ -311,34 +352,61 @@ function handleSectionPresentationVariant(facet, facetKey, appSchema, sections,
|
|
|
311
352
|
return prop.name === navPath;
|
|
312
353
|
});
|
|
313
354
|
const targetType = navigationProp.targetType;
|
|
314
|
-
target = targetType.annotations.UI[visualizationKey.split(
|
|
355
|
+
target = targetType.annotations.UI[visualizationKey.split(ux_specification_types_1.UIVOCABULARYDOT)[1]];
|
|
315
356
|
}
|
|
316
357
|
}
|
|
317
358
|
if (facetTarget) {
|
|
318
|
-
const visualizationType = visualizationKey.split(
|
|
319
|
-
const namespace = facet.target[
|
|
359
|
+
const visualizationType = visualizationKey.split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
360
|
+
const namespace = facet.target[ux_specification_types_1.SchemaTag.fullyQualifiedName].split('@')[0];
|
|
320
361
|
const fullVisualizationKey = navPath ? `${navPath}::${visualizationKey}` : visualizationKey;
|
|
321
362
|
if (visualizationType.startsWith(ux_specification_types_1.Visualization.Chart)) {
|
|
322
363
|
sections.properties[`${facetKey}<${visualizationKey}>`] = {
|
|
323
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
364
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionChart, fullVisualizationKey)
|
|
324
365
|
};
|
|
325
366
|
const { sectionChart, chart } = handleSectionChart(facetTarget, fullVisualizationKey, appSchema, undefined, facet.entityType);
|
|
326
|
-
sectionChart[
|
|
367
|
+
sectionChart[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
327
368
|
common_1.addTargetTitleAndSectionDescription(facet, sectionChart, facetKey);
|
|
328
|
-
chart[
|
|
369
|
+
chart[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/${visualizationKey}`;
|
|
329
370
|
}
|
|
330
371
|
else if (visualizationType.startsWith(ux_specification_types_1.Visualization.LineItem)) {
|
|
331
372
|
sections.properties[`${facetKey}<${visualizationKey}>`] = {
|
|
332
|
-
$ref: common_1.getFacetDefinitionLink(
|
|
373
|
+
$ref: common_1.getFacetDefinitionLink(ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4, fullVisualizationKey)
|
|
333
374
|
};
|
|
334
375
|
const { sectionTable, table } = handleSectionTable(facet, fullVisualizationKey, appSchema, { target, entityType: facet.entityType }, generateParameters, v4Page);
|
|
335
|
-
sectionTable[
|
|
376
|
+
sectionTable[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
336
377
|
common_1.addTargetTitleAndSectionDescription(facet, sectionTable, facetKey);
|
|
337
|
-
delete sectionTable[
|
|
338
|
-
table[
|
|
378
|
+
delete sectionTable[ux_specification_types_1.SchemaTag.isViewNode];
|
|
379
|
+
table[ux_specification_types_1.SchemaTag.annotationPath] = `/${namespace}/${visualizationKey}`;
|
|
339
380
|
}
|
|
340
381
|
}
|
|
341
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Adds definitions for collections in object page sections to the app schema
|
|
385
|
+
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
386
|
+
* @param {string} facetKey - key of the facet, as used in annotation
|
|
387
|
+
* @param {Definition} appSchema - app schema in general
|
|
388
|
+
* @param {Definition} sections - schema of current sections definition.
|
|
389
|
+
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
390
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
391
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
392
|
+
*/
|
|
393
|
+
function handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page) {
|
|
394
|
+
const collectionFacet = (sections.properties[facetKey] = common_1.createDefaultSection(appSchema, facet, facetKey));
|
|
395
|
+
collectionFacet.properties = {
|
|
396
|
+
subsections: {
|
|
397
|
+
additionalProperties: false,
|
|
398
|
+
type: 'object',
|
|
399
|
+
properties: {},
|
|
400
|
+
description: 'Subsections'
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
const subSections = collectionFacet.properties.subsections;
|
|
404
|
+
subSections[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
405
|
+
subSections[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
406
|
+
for (const key in facet.facets) {
|
|
407
|
+
addSection(generateParameters, facet.facets, key, subSections, appSchema, sectionPrefix, v4Page);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
342
410
|
/**
|
|
343
411
|
* Creates a section definition in app schema.
|
|
344
412
|
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
@@ -353,31 +421,31 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
353
421
|
const facet = facets[facetKey];
|
|
354
422
|
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${common_1.getFacetKeyInSchema(facetKey)}>`;
|
|
355
423
|
switch (facet.base) {
|
|
356
|
-
case
|
|
424
|
+
case ux_specification_types_1.FacetBase.PresentationVariant: {
|
|
357
425
|
handleSectionPresentationVariant(facet, facetKey, appSchema, sections, generateParameters, v4Page);
|
|
358
426
|
break;
|
|
359
427
|
}
|
|
360
|
-
case
|
|
428
|
+
case ux_specification_types_1.FacetBase.CollectionFacet: {
|
|
361
429
|
handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page);
|
|
362
430
|
break;
|
|
363
431
|
}
|
|
364
|
-
case
|
|
432
|
+
case ux_specification_types_1.FacetBase.LineItem: {
|
|
365
433
|
if (sectionPrefix === ux_specification_types_1.SectionType.Section) {
|
|
366
434
|
const lineItemFacet = facets[facetKey];
|
|
367
435
|
handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateParameters, v4Page, sections);
|
|
368
436
|
}
|
|
369
437
|
break;
|
|
370
438
|
}
|
|
371
|
-
case
|
|
372
|
-
case
|
|
373
|
-
handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix);
|
|
439
|
+
case ux_specification_types_1.FacetBase.Form:
|
|
440
|
+
case ux_specification_types_1.FacetBase.Identification: {
|
|
441
|
+
handleFormIdentification(facet, v4Page, facetKey, sections, appSchema, sectionPrefix, generateParameters.logger);
|
|
374
442
|
break;
|
|
375
443
|
}
|
|
376
|
-
case
|
|
444
|
+
case ux_specification_types_1.FacetBase.DataPoint: {
|
|
377
445
|
handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
378
446
|
break;
|
|
379
447
|
}
|
|
380
|
-
case
|
|
448
|
+
case ux_specification_types_1.FacetBase.Chart: {
|
|
381
449
|
if (sectionPrefix === ux_specification_types_1.SectionType.HeaderSection) {
|
|
382
450
|
handleHeaderFacet(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
383
451
|
}
|
|
@@ -386,8 +454,8 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
386
454
|
}
|
|
387
455
|
break;
|
|
388
456
|
}
|
|
389
|
-
case
|
|
390
|
-
case
|
|
457
|
+
case ux_specification_types_1.FacetBase.Address:
|
|
458
|
+
case ux_specification_types_1.FacetBase.Contact: {
|
|
391
459
|
common_1.handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefix);
|
|
392
460
|
break;
|
|
393
461
|
}
|
|
@@ -396,33 +464,6 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
396
464
|
}
|
|
397
465
|
}
|
|
398
466
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Adds definitions for collections in object page sections to the app schema
|
|
401
|
-
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
402
|
-
* @param {string} facetKey - key of the facet, as used in annotation
|
|
403
|
-
* @param {Definition} appSchema - app schema in general
|
|
404
|
-
* @param {Definition} sections - schema of current sections definition.
|
|
405
|
-
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
406
|
-
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
407
|
-
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
408
|
-
*/
|
|
409
|
-
function handleCollection(facet, facetKey, appSchema, sections, sectionPrefix, generateParameters, v4Page) {
|
|
410
|
-
const collectionFacet = (sections.properties[facetKey] = common_1.createDefaultSection(appSchema, facet, facetKey));
|
|
411
|
-
collectionFacet.properties = {
|
|
412
|
-
subsections: {
|
|
413
|
-
additionalProperties: false,
|
|
414
|
-
type: 'object',
|
|
415
|
-
properties: {},
|
|
416
|
-
description: 'Subsections'
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
const subSections = collectionFacet.properties.subsections;
|
|
420
|
-
subSections[common_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
421
|
-
subSections[common_1.SchemaTag.isViewNode] = true;
|
|
422
|
-
for (const key in facet.facets) {
|
|
423
|
-
addSection(generateParameters, facet.facets, key, subSections, appSchema, sectionPrefix, v4Page);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
467
|
/**
|
|
427
468
|
* Derives the sections from the UI.Facets annotation and adds them to the schema
|
|
428
469
|
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
@@ -433,18 +474,18 @@ function addSections(generateParameters, appSchema, v4Page) {
|
|
|
433
474
|
// Get facet annotations
|
|
434
475
|
const facets = common_1.getObjectPageFacets(generateParameters.entitySet.entityType, generateParameters.serviceAVT, ux_specification_types_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
435
476
|
if (!facets) {
|
|
436
|
-
delete appSchema.definitions[
|
|
477
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSubSections];
|
|
437
478
|
return;
|
|
438
479
|
}
|
|
439
|
-
const sections = appSchema.definitions[
|
|
480
|
+
const sections = appSchema.definitions[ux_specification_types_1.DefinitionName.Sections];
|
|
440
481
|
for (const facetKey in facets) {
|
|
441
482
|
addSection(generateParameters, facets, facetKey, sections, appSchema, ux_specification_types_1.SectionType.Section, v4Page);
|
|
442
483
|
}
|
|
443
484
|
// Custom sections as part of sections
|
|
444
|
-
if (appSchema.definitions[
|
|
485
|
+
if (appSchema.definitions[ux_specification_types_1.DefinitionName.CustomSections]) {
|
|
445
486
|
sections.properties = {
|
|
446
487
|
...sections.properties,
|
|
447
|
-
...appSchema.definitions[
|
|
488
|
+
...appSchema.definitions[ux_specification_types_1.DefinitionName.CustomSections].properties
|
|
448
489
|
};
|
|
449
490
|
}
|
|
450
491
|
}
|
|
@@ -458,7 +499,7 @@ function addSections(generateParameters, appSchema, v4Page) {
|
|
|
458
499
|
function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
459
500
|
// Get facet annotations
|
|
460
501
|
const facets = common_1.getObjectPageHeaderFacets(entityType, generateParameters.serviceAVT, ux_specification_types_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
461
|
-
const sections = appSchema.definitions[
|
|
502
|
+
const sections = appSchema.definitions[ux_specification_types_1.DefinitionName.HeaderSections];
|
|
462
503
|
sections.properties = {};
|
|
463
504
|
sections.additionalProperties = false;
|
|
464
505
|
if (!facets) {
|
|
@@ -468,11 +509,11 @@ function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
|
468
509
|
addSection(generateParameters, facets, facetKey, sections, appSchema, ux_specification_types_1.SectionType.HeaderSection, v4Page);
|
|
469
510
|
}
|
|
470
511
|
//delete generic definitions
|
|
471
|
-
delete appSchema.definitions[
|
|
472
|
-
delete appSchema.definitions[
|
|
473
|
-
delete appSchema.definitions[
|
|
474
|
-
delete appSchema.definitions[
|
|
475
|
-
delete appSchema.definitions[
|
|
512
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionForm];
|
|
513
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionChart];
|
|
514
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionDataPoint];
|
|
515
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionContact];
|
|
516
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeaderSectionAddress];
|
|
476
517
|
}
|
|
477
518
|
/**
|
|
478
519
|
* Adds the related facets keys 'enum' to the app schema
|
|
@@ -507,7 +548,7 @@ function addRelatedFacetKeysType(generateParameters, schema, entitySetName, page
|
|
|
507
548
|
});
|
|
508
549
|
}
|
|
509
550
|
// Update schema definition
|
|
510
|
-
common_1.addDefinitionForRelatedFacetKeys(schema, [
|
|
551
|
+
common_1.addDefinitionForRelatedFacetKeys(schema, [ux_specification_types_1.DefinitionName.ObjectPageCustomSectionFragment], facetSections, [
|
|
511
552
|
'ID',
|
|
512
553
|
'label',
|
|
513
554
|
'key'
|
|
@@ -527,7 +568,7 @@ function addHeader(generateParameters, appSchema, v4Page) {
|
|
|
527
568
|
// Add header actions
|
|
528
569
|
common_1.addHeaderActions(appSchema, entityType, generateParameters.serviceAVT, addHeaderActionCallBackV4);
|
|
529
570
|
// Add header sections
|
|
530
|
-
appSchema.definitions[
|
|
571
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.HeaderSections][ux_specification_types_1.SchemaTag.annotationPath] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.HeaderFacets" /* HeaderFacets */}`;
|
|
531
572
|
addHeaderSections(generateParameters, appSchema, entityType, v4Page);
|
|
532
573
|
}
|
|
533
574
|
/**
|
|
@@ -543,7 +584,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
543
584
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
544
585
|
// Change reference to generated sections
|
|
545
586
|
appSchema.properties.sections = {
|
|
546
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}${
|
|
587
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.Sections}`
|
|
547
588
|
};
|
|
548
589
|
const entitySet = generateParameters.serviceAVT?.entitySets?.find((es) => es.entityType.name === entityTypeName);
|
|
549
590
|
if (!entitySet) {
|
|
@@ -551,7 +592,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
551
592
|
severity: "error" /* Error */,
|
|
552
593
|
message: i18next_1.default.t('NOENTITYSET4NAME', { entityType: entityTypeName }),
|
|
553
594
|
location: {
|
|
554
|
-
path:
|
|
595
|
+
path: ux_specification_types_1.METADATAPATH
|
|
555
596
|
}
|
|
556
597
|
});
|
|
557
598
|
}
|
|
@@ -562,19 +603,19 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
562
603
|
severity: "error" /* Error */,
|
|
563
604
|
message: i18next_1.default.t('NOROUTING'),
|
|
564
605
|
location: {
|
|
565
|
-
path:
|
|
606
|
+
path: ux_specification_types_1.MANIFESTPATH
|
|
566
607
|
}
|
|
567
608
|
});
|
|
568
609
|
return appSchema;
|
|
569
610
|
}
|
|
570
611
|
//initialize sections
|
|
571
|
-
const sections = (appSchema.definitions[
|
|
612
|
+
const sections = (appSchema.definitions[ux_specification_types_1.DefinitionName.Sections] = {
|
|
572
613
|
type: 'object',
|
|
573
614
|
properties: {},
|
|
574
615
|
additionalProperties: false,
|
|
575
|
-
description:
|
|
616
|
+
description: ux_specification_types_1.DefinitionName.Sections
|
|
576
617
|
});
|
|
577
|
-
sections[
|
|
618
|
+
sections[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
578
619
|
if (entitySet) {
|
|
579
620
|
const pages = generateParameters.manifest[ux_specification_types_1.ManifestSection.ui5].routing
|
|
580
621
|
.targets;
|
|
@@ -583,7 +624,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
583
624
|
severity: "error" /* Error */,
|
|
584
625
|
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
585
626
|
location: {
|
|
586
|
-
path:
|
|
627
|
+
path: ux_specification_types_1.MANIFESTPATH,
|
|
587
628
|
range: [ux_specification_types_1.ManifestSection.generic]
|
|
588
629
|
}
|
|
589
630
|
});
|
|
@@ -596,8 +637,8 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
596
637
|
// Add Header
|
|
597
638
|
addHeader(generateParameters, appSchema, v4Page);
|
|
598
639
|
// Add sections
|
|
599
|
-
sections[
|
|
600
|
-
sections[
|
|
640
|
+
sections[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
641
|
+
sections[ux_specification_types_1.SchemaTag.annotationPath] = `/${entitySet.entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`;
|
|
601
642
|
addSections(generateParameters, appSchema, v4Page);
|
|
602
643
|
// Custom Section facets
|
|
603
644
|
addRelatedFacetKeysType(generateParameters, appSchema, entitySet.name, pages);
|
|
@@ -605,23 +646,23 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
605
646
|
common_1.addFooterActions(appSchema, generateParameters);
|
|
606
647
|
}
|
|
607
648
|
// Delete generic definitions from schema
|
|
608
|
-
delete appSchema.definitions[
|
|
609
|
-
delete appSchema.definitions[
|
|
610
|
-
delete appSchema.definitions[
|
|
611
|
-
delete appSchema.definitions[
|
|
612
|
-
delete appSchema.definitions[
|
|
613
|
-
delete appSchema.definitions[
|
|
614
|
-
delete appSchema.definitions[
|
|
615
|
-
delete appSchema.definitions[
|
|
616
|
-
delete appSchema.definitions[
|
|
617
|
-
delete appSchema.definitions[
|
|
618
|
-
delete appSchema.definitions[
|
|
619
|
-
delete appSchema.definitions[
|
|
620
|
-
delete appSchema.definitions[
|
|
621
|
-
delete appSchema.definitions[
|
|
622
|
-
delete appSchema.definitions[
|
|
623
|
-
delete appSchema.definitions[
|
|
624
|
-
delete appSchema.definitions[
|
|
649
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.CommonHeaderFacetSettings];
|
|
650
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.GenericColumnsOP];
|
|
651
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.GenericSections];
|
|
652
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageChart];
|
|
653
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionAddress];
|
|
654
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionChart];
|
|
655
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionContact];
|
|
656
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionDataPoint];
|
|
657
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionForm];
|
|
658
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionTableV4];
|
|
659
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSectionPresentationVariant];
|
|
660
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageSubSections];
|
|
661
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageTable];
|
|
662
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageToolBar];
|
|
663
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageToolBarAction];
|
|
664
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageToolBarActions];
|
|
665
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.QuickVariantSelectionV4OP];
|
|
625
666
|
return appSchema;
|
|
626
667
|
}
|
|
627
668
|
exports.generateObjectPageSchemaV4 = generateObjectPageSchemaV4;
|