@sap/ux-specification 1.142.0 → 1.142.1

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 (134) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
  3. package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
  4. package/dist/documentation/v2/v2-ListReport.html +2 -2
  5. package/dist/documentation/v2/v2-ListReportNew.html +2 -2
  6. package/dist/documentation/v2/v2-ObjectPage.html +2 -2
  7. package/dist/documentation/v2/v2-OverviewPage.html +2 -2
  8. package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
  9. package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
  10. package/dist/documentation/v4/v4-FreestylePage.html +2 -2
  11. package/dist/documentation/v4/v4-ListReport.html +2 -2
  12. package/dist/documentation/v4/v4-ObjectPage.html +2 -2
  13. package/dist/index-min.js +247 -247
  14. package/dist/index-min.js.map +4 -4
  15. package/dist/schemas/v2/ApplicationV2.json +28 -3
  16. package/dist/schemas/v2/ListReportNewConfig.json +45 -0
  17. package/dist/schemas/v2/ObjectPageConfig.json +11 -5
  18. package/dist/schemas/v4/ApplicationV4.json +18 -12
  19. package/dist/schemas/v4/ListReportConfig.json +56 -8
  20. package/dist/schemas/v4/ObjectPageConfig.json +36 -12
  21. package/dist/specification/package.json +16 -16
  22. package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
  23. package/dist/specification/scripts/schema/to-json-schema.js +23 -13
  24. package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
  25. package/dist/specification/src/sync/common/generate/utils.d.ts +8 -0
  26. package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
  27. package/dist/specification/src/sync/common/generate/utils.js +29 -16
  28. package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
  29. package/dist/specification/src/sync/common/i18n.json +5 -3
  30. package/dist/specification/src/sync/common/utils.d.ts +39 -0
  31. package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
  32. package/dist/specification/src/sync/common/utils.js +93 -2
  33. package/dist/specification/src/sync/common/utils.js.map +1 -1
  34. package/dist/specification/src/sync/v2/application.d.ts +1 -0
  35. package/dist/specification/src/sync/v2/application.d.ts.map +1 -1
  36. package/dist/specification/src/sync/v2/application.js +18 -0
  37. package/dist/specification/src/sync/v2/application.js.map +1 -1
  38. package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
  39. package/dist/specification/src/sync/v2/export/exportPage.d.ts.map +1 -1
  40. package/dist/specification/src/sync/v2/export/exportPage.js +15 -4
  41. package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
  42. package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
  43. package/dist/specification/src/sync/v2/export/exportPageGeneric.js +5 -2
  44. package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
  45. package/dist/specification/src/sync/v2/export/factory.d.ts +26 -0
  46. package/dist/specification/src/sync/v2/export/factory.d.ts.map +1 -1
  47. package/dist/specification/src/sync/v2/export/factory.js +3 -3
  48. package/dist/specification/src/sync/v2/export/factory.js.map +1 -1
  49. package/dist/specification/src/sync/v2/export/pages/ObjectPage.d.ts +1 -0
  50. package/dist/specification/src/sync/v2/export/pages/ObjectPage.d.ts.map +1 -1
  51. package/dist/specification/src/sync/v2/export/pages/ObjectPage.js +11 -0
  52. package/dist/specification/src/sync/v2/export/pages/ObjectPage.js.map +1 -1
  53. package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
  54. package/dist/specification/src/sync/v2/generate/listReport.js +46 -1
  55. package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
  56. package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
  57. package/dist/specification/src/sync/v2/generate/objectPage.js +63 -13
  58. package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
  59. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.d.ts +22 -0
  60. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.d.ts.map +1 -0
  61. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.js +124 -0
  62. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.js.map +1 -0
  63. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +1 -0
  64. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
  65. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +4 -0
  66. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
  67. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +1 -0
  68. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
  69. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +1 -0
  70. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js.map +1 -1
  71. package/dist/specification/src/sync/v2/import/pages/overviewPage.d.ts.map +1 -1
  72. package/dist/specification/src/sync/v2/import/pages/overviewPage.js +4 -0
  73. package/dist/specification/src/sync/v2/import/pages/overviewPage.js.map +1 -1
  74. package/dist/specification/src/sync/v2/utils.d.ts +17 -1
  75. package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
  76. package/dist/specification/src/sync/v2/utils.js +57 -0
  77. package/dist/specification/src/sync/v2/utils.js.map +1 -1
  78. package/dist/specification/src/sync/v4/export/controls/Header.d.ts +3 -2
  79. package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
  80. package/dist/specification/src/sync/v4/export/controls/Header.js +14 -2
  81. package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
  82. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +2 -1
  83. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
  84. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -2
  85. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
  86. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +4 -0
  87. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts.map +1 -1
  88. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.js +30 -0
  89. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
  90. package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts +7 -0
  91. package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
  92. package/dist/specification/src/sync/v4/export/controls/TableColumn.js +60 -0
  93. package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  94. package/dist/specification/src/sync/v4/export/pages/ListReport.d.ts.map +1 -1
  95. package/dist/specification/src/sync/v4/export/pages/ListReport.js +2 -1
  96. package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
  97. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +107 -0
  98. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +1 -0
  99. package/dist/specification/src/sync/v4/generate/ListReportUtils.js +392 -0
  100. package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +1 -0
  101. package/dist/specification/src/sync/v4/generate/listReport.d.ts +107 -2
  102. package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +1 -1
  103. package/dist/specification/src/sync/v4/generate/listReport.js +97 -105
  104. package/dist/specification/src/sync/v4/generate/listReport.js.map +1 -1
  105. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  106. package/dist/specification/src/sync/v4/generate/objectPage.js +6 -6
  107. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  108. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +2 -2
  109. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
  110. package/dist/specification/src/sync/v4/sync-rules/utils.js +2 -2
  111. package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -1
  112. package/dist/specification/src/sync/v4/utils/utils.d.ts +5 -27
  113. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  114. package/dist/specification/src/sync/v4/utils/utils.js +6 -53
  115. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  116. package/dist/types/src/common/webapp/manifest/Manifest.d.ts +1 -1
  117. package/dist/types/src/common/webapp/manifest/Manifest.d.ts.map +1 -1
  118. package/dist/types/src/v2/application.d.ts +18 -0
  119. package/dist/types/src/v2/application.d.ts.map +1 -1
  120. package/dist/types/src/v2/controls/ObjectPageHeaderSection.d.ts.map +1 -1
  121. package/dist/types/src/v2/controls/ObjectPageTable.d.ts +4 -4
  122. package/dist/types/src/v2/controls/ObjectPageTable.d.ts.map +1 -1
  123. package/dist/types/src/v2/controls/Table.d.ts.map +1 -1
  124. package/dist/types/src/v2/pages/ObjectPageConfigV2.d.ts +10 -1
  125. package/dist/types/src/v2/pages/ObjectPageConfigV2.d.ts.map +1 -1
  126. package/dist/types/src/v4/application.d.ts +6 -6
  127. package/dist/types/src/v4/controls/Action.d.ts +1 -0
  128. package/dist/types/src/v4/controls/Action.d.ts.map +1 -1
  129. package/dist/types/src/v4/controls/ObjectPageHeaderSection.d.ts.map +1 -1
  130. package/dist/types/src/v4/controls/ObjectPageSection.d.ts.map +1 -1
  131. package/dist/types/src/v4/webapp/manifest/ManifestSettings.d.ts +59 -0
  132. package/dist/types/src/v4/webapp/manifest/ManifestSettings.d.ts.map +1 -1
  133. package/dist/types/src/v4/webapp/manifest/ManifestSettings.js.map +1 -1
  134. package/package.json +16 -16
@@ -1,11 +1,12 @@
1
1
  import { type LineItemDataForSchema } from '../utils/utils';
2
- import { Visualization } from '@sap/ux-specification-types';
2
+ import { TemplateType, Visualization } from '@sap/ux-specification-types';
3
3
  import type { ExtensionLogger, v4, GenerateAppSchemaParameters } from '@sap/ux-specification-types';
4
4
  import type { AnnotationTerm, EntityType, ConvertedMetadata } from '@sap-ux/vocabularies-types';
5
5
  import type { SelectionFields } from '@sap-ux/vocabularies-types/vocabularies/UI';
6
+ import { type ManifestPathParams } from '../../common';
6
7
  import type { Definition } from 'typescript-json-schema';
8
+ import { Page } from '../sync-rules/Page';
7
9
  export interface SchemaAdjustmentParameters {
8
- generateParameters: GenerateAppSchemaParameters;
9
10
  appSchema: Definition;
10
11
  v4Page: v4.SapUiAppPageV4;
11
12
  tableDefinitionId: string;
@@ -25,6 +26,32 @@ export interface SchemaAdjustmentParameters {
25
26
  * @returns {Definition} - the updated selection fields definition
26
27
  */
27
28
  export declare function addSelectionFields(entityType: EntityType, appSchema: Definition, selectionFieldsAnnotation: AnnotationTerm<SelectionFields>, selectionFieldsDefinition?: Definition, qualifier?: string): Definition;
29
+ /**
30
+ * Returns visual filters (if defined) from manifest page.
31
+ *
32
+ * @param v4Page - actual page in the manifest
33
+ * @returns - The visual filters object if defined, otherwise undefined.
34
+ */
35
+ export declare function getVisualFilters(v4Page: v4.SapUiAppPageV4): {} | undefined;
36
+ /**
37
+ * Adds visual filters to the app schema, as properties of the FilterBar.
38
+ *
39
+ * @param {EntityType} entityType - the entity type as part of the AVT ConvertedMetadata
40
+ * @param {Definition} appSchema - the app specific schema that shall get enhanced
41
+ * @param visualFiltersManifest - the UI.SelectionFields under controlConfiguration
42
+ * @param selectionFields - The selection fields annotation to be processed
43
+ */
44
+ export declare function addVisualFilters(entityType: EntityType, appSchema: Definition, visualFiltersManifest: any, selectionFields: AnnotationTerm<SelectionFields>): void;
45
+ /**
46
+ * Method updates schema for custom filter fields:
47
+ * 1. Enables creation of custom filter fields.
48
+ * 2. Populates custom filter fields from manifest to schema.
49
+ *
50
+ * @param appSchema - the app specific schema that shall get enhanced
51
+ * @param selectionFieldsDefinition - schema of selection fields which should contain custom filter fields
52
+ * @param v4Page - actual page in the manifest
53
+ */
54
+ export declare function applyCustomFilterFields(appSchema: Definition, selectionFieldsDefinition: Definition, v4Page: v4.SapUiAppPageV4): void;
28
55
  /**
29
56
  * An annotationPath must be analyzed, to find the right target annotation and visualization.
30
57
  *
@@ -45,6 +72,84 @@ export declare function analyzeViewAnnotation(annotationPath: string, uIAnnotati
45
72
  namespace: string;
46
73
  title: string;
47
74
  };
75
+ /**
76
+ * Adds the ALP views to the app-specific schema.
77
+ *
78
+ * @param appSchema - app-specific JSON schema
79
+ * @param viewsPaths - views' paths' section in the manifest
80
+ * @param generateParameters - list of API input parameters
81
+ * @param templateAnnotation - defaultTemplateAnnotationPath as registered in manifest
82
+ * @param v4Page - actual page in the manifest
83
+ * @param tableDefinitionName - The name of the table definition in the schema
84
+ */
85
+ export declare function addALPViews(appSchema: Definition, viewsPaths: Array<object>, generateParameters: GenerateAppSchemaParameters, templateAnnotation: string, v4Page: v4.SapUiAppPageV4, tableDefinitionName: string): void;
86
+ export type ViewsParameters = {
87
+ viewKey: string;
88
+ appSchema: Definition;
89
+ targetAnnotation: string;
90
+ navPropName: string;
91
+ targetEntityType: EntityType;
92
+ title: string;
93
+ entitySet?: string;
94
+ };
95
+ /**
96
+ * Adjusts the schema for a table by making necessary changes such as populating creation fields,
97
+ * adjusting creation field definitions, and adding enum mappings for mass edit functionalities.
98
+ *
99
+ * @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - Object containing the parameters required for schema adjustments. Includes the generate parameters, application schema, table definition ID, and facet definition ID.
100
+ * @returns {void} This function does not return a value; it performs in-place adjustments to the schema provided through the input parameters.
101
+ */
102
+ export declare function applyLRTableSchemaAdjustments(schemaAdjustmentParameters: SchemaAdjustmentParameters): void;
103
+ /**
104
+ * Adds the schema tags to a given view.
105
+ *
106
+ * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
107
+ * @param viewKey - key property of the view
108
+ * @param namespace - target namespace for annotations
109
+ * @param view - the given view
110
+ */
111
+ export declare function addTagsToView(viewsDefinition: Definition, viewKey: string, namespace: string, view: object): void;
112
+ /**
113
+ * Adds definition parts to a LR View (LineItem/Chart).
114
+ *
115
+ * @param visualization - visualization of the annotation
116
+ * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
117
+ * @param commonInputParameters - list of input parameters as collected by the calling instance
118
+ * @param generateParameters - list of API input parameters
119
+ * @param generateParameters.serviceAVT - OData service AVT information
120
+ * @param generateParameters.entityType - entity type of the current page
121
+ * @param generateParameters.logger - extension logger
122
+ * @param page - the current page object
123
+ * @param uiAnnotations - UI annotations of the given entityType
124
+ * @param view - the given view
125
+ */
126
+ export declare function addLRViewParts(visualization: string, viewsDefinition: Definition, commonInputParameters: ViewsParameters, { serviceAVT, entityType, logger }: Partial<GenerateAppSchemaParameters>, page: Page, uiAnnotations: object, view: object): void;
127
+ /**
128
+ * Checks for the default annotation path to use for LR table.
129
+ *
130
+ * @param v4Page - actual page in the manifest
131
+ * @param entityType - actual entity type (AVT information)
132
+ * @param templateType - The type of template being used (e.g., ListReportObjectPageV4 or AnalyticalListPageV4)
133
+ * @returns annotation term
134
+ */
135
+ export declare function getDefaultAnnotationPath(v4Page: v4.SapUiAppPageV4, entityType: EntityType, templateType: TemplateType): string | undefined;
136
+ /**
137
+ * Adds header actions to schema (LR or ALP).
138
+ *
139
+ * @param appSchema - app-specific JSON schema
140
+ * @param v4Page - actual page in the manifest
141
+ * @param logger - Logger class for logging messages
142
+ */
143
+ export declare function addHeaderActions(appSchema: Definition, v4Page: v4.SapUiAppPageV4, logger: ExtensionLogger): void;
144
+ /**
145
+ * Adds 'manifestPath' to each property in a definition based on metadata sync rules.
146
+ *
147
+ * @param appSchema - Full schema.
148
+ * @param definitionName - The name of the definition/class whose properties are being processed.
149
+ * @param definition - The definition object containing property schemas.
150
+ * @param pathParams - Additional context required to compute manifest paths.
151
+ */
152
+ export declare function addManifestPathsToPropertiesLR(appSchema: Definition, definitionName: string | undefined, definition: Definition, pathParams: ManifestPathParams): void;
48
153
  /**
49
154
  * Generates an app specific schema for the FE V4 ListReport from the generic schema.
50
155
  * Generic types are replaced by information from the app specific annotations.
@@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D;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACtC,kBAAkB,EAAE,2BAA2B,EAC/C,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GACpB,MAAM,CAQR"}
@@ -4,7 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.addSelectionFields = addSelectionFields;
7
+ exports.getVisualFilters = getVisualFilters;
8
+ exports.addVisualFilters = addVisualFilters;
9
+ exports.applyCustomFilterFields = applyCustomFilterFields;
7
10
  exports.analyzeViewAnnotation = analyzeViewAnnotation;
11
+ exports.addALPViews = addALPViews;
12
+ exports.applyLRTableSchemaAdjustments = applyLRTableSchemaAdjustments;
13
+ exports.addTagsToView = addTagsToView;
14
+ exports.addLRViewParts = addLRViewParts;
15
+ exports.getDefaultAnnotationPath = getDefaultAnnotationPath;
16
+ exports.addHeaderActions = addHeaderActions;
17
+ exports.addManifestPathsToPropertiesLR = addManifestPathsToPropertiesLR;
8
18
  exports.generateListReportSchemaV4 = generateListReportSchemaV4;
9
19
  const utils_1 = require("../utils/utils");
10
20
  const utils_2 = require("../utils/utils");
@@ -12,6 +22,10 @@ const ux_specification_types_1 = require("@sap/ux-specification-types");
12
22
  const i18next_1 = __importDefault(require("i18next"));
13
23
  const extensionLogger_1 = require("../../../extensionLogger");
14
24
  const common_1 = require("../../common");
25
+ const AppSchema_1 = require("../sync-rules/AppSchema");
26
+ const App_1 = require("../sync-rules/App");
27
+ const Page_1 = require("../sync-rules/Page");
28
+ const ListReportUtils_1 = require("./ListReportUtils");
15
29
  const ROOT_PROPERTIES_ORDER = ['header', 'filterBar', 'chart', 'table'];
16
30
  const UILINEITEM = '@UI.LineItem';
17
31
  /**
@@ -484,7 +498,6 @@ function addALPViews(appSchema, viewsPaths, generateParameters, templateAnnotati
484
498
  appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTable][ux_specification_types_1.SchemaTag.annotationPath] = target;
485
499
  }
486
500
  const schemaAdjustmentParameters = {
487
- generateParameters,
488
501
  appSchema,
489
502
  v4Page,
490
503
  tableDefinitionId: ux_specification_types_1.DefinitionName.ALPTable,
@@ -589,10 +602,9 @@ function getLineItemRef(v4Page, entityType, viewKey, lineItemTerm, lineItemQuali
589
602
  * @returns {void} This function does not return any value.
590
603
  */
591
604
  function adjustCreationFieldsDefinition(schemaAdjustmentParameters) {
592
- const { appSchema, tableDefinitionId, facetDefinitionId, v4Page, generateParameters, viewKey } = schemaAdjustmentParameters;
605
+ const { entityType, appSchema, tableDefinitionId, facetDefinitionId, v4Page, viewKey } = schemaAdjustmentParameters;
593
606
  // when the table view is created, the entity type may differ from the one used for the table
594
607
  // schemaAdjustmentParameters contains the entity type used for the view
595
- const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
596
608
  const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term);
597
609
  // set specific implementation for creation fields in the LR table
598
610
  const creationModeDefinitionKey = (0, common_1.getFacetDefinitionKey)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionId);
@@ -625,10 +637,9 @@ function adjustCreationFieldsDefinition(schemaAdjustmentParameters) {
625
637
  * @returns {void} This function does not return any value.
626
638
  */
627
639
  function adjustAnalyticalConfiguration(schemaAdjustmentParameters) {
628
- const { appSchema, tableDefinitionId, facetDefinitionId, v4Page, generateParameters, viewKey, dataForLineItem } = schemaAdjustmentParameters;
640
+ const { entityType, appSchema, tableDefinitionId, facetDefinitionId, v4Page, viewKey, dataForLineItem } = schemaAdjustmentParameters;
629
641
  // when the table view is created, the entity type may differ from the one used for the table
630
642
  // schemaAdjustmentParameters contains the entity type used for the view
631
- const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
632
643
  const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term, dataForLineItem.lineItemAnnotation?.qualifier);
633
644
  // set specific implementation for analytical configuration in the LR table
634
645
  const tableDefinition = appSchema.definitions[tableDefinitionId];
@@ -657,10 +668,9 @@ function adjustAnalyticalConfiguration(schemaAdjustmentParameters) {
657
668
  * @returns {void} This function does not return any value.
658
669
  */
659
670
  function adjustPopinLayout(schemaAdjustmentParameters) {
660
- const { appSchema, tableDefinitionId, v4Page, generateParameters, viewKey, dataForLineItem } = schemaAdjustmentParameters;
671
+ const { entityType, appSchema, tableDefinitionId, v4Page, viewKey, dataForLineItem } = schemaAdjustmentParameters;
661
672
  // when the table view is created, the entity type may differ from the one used for the table
662
673
  // schemaAdjustmentParameters contains the entity type used for the view
663
- const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
664
674
  const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term, dataForLineItem.lineItemAnnotation?.qualifier);
665
675
  // set specific implementation for popinLayout in the LR table
666
676
  const tableDefinition = appSchema.definitions[tableDefinitionId];
@@ -684,8 +694,7 @@ function adjustPopinLayout(schemaAdjustmentParameters) {
684
694
  * @returns {void} This function does not return a value; it performs in-place adjustments to the schema provided through the input parameters.
685
695
  */
686
696
  function applyLRTableSchemaAdjustments(schemaAdjustmentParameters) {
687
- const { generateParameters, appSchema, tableDefinitionId, facetDefinitionId } = schemaAdjustmentParameters;
688
- const { entityType } = generateParameters;
697
+ const { entityType, appSchema, tableDefinitionId, facetDefinitionId } = schemaAdjustmentParameters;
689
698
  // in the future, all postgeneration adjustments for the LR Page should be done here
690
699
  // populate the creation fields for the table with the data from the columns
691
700
  (0, utils_1.initializeCreationModeSchema)(appSchema, facetDefinitionId, entityType, ux_specification_types_1.DefinitionName.TableCreationModeLR);
@@ -705,10 +714,10 @@ function applyLRTableSchemaAdjustments(schemaAdjustmentParameters) {
705
714
  * @param {string} visualization - The visualization format or mode for the line items, used to determine the associated annotations.
706
715
  * @param {string} templateAnnotation - The template annotation to infer metadata for the line items.
707
716
  * @param {GenerateAppSchemaParameters} generateParameters - Parameters essential for schema generation, including OData service metadata.
708
- * @param {v4.SapUiAppPageV4} v4Page - The V4 application page configuration where adjustments and schema changes will apply.
717
+ * @param {Page} page - The page object representing the context in which the view is being generated.
709
718
  * @returns {void} No return value.
710
719
  */
711
- function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, generateParameters, v4Page) {
720
+ function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, { serviceAVT, entityType }, page) {
712
721
  const tableId = `${ux_specification_types_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
713
722
  const viewId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`;
714
723
  const lrTableView = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.LRTableView, inputParameters.viewKey, inputParameters.appSchema);
@@ -738,25 +747,24 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
738
747
  appSchema: inputParameters.appSchema,
739
748
  lineItemAnnotation: inputParameters.targetEntityType?.annotations.UI[annotationTerm],
740
749
  entityType: inputParameters.targetEntityType,
741
- oDataServiceAVT: generateParameters.serviceAVT,
750
+ oDataServiceAVT: serviceAVT,
742
751
  lineItemId: viewId
743
752
  };
744
753
  (0, utils_2.addLineItemsTypeToSchema)(dataForLineItem, ux_specification_types_1.DefinitionName.ViewTableColumn, ux_specification_types_1.DefinitionName.ViewCustomColumn, ux_specification_types_1.DefinitionName.ViewCustomAction);
745
754
  const schemaAdjustmentParameters = {
746
- generateParameters,
747
755
  appSchema: inputParameters.appSchema,
748
- v4Page,
756
+ v4Page: page.getPage(),
749
757
  tableDefinitionId: tableId,
750
758
  facetDefinitionId: viewId,
751
759
  viewKey: inputParameters.viewKey,
752
- entityType: inputParameters.targetEntityType,
760
+ entityType: inputParameters.targetEntityType || entityType,
753
761
  dataForLineItem
754
762
  };
755
763
  applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
756
764
  // Add "manifestPath" for table properties
757
765
  addManifestPathsToPropertiesLR(inputParameters.appSchema, ux_specification_types_1.DefinitionName.LRTableView, lrTableView, {
758
- pageName: v4Page.id,
759
- manifest: generateParameters.manifest,
766
+ pageName: page.getPage().id,
767
+ manifest: page.getApp().manifest,
760
768
  targetAnnotation: inputParameters.targetAnnotation
761
769
  });
762
770
  }
@@ -800,18 +808,18 @@ function getTargetEntityType(entitySet, view, generateParameters) {
800
808
  * Adds view custom extensions - custom column and custom action definitions.
801
809
  *
802
810
  * @param commonInputParameters - list of input parameters as collected by the calling instance
803
- * @param generateParameters - list of API input parameters
804
811
  * @param visualization - visualization of the annotation
805
812
  * @param v4Page - the given page in manifest
813
+ * @param logger - extension logger
806
814
  */
807
- function addViewCustomExtensions(commonInputParameters, generateParameters, visualization, v4Page) {
815
+ function addViewCustomExtensions(commonInputParameters, visualization, v4Page, logger) {
808
816
  const sectionId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${commonInputParameters.viewKey}`;
809
817
  const sectionIdPrefix = commonInputParameters.entitySet ? `/${commonInputParameters.entitySet}/` : '';
810
818
  const sectionIdInManifest = `${sectionIdPrefix}@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}${visualization.split(ux_specification_types_1.Visualization.LineItem)[1]}`;
811
819
  const viewColumnDefinition = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomColumn, sectionId, commonInputParameters.appSchema);
812
820
  (0, common_1.addDefinitionRef)(viewColumnDefinition.properties.position, ux_specification_types_1.DefinitionName.ViewPosition, sectionId);
813
821
  (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewPosition, sectionId, commonInputParameters.appSchema);
814
- (0, utils_2.addCustomColumnDefinition)(commonInputParameters.appSchema, v4Page, generateParameters.logger, `${ux_specification_types_1.DefinitionName.ViewCustomColumn}<${sectionId}>`, sectionId, sectionIdInManifest);
822
+ (0, utils_2.addCustomColumnDefinition)(commonInputParameters.appSchema, v4Page, logger, `${ux_specification_types_1.DefinitionName.ViewCustomColumn}<${sectionId}>`, sectionId, sectionIdInManifest);
815
823
  (0, utils_2.addFragmentEnumForAnchor)(commonInputParameters.appSchema, sectionId, v4Page, `${ux_specification_types_1.DefinitionName.ViewPosition}<${sectionId}>`, sectionIdInManifest);
816
824
  // Remove generic position
817
825
  if (commonInputParameters.appSchema.definitions.Position) {
@@ -820,7 +828,7 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
820
828
  // Table toolbar actions with custom actions
821
829
  const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${sectionId}>`;
822
830
  const customActionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomAction}<${sectionId}>`;
823
- (0, utils_2.addCustomActionDefinition)(commonInputParameters.appSchema, v4Page, generateParameters.logger, customActionDefinitionKey, schemaIdForToolbarActions, sectionIdInManifest);
831
+ (0, utils_2.addCustomActionDefinition)(commonInputParameters.appSchema, v4Page, logger, customActionDefinitionKey, schemaIdForToolbarActions, sectionIdInManifest);
824
832
  // Anchor selection
825
833
  (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomActionPosition, sectionId, commonInputParameters.appSchema);
826
834
  const customActionPositionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomActionPosition}<${sectionId}>`;
@@ -836,15 +844,18 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
836
844
  * @param viewsDefinition - the views definition in app schema (MultiTableModeV4)
837
845
  * @param commonInputParameters - list of input parameters as collected by the calling instance
838
846
  * @param generateParameters - list of API input parameters
839
- * @param v4Page - the given page in manifest
847
+ * @param generateParameters.serviceAVT - OData service AVT information
848
+ * @param generateParameters.entityType - entity type of the current page
849
+ * @param generateParameters.logger - extension logger
850
+ * @param page - the current page object
840
851
  * @param uiAnnotations - UI annotations of the given entityType
841
852
  * @param view - the given view
842
853
  */
843
- function addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, v4Page, uiAnnotations, view) {
854
+ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, { serviceAVT, entityType, logger }, page, uiAnnotations, view) {
844
855
  if (visualization?.indexOf(ux_specification_types_1.Visualization.LineItem) > -1) {
845
856
  //Add Line item view
846
- addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, generateParameters, v4Page);
847
- addViewCustomExtensions(commonInputParameters, generateParameters, visualization, v4Page);
857
+ addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, { serviceAVT, entityType }, page);
858
+ addViewCustomExtensions(commonInputParameters, visualization, page.getPage(), logger);
848
859
  }
849
860
  else if (visualization?.indexOf('Chart') > -1) {
850
861
  //Add Chart view
@@ -875,10 +886,10 @@ function addLRViewParts(visualization, viewsDefinition, commonInputParameters, g
875
886
  * @param appSchema - app-specific JSON schema
876
887
  * @param viewsPaths - views' paths' section in the manifest
877
888
  * @param generateParameters - list of API input parameters
878
- * @param v4Page - the given page in manifest
889
+ * @param page - the current page object
879
890
  * @param tableDefinitionName - The name of the table definition in the schema
880
891
  */
881
- function addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefinitionName) {
892
+ function addLRViews(appSchema, viewsPaths, generateParameters, page, tableDefinitionName) {
882
893
  const tableDefinition = appSchema.definitions[tableDefinitionName];
883
894
  tableDefinition.properties = {
884
895
  annotationPath: tableDefinition.properties.annotationPath,
@@ -909,7 +920,7 @@ function addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefi
909
920
  title,
910
921
  entitySet: view['entitySet']
911
922
  };
912
- addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, v4Page, uiAnnotations, view);
923
+ addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, page, uiAnnotations, view);
913
924
  addTagsToView(viewsDefinition, viewKey, namespace, view);
914
925
  }
915
926
  }
@@ -964,7 +975,6 @@ function adaptTableDefinition(appSchema, generateParameters, templateAnnotation,
964
975
  (0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger, undefined, annotationTermInSchema, sectionIdInManifest);
965
976
  (0, utils_2.addFragmentEnumForAnchor)(appSchema, annotationTermInSchema, v4Page, undefined, sectionIdInManifest);
966
977
  const schemaAdjustmentParameters = {
967
- generateParameters,
968
978
  appSchema,
969
979
  v4Page,
970
980
  tableDefinitionId: `${tableDefinitionName}SPV`,
@@ -1001,7 +1011,6 @@ function adaptTableDefinition(appSchema, generateParameters, templateAnnotation,
1001
1011
  (0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger);
1002
1012
  (0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
1003
1013
  const schemaAdjustmentParameters = {
1004
- generateParameters,
1005
1014
  appSchema,
1006
1015
  v4Page,
1007
1016
  tableDefinitionId: tableDefinitionName,
@@ -1044,39 +1053,6 @@ function getDefaultAnnotationPath(v4Page, entityType, templateType) {
1044
1053
  entityType?.annotations.UI?.PresentationVariant?.term);
1045
1054
  }
1046
1055
  }
1047
- /**
1048
- * Add views to schema (LR or ALP).
1049
- *
1050
- * @param appSchema - app-specific JSON schema
1051
- * @param v4Page - actual page in the manifest
1052
- * @param generateParameters - list of API input parameters
1053
- * @param alias - The alias of the OData annotations
1054
- */
1055
- function addTableAndViews(appSchema, v4Page, generateParameters, alias) {
1056
- const viewsPaths = v4Page.options?.settings?.views?.paths;
1057
- const entityType = generateParameters.entityType;
1058
- const defaultAnnotation = getDefaultAnnotationPath(v4Page, generateParameters.entityType, generateParameters.templateType);
1059
- const tableDefinitionName = (0, utils_2.alignSchemaWithTemplateType)(appSchema, generateParameters);
1060
- // Add filter bar
1061
- addFilterBar(entityType, appSchema, v4Page, alias);
1062
- if (generateParameters.templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
1063
- adaptTableDefinition(appSchema, generateParameters, defaultAnnotation, v4Page, alias, tableDefinitionName);
1064
- if (viewsPaths) {
1065
- delete appSchema.definitions['LineItems'];
1066
- delete appSchema.definitions['ToolBar<LineItems>'];
1067
- delete appSchema.definitions['Actions<LineItems>'];
1068
- addLRViews(appSchema, viewsPaths, generateParameters, v4Page, tableDefinitionName);
1069
- }
1070
- else if (!v4Page.options?.settings?.views) {
1071
- appSchema.definitions.MultiTableModeV4.properties = {};
1072
- }
1073
- appSchema.properties[ux_specification_types_1.PropertyName.chart][ux_specification_types_1.SchemaTag.hidden] = true;
1074
- }
1075
- else if (generateParameters.templateType === ux_specification_types_1.TemplateType.AnalyticalListPageV4) {
1076
- addALPViews(appSchema, viewsPaths, generateParameters, defaultAnnotation, v4Page, tableDefinitionName);
1077
- (0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
1078
- }
1079
- }
1080
1056
  /**
1081
1057
  * Adds header actions to schema (LR or ALP).
1082
1058
  *
@@ -1106,10 +1082,10 @@ function addHeaderActions(appSchema, v4Page, logger) {
1106
1082
  /**
1107
1083
  * Adds 'manifestPath' to each property in a definition based on metadata sync rules.
1108
1084
  *
1109
- * @param {string} appSchema - Full schema.
1110
- * @param {string} definitionName - The name of the definition/class whose properties are being processed.
1111
- * @param {Definition} definition - The definition object containing property schemas.
1112
- * @param {ListReportManifestPathParams} pathParams - Additional context required to compute manifest paths.
1085
+ * @param appSchema - Full schema.
1086
+ * @param definitionName - The name of the definition/class whose properties are being processed.
1087
+ * @param definition - The definition object containing property schemas.
1088
+ * @param pathParams - Additional context required to compute manifest paths.
1113
1089
  */
1114
1090
  function addManifestPathsToPropertiesLR(appSchema, definitionName, definition, pathParams) {
1115
1091
  let targetAnnotation = undefined;
@@ -1129,8 +1105,8 @@ function addManifestPathsToPropertiesLR(appSchema, definitionName, definition, p
1129
1105
  /**
1130
1106
  * Adds 'manifestPath' to static nodes in schema.
1131
1107
  *
1132
- * @param {string} appSchema - Full schema.
1133
- * @param {ListReportManifestPathParams} pathParams - Additional context required to compute manifest paths.
1108
+ * @param appSchema - Full schema.
1109
+ * @param pathParams - Additional context required to compute manifest paths.
1134
1110
  */
1135
1111
  function addManifestPathsToStaticNodes(appSchema, pathParams) {
1136
1112
  // Root level - rules stored on page class level
@@ -1144,6 +1120,53 @@ function addManifestPathsToStaticNodes(appSchema, pathParams) {
1144
1120
  }
1145
1121
  }
1146
1122
  }
1123
+ /**
1124
+ * Class to generate the List Report page schema.
1125
+ */
1126
+ class ListReportPage {
1127
+ /**
1128
+ * Constructor for ListReportPage.
1129
+ *
1130
+ * @param generateParameters - parameters for generating the app schema
1131
+ * @param schema - generic JSON schema of the List Report page
1132
+ * @param templateName - name of the template
1133
+ * @param contextPath - context path of the page
1134
+ */
1135
+ constructor(generateParameters, schema, templateName, contextPath) {
1136
+ this.schema = new AppSchema_1.AppSchema(schema);
1137
+ this.app = (0, App_1.createApp)(generateParameters.manifest, generateParameters.serviceAVT, generateParameters.logger);
1138
+ this.page = new Page_1.Page(this.app, { name: templateName, type: generateParameters.templateType }, generateParameters.entitySet, contextPath);
1139
+ }
1140
+ /**
1141
+ * Cleans up the schema by hiding specific properties and removing unnecessary definitions.
1142
+ */
1143
+ cleanup() {
1144
+ this.schema.hide(this.schema.getRootProperty([ux_specification_types_1.PropertyName.defaultTemplateAnnotationPath]));
1145
+ this.schema.cleanup(['GenericColumns', 'Action']);
1146
+ (0, common_1.updatePropertyIndices)(this.schema.getSchema(), ROOT_PROPERTIES_ORDER);
1147
+ }
1148
+ /**
1149
+ * Generates the finalized schema for the List Report page.
1150
+ *
1151
+ * @returns The finalized schema for List Report page
1152
+ */
1153
+ generate() {
1154
+ new ListReportUtils_1.GeneralListReportSettings(this.schema, this.page, this.app.getLogger()).instantiate();
1155
+ if (!this.page.getPage()) {
1156
+ return this.schema.finalize();
1157
+ }
1158
+ new ListReportUtils_1.Header(this.schema, this.page, this.app.getLogger()).instantiate();
1159
+ new ListReportUtils_1.FilterBar(this.schema, this.page, this.app.getLogger()).instantiate();
1160
+ new ListReportUtils_1.TableAndViews(this.schema, this.page, this.app.getLogger()).instantiate();
1161
+ // Add "manifestPath" for properties in static nodes
1162
+ addManifestPathsToStaticNodes(this.schema.getSchema(), {
1163
+ pageName: this.page.getPage().id,
1164
+ manifest: this.app.getManifest()
1165
+ });
1166
+ this.cleanup();
1167
+ return this.schema.finalize();
1168
+ }
1169
+ }
1147
1170
  /**
1148
1171
  * Generates an app specific schema for the FE V4 ListReport from the generic schema.
1149
1172
  * Generic types are replaced by information from the app specific annotations.
@@ -1155,42 +1178,11 @@ function addManifestPathsToStaticNodes(appSchema, pathParams) {
1155
1178
  * @returns {object} application-specific schema of the list report
1156
1179
  */
1157
1180
  function generateListReportSchemaV4(generateParameters, genericSchema, templateName, contextPath) {
1158
- const appSchema = JSON.parse(JSON.stringify(genericSchema));
1159
- const entityType = generateParameters.entityType;
1160
- const alias = generateParameters.serviceAVT && (0, common_1.findAlias)(ux_specification_types_1.UIVOCABULARY, generateParameters.serviceAVT);
1161
- appSchema.properties[ux_specification_types_1.PropertyName.defaultTemplateAnnotationPath][ux_specification_types_1.SchemaTag.hidden] = true;
1162
- //enum for annotation path as part of QuickVariantSelection
1163
- (0, common_1.addEnumForSingleTabVariant)(entityType, appSchema, ux_specification_types_1.DefinitionName.AnnotationPathAsObject);
1164
- if (generateParameters.manifest) {
1165
- //Find page in targets
1166
- const pages = generateParameters.manifest[ux_specification_types_1.ManifestSection.ui5].routing
1167
- .targets;
1168
- if (!pages) {
1169
- (0, extensionLogger_1.log)(generateParameters.logger, {
1170
- severity: "error" /* LogSeverity.Error */,
1171
- message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
1172
- location: {
1173
- path: ux_specification_types_1.MANIFESTPATH,
1174
- range: [ux_specification_types_1.ManifestSection.generic]
1175
- }
1176
- });
1177
- return appSchema;
1178
- }
1179
- const v4Page = (0, utils_2.findPageV4)(pages, templateName, generateParameters.entitySet, contextPath);
1180
- if (!v4Page) {
1181
- return appSchema;
1182
- }
1183
- addHeaderActions(appSchema, v4Page, generateParameters.logger);
1184
- addTableAndViews(appSchema, v4Page, generateParameters, alias);
1185
- // Add "manifestPath" for properties in static nodes
1186
- addManifestPathsToStaticNodes(appSchema, {
1187
- pageName: v4Page.id,
1188
- manifest: generateParameters.manifest
1189
- });
1181
+ const listReport = new ListReportPage(generateParameters, genericSchema, templateName, contextPath);
1182
+ if (!listReport.app.getManifest()) {
1183
+ listReport.cleanup();
1184
+ return listReport.schema.finalize();
1190
1185
  }
1191
- delete appSchema.definitions.GenericColumns;
1192
- delete appSchema.definitions.Action;
1193
- (0, common_1.updatePropertyIndices)(appSchema, ROOT_PROPERTIES_ORDER);
1194
- return appSchema;
1186
+ return listReport.generate();
1195
1187
  }
1196
1188
  //# sourceMappingURL=listReport.js.map