@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.
Files changed (139) hide show
  1. package/CHANGELOG.md +38 -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 +86 -11
  13. package/dist/schemas/v2/ListReportConfig.json +86 -11
  14. package/dist/schemas/v2/ObjectPageConfig.json +265 -53
  15. package/dist/schemas/v2/OverviewPageConfig.json +0 -28
  16. package/dist/schemas/v4/ObjectPageConfig.json +22 -0
  17. package/dist/specification/v2/index-min.js +1 -1
  18. package/dist/src/apiTypes.d.ts +8 -0
  19. package/dist/src/specification/v2/controls/Card.d.ts +0 -8
  20. package/dist/src/specification/v2/controls/Card.js.map +1 -1
  21. package/dist/src/specification/v2/controls/{DataField.d.ts → Field.d.ts} +2 -2
  22. package/dist/src/specification/v2/controls/{DataField.js → Field.js} +1 -1
  23. package/dist/src/specification/v2/controls/Field.js.map +1 -0
  24. package/dist/src/specification/v2/controls/FormAction.d.ts +43 -0
  25. package/dist/src/specification/v2/controls/FormAction.js +20 -0
  26. package/dist/src/specification/v2/controls/FormAction.js.map +1 -0
  27. package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +11 -0
  28. package/dist/src/specification/v2/controls/ObjectPageFooter.js +3 -0
  29. package/dist/src/specification/v2/controls/ObjectPageFooter.js.map +1 -0
  30. package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +4 -5
  31. package/dist/src/specification/v2/controls/ObjectPageHeaderAction.d.ts +20 -0
  32. package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +25 -15
  33. package/dist/src/specification/v2/controls/ObjectPageSection.js.map +1 -1
  34. package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +8 -4
  35. package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
  36. package/dist/src/specification/v2/controls/Table.d.ts +4 -3
  37. package/dist/src/specification/v2/controls/ToolBar.d.ts +2 -6
  38. package/dist/src/specification/v2/controls/index.d.ts +4 -1
  39. package/dist/src/specification/v2/controls/index.js +1 -0
  40. package/dist/src/specification/v2/controls/index.js.map +1 -1
  41. package/dist/src/specification/v2/pages/ObjectPageConfig.d.ts +2 -1
  42. package/dist/src/specification/v4/controls/ObjectPageFooter.d.ts +11 -0
  43. package/dist/src/specification/v4/controls/ObjectPageFooter.js +3 -0
  44. package/dist/src/specification/v4/controls/ObjectPageFooter.js.map +1 -0
  45. package/dist/src/specification/v4/controls/index.d.ts +1 -0
  46. package/dist/src/specification/v4/pages/ObjectPageConfig.d.ts +2 -1
  47. package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +2 -1
  48. package/dist/src/specification/v4/webapp/manifest/sapUi5.js.map +1 -1
  49. package/dist/src/sync/common/decoration/control.js +34 -19
  50. package/dist/src/sync/common/decoration/control.js.map +1 -1
  51. package/dist/src/sync/common/generate/objectPage.d.ts +31 -2
  52. package/dist/src/sync/common/generate/objectPage.js +185 -20
  53. package/dist/src/sync/common/generate/objectPage.js.map +1 -1
  54. package/dist/src/sync/common/import/utils.d.ts +6 -0
  55. package/dist/src/sync/common/import/utils.js +21 -0
  56. package/dist/src/sync/common/import/utils.js.map +1 -1
  57. package/dist/src/sync/common/importProject.js +62 -60
  58. package/dist/src/sync/common/importProject.js.map +1 -1
  59. package/dist/src/sync/common/types.d.ts +5 -2
  60. package/dist/src/sync/common/types.js +4 -0
  61. package/dist/src/sync/common/types.js.map +1 -1
  62. package/dist/src/sync/common/utils.d.ts +4 -3
  63. package/dist/src/sync/common/utils.js +76 -81
  64. package/dist/src/sync/common/utils.js.map +1 -1
  65. package/dist/src/sync/v2/application.d.ts +1 -0
  66. package/dist/src/sync/v2/application.js +3 -0
  67. package/dist/src/sync/v2/application.js.map +1 -1
  68. package/dist/src/sync/v2/export/controls/Card.d.ts +0 -2
  69. package/dist/src/sync/v2/export/controls/Card.js +0 -14
  70. package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
  71. package/dist/src/sync/v2/export/controls/Field.d.ts +4 -0
  72. package/dist/src/sync/v2/export/controls/{DataField.js → Field.js} +6 -6
  73. package/dist/src/sync/v2/export/controls/Field.js.map +1 -0
  74. package/dist/src/sync/v2/export/controls/FilterBar.d.ts +1 -2
  75. package/dist/src/sync/v2/export/controls/FilterBar.js +2 -4
  76. package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
  77. package/dist/src/sync/v2/export/controls/FormAction.d.ts +15 -0
  78. package/dist/src/sync/v2/export/controls/FormAction.js +133 -0
  79. package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -0
  80. package/dist/src/sync/v2/export/controls/ObjectPageChart.d.ts +4 -1
  81. package/dist/src/sync/v2/export/controls/ObjectPageChart.js +13 -0
  82. package/dist/src/sync/v2/export/controls/ObjectPageChart.js.map +1 -1
  83. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +5 -1
  84. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +42 -3
  85. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
  86. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +32 -0
  87. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +144 -0
  88. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -0
  89. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +5 -4
  90. package/dist/src/sync/v2/export/controls/ObjectPageTable.js +16 -4
  91. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
  92. package/dist/src/sync/v2/export/controls/Table.d.ts +12 -4
  93. package/dist/src/sync/v2/export/controls/Table.js +84 -37
  94. package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
  95. package/dist/src/sync/v2/export/controls/index.d.ts +3 -1
  96. package/dist/src/sync/v2/export/controls/index.js +3 -1
  97. package/dist/src/sync/v2/export/controls/index.js.map +1 -1
  98. package/dist/src/sync/v2/export/export.js +125 -86
  99. package/dist/src/sync/v2/export/export.js.map +1 -1
  100. package/dist/src/sync/v2/generate/analyticalListReport.d.ts +3 -9
  101. package/dist/src/sync/v2/generate/analyticalListReport.js +12 -13
  102. package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  103. package/dist/src/sync/v2/generate/generate.js +28 -6
  104. package/dist/src/sync/v2/generate/generate.js.map +1 -1
  105. package/dist/src/sync/v2/generate/listReport.d.ts +3 -10
  106. package/dist/src/sync/v2/generate/listReport.js +7 -12
  107. package/dist/src/sync/v2/generate/listReport.js.map +1 -1
  108. package/dist/src/sync/v2/generate/objectPage.d.ts +3 -10
  109. package/dist/src/sync/v2/generate/objectPage.js +199 -151
  110. package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
  111. package/dist/src/sync/v2/generate/utils.d.ts +1 -2
  112. package/dist/src/sync/v2/generate/utils.js +5 -0
  113. package/dist/src/sync/v2/generate/utils.js.map +1 -1
  114. package/dist/src/sync/v2/import/pages/objectPage.js +162 -88
  115. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
  116. package/dist/src/sync/v2/types.d.ts +12 -0
  117. package/dist/src/sync/v2/types.js +11 -0
  118. package/dist/src/sync/v2/types.js.map +1 -1
  119. package/dist/src/sync/v4/application.js +10 -10
  120. package/dist/src/sync/v4/application.js.map +1 -1
  121. package/dist/src/sync/v4/export/export.js +156 -134
  122. package/dist/src/sync/v4/export/export.js.map +1 -1
  123. package/dist/src/sync/v4/export/manifest.js +96 -76
  124. package/dist/src/sync/v4/export/manifest.js.map +1 -1
  125. package/dist/src/sync/v4/generate/generate.js +10 -2
  126. package/dist/src/sync/v4/generate/generate.js.map +1 -1
  127. package/dist/src/sync/v4/generate/objectPage.d.ts +3 -6
  128. package/dist/src/sync/v4/generate/objectPage.js +87 -94
  129. package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
  130. package/dist/src/sync/v4/import/app/appProvider.js +108 -80
  131. package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
  132. package/dist/src/sync/v4/import/fragment.js +41 -46
  133. package/dist/src/sync/v4/import/fragment.js.map +1 -1
  134. package/dist/src/sync/v4/utils/utils.js +1 -1
  135. package/dist/src/sync/v4/utils/utils.js.map +1 -1
  136. package/package.json +4 -5
  137. package/dist/src/specification/v2/controls/DataField.js.map +0 -1
  138. package/dist/src/sync/v2/export/controls/DataField.d.ts +0 -4
  139. 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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- 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,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
- * 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
- appSchema['definitions']['ObjectPageHeader'].properties['actions'] = {
22
- $ref: `${common_1.DEFINITION_LINK_PREFIX}HeaderActions`
23
- };
24
- const headerActions = (appSchema['definitions']['HeaderActions'] = {
25
- type: 'object',
26
- properties: {},
27
- description: 'Actions',
28
- additionalProperties: false,
29
- isViewNode: true
30
- });
31
- const alias = common_1.findAlias(v2_1.UIVOCABULARY, oDataServiceAVT);
32
- const actionAnnotation = alias &&
33
- entityType.annotations &&
34
- entityType.annotations[alias] &&
35
- entityType.annotations[alias].Identification;
36
- if (actionAnnotation) {
37
- // Add action to configuration
38
- headerActions['annotationPath'] =
39
- '/' +
40
- actionAnnotation.fullyQualifiedName.replace('@com.sap.vocabularies.UI.v1.Identification', '/@com.sap.vocabularies.UI.v1.Identification');
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
- else {
56
- headerActions['annotationPath'] = `/${entityType.fullyQualifiedName}/@com.sap.vocabularies.UI.v1.Identification`;
43
+ if (controlType === undefined) {
44
+ return;
57
45
  }
58
- delete appSchema['definitions']['GenericActions'];
59
- delete appSchema['definitions']['HeaderAction'];
60
- delete appSchema['definitions']['ObjectPageHeader<GenericActions>'];
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, oDataServiceAVT, manifest, fragments) {
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 = 'ObjectPageSectionTableV2<' + facetId + '>';
124
- appSchema['definitions'][schemaIdForOpSection] = {
125
- type: 'object',
126
- properties: {
127
- table: {
128
- anyOf: [
129
- {
130
- $ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageResponsiveTableWithMultiSelect<${facetId}>`
131
- },
132
- {
133
- $ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageResponsiveTableWithInlineDelete<${facetId}>`
134
- },
135
- {
136
- $ref: `${common_1.DEFINITION_LINK_PREFIX}ObjectPageAnalyticalTable<${facetId}>`
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
- additionalProperties: false,
148
- annotationPath: facet.annotationPath
149
- };
150
- 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);
151
165
  // Find target entity
152
166
  const targetEntity = facet.entityType
153
- ? 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)
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, oDataServiceAVT, fragments);
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]['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);
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, manifest, oDataServiceAVT, fragments) {
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 schemaIdForSection = facetKey.replace('@com.sap.vocabularies.UI.v1.Facets', facet.base);
187
- sections['properties'][schemaIdForSection] = common_1.createSectionWithoutProperties(facet, facetKey);
188
- const collectionDefinition = `ObjectPageSectionV2<${schemaIdForSection}>`;
189
- sections['properties'][schemaIdForSection].properties = {
190
- subsections: {
191
- $ref: common_1.DEFINITION_LINK_PREFIX + collectionDefinition
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, appSchema['definitions'][collectionDefinition], appSchema, manifest, oDataServiceAVT, fragments);
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}ObjectPageSectionTableV2<${facetKey}>`
241
+ $ref: `${common_1.DEFINITION_LINK_PREFIX}${sectionType}<${facetKey}>`
205
242
  };
206
- handleLineItem(facetKey, appSchema, facet, facets, oDataServiceAVT, manifest, fragments);
243
+ handleLineItem(generateParameters, facetKey, appSchema, facet, facets, sectionType);
207
244
  //add fields for createWithParameterDialog
208
- common_1.addFieldsType(appSchema, facet.entityType);
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 chartSettings = appSchema['definitions']['GenericSections']['additionalProperties']['anyOf'].find((element) => element['$ref'] === `${common_1.DEFINITION_LINK_PREFIX}ObjectPageSectionChartV2`);
214
- sections['properties'][facetKey] = chartSettings;
215
- 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
+ }
216
264
  break;
217
265
  }
218
266
  case v2_1.FacetBase.Form:
219
267
  case v2_1.FacetBase.Identification: {
220
- const formDefinitionKey = `ObjectPageForm<${facetKey}>`;
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}${formDefinitionKey}`
271
+ $ref: `${common_1.DEFINITION_LINK_PREFIX}${definitionKey}`
223
272
  };
224
- 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
+ }
225
281
  if (facet === null || facet === void 0 ? void 0 : facet.ID) {
226
- appSchema['definitions'][formDefinitionKey]['title'] = common_1.FacetTitlePrefix + facet.ID;
282
+ appSchemaSection.title = common_1.FacetTitlePrefix + facet.ID;
227
283
  }
228
284
  if (facet === null || facet === void 0 ? void 0 : facet.Label) {
229
- appSchema['definitions'][formDefinitionKey]['description'] = facet.Label;
285
+ appSchemaSection.description = facet.Label;
230
286
  }
231
287
  let withActions = true;
232
- appSchema['definitions'][formDefinitionKey]['annotationPath'] = facet.annotationPath;
233
- appSchema['definitions'][formDefinitionKey]['isViewNode'] = true;
234
- if (!appSchema['definitions'][formDefinitionKey].description) {
288
+ appSchemaSection.annotationPath = facet.annotationPath;
289
+ appSchemaSection.isViewNode = true;
290
+ if (!appSchemaSection.description) {
235
291
  if (facet.base === v2_1.FacetBase.Form) {
236
- appSchema['definitions'][formDefinitionKey].description = 'Form';
292
+ appSchemaSection.description = 'Form';
237
293
  }
238
294
  else if (facet.base === 'Identification') {
239
- appSchema['definitions'][formDefinitionKey].description = 'Identification';
295
+ appSchemaSection.description = 'Identification';
240
296
  withActions = false;
241
297
  }
242
298
  }
243
- 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);
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, oDataServiceAVT, manifest, fragments, logger) {
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}/@com.sap.vocabularies.UI.v1.Facets`;
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, oDataServiceAVT, common_2.FioriElementsVersion.v2, logger);
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, manifest, oDataServiceAVT, fragments);
341
+ addSection(generateParameters, facets, facetKey, sections, appSchema);
287
342
  }
288
343
  }
289
344
  else {
290
- addSections(appSchema, entityType, entitySetName, element.pages, oDataServiceAVT, manifest, fragments);
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['properties']['header'] = {
307
- $ref: common_1.DEFINITION_LINK_PREFIX + 'ObjectPageHeader'
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, oDataServiceAVT, manifest, fragments, logger) {
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 = oDataServiceAVT.entitySets &&
357
- 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);
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, oDataServiceAVT);
428
+ addHeader(appSchema, entityType, generateParameters.serviceAVT);
371
429
  // Add sections
372
- addSections(appSchema, entityType, entitySet.name, manifest[common_2.ManifestSection.generic].pages, oDataServiceAVT, manifest, fragments, logger);
430
+ addSections(generateParameters, appSchema, entityType, entitySet.name, pages);
373
431
  // Custom section facets
374
- addRelatedFacetKeysType(appSchema, entityType, oDataServiceAVT, logger);
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
- const v2Page = import_1.findObjectPageV2(manifest[common_2.ManifestSection.generic].pages, entitySet.name, []);
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']['ObjectPageSubSections'];
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'];