@sap/ux-specification 1.90.11 → 1.90.15

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