@sap/ux-specification 1.90.12 → 1.90.13
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 +38 -4
- 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-AnalyticalListPage.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 +86 -11
- package/dist/schemas/v2/ListReportConfig.json +86 -11
- package/dist/schemas/v2/ObjectPageConfig.json +265 -53
- package/dist/schemas/v2/OverviewPageConfig.json +0 -28
- package/dist/schemas/v4/ObjectPageConfig.json +22 -0
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/src/apiTypes.d.ts +8 -0
- package/dist/src/specification/v2/controls/Card.d.ts +0 -8
- package/dist/src/specification/v2/controls/Card.js.map +1 -1
- package/dist/src/specification/v2/controls/{DataField.d.ts → Field.d.ts} +2 -2
- package/dist/src/specification/v2/controls/{DataField.js → Field.js} +1 -1
- package/dist/src/specification/v2/controls/Field.js.map +1 -0
- package/dist/src/specification/v2/controls/FormAction.d.ts +43 -0
- package/dist/src/specification/v2/controls/FormAction.js +20 -0
- package/dist/src/specification/v2/controls/FormAction.js.map +1 -0
- package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +11 -0
- package/dist/src/specification/v2/controls/ObjectPageFooter.js +3 -0
- package/dist/src/specification/v2/controls/ObjectPageFooter.js.map +1 -0
- package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +4 -5
- package/dist/src/specification/v2/controls/ObjectPageHeaderAction.d.ts +20 -0
- package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +25 -15
- package/dist/src/specification/v2/controls/ObjectPageSection.js.map +1 -1
- package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +8 -4
- package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/specification/v2/controls/Table.d.ts +4 -3
- package/dist/src/specification/v2/controls/ToolBar.d.ts +2 -6
- package/dist/src/specification/v2/controls/index.d.ts +4 -1
- package/dist/src/specification/v2/controls/index.js +1 -0
- package/dist/src/specification/v2/controls/index.js.map +1 -1
- package/dist/src/specification/v2/pages/ObjectPageConfig.d.ts +2 -1
- package/dist/src/specification/v4/controls/ObjectPageFooter.d.ts +11 -0
- package/dist/src/specification/v4/controls/ObjectPageFooter.js +3 -0
- package/dist/src/specification/v4/controls/ObjectPageFooter.js.map +1 -0
- package/dist/src/specification/v4/controls/index.d.ts +1 -0
- package/dist/src/specification/v4/pages/ObjectPageConfig.d.ts +2 -1
- package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +2 -1
- package/dist/src/specification/v4/webapp/manifest/sapUi5.js.map +1 -1
- package/dist/src/sync/common/decoration/control.js +34 -19
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +31 -2
- package/dist/src/sync/common/generate/objectPage.js +185 -20
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/import/utils.d.ts +6 -0
- package/dist/src/sync/common/import/utils.js +21 -0
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.js +62 -60
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +5 -2
- package/dist/src/sync/common/types.js +4 -0
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +4 -3
- package/dist/src/sync/common/utils.js +76 -81
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/application.d.ts +1 -0
- package/dist/src/sync/v2/application.js +3 -0
- package/dist/src/sync/v2/application.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Card.d.ts +0 -2
- package/dist/src/sync/v2/export/controls/Card.js +0 -14
- package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Field.d.ts +4 -0
- package/dist/src/sync/v2/export/controls/{DataField.js → Field.js} +6 -6
- package/dist/src/sync/v2/export/controls/Field.js.map +1 -0
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts +1 -2
- package/dist/src/sync/v2/export/controls/FilterBar.js +2 -4
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.d.ts +15 -0
- package/dist/src/sync/v2/export/controls/FormAction.js +133 -0
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.d.ts +4 -1
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js +13 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +5 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +42 -3
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +32 -0
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +144 -0
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +5 -4
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +16 -4
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Table.d.ts +12 -4
- package/dist/src/sync/v2/export/controls/Table.js +84 -37
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v2/export/controls/index.d.ts +3 -1
- package/dist/src/sync/v2/export/controls/index.js +3 -1
- package/dist/src/sync/v2/export/controls/index.js.map +1 -1
- package/dist/src/sync/v2/export/export.js +125 -86
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts +3 -9
- package/dist/src/sync/v2/generate/analyticalListReport.js +12 -13
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/generate.js +28 -6
- package/dist/src/sync/v2/generate/generate.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts +3 -10
- package/dist/src/sync/v2/generate/listReport.js +7 -12
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts +3 -10
- package/dist/src/sync/v2/generate/objectPage.js +199 -151
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +1 -2
- package/dist/src/sync/v2/generate/utils.js +5 -0
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +162 -88
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +12 -0
- package/dist/src/sync/v2/types.js +11 -0
- package/dist/src/sync/v2/types.js.map +1 -1
- package/dist/src/sync/v4/application.js +10 -10
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +156 -134
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/manifest.js +96 -76
- package/dist/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/src/sync/v4/generate/generate.js +10 -2
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.d.ts +3 -6
- package/dist/src/sync/v4/generate/objectPage.js +87 -94
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.js +108 -80
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/fragment.js +41 -46
- package/dist/src/sync/v4/import/fragment.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.js +1 -1
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/package.json +4 -5
- package/dist/src/specification/v2/controls/DataField.js.map +0 -1
- package/dist/src/sync/v2/export/controls/DataField.d.ts +0 -4
- package/dist/src/sync/v2/export/controls/DataField.js.map +0 -1
|
@@ -13,18 +13,13 @@ const types_1 = require("../types");
|
|
|
13
13
|
/**
|
|
14
14
|
* Generates an app specific schema for the FE V2 Listreport from the generic schema.
|
|
15
15
|
* Generic types are replaced by information from the app specific annotations.
|
|
16
|
-
*
|
|
16
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
17
17
|
* @param {object} genericSchema - generic JSON schema of a list report
|
|
18
18
|
* @param {string} entityTypeName - the base entity type of the given page
|
|
19
19
|
* @param {EntityType[]} entityTypes - list of all entity types
|
|
20
|
-
* @param {object} manifest - manifest.json of the given application
|
|
21
|
-
* @param {FileData[]} fragments - list of fragment files and their content
|
|
22
|
-
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
23
|
-
* @param {string} appId - application ID
|
|
24
|
-
*
|
|
25
20
|
* @returns appSchema - the application specific JSON schema
|
|
26
21
|
*/
|
|
27
|
-
function generateListReportSchemaV2(genericSchema, entityTypeName
|
|
22
|
+
function generateListReportSchemaV2(generateParameters, genericSchema, entityTypeName) {
|
|
28
23
|
// Initialize i18next
|
|
29
24
|
i18n_1.initI18n();
|
|
30
25
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
@@ -57,9 +52,9 @@ function generateListReportSchemaV2(genericSchema, entityTypeName, entityTypes,
|
|
|
57
52
|
appSchema['definitions'][types_1.ANALYTICALTABLE].properties.toolBar.$ref = lrToolBar;
|
|
58
53
|
appSchema['definitions'][types_1.GRIDTABLE] = gridTableDefinition;
|
|
59
54
|
appSchema['definitions'][types_1.GRIDTABLE].properties.toolBar.$ref = lrToolBar;
|
|
60
|
-
const entityType = entityTypes.find((et) => et.name === entityTypeName);
|
|
55
|
+
const entityType = generateParameters.serviceAVT.entityTypes.find((et) => et.name === entityTypeName);
|
|
61
56
|
if (!entityType) {
|
|
62
|
-
v2_1.log(logger, {
|
|
57
|
+
v2_1.log(generateParameters.logger, {
|
|
63
58
|
severity: "error" /* Error */,
|
|
64
59
|
message: i18next_1.default.t('NOENTITYTYPE', { entityType: entityTypeName }),
|
|
65
60
|
location: {
|
|
@@ -74,9 +69,9 @@ function generateListReportSchemaV2(genericSchema, entityTypeName, entityTypes,
|
|
|
74
69
|
//add fields for createWithParameterDialog
|
|
75
70
|
common_1.addFieldsType(appSchema, entityType);
|
|
76
71
|
const pageKeys = [];
|
|
77
|
-
const v2Page = import_1.findListReportPageV2(manifest[v2_1.ManifestSection.generic].pages, pageKeys);
|
|
72
|
+
const v2Page = import_1.findListReportPageV2(generateParameters.manifest[v2_1.ManifestSection.generic].pages, pageKeys);
|
|
78
73
|
if (!v2Page) {
|
|
79
|
-
v2_1.log(logger, {
|
|
74
|
+
v2_1.log(generateParameters.logger, {
|
|
80
75
|
severity: "error" /* Error */,
|
|
81
76
|
message: i18next_1.default.t('NOALP'),
|
|
82
77
|
location: {
|
|
@@ -86,7 +81,7 @@ function generateListReportSchemaV2(genericSchema, entityTypeName, entityTypes,
|
|
|
86
81
|
});
|
|
87
82
|
return;
|
|
88
83
|
}
|
|
89
|
-
utils_1.addListReportColumnExtensions(appSchema, entityType, v2Page, manifest, fragments);
|
|
84
|
+
utils_1.addListReportColumnExtensions(appSchema, entityType, v2Page, generateParameters.manifest, generateParameters.fragments);
|
|
90
85
|
//Delete generic definitions
|
|
91
86
|
delete appSchema['definitions']['ResponsiveTableWithMultiSelect'];
|
|
92
87
|
delete appSchema['definitions']['ResponsiveTableWithInlineDelete'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listReport.js","sourceRoot":"","sources":["../../../../../src/sync/v2/generate/listReport.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"listReport.js","sourceRoot":"","sources":["../../../../../src/sync/v2/generate/listReport.ts"],"names":[],"mappings":";;;;;AAAA,mCAA0E;AAC1E,sCAAiD;AACjD,yCAA4F;AAC5F,sDAA8B;AAC9B,6CAA8C;AAC9C,oCAA2G;AAC3G,oCAAsG;AAEtG;;;;;;;;GAQG;AACH,SAAgB,0BAA0B,CACtC,kBAA+C,EAC/C,aAAqB,EACrB,cAAsB;IAEtB,qBAAqB;IACrB,eAAQ,EAAE,CAAC;IAEX,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IAE5D,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,+BAAsB,GAAG,wBAAgB,CAAC;IACnG,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,+BAAsB,GAAG,yBAAiB,CAAC;IACpG,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,+BAAsB,GAAG,iBAAS,CAAC;IAC5F,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,+BAAsB,GAAG,uBAAe,CAAC;IAClG,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,+BAAsB,GAAG,iBAAS,CAAC;IAE5F,MAAM,0BAA0B,GAAG,IAAI,CAAC,KAAK,CACzC,IAAI,CAAC,SAAS,CAA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,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC;KAC9C;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAjGD,gEAiGC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FileData } from '../../common';
|
|
3
|
-
import { ExtensionLogger } from '../../../v2';
|
|
1
|
+
import { GenerateAppSchemaParameters } from '../../../v2';
|
|
4
2
|
export interface ObjectPageSectionData {
|
|
5
3
|
target: string;
|
|
6
4
|
key?: string;
|
|
@@ -8,15 +6,10 @@ export interface ObjectPageSectionData {
|
|
|
8
6
|
/**
|
|
9
7
|
* Generates an app specific schema out of the generic schema.
|
|
10
8
|
* Generic types are replaced by information from the app specific annotations.
|
|
11
|
-
*
|
|
9
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
12
10
|
* @param genericSchema - generic JSON schema of an object page
|
|
13
11
|
* @param entityTypeName - the base entity type of the given page
|
|
14
|
-
* @param annotations - list of all annotation files (file content plus URI as identifier)
|
|
15
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
16
|
-
* @param manifest - manifest.json of the app
|
|
17
|
-
* @param {FileData[]} [fragments] - array with XML fragments.
|
|
18
|
-
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
19
12
|
*
|
|
20
13
|
* @returns the app specific JSON schema
|
|
21
14
|
*/
|
|
22
|
-
export declare function generateObjectPageSchemaV2(genericSchema: object, entityTypeName: string
|
|
15
|
+
export declare function generateObjectPageSchemaV2(generateParameters: GenerateAppSchemaParameters, genericSchema: object, entityTypeName: string): object | undefined;
|
|
@@ -10,54 +10,66 @@ const v2_1 = require("../../../v2");
|
|
|
10
10
|
const common_2 = require("../../../specification/common");
|
|
11
11
|
const i18next_1 = __importDefault(require("i18next"));
|
|
12
12
|
const i18n_1 = require("../../../i18n/i18n");
|
|
13
|
+
const types_1 = require("../types");
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
15
|
+
* Adds flexChange properties for sub(sections)
|
|
16
|
+
* @param appSchema - app schema in general
|
|
17
|
+
* @param schemaSection - current section
|
|
18
|
+
* @param property - property that will be enhanced
|
|
19
|
+
* @param sectionType - type of section
|
|
19
20
|
*/
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
actionAnnotation.forEach((item, index) => {
|
|
42
|
-
if (!item['Determining'] && item.$Type === 'com.sap.vocabularies.UI.v1.DataFieldForAction') {
|
|
43
|
-
const { actionName, actionId } = common_1.getActionNameAndId(item.Action, entityType);
|
|
44
|
-
const description = item.Label || actionName;
|
|
45
|
-
const actionDefinitionKey = `HeaderAction<${actionId}>`;
|
|
46
|
-
appSchema['definitions'][actionDefinitionKey] = JSON.parse(JSON.stringify(appSchema['definitions']['HeaderAction']));
|
|
47
|
-
appSchema['definitions'][actionDefinitionKey].annotationPath = `${actionAnnotation.fullyQualifiedName}/${index}`;
|
|
48
|
-
appSchema['definitions'][actionDefinitionKey].description = description;
|
|
49
|
-
headerActions.properties[actionId] = {
|
|
50
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}${actionDefinitionKey}`
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
});
|
|
21
|
+
function addFlexChangeForSection(appSchema, schemaSection, property, sectionType) {
|
|
22
|
+
let controlType;
|
|
23
|
+
switch (sectionType) {
|
|
24
|
+
case types_1.SectionTypeV2.Section:
|
|
25
|
+
case types_1.SectionTypeV2.SectionForm:
|
|
26
|
+
case types_1.SectionTypeV2.SectionChart:
|
|
27
|
+
case types_1.SectionTypeV2.SectionTable:
|
|
28
|
+
controlType = v2_1.ControlType.Section;
|
|
29
|
+
break;
|
|
30
|
+
case types_1.SectionTypeV2.SubSection:
|
|
31
|
+
controlType = v2_1.ControlType.SubSection;
|
|
32
|
+
break;
|
|
33
|
+
case types_1.SectionTypeV2.SubSectionForm:
|
|
34
|
+
controlType = v2_1.ControlType.SmartGroup;
|
|
35
|
+
break;
|
|
36
|
+
case types_1.SectionTypeV2.SubSectionChart:
|
|
37
|
+
controlType = v2_1.ControlType.SmartChart;
|
|
38
|
+
break;
|
|
39
|
+
case types_1.SectionTypeV2.SubSectionTable:
|
|
40
|
+
controlType = v2_1.ControlType.SmartTable;
|
|
41
|
+
break;
|
|
54
42
|
}
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
if (controlType === undefined) {
|
|
44
|
+
return;
|
|
57
45
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
common_1.addPatternForBindingChangeOfEnumOP(appSchema, schemaSection, property);
|
|
47
|
+
schemaSection['properties'][property].artifactType = 'FlexChange';
|
|
48
|
+
schemaSection['properties'][property].controlType = controlType;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Callback for adding a single action to headerActions of V2
|
|
52
|
+
* @param {EntityType} entityType - current entity type
|
|
53
|
+
* @param {object} appSchema Schema of the app
|
|
54
|
+
* @param actionAnnotation - annotation as present in AVT ConverterOutput
|
|
55
|
+
* @param headerActions - list of header actions, to be enhanced
|
|
56
|
+
*/
|
|
57
|
+
function addHeaderActionCallBackV2(entityType, appSchema, actionAnnotation, headerActions, oDataServiceAVT) {
|
|
58
|
+
return (item, index) => {
|
|
59
|
+
if (!item['Determining'] && item.$Type === 'com.sap.vocabularies.UI.v1.DataFieldForAction') {
|
|
60
|
+
const action = common_1.replaceAlias(item.Action, oDataServiceAVT);
|
|
61
|
+
const { actionName, actionId } = common_1.getActionNameAndId(action, entityType);
|
|
62
|
+
const description = item.Label || actionName;
|
|
63
|
+
const actionDefinitionKey = `HeaderAction<${actionId}>`;
|
|
64
|
+
appSchema['definitions'][actionDefinitionKey] = JSON.parse(JSON.stringify(appSchema['definitions']['HeaderAction']));
|
|
65
|
+
const convertedIdentification = actionAnnotation.fullyQualifiedName.replace(`@${"com.sap.vocabularies.UI.v1.Identification" /* Identification */}`, `/@${"com.sap.vocabularies.UI.v1.Identification" /* Identification */}`);
|
|
66
|
+
appSchema['definitions'][actionDefinitionKey].annotationPath = `/${convertedIdentification}/${index}`;
|
|
67
|
+
appSchema['definitions'][actionDefinitionKey].description = description;
|
|
68
|
+
headerActions.properties[actionId] = {
|
|
69
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${actionDefinitionKey}`
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
};
|
|
61
73
|
}
|
|
62
74
|
/**
|
|
63
75
|
* Method ensures that definitions for custom columns are created for passed entitySet.
|
|
@@ -106,51 +118,53 @@ function addTableDefinition(tableType, facetId, facet, appSchema) {
|
|
|
106
118
|
}
|
|
107
119
|
/**
|
|
108
120
|
* Adds definitions for line items in object page sections to the app schema
|
|
121
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
109
122
|
* @param {string} facetId - key of the facet, as listed in FacetConfigs
|
|
110
123
|
* @param {object} appSchema - app schema in general
|
|
111
124
|
* @param {FacetConfig} facet - the given facet from the UI annotations
|
|
112
125
|
* @param {FacetConfigs} facets - list of all facets
|
|
113
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
114
|
-
* @param {object} manifest - manifest.json of the app
|
|
115
|
-
* @param {FileData[]} [fragments] - array with XML fragments.
|
|
116
126
|
*/
|
|
117
|
-
function handleLineItem(facetId, appSchema, facet, facets,
|
|
127
|
+
function handleLineItem(generateParameters, facetId, appSchema, facet, facets, sectionType) {
|
|
128
|
+
var _a;
|
|
118
129
|
if (facet.base !== 'LineItem' || !facetId) {
|
|
119
130
|
//no properties
|
|
120
131
|
return;
|
|
121
132
|
}
|
|
122
133
|
const navigationProperty = facetId.split('::')[0];
|
|
123
|
-
const schemaIdForOpSection =
|
|
124
|
-
appSchema['definitions'][schemaIdForOpSection] =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
{
|
|
139
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageGridTable<${facetId}>`
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageTreeTable<${facetId}>`
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
134
|
+
const schemaIdForOpSection = `${sectionType}<${facetId}>`;
|
|
135
|
+
appSchema['definitions'][schemaIdForOpSection] = common_1.createSectionWithoutProperties(facet, facetId);
|
|
136
|
+
const appSchemaSection = appSchema['definitions'][schemaIdForOpSection];
|
|
137
|
+
if (facet.ID || ((_a = facet.target) === null || _a === void 0 ? void 0 : _a['qualifier'])) {
|
|
138
|
+
appSchemaSection.properties = JSON.parse(JSON.stringify(appSchema['definitions'][types_1.SectionTypeV2.SectionTable]['properties']));
|
|
139
|
+
if (appSchemaSection.properties.visible) {
|
|
140
|
+
addFlexChangeForSection(appSchema, appSchemaSection, 'visible', sectionType);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
appSchemaSection.properties.table = JSON.parse(JSON.stringify(appSchema['definitions'][types_1.SectionTypeV2.SectionTable]['properties']['table']));
|
|
145
|
+
}
|
|
146
|
+
appSchemaSection.properties.table.anyOf = [
|
|
147
|
+
{
|
|
148
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageResponsiveTableWithMultiSelect<${facetId}>`
|
|
146
149
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
{
|
|
151
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageResponsiveTableWithInlineDelete<${facetId}>`
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageAnalyticalTable<${facetId}>`
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageGridTable<${facetId}>`
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageTreeTable<${facetId}>`
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
appSchemaSection.annotationPath = facet.annotationPath;
|
|
164
|
+
common_1.addSectionTitleAndDescription(facet, appSchemaSection, facetId);
|
|
151
165
|
// Find target entity
|
|
152
166
|
const targetEntity = facet.entityType
|
|
153
|
-
?
|
|
167
|
+
? generateParameters.serviceAVT.entitySets.find((es) => es.entityType.name === facet.entityType.name || es.name === facet.entityType.name)
|
|
154
168
|
: undefined;
|
|
155
169
|
addTableDefinition('ObjectPageResponsiveTableWithMultiSelect', facetId, facet, appSchema);
|
|
156
170
|
addTableDefinition('ObjectPageResponsiveTableWithInlineDelete', facetId, facet, appSchema);
|
|
@@ -160,87 +174,129 @@ function handleLineItem(facetId, appSchema, facet, facets, oDataServiceAVT, mani
|
|
|
160
174
|
let customColumnDefinitionKey;
|
|
161
175
|
if (targetEntity) {
|
|
162
176
|
// Make sure that custom columns definitions are created for passed entity
|
|
163
|
-
customColumnDefinitionKey = ensureCustomColumnDefinitionExists(appSchema, manifest, targetEntity.name, facet.entityType.name,
|
|
177
|
+
customColumnDefinitionKey = ensureCustomColumnDefinitionExists(appSchema, generateParameters.manifest, targetEntity.name, facet.entityType.name, generateParameters.serviceAVT, generateParameters.fragments);
|
|
164
178
|
}
|
|
165
179
|
for (const facetKey in facets) {
|
|
166
180
|
if (facets[facetKey].base === 'LineItem' && facetKey.includes(navigationProperty)) {
|
|
167
|
-
utils_1.addLineItemsType(appSchema, facets[facetKey]
|
|
181
|
+
utils_1.addLineItemsType(appSchema, facets[facetKey].target, facets[facetKey].entityType, facetId, customColumnDefinitionKey);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Adds definitions for subsections in object page sections to the app schema
|
|
187
|
+
* @param facetId - key of the facet, as listed in FacetConfigs
|
|
188
|
+
* @param appSchema - app schema in general
|
|
189
|
+
* @param facet - the given facet from the UI annotations
|
|
190
|
+
* @param facets - list of all facets
|
|
191
|
+
*/
|
|
192
|
+
function handleSubSection(facetId, appSchema, facet, sectionType) {
|
|
193
|
+
const schemaIdForSection = facetId.replace(`@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`, facet.base);
|
|
194
|
+
const definitionKey = `${sectionType}<${schemaIdForSection}>`;
|
|
195
|
+
appSchema['definitions'][definitionKey] = common_1.createSectionWithoutProperties(facet, facetId);
|
|
196
|
+
const appSchemaSection = appSchema['definitions'][definitionKey];
|
|
197
|
+
if (facet.ID) {
|
|
198
|
+
appSchemaSection.properties = JSON.parse(JSON.stringify(appSchema['definitions'][types_1.SectionTypeV2.SubSection]['properties']));
|
|
199
|
+
if (appSchemaSection.properties.visible) {
|
|
200
|
+
addFlexChangeForSection(appSchema, appSchemaSection, 'visible', sectionType);
|
|
168
201
|
}
|
|
169
202
|
}
|
|
203
|
+
appSchemaSection.properties.subsections = {
|
|
204
|
+
type: 'object',
|
|
205
|
+
description: 'Subsections',
|
|
206
|
+
properties: {},
|
|
207
|
+
additionalProperties: false,
|
|
208
|
+
isViewNode: true
|
|
209
|
+
};
|
|
170
210
|
}
|
|
171
211
|
/**
|
|
172
212
|
* Creates a section definition in app schema.
|
|
213
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
173
214
|
* @param {FacetConfigs} facets - list of all facets.
|
|
174
215
|
* @param {string} facetKey - facet key.
|
|
175
216
|
* @param {object} sections - schema of current sections definition.
|
|
176
217
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
177
|
-
* @param {object} manifest - manifest.json of the app.
|
|
178
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool.
|
|
179
|
-
* @param {FileData[]} [fragments] - array with XML fragments.
|
|
180
218
|
*/
|
|
181
|
-
function addSection(facets, facetKey, sections, appSchema,
|
|
219
|
+
function addSection(generateParameters, facets, facetKey, sections, appSchema, isSubSection = false) {
|
|
220
|
+
var _a;
|
|
182
221
|
const facet = facets[facetKey];
|
|
183
222
|
switch (facet.base) {
|
|
184
223
|
case v2_1.FacetBase.CollectionFacet: {
|
|
185
224
|
//handle collection facets
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
};
|
|
194
|
-
appSchema['definitions'][collectionDefinition] = common_1.createSectionWithoutProperties(facet, facetKey);
|
|
195
|
-
appSchema['definitions'][collectionDefinition].description = 'Subsections';
|
|
225
|
+
const sectionType = (sections === null || sections === void 0 ? void 0 : sections['description']) === 'Subsections' ? types_1.SectionTypeV2.SubSection : types_1.SectionTypeV2.Section;
|
|
226
|
+
const schemaIdForSection = facetKey.replace(`@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`, facet.base);
|
|
227
|
+
isSubSection = true;
|
|
228
|
+
const definitionKey = `${sectionType}<${schemaIdForSection}>`;
|
|
229
|
+
sections['properties'][schemaIdForSection] = { $ref: `${common_1.DEFINITION_LINK_PREFIX}${definitionKey}` };
|
|
230
|
+
handleSubSection(facetKey, appSchema, facet, sectionType);
|
|
231
|
+
const subSections = appSchema['definitions'][definitionKey].properties.subsections;
|
|
196
232
|
for (const key in facet['facets']) {
|
|
197
|
-
addSection(facet['facets'], key,
|
|
233
|
+
addSection(generateParameters, facet['facets'], key, subSections, appSchema, isSubSection);
|
|
198
234
|
}
|
|
199
235
|
break;
|
|
200
236
|
}
|
|
201
237
|
case v2_1.FacetBase.LineItem: {
|
|
202
238
|
//handle reference facet (if comprising line item)
|
|
239
|
+
const sectionType = isSubSection ? types_1.SectionTypeV2.SubSectionTable : types_1.SectionTypeV2.SectionTable;
|
|
203
240
|
sections['properties'][facetKey] = {
|
|
204
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}
|
|
241
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${sectionType}<${facetKey}>`
|
|
205
242
|
};
|
|
206
|
-
handleLineItem(facetKey, appSchema, facet, facets,
|
|
243
|
+
handleLineItem(generateParameters, facetKey, appSchema, facet, facets, sectionType);
|
|
207
244
|
//add fields for createWithParameterDialog
|
|
208
|
-
|
|
245
|
+
const floorplanSuffix = 'OP';
|
|
246
|
+
common_1.addFieldsType(appSchema, facet.entityType, floorplanSuffix);
|
|
209
247
|
break;
|
|
210
248
|
}
|
|
211
249
|
case v2_1.FacetBase.Chart: {
|
|
212
250
|
//handle reference facet (if comprising chart)
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
251
|
+
const sectionType = isSubSection ? types_1.SectionTypeV2.SubSectionChart : types_1.SectionTypeV2.SectionChart;
|
|
252
|
+
const definitionKey = `${sectionType}<${facetKey}>`;
|
|
253
|
+
sections['properties'][facetKey] = {
|
|
254
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${definitionKey}`
|
|
255
|
+
};
|
|
256
|
+
appSchema['definitions'][definitionKey] = common_1.createSectionWithoutProperties(facet, facetKey);
|
|
257
|
+
const appSchemaSection = appSchema['definitions'][definitionKey];
|
|
258
|
+
if (facet.ID) {
|
|
259
|
+
appSchemaSection.properties = JSON.parse(JSON.stringify(appSchema['definitions'][types_1.SectionTypeV2.SectionChart]['properties']));
|
|
260
|
+
if (appSchemaSection.properties.visible) {
|
|
261
|
+
addFlexChangeForSection(appSchema, appSchemaSection, 'visible', sectionType);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
216
264
|
break;
|
|
217
265
|
}
|
|
218
266
|
case v2_1.FacetBase.Form:
|
|
219
267
|
case v2_1.FacetBase.Identification: {
|
|
220
|
-
const
|
|
268
|
+
const sectionType = isSubSection ? types_1.SectionTypeV2.SubSectionForm : types_1.SectionTypeV2.SectionForm;
|
|
269
|
+
const definitionKey = `${sectionType}<${facetKey}>`;
|
|
221
270
|
sections['properties'][facetKey] = {
|
|
222
|
-
$ref: `${common_1.DEFINITION_LINK_PREFIX}${
|
|
271
|
+
$ref: `${common_1.DEFINITION_LINK_PREFIX}${definitionKey}`
|
|
223
272
|
};
|
|
224
|
-
appSchema['definitions'][
|
|
273
|
+
appSchema['definitions'][definitionKey] = common_1.createSectionWithoutProperties(facet, facetKey);
|
|
274
|
+
const appSchemaSection = appSchema['definitions'][definitionKey];
|
|
275
|
+
if ((facet === null || facet === void 0 ? void 0 : facet.ID) || ((_a = facet.target) === null || _a === void 0 ? void 0 : _a['qualifier'])) {
|
|
276
|
+
appSchemaSection['properties'] = JSON.parse(JSON.stringify(appSchema['definitions'][types_1.SectionTypeV2.SectionForm]['properties']));
|
|
277
|
+
if (appSchemaSection.properties.visible) {
|
|
278
|
+
addFlexChangeForSection(appSchema, appSchemaSection, 'visible', sectionType);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
225
281
|
if (facet === null || facet === void 0 ? void 0 : facet.ID) {
|
|
226
|
-
|
|
282
|
+
appSchemaSection.title = common_1.FacetTitlePrefix + facet.ID;
|
|
227
283
|
}
|
|
228
284
|
if (facet === null || facet === void 0 ? void 0 : facet.Label) {
|
|
229
|
-
|
|
285
|
+
appSchemaSection.description = facet.Label;
|
|
230
286
|
}
|
|
231
287
|
let withActions = true;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (!
|
|
288
|
+
appSchemaSection.annotationPath = facet.annotationPath;
|
|
289
|
+
appSchemaSection.isViewNode = true;
|
|
290
|
+
if (!appSchemaSection.description) {
|
|
235
291
|
if (facet.base === v2_1.FacetBase.Form) {
|
|
236
|
-
|
|
292
|
+
appSchemaSection.description = 'Form';
|
|
237
293
|
}
|
|
238
294
|
else if (facet.base === 'Identification') {
|
|
239
|
-
|
|
295
|
+
appSchemaSection.description = 'Identification';
|
|
240
296
|
withActions = false;
|
|
241
297
|
}
|
|
242
298
|
}
|
|
243
|
-
common_1.handleForm(v2_1.SectionType.Section, facet,
|
|
299
|
+
common_1.handleForm(v2_1.SectionType.Section, facet, appSchemaSection, appSchema, common_2.FioriElementsVersion.v2, withActions);
|
|
244
300
|
break;
|
|
245
301
|
}
|
|
246
302
|
default: {
|
|
@@ -251,13 +307,12 @@ function addSection(facets, facetKey, sections, appSchema, manifest, oDataServic
|
|
|
251
307
|
}
|
|
252
308
|
/**
|
|
253
309
|
* Adds the sections to the app schema
|
|
310
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
254
311
|
* @param {object} appSchema - app specific schema that potentially gets enhanced
|
|
255
312
|
* @param {EntityType} entityType - current entity type
|
|
256
313
|
* @param {SapUiAppPagesV2} pages - list of (manifest) pages
|
|
257
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
258
|
-
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
259
314
|
*/
|
|
260
|
-
function addSections(appSchema, entityType, entitySetName, pages
|
|
315
|
+
function addSections(generateParameters, appSchema, entityType, entitySetName, pages) {
|
|
261
316
|
//initialize sections
|
|
262
317
|
const sections = (appSchema['definitions']['Sections'] = {
|
|
263
318
|
type: 'object',
|
|
@@ -267,13 +322,13 @@ function addSections(appSchema, entityType, entitySetName, pages, oDataServiceAV
|
|
|
267
322
|
isViewNode: true
|
|
268
323
|
});
|
|
269
324
|
if (entityType) {
|
|
270
|
-
sections['annotationPath'] = `/${entityType.fullyQualifiedName}
|
|
325
|
+
sections['annotationPath'] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`;
|
|
271
326
|
}
|
|
272
327
|
if (!pages) {
|
|
273
328
|
return;
|
|
274
329
|
}
|
|
275
330
|
// Get facet annotations
|
|
276
|
-
const facets = common_1.getObjectPageFacets(entityType,
|
|
331
|
+
const facets = common_1.getObjectPageFacets(entityType, generateParameters.serviceAVT, common_2.FioriElementsVersion.v2, generateParameters.logger);
|
|
277
332
|
if (!facets || Object.keys(facets).length === 0) {
|
|
278
333
|
return;
|
|
279
334
|
}
|
|
@@ -283,11 +338,11 @@ function addSections(appSchema, entityType, entitySetName, pages, oDataServiceAV
|
|
|
283
338
|
if (entitySetName.includes(element.entitySet)) {
|
|
284
339
|
// Loop on all facets (of the given entitySet)
|
|
285
340
|
for (const facetKey in facets) {
|
|
286
|
-
addSection(facets, facetKey, sections, appSchema
|
|
341
|
+
addSection(generateParameters, facets, facetKey, sections, appSchema);
|
|
287
342
|
}
|
|
288
343
|
}
|
|
289
344
|
else {
|
|
290
|
-
addSections(appSchema, entityType, entitySetName, element.pages
|
|
345
|
+
addSections(generateParameters, appSchema, entityType, entitySetName, element.pages);
|
|
291
346
|
}
|
|
292
347
|
}
|
|
293
348
|
// Add custom sections
|
|
@@ -303,13 +358,9 @@ function addSections(appSchema, entityType, entitySetName, pages, oDataServiceAV
|
|
|
303
358
|
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
304
359
|
*/
|
|
305
360
|
function addHeader(appSchema, entityType, oDataServiceAVT) {
|
|
306
|
-
appSchema
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
appSchema['definitions']['ObjectPageHeader'] = JSON.parse(JSON.stringify(appSchema['definitions']['ObjectPageHeader<GenericActions>']));
|
|
310
|
-
appSchema['definitions']['ObjectPageHeader'].annotationPath = `/${entityType.fullyQualifiedName}/@com.sap.vocabularies.UI.v1.HeaderInfo`;
|
|
311
|
-
//Add Header Actions
|
|
312
|
-
addHeaderActions(appSchema, entityType, oDataServiceAVT);
|
|
361
|
+
common_1.addCommonHeaderSchema(appSchema, entityType);
|
|
362
|
+
//Add header actions
|
|
363
|
+
common_1.addHeaderActions(appSchema, entityType, oDataServiceAVT, addHeaderActionCallBackV2);
|
|
313
364
|
}
|
|
314
365
|
/**
|
|
315
366
|
* Adds the related facets keys 'enum' to the app schema
|
|
@@ -329,18 +380,13 @@ function addRelatedFacetKeysType(schema, entityType, oDataServiceAVT, logger) {
|
|
|
329
380
|
/**
|
|
330
381
|
* Generates an app specific schema out of the generic schema.
|
|
331
382
|
* Generic types are replaced by information from the app specific annotations.
|
|
332
|
-
*
|
|
383
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
333
384
|
* @param genericSchema - generic JSON schema of an object page
|
|
334
385
|
* @param entityTypeName - the base entity type of the given page
|
|
335
|
-
* @param annotations - list of all annotation files (file content plus URI as identifier)
|
|
336
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
337
|
-
* @param manifest - manifest.json of the app
|
|
338
|
-
* @param {FileData[]} [fragments] - array with XML fragments.
|
|
339
|
-
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
340
386
|
*
|
|
341
387
|
* @returns the app specific JSON schema
|
|
342
388
|
*/
|
|
343
|
-
function generateObjectPageSchemaV2(genericSchema, entityTypeName
|
|
389
|
+
function generateObjectPageSchemaV2(generateParameters, genericSchema, entityTypeName) {
|
|
344
390
|
// Initialize i18next
|
|
345
391
|
i18n_1.initI18n();
|
|
346
392
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
@@ -353,10 +399,10 @@ function generateObjectPageSchemaV2(genericSchema, entityTypeName, oDataServiceA
|
|
|
353
399
|
appSchema['properties']['sections'] = {
|
|
354
400
|
$ref: common_1.DEFINITION_LINK_PREFIX + 'Sections'
|
|
355
401
|
};
|
|
356
|
-
const entitySet =
|
|
357
|
-
|
|
402
|
+
const entitySet = generateParameters.serviceAVT.entitySets &&
|
|
403
|
+
generateParameters.serviceAVT.entitySets.find((es) => es.entityType.name === entityTypeName || es.name === entityTypeName);
|
|
358
404
|
if (!entitySet) {
|
|
359
|
-
v2_1.log(logger, {
|
|
405
|
+
v2_1.log(generateParameters.logger, {
|
|
360
406
|
severity: "error" /* Error */,
|
|
361
407
|
message: i18next_1.default.t('NOENTITYSET4NAME', { entityType: entityTypeName }),
|
|
362
408
|
location: {
|
|
@@ -366,12 +412,24 @@ function generateObjectPageSchemaV2(genericSchema, entityTypeName, oDataServiceA
|
|
|
366
412
|
return;
|
|
367
413
|
}
|
|
368
414
|
const entityType = entitySet === null || entitySet === void 0 ? void 0 : entitySet.entityType;
|
|
415
|
+
const pages = generateParameters.manifest[common_2.ManifestSection.generic].pages;
|
|
416
|
+
if (!pages) {
|
|
417
|
+
v2_1.log(generateParameters.logger, {
|
|
418
|
+
severity: "error" /* Error */,
|
|
419
|
+
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
420
|
+
location: {
|
|
421
|
+
path: v2_1.MANIFESTPATH,
|
|
422
|
+
range: [common_2.ManifestSection.generic]
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
return appSchema;
|
|
426
|
+
}
|
|
369
427
|
// Add header
|
|
370
|
-
addHeader(appSchema, entityType,
|
|
428
|
+
addHeader(appSchema, entityType, generateParameters.serviceAVT);
|
|
371
429
|
// Add sections
|
|
372
|
-
addSections(appSchema, entityType, entitySet.name,
|
|
430
|
+
addSections(generateParameters, appSchema, entityType, entitySet.name, pages);
|
|
373
431
|
// Custom section facets
|
|
374
|
-
addRelatedFacetKeysType(appSchema, entityType,
|
|
432
|
+
addRelatedFacetKeysType(appSchema, entityType, generateParameters.serviceAVT, generateParameters.logger);
|
|
375
433
|
// Remove Custom Column non existing extensions - TreeTableColumnsExtension does not exist in ALP
|
|
376
434
|
utils_1.removeElementsFromEnum(appSchema['definitions']['TableColumnExtensionTypeV2']['enum'], [
|
|
377
435
|
v2_1.TableColumnExtensionTypeV2.TreeTableColumnsExtension
|
|
@@ -391,28 +449,18 @@ function generateObjectPageSchemaV2(genericSchema, entityTypeName, oDataServiceA
|
|
|
391
449
|
delete appSchema['properties']['sections'];
|
|
392
450
|
}
|
|
393
451
|
}
|
|
394
|
-
|
|
395
|
-
if (!v2Page) {
|
|
396
|
-
v2_1.log(logger, {
|
|
397
|
-
severity: "error" /* Error */,
|
|
398
|
-
message: i18next_1.default.t('NOALP'),
|
|
399
|
-
location: {
|
|
400
|
-
path: v2_1.MANIFESTPATH,
|
|
401
|
-
range: [common_2.ManifestSection.generic]
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
return appSchema;
|
|
405
|
-
}
|
|
452
|
+
common_1.addFooterActions(appSchema, entityType, generateParameters.serviceAVT);
|
|
406
453
|
// Eliminate generic definitions
|
|
407
454
|
delete appSchema['definitions']['GenericSections'];
|
|
408
455
|
delete appSchema['definitions']['ObjectPageSectionTableV2'];
|
|
409
456
|
delete appSchema['definitions']['GenericColumns'];
|
|
410
|
-
delete appSchema['definitions']['
|
|
457
|
+
delete appSchema['definitions']['ObjectPageSectionFormV2'];
|
|
458
|
+
delete appSchema['definitions']['ObjectPageSectionTableV2'];
|
|
459
|
+
delete appSchema['definitions']['ObjectPageSubSectionV2'];
|
|
411
460
|
delete appSchema['definitions']['ObjectPageResponsiveTableWithMultiSelect'];
|
|
412
461
|
delete appSchema['definitions']['ObjectPageResponsiveTableWithInlineDelete'];
|
|
413
462
|
delete appSchema['definitions']['ObjectPageAnalyticalTable'];
|
|
414
463
|
delete appSchema['definitions']['ObjectPageTreeTable'];
|
|
415
|
-
delete appSchema['definitions']['ObjectPageSectionFormV2'];
|
|
416
464
|
delete appSchema['definitions']['ObjectPageGridTable'];
|
|
417
465
|
delete appSchema['definitions']['ObjectPageToolBar'];
|
|
418
466
|
delete appSchema['definitions']['ObjectPageToolBarActions'];
|