@sap/ux-specification 1.90.26 → 1.90.29

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 (129) hide show
  1. package/CHANGELOG.md +64 -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-ApplicationV4.html +1 -1
  8. package/dist/documentation/v4/v4-ListReport.html +1 -1
  9. package/dist/documentation/v4/v4-ObjectPage.html +1 -1
  10. package/dist/index-min.js +1 -1
  11. package/dist/schemas/v2/AnalyticalListPageConfig.json +10 -10
  12. package/dist/schemas/v2/ListReportConfig.json +15 -15
  13. package/dist/schemas/v2/ObjectPageConfig.json +204 -20
  14. package/dist/schemas/v4/ListReportConfig.json +3 -3
  15. package/dist/scripts/to-json-schema.js +1 -1
  16. package/dist/scripts/to-json-schema.js.map +1 -1
  17. package/dist/src/apiTypes.d.ts +3 -3
  18. package/dist/src/project.d.ts +1 -0
  19. package/dist/src/project.js +2 -2
  20. package/dist/src/project.js.map +1 -1
  21. package/dist/src/specification/schemaAccess.js +2 -2
  22. package/dist/src/specification/schemaAccess.js.map +1 -1
  23. package/dist/src/specification/v2/controls/Action.d.ts +6 -4
  24. package/dist/src/specification/v2/controls/Facets.d.ts +2 -1
  25. package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +3 -2
  26. package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +44 -9
  27. package/dist/src/specification/v2/controls/ObjectPageSection.js.map +1 -1
  28. package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +5 -3
  29. package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
  30. package/dist/src/specification/v2/controls/Table.d.ts +7 -4
  31. package/dist/src/specification/v2/controls/Table.js.map +1 -1
  32. package/dist/src/specification/v4/controls/Table.d.ts +2 -2
  33. package/dist/src/specification/v4/pages/ListReportConfig.d.ts +1 -1
  34. package/dist/src/sync/common/appProvider.d.ts +1 -1
  35. package/dist/src/sync/common/appProvider.js +1 -1
  36. package/dist/src/sync/common/decoration/control.d.ts +1 -1
  37. package/dist/src/sync/common/decoration/control.js +3 -3
  38. package/dist/src/sync/common/decoration/control.js.map +1 -1
  39. package/dist/src/sync/common/decoration/decorators.d.ts +2 -2
  40. package/dist/src/sync/common/decoration/decorators.js +8 -6
  41. package/dist/src/sync/common/decoration/decorators.js.map +1 -1
  42. package/dist/src/sync/common/flexUtils.js +1 -2
  43. package/dist/src/sync/common/flexUtils.js.map +1 -1
  44. package/dist/src/sync/common/generate/objectPage.d.ts +8 -9
  45. package/dist/src/sync/common/generate/objectPage.js +6 -6
  46. package/dist/src/sync/common/generate/objectPage.js.map +1 -1
  47. package/dist/src/sync/common/generate/utils.d.ts +28 -10
  48. package/dist/src/sync/common/generate/utils.js +39 -6
  49. package/dist/src/sync/common/generate/utils.js.map +1 -1
  50. package/dist/src/sync/common/import/utils.d.ts +9 -2
  51. package/dist/src/sync/common/import/utils.js +25 -6
  52. package/dist/src/sync/common/import/utils.js.map +1 -1
  53. package/dist/src/sync/common/importProject.d.ts +2 -3
  54. package/dist/src/sync/common/importProject.js +1 -1
  55. package/dist/src/sync/common/importProject.js.map +1 -1
  56. package/dist/src/sync/common/types.d.ts +9 -2
  57. package/dist/src/sync/common/types.js +5 -0
  58. package/dist/src/sync/common/types.js.map +1 -1
  59. package/dist/src/sync/common/utils.d.ts +19 -17
  60. package/dist/src/sync/common/utils.js +52 -46
  61. package/dist/src/sync/common/utils.js.map +1 -1
  62. package/dist/src/sync/v2/application.d.ts +3 -3
  63. package/dist/src/sync/v2/application.js +4 -4
  64. package/dist/src/sync/v2/application.js.map +1 -1
  65. package/dist/src/sync/v2/export/controls/Action.d.ts +12 -10
  66. package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
  67. package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js +6 -6
  68. package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js.map +1 -1
  69. package/dist/src/sync/v2/export/controls/FormAction.d.ts +9 -7
  70. package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
  71. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +3 -3
  72. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
  73. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +6 -4
  74. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
  75. package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +3 -2
  76. package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
  77. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +6 -4
  78. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
  79. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +26 -14
  80. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +57 -5
  81. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
  82. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +5 -3
  83. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
  84. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +6 -4
  85. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
  86. package/dist/src/sync/v2/export/controls/Table.d.ts +5 -3
  87. package/dist/src/sync/v2/export/controls/Table.js +1 -1
  88. package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
  89. package/dist/src/sync/v2/export/controls/TableColumn.d.ts +12 -10
  90. package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
  91. package/dist/src/sync/v2/export/exportPage.js +32 -32
  92. package/dist/src/sync/v2/export/exportPage.js.map +1 -1
  93. package/dist/src/sync/v2/generate/listReport.d.ts +3 -4
  94. package/dist/src/sync/v2/generate/listReport.js +1 -1
  95. package/dist/src/sync/v2/generate/listReport.js.map +1 -1
  96. package/dist/src/sync/v2/generate/objectPage.js +66 -53
  97. package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
  98. package/dist/src/sync/v2/generate/utils.d.ts +7 -6
  99. package/dist/src/sync/v2/generate/utils.js +5 -5
  100. package/dist/src/sync/v2/generate/utils.js.map +1 -1
  101. package/dist/src/sync/v2/import/pages/objectPage.js +64 -67
  102. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
  103. package/dist/src/sync/v2/types.d.ts +8 -3
  104. package/dist/src/sync/v2/types.js +6 -2
  105. package/dist/src/sync/v2/types.js.map +1 -1
  106. package/dist/src/sync/v4/export/controls/Table.d.ts +3 -1
  107. package/dist/src/sync/v4/export/controls/Table.js +12 -9
  108. package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
  109. package/dist/src/sync/v4/export/export.js +32 -26
  110. package/dist/src/sync/v4/export/export.js.map +1 -1
  111. package/dist/src/sync/v4/export/manifest.js +25 -6
  112. package/dist/src/sync/v4/export/manifest.js.map +1 -1
  113. package/dist/src/sync/v4/export/pages/ListReport.d.ts +1 -1
  114. package/dist/src/sync/v4/export/pages/ListReport.js +1 -1
  115. package/dist/src/sync/v4/generate/listReport.d.ts +2 -2
  116. package/dist/src/sync/v4/generate/listReport.js +220 -146
  117. package/dist/src/sync/v4/generate/listReport.js.map +1 -1
  118. package/dist/src/sync/v4/generate/objectPage.js +13 -29
  119. package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
  120. package/dist/src/sync/v4/import/pages/listReport.js +105 -60
  121. package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
  122. package/dist/src/sync/v4/import/utils.js +1 -1
  123. package/dist/src/sync/v4/import/utils.js.map +1 -1
  124. package/dist/src/sync/v4/types.d.ts +1 -1
  125. package/dist/src/sync/v4/utils/utils.d.ts +9 -8
  126. package/dist/src/sync/v4/utils/utils.js +7 -7
  127. package/dist/src/sync/v4/utils/utils.js.map +1 -1
  128. package/dist/test/test-utils/utils.d.ts +1 -2
  129. package/package.json +7 -7
@@ -10,8 +10,8 @@ const i18next_1 = __importDefault(require("i18next"));
10
10
  const extensionLogger_1 = require("../../../extensionLogger");
11
11
  const common_1 = require("../../common");
12
12
  /**
13
- * Adds the selection fields to the app schema, as properties of the Filterbar
14
- * @param entityType - the entity type as part of the AVT ConverterOutput
13
+ * Adds the selection fields to the app schema, as properties of the FilterBar
14
+ * @param entityType - the entity type as part of the AVT ConvertedMetadata
15
15
  * @param appSchema - the app specific schema that shall get enhanced
16
16
  * @param selectionFieldsAnnotation - the UI.SelectionField annotation
17
17
  */
@@ -39,17 +39,19 @@ function addSelectionFields(entityType, appSchema, selectionFieldsAnnotation) {
39
39
  i++;
40
40
  });
41
41
  }
42
+ /**
43
+ * Convert alias prefix of visualization if different from @UI (e.g. SAP__UI)
44
+ * @param visualization visualization of an (Selection)PresentationVariant
45
+ * @param alias - the given alias or namespace of the OData annotations
46
+ * @returns the converted visualization
47
+ */
42
48
  function convertVisualization(visualization, alias) {
43
- if (!visualization) {
44
- return;
45
- }
46
- if (visualization.startsWith(`@${common_1.UIVOCABULARY}`)) {
47
- visualization = visualization.replace(common_1.UIVOCABULARY, '@UI');
49
+ if (visualization && !visualization.startsWith(`@${alias}`)) {
50
+ return visualization.replace(visualization.split('.')[0], '@UI');
48
51
  }
49
- else if (!visualization.startsWith(`@${alias}`)) {
50
- visualization = visualization.replace(visualization.split('.')[0], '@UI');
52
+ else {
53
+ return visualization;
51
54
  }
52
- return visualization;
53
55
  }
54
56
  function defineActions(appSchema, schemaIdForActions, annotations, targetAnnotation, entityType) {
55
57
  appSchema.definitions[schemaIdForActions] = JSON.parse(JSON.stringify(appSchema.definitions['Actions']));
@@ -71,7 +73,7 @@ function defineActions(appSchema, schemaIdForActions, annotations, targetAnnotat
71
73
  action[v4_1.SchemaTag.propertyIndex] = i;
72
74
  action[v4_1.SchemaTag.annotationType] = actionRecord.$Type;
73
75
  action[v4_1.SchemaTag.annotationPath] = `/${actionRecord.fullyQualifiedName}`;
74
- //as ChartToolBarAction is an empty objec, copy ViewToolBarAction and remove properties
76
+ //as ChartToolBarAction is an empty object, copy ViewToolBarAction and remove properties
75
77
  appSchema.definitions[actionDefinition] = JSON.parse(JSON.stringify(appSchema.definitions[v4_1.DefinitionName.ViewToolBarAction]));
76
78
  appSchema.definitions[actionDefinition].properties = {};
77
79
  appSchema.definitions[actionDefinition][v4_1.SchemaTag.annotationPath] = actionRecord.fullyQualifiedName;
@@ -120,6 +122,22 @@ function findTheRightVisualization(allVisualizations, alias, namespace, viewKey,
120
122
  }
121
123
  return { visualization, targetAnnotation };
122
124
  }
125
+ /**
126
+ * An annotationPath must be analyzed, to find the right target annotation and visualization
127
+ *
128
+ */
129
+ function analyzeChartAnnotation(namespace, annotationPath, annotationAVT, viewKey) {
130
+ const visualization = '@UI.Chart';
131
+ const targetAnnotationFullName = `/${namespace}/@${annotationPath}`;
132
+ let chartTitle;
133
+ if (annotationAVT['Title']) {
134
+ chartTitle = annotationAVT['Title'];
135
+ }
136
+ else {
137
+ chartTitle = `Chart View (${viewKey})`;
138
+ }
139
+ return { visualization, targetAnnotation: targetAnnotationFullName, chartTitle };
140
+ }
123
141
  /**
124
142
  * An annotationPath must be analyzed, to find the right target annotation and visualization
125
143
  * @param annotationPath - given annotationPath
@@ -127,63 +145,76 @@ function findTheRightVisualization(allVisualizations, alias, namespace, viewKey,
127
145
  * @param viewKey - allows to distinguish the different view types (LR or ALP)
128
146
  * @param visualizationType - allows to find the right visualization if there are many.
129
147
  * @returns { visualization: string describing the visualization of the annotation,
130
- * targetAnnotation: the target annotation behind the visualization }
148
+ * targetAnnotation: the target annotation behind the visualization
149
+ * namespace: namespace of the annotation,
150
+ * title: title to be shown, derived from the annotation }
131
151
  */
132
152
  function analyzeViewAnnotation(annotationPath, uIAnnotations, generateParameters, viewKey, visualizationType) {
133
153
  let namespace = undefined;
154
+ let title = `View (${viewKey})`;
134
155
  const annotationInManifest = annotationPath === null || annotationPath === void 0 ? void 0 : annotationPath.split(`${common_1.UIVOCABULARY}.`)[1];
135
156
  const annotationAVT = annotationInManifest && uIAnnotations[annotationInManifest];
136
157
  if (!annotationAVT) {
137
- return { visualization: undefined, targetAnnotation: undefined, namespace };
158
+ return { visualization: undefined, targetAnnotation: undefined, namespace, title };
138
159
  }
139
160
  namespace = annotationAVT.fullyQualifiedName.split('@com.sap.vocabularies.UI.v1.')[0];
140
161
  const alias = common_1.findAlias(common_1.UIVOCABULARY, generateParameters.serviceAVT);
141
162
  if (annotationInManifest.startsWith('PresentationVariant')) {
142
163
  const { visualization, targetAnnotation } = findTheRightVisualization(annotationAVT.Visualizations, alias, namespace, viewKey, visualizationType);
143
- return { visualization, targetAnnotation, namespace };
164
+ if (annotationAVT.Text) {
165
+ title = annotationAVT.Text;
166
+ }
167
+ return { visualization, targetAnnotation, namespace, title };
144
168
  }
145
169
  else if (annotationInManifest.startsWith('SelectionPresentationVariant')) {
146
170
  const { visualization, targetAnnotation } = findTheRightVisualization(annotationAVT.PresentationVariant.Visualizations, alias, namespace, viewKey, visualizationType);
147
- return { visualization, targetAnnotation, namespace };
171
+ if (annotationAVT.Text) {
172
+ title = annotationAVT.Text;
173
+ }
174
+ return { visualization, targetAnnotation, namespace, title };
148
175
  }
149
176
  else if (annotationInManifest.startsWith('SelectionVariant')) {
150
177
  const visualization = '@UI.LineItem';
151
178
  const targetAnnotation = `/${namespace}/@com.sap.vocabularies.UI.v1.LineItem`;
152
- return { visualization, targetAnnotation, namespace };
179
+ title = annotationAVT.Text ? annotationAVT.Text : `Table View (${viewKey})`;
180
+ return { visualization, targetAnnotation, namespace, title };
153
181
  }
154
182
  else if (annotationInManifest.startsWith('LineItem')) {
155
183
  const visualization = '@UI.LineItem';
156
184
  const targetAnnotation = `/${namespace}/@${annotationPath}`;
157
- return { visualization, targetAnnotation, namespace };
185
+ title = annotationAVT.Text ? annotationAVT.Text : `Table View (${viewKey})`;
186
+ return { visualization, targetAnnotation, namespace, title };
158
187
  }
159
188
  else if (annotationInManifest.startsWith('Chart')) {
160
- const visualization = '@UI.Chart';
161
- const targetAnnotation = `/${namespace}/@${annotationPath}`;
162
- return { visualization, targetAnnotation, namespace };
189
+ const { visualization, targetAnnotation, chartTitle } = analyzeChartAnnotation(namespace, annotationPath, annotationAVT, viewKey);
190
+ return { visualization, targetAnnotation, namespace, title: chartTitle };
163
191
  }
164
- return { visualization: undefined, targetAnnotation: undefined, namespace };
192
+ return { visualization: undefined, targetAnnotation: undefined, namespace, title };
165
193
  }
166
194
  /**
167
195
  * Adds the ALP chart view to the app-specific schema
168
196
  * @param {Definition} appSchema - app-specific JSON schema
169
197
  * @param targetAnnotation - target annotation of the chart view, as determined by analyzeViewAnnotation
170
- * @param {Array<Object>} viewsPaths - views' paths' section in the manifest
171
198
  * @param annotations - UI annotations, as determined by AVT
172
199
  */
173
- function addALPChartView(appSchema, targetAnnotation, viewsPaths, annotations) {
200
+ function addALPChartView(appSchema, chartAnnotationPath, targetAnnotation, annotations) {
174
201
  const chartView = appSchema.definitions[v4_1.DefinitionName.ALPChartView];
175
202
  appSchema.definitions[v4_1.DefinitionName.ALPChart] = JSON.parse(JSON.stringify(chartView));
176
203
  delete appSchema.definitions[v4_1.DefinitionName.ALPChart][v4_1.SchemaTag.isViewNode];
177
- appSchema.definitions[v4_1.DefinitionName.ALPChart][v4_1.SchemaTag.annotationPath] = targetAnnotation;
204
+ if (targetAnnotation) {
205
+ appSchema.definitions[v4_1.DefinitionName.ALPChart][v4_1.SchemaTag.annotationPath] = targetAnnotation;
206
+ }
178
207
  appSchema.definitions[v4_1.DefinitionName.ALPChart].properties.annotationPath[v4_1.SchemaTag.hidden] = true;
179
- delete chartView.properties;
208
+ chartView.properties.annotationPath[v4_1.SchemaTag.hidden] = true;
180
209
  chartView.additionalProperties = false;
181
210
  chartView.description = `Chart (key: primary)`;
182
211
  chartView.title = `Chart`;
183
212
  chartView.$ref = `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.ALPChart}`;
184
- const viewAnnotation = viewsPaths[0]['primary'][0].annotationPath.split(v4_1.UIVOCABULARYDOT)[1];
185
- const pathParts = annotations[viewAnnotation].fullyQualifiedName.split('@');
186
- chartView[v4_1.SchemaTag.annotationPath] = `/${pathParts[0]}/@${pathParts[1]}`;
213
+ if (chartAnnotationPath) {
214
+ const viewAnnotation = chartAnnotationPath.split(v4_1.UIVOCABULARYDOT)[1];
215
+ const pathParts = annotations[viewAnnotation].fullyQualifiedName.split('@');
216
+ chartView[v4_1.SchemaTag.annotationPath] = `/${pathParts[0]}/@${pathParts[1]}`;
217
+ }
187
218
  chartView[v4_1.SchemaTag.artifactType] = common_1.ArtifactType.Manifest;
188
219
  chartView[v4_1.SchemaTag.key] = 'primary';
189
220
  }
@@ -195,14 +226,13 @@ function addALPChartView(appSchema, targetAnnotation, viewsPaths, annotations) {
195
226
  * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
196
227
  * @param templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
197
228
  */
198
- function addALPViews(appSchema, viewsPaths, entityType, generateParameters, templateAnnotation) {
229
+ function addALPViews(appSchema, viewsPaths, entityType, generateParameters, templateAnnotation, tableDefinitionName) {
199
230
  var _a, _b, _c, _d, _e, _f;
200
231
  const annotations = entityType.annotations.UI;
201
232
  //1. Chart View
202
- const { visualization, targetAnnotation } = analyzeViewAnnotation((_c = (_b = (_a = viewsPaths === null || viewsPaths === void 0 ? void 0 : viewsPaths[0]) === null || _a === void 0 ? void 0 : _a['primary']) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[v4_1.SchemaTag.annotationPath], annotations, generateParameters, 'primary');
203
- if (visualization && visualization.indexOf('Chart') > -1) {
204
- addALPChartView(appSchema, targetAnnotation, viewsPaths, annotations);
205
- }
233
+ const chartAnnotationPath = (_c = (_b = (_a = viewsPaths === null || viewsPaths === void 0 ? void 0 : viewsPaths[0]) === null || _a === void 0 ? void 0 : _a['primary']) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[v4_1.SchemaTag.annotationPath];
234
+ const { targetAnnotation } = analyzeViewAnnotation(chartAnnotationPath, annotations, generateParameters, 'primary');
235
+ addALPChartView(appSchema, chartAnnotationPath, targetAnnotation, annotations);
206
236
  // Copy toolbar
207
237
  const schemaIdForActions = `Actions<ALPChart>`;
208
238
  appSchema.definitions[v4_1.DefinitionName.ViewChartToolBar].properties.actions['$ref'] =
@@ -210,7 +240,6 @@ function addALPViews(appSchema, viewsPaths, entityType, generateParameters, temp
210
240
  defineActions(appSchema, schemaIdForActions, annotations, targetAnnotation, entityType);
211
241
  //2. Table View
212
242
  const { visualization: tableVisualization, targetAnnotation: target } = analyzeViewAnnotation((_f = (_e = (_d = viewsPaths === null || viewsPaths === void 0 ? void 0 : viewsPaths[0]) === null || _d === void 0 ? void 0 : _d['secondary']) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f[v4_1.SchemaTag.annotationPath], annotations, generateParameters, 'secondary');
213
- const tableDefinitionName = utils_1.alignSchemaWithTemplateType(appSchema, generateParameters);
214
243
  const tableDefinition = appSchema.definitions[tableDefinitionName];
215
244
  if (tableVisualization || templateAnnotation) {
216
245
  tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.ToolBarLR}`;
@@ -255,7 +284,7 @@ function addALPViews(appSchema, viewsPaths, entityType, generateParameters, temp
255
284
  }
256
285
  /**
257
286
  * Modifies the app schema, adds the right line chart settings
258
- * @param inputParameters - list of input paramaters as collected by the calling instance
287
+ * @param inputParameters - list of input parameters as collected by the calling instance
259
288
  * @param annotations - UI annotations of the given entityType
260
289
  * @returns the ID for the chart view in schema
261
290
  */
@@ -277,42 +306,62 @@ function addViewChartDefinitions(inputParameters, annotations) {
277
306
  inputParameters.appSchema.definitions[idForToolbar]['properties'][common_1.PropertyName.actions]['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${schemaIdForActions}`;
278
307
  return idForChart;
279
308
  }
309
+ /**
310
+ * Adds the definition of a chart view to the app schema
311
+ * @param inputParameters - list of input parameters as collected by the calling instance
312
+ * @param UIAnnotations - AVT UI annotations of the given entity type
313
+ * @param appSchema - app schema
314
+ * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
315
+ * @param viewKey - view key
316
+ * @param title - view title
317
+ */
318
+ function addViewChart(inputParameters, UIAnnotations, appSchema, viewsDefinition, viewKey, title) {
319
+ const idForChart = addViewChartDefinitions(inputParameters, UIAnnotations);
320
+ appSchema.definitions[idForChart].properties.annotationPath[v4_1.SchemaTag.hidden] = true;
321
+ appSchema.definitions[idForChart].properties.index[v4_1.SchemaTag.hidden] = true;
322
+ appSchema.definitions[idForChart].properties.entitySet[v4_1.SchemaTag.hidden] = true;
323
+ const titleOnHover = `Chart View (key: ${viewKey})`;
324
+ viewsDefinition.properties[viewKey] = {
325
+ $ref: `${common_1.DEFINITION_LINK_PREFIX}${idForChart}`,
326
+ description: title ? title : titleOnHover,
327
+ title: titleOnHover
328
+ };
329
+ }
280
330
  /**
281
331
  * Modifies the app schema, adds the right line item settings as derived from the visualization
282
- * @param inputParameters - list of input paramaters as collected by the calling instance
283
- * @param viewsDefinition - the views definitio in app schema (MultiTableModeV4)
332
+ * @param inputParameters - list of input parameters as collected by the calling instance
333
+ * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
284
334
  * @param visualization - visualization from the given (S)PV
285
335
  * @param templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
286
336
  * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
287
337
  */
288
338
  function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, generateParameters) {
289
- const idForTable = `${v4_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
290
- inputParameters.appSchema.definitions[idForTable] = JSON.parse(JSON.stringify(inputParameters.appSchema.definitions[v4_1.DefinitionName.LRTableView]));
291
- delete inputParameters.appSchema.definitions[idForTable][v4_1.SchemaTag.isViewNode];
292
- inputParameters.appSchema.definitions[idForTable][v4_1.SchemaTag.annotationPath] = inputParameters.targetAnnotation;
339
+ const tableId = `${v4_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
340
+ const viewId = `${v4_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`;
341
+ const lrTableView = common_1.parseSchemaDefinition(v4_1.DefinitionName.LRTableView, inputParameters.viewKey, inputParameters.appSchema);
342
+ delete lrTableView[v4_1.SchemaTag.isViewNode];
343
+ lrTableView[v4_1.SchemaTag.annotationPath] = inputParameters.targetAnnotation;
293
344
  if (inputParameters.navPropName) {
294
- inputParameters.appSchema.definitions[idForTable]['navigationProperty'] = inputParameters.navPropName;
345
+ lrTableView['navigationProperty'] = inputParameters.navPropName;
295
346
  }
296
347
  //Copy toolbar
297
- inputParameters.appSchema.definitions[idForTable]['properties'].toolBar.$ref = `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.ToolBar}<${v4_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}>`;
348
+ common_1.addDefinitionRef(lrTableView.properties.toolBar, v4_1.DefinitionName.ToolBar, viewId);
349
+ const title = `Table View (key: ${inputParameters.viewKey})`;
298
350
  viewsDefinition.properties[inputParameters.viewKey] = {
299
- $ref: `${common_1.DEFINITION_LINK_PREFIX}${idForTable}`,
300
- description: `Table View (key: ${inputParameters.viewKey})`,
301
- title: `Table View (${inputParameters.viewKey})`
302
- };
303
- inputParameters.appSchema.definitions[idForTable].properties.columns = {
304
- $ref: `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`
351
+ $ref: `${common_1.DEFINITION_LINK_PREFIX}${tableId}`,
352
+ description: inputParameters.title || title,
353
+ title
305
354
  };
306
- inputParameters.appSchema.definitions[idForTable].properties.annotationPath[v4_1.SchemaTag.hidden] =
307
- true;
308
- inputParameters.appSchema.definitions[idForTable].properties.index[v4_1.SchemaTag.hidden] = true;
309
- inputParameters.appSchema.definitions[idForTable].properties.entitySet[v4_1.SchemaTag.hidden] = true;
310
- const annotationTerm = visualization ? visualization.split('.')[1] : templateAnnotation.split(v4_1.UIVOCABULARYDOT)[1];
311
- utils_1.addLineItemsType(inputParameters.appSchema, inputParameters.targetEntityType.annotations.UI[annotationTerm], inputParameters.targetEntityType, generateParameters.serviceAVT, `${v4_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`, v4_1.DefinitionName.ViewTableColumn);
355
+ common_1.addDefinitionRef(lrTableView.properties.columns, viewId);
356
+ lrTableView.properties.annotationPath[v4_1.SchemaTag.hidden] = true;
357
+ lrTableView.properties.index[v4_1.SchemaTag.hidden] = true;
358
+ lrTableView.properties.entitySet[v4_1.SchemaTag.hidden] = true;
359
+ const annotationTerm = (visualization === null || visualization === void 0 ? void 0 : visualization.split('.')[1]) || templateAnnotation.split(v4_1.UIVOCABULARYDOT)[1];
360
+ utils_1.addLineItemsType(inputParameters.appSchema, inputParameters.targetEntityType.annotations.UI[annotationTerm], inputParameters.targetEntityType, generateParameters.serviceAVT, viewId, v4_1.DefinitionName.ViewTableColumn);
312
361
  }
313
362
  /**
314
363
  * Adds the schema tags to a given view
315
- * @param viewsDefinition - the views definitio in app schema (MultiTableModeV4)
364
+ * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
316
365
  * @param viewKey - key property of the view
317
366
  * @param namespace - target namespace for annotations
318
367
  * @param view - the given view
@@ -344,6 +393,35 @@ function getTargetEntityType(entitySet, view, generateParameters, entityType) {
344
393
  }
345
394
  return targetEntityType;
346
395
  }
396
+ /**
397
+ * Adds definition parts to a LR View (LineItem/Chart)
398
+ * @param {string} templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
399
+ * @param {string} visualization - visualization of the annotation
400
+ * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
401
+ * @param {object} commonInputParameters - list of input parameters as collected by the calling instance
402
+ * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
403
+ * @param {SapUiAppPageV4} v4Page - the given page in manifest
404
+ * @param uiAnnotations - UI annotations of the given entityType
405
+ */
406
+ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, uiAnnotations) {
407
+ if ((visualization === null || visualization === void 0 ? void 0 : visualization.indexOf(v4_1.Visualization.LineItem)) > -1) {
408
+ //Add Line item view
409
+ addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, generateParameters);
410
+ }
411
+ else if ((visualization === null || visualization === void 0 ? void 0 : visualization.indexOf('Chart')) > -1) {
412
+ //Add Chart view
413
+ addViewChart(commonInputParameters, uiAnnotations, commonInputParameters.appSchema, viewsDefinition, commonInputParameters.viewKey, commonInputParameters.title);
414
+ }
415
+ else {
416
+ const titleOnHover = `View (key: ${commonInputParameters.viewKey})`;
417
+ viewsDefinition.properties[commonInputParameters.viewKey] = {
418
+ description: commonInputParameters.title || titleOnHover,
419
+ title: titleOnHover,
420
+ // Default view - use table view reference as default
421
+ $ref: `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.LRTableView}`
422
+ };
423
+ }
424
+ }
347
425
  /**
348
426
  * Add list report views to the app-specific schema
349
427
  * @param {Definition} appSchema - app-specific JSON schema
@@ -351,13 +429,17 @@ function getTargetEntityType(entitySet, view, generateParameters, entityType) {
351
429
  * @param {EntityType} entityType - actual entity type of the page's entitySet
352
430
  * @param {EntitySet} entitySet - actual entity set (AVT information)
353
431
  * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
354
- * @param templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
432
+ * @param {string} templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
433
+ * @param {SapUiAppPageV4} v4Page - the given page in manifest
355
434
  */
356
- function addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParameters, templateAnnotation) {
435
+ function addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParameters, v4Page, tableDefinitionName) {
357
436
  var _a;
358
437
  if (!viewsPaths) {
359
438
  return;
360
439
  }
440
+ const tableDefinition = appSchema.definitions[tableDefinitionName];
441
+ delete tableDefinition.properties.toolBar;
442
+ delete tableDefinition.properties.columns;
361
443
  const viewsDefinition = appSchema.definitions.MultiTableModeV4;
362
444
  for (const view of viewsPaths) {
363
445
  if (!view[v4_1.SchemaTag.key]) {
@@ -365,8 +447,8 @@ function addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParame
365
447
  }
366
448
  let navPropName = undefined;
367
449
  const targetEntityType = getTargetEntityType(entitySet, view, generateParameters, entityType);
368
- const annotations = targetEntityType.annotations.UI;
369
- const { visualization, targetAnnotation, namespace } = analyzeViewAnnotation(view === null || view === void 0 ? void 0 : view[v4_1.SchemaTag.annotationPath], annotations, generateParameters, view[v4_1.SchemaTag.key]);
450
+ const uiAnnotations = targetEntityType.annotations.UI;
451
+ const { visualization, targetAnnotation, namespace, title } = analyzeViewAnnotation(view === null || view === void 0 ? void 0 : view[v4_1.SchemaTag.annotationPath], uiAnnotations, generateParameters, view[v4_1.SchemaTag.key]);
370
452
  if (view['entitySet']) {
371
453
  navPropName = (_a = entityType.navigationProperties.find((np) => {
372
454
  return np.targetTypeName === namespace;
@@ -374,106 +456,103 @@ function addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParame
374
456
  }
375
457
  const viewKey = common_1.prepareRef(view[v4_1.SchemaTag.key]);
376
458
  const commonInputParameters = {
377
- viewKey: viewKey,
378
- appSchema: appSchema,
379
- targetAnnotation: targetAnnotation,
380
- navPropName: navPropName,
381
- targetEntityType: targetEntityType
459
+ viewKey,
460
+ appSchema,
461
+ targetAnnotation,
462
+ navPropName,
463
+ targetEntityType,
464
+ title
382
465
  };
383
- //Add Line item view
384
- if (templateAnnotation || (visualization && visualization.indexOf(v4_1.Visualization.LineItem) > -1)) {
385
- //Copy table
386
- addViewLineItems(commonInputParameters, viewsDefinition, visualization, templateAnnotation, generateParameters);
387
- }
388
- else if (visualization && visualization.indexOf('Chart') > -1) {
389
- //Add Chart view
390
- const idForChart = addViewChartDefinitions(commonInputParameters, annotations);
391
- appSchema.definitions[idForChart].properties.annotationPath[v4_1.SchemaTag.hidden] = true;
392
- appSchema.definitions[idForChart].properties.index[v4_1.SchemaTag.hidden] = true;
393
- appSchema.definitions[idForChart].properties.entitySet[v4_1.SchemaTag.hidden] = true;
394
- viewsDefinition.properties[viewKey] = {
395
- $ref: `${common_1.DEFINITION_LINK_PREFIX}${idForChart}`,
396
- description: `Chart View (key: ${viewKey})`,
397
- title: `Chart View (${viewKey})`
398
- };
399
- }
400
- else {
401
- viewsDefinition.properties[viewKey] = {
402
- description: `View (key: ${viewKey})`,
403
- title: `View (${viewKey})`,
404
- properties: {},
405
- additionalProperties: false
406
- };
407
- }
466
+ addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, uiAnnotations);
408
467
  addTagsToView(viewsDefinition, viewKey, namespace, view);
409
468
  }
410
469
  }
411
- /**
412
- * Add views to schema (LR or ALP)
413
- * @param {Definition} appSchema - app-specific JSON schema
414
- * @param {SapUiAppPageV4} v4Page - actual page in the manifest
415
- * @param {EntityType} entityType - actual entity type (AVT information)
416
- * @param {EntitySet} entitySet - actual entity set (AVT information)
417
- * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
418
- */
419
- function addViews(appSchema, v4Page, entityType, entitySet, generateParameters) {
420
- var _a, _b, _c, _d, _e;
421
- const viewsPaths = (_c = (_b = (_a = v4Page.options) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.views) === null || _c === void 0 ? void 0 : _c.paths;
422
- const templateAnnotation = (_e = (_d = v4Page.options) === null || _d === void 0 ? void 0 : _d.settings) === null || _e === void 0 ? void 0 : _e.defaultTemplateAnnotationPath;
423
- if (generateParameters.templateType === common_1.TemplateType.ListReportObjectPageV4) {
424
- addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParameters, templateAnnotation);
425
- appSchema.properties[common_1.PropertyName.chart][v4_1.SchemaTag.hidden] = true;
426
- }
427
- else if (generateParameters.templateType === common_1.TemplateType.AnalyticalListPageV4) {
428
- addALPViews(appSchema, viewsPaths, entityType, generateParameters, templateAnnotation);
429
- }
430
- }
431
470
  /**
432
471
  * Adapts the table definition in schema.
433
- * If defaultTemplateAnnotationPath is present, evaluates the SelectionPresentationVariant.
472
+ * Evaluates the path depending on if defaultTemplateAnnotationPath or Selection-/PresentationVariant is present.
434
473
  * @param {SapUiAppPageV4} v4Page - the given page in manifest
435
474
  * @param {EntityType} entityType - the current entity type, as defined in AVT
436
475
  * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
437
476
  * @param appSchema - the app-specific JSON schema
438
477
  * @param alias - alias definition for the UI vocabulary
439
478
  */
440
- function adaptTableDefinition(v4Page, entityType, generateParameters, appSchema, alias) {
441
- var _a, _b, _c, _d;
479
+ function adaptTableDefinition(appSchema, entityType, generateParameters, templateAnnotation, v4Page, alias, tableDefinitionName) {
480
+ var _a, _b;
442
481
  //here: tableDefinitionName = DefinitionName.Table
443
- const tableDefinitionName = utils_1.alignSchemaWithTemplateType(appSchema, generateParameters);
444
- const templateAnnotation = (_b = (_a = v4Page.options) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.defaultTemplateAnnotationPath;
445
- if (templateAnnotation) {
446
- const { visualization, targetAnnotation, namespace } = analyzeViewAnnotation(templateAnnotation, entityType.annotations.UI, generateParameters, undefined, v4_1.Visualization.LineItem);
447
- if (visualization) {
448
- const annotationTerm = visualization.split('.')[1];
449
- const annotationTermInSchema = `${v4_1.DefinitionName.LineItems}OfSPV::${common_1.prepareRef(annotationTerm)}`;
450
- appSchema.definitions[`${tableDefinitionName}SPV`] = JSON.parse(JSON.stringify(appSchema.definitions[tableDefinitionName]));
451
- delete appSchema.definitions[`${tableDefinitionName}SPV`][v4_1.SchemaTag.isViewNode];
452
- appSchema.definitions[`${tableDefinitionName}SPV`].properties['toolBar']['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.ToolBar}<${annotationTermInSchema}>`;
453
- appSchema.definitions[tableDefinitionName]['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${tableDefinitionName}SPV`;
454
- delete appSchema.definitions[`${tableDefinitionName}`].properties;
455
- appSchema.definitions[`${tableDefinitionName}`][v4_1.SchemaTag.annotationPath] = `/${namespace}/@${templateAnnotation}`;
456
- // Switch from generic column to specific definition
457
- appSchema.definitions[`${tableDefinitionName}SPV`].properties['columns'] = {
458
- $ref: `${common_1.DEFINITION_LINK_PREFIX}${annotationTermInSchema}`
459
- };
460
- appSchema.definitions[`${tableDefinitionName}SPV`][v4_1.SchemaTag.annotationPath] = targetAnnotation;
461
- const lineItemAnnotation = entityType.annotations.UI[annotationTerm];
462
- utils_1.addLineItemsType(appSchema, lineItemAnnotation, entityType, generateParameters.serviceAVT, annotationTermInSchema);
463
- }
482
+ const tableDefinition = appSchema.definitions[tableDefinitionName];
483
+ const { visualization, targetAnnotation, namespace } = analyzeViewAnnotation(templateAnnotation, entityType.annotations.UI, generateParameters, undefined, v4_1.Visualization.LineItem);
484
+ if (visualization) {
485
+ const annotationTerm = visualization.split('.')[1];
486
+ const annotationTermInSchema = `${v4_1.DefinitionName.LineItems}OfSPV::${common_1.prepareRef(annotationTerm)}`;
487
+ const spvTable = (appSchema.definitions[`${tableDefinitionName}SPV`] = JSON.parse(JSON.stringify(appSchema.definitions[tableDefinitionName])));
488
+ delete spvTable[v4_1.SchemaTag.isViewNode];
489
+ common_1.addDefinitionRef(spvTable.properties.toolBar, v4_1.DefinitionName.ToolBar, annotationTermInSchema);
490
+ // Switch from generic column to specific definition
491
+ spvTable[v4_1.SchemaTag.annotationPath] = targetAnnotation;
492
+ spvTable.properties.columns = {};
493
+ common_1.addDefinitionRef(spvTable.properties.columns, annotationTermInSchema);
494
+ delete tableDefinition.properties;
495
+ common_1.addDefinitionRef(tableDefinition, `${tableDefinitionName}SPV`);
496
+ tableDefinition[v4_1.SchemaTag.annotationPath] = `/${namespace}/@${templateAnnotation}`;
497
+ const lineItemAnnotation = entityType.annotations.UI[annotationTerm];
498
+ utils_1.addLineItemsType(appSchema, lineItemAnnotation, entityType, generateParameters.serviceAVT, annotationTermInSchema);
464
499
  }
465
500
  else {
466
- const tableDefinition = appSchema.definitions[tableDefinitionName];
467
501
  tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${v4_1.DefinitionName.ToolBarLR}`;
468
502
  // Switch from generic column to specific definition
469
- tableDefinition.properties['columns'] = {
470
- $ref: common_1.DEFINITION_LINK_PREFIX + v4_1.DefinitionName.LineItems
471
- };
472
- utils_1.addLineItemsType(appSchema, (_d = (_c = entityType === null || entityType === void 0 ? void 0 : entityType.annotations) === null || _c === void 0 ? void 0 : _c[alias]) === null || _d === void 0 ? void 0 : _d.LineItem, entityType, generateParameters.serviceAVT, v4_1.DefinitionName.LineItems);
503
+ common_1.addDefinitionRef(tableDefinition.properties.columns, v4_1.DefinitionName.LineItems);
504
+ utils_1.addLineItemsType(appSchema, (_b = (_a = entityType === null || entityType === void 0 ? void 0 : entityType.annotations) === null || _a === void 0 ? void 0 : _a[alias]) === null || _b === void 0 ? void 0 : _b.LineItem, entityType, generateParameters.serviceAVT, v4_1.DefinitionName.LineItems);
505
+ // Copy annotation path from columns definition
506
+ tableDefinition[v4_1.SchemaTag.annotationPath] =
507
+ appSchema.definitions[v4_1.DefinitionName.LineItems][v4_1.SchemaTag.annotationPath];
473
508
  }
474
509
  }
475
510
  /**
476
- * Generates an app specific schema for the FE V4 Listreport from the generic schema.
511
+ * Checks for the default annotation path to use for LR table
512
+ * @param {SapUiAppPageV4} v4Page - actual page in the manifest
513
+ * @param {EntityType} entityType - actual entity type (AVT information)
514
+ * @returns {string} annotation term
515
+ */
516
+ function getDefaultAnnotationPath(v4Page, entityType, templateType) {
517
+ var _a, _b, _c, _d, _e, _f, _g;
518
+ if (((_b = (_a = v4Page.options.settings) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.paths) && templateType === common_1.TemplateType.ListReportObjectPageV4) {
519
+ return;
520
+ }
521
+ if ((_c = v4Page.options.settings) === null || _c === void 0 ? void 0 : _c.defaultTemplateAnnotationPath) {
522
+ return v4Page.options.settings.defaultTemplateAnnotationPath;
523
+ }
524
+ if (templateType === common_1.TemplateType.ListReportObjectPageV4) {
525
+ return (((_e = (_d = entityType.annotations.UI) === null || _d === void 0 ? void 0 : _d.SelectionPresentationVariant) === null || _e === void 0 ? void 0 : _e.term) || ((_g = (_f = entityType.annotations.UI) === null || _f === void 0 ? void 0 : _f.PresentationVariant) === null || _g === void 0 ? void 0 : _g.term));
526
+ }
527
+ }
528
+ /**
529
+ * Add views to schema (LR or ALP)
530
+ * @param {Definition} appSchema - app-specific JSON schema
531
+ * @param {SapUiAppPageV4} v4Page - actual page in the manifest
532
+ * @param {EntityType} entityType - actual entity type (AVT information)
533
+ * @param {EntitySet} entitySet - actual entity set (AVT information)
534
+ * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
535
+ */
536
+ function addTableAndViews(appSchema, v4Page, entityType, entitySet, generateParameters, alias) {
537
+ var _a, _b, _c;
538
+ const viewsPaths = (_c = (_b = (_a = v4Page.options) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.views) === null || _c === void 0 ? void 0 : _c.paths;
539
+ const defaultAnnotation = getDefaultAnnotationPath(v4Page, entityType, generateParameters.templateType);
540
+ const tableDefinitionName = utils_1.alignSchemaWithTemplateType(appSchema, generateParameters);
541
+ if (generateParameters.templateType === common_1.TemplateType.ListReportObjectPageV4) {
542
+ if (viewsPaths) {
543
+ addLRViews(appSchema, viewsPaths, entityType, entitySet, generateParameters, v4Page, tableDefinitionName);
544
+ }
545
+ else {
546
+ adaptTableDefinition(appSchema, entityType, generateParameters, defaultAnnotation, v4Page, alias, tableDefinitionName);
547
+ }
548
+ appSchema.properties[common_1.PropertyName.chart][v4_1.SchemaTag.hidden] = true;
549
+ }
550
+ else if (generateParameters.templateType === common_1.TemplateType.AnalyticalListPageV4) {
551
+ addALPViews(appSchema, viewsPaths, entityType, generateParameters, defaultAnnotation, tableDefinitionName);
552
+ }
553
+ }
554
+ /**
555
+ * Generates an app specific schema for the FE V4 ListReport from the generic schema.
477
556
  * Generic types are replaced by information from the app specific annotations.
478
557
  * @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
479
558
  * @param genericSchema - generic JSON schema of an object page
@@ -511,12 +590,7 @@ function generateListReportSchemaV4(generateParameters, genericSchema, entitySet
511
590
  if (!v4Page) {
512
591
  return appSchema;
513
592
  }
514
- if (generateParameters.templateType === common_1.TemplateType.ListReportObjectPageV4) {
515
- //LR table definition
516
- adaptTableDefinition(v4Page, entityType, generateParameters, appSchema, alias);
517
- }
518
- // Handle LR & ALP views
519
- addViews(appSchema, v4Page, entityType, entitySet, generateParameters);
593
+ addTableAndViews(appSchema, v4Page, entityType, entitySet, generateParameters, alias);
520
594
  }
521
595
  delete appSchema.definitions.GenericColumns;
522
596
  delete appSchema.definitions.Action;