@sap/ux-specification 1.136.8 → 1.136.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
- package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
- package/dist/documentation/v2/v2-ListReport.html +2 -2
- package/dist/documentation/v2/v2-ListReportNew.html +2 -2
- package/dist/documentation/v2/v2-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
- package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
- package/dist/documentation/v4/v4-FreestylePage.html +2 -2
- package/dist/documentation/v4/v4-ListReport.html +2 -2
- package/dist/documentation/v4/v4-ObjectPage.html +2 -2
- package/dist/index-min.js +109 -109
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v4/BuildingBlocksConfig.json +334 -23
- package/dist/schemas/v4/ListReportConfig.json +57 -0
- package/dist/schemas/v4/ObjectPageConfig.json +48 -28
- package/dist/specification/package.json +6 -6
- package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +3 -0
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/src/api.js +1 -1
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +75 -0
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -0
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +69 -0
- package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -0
- package/dist/specification/src/sync/common/dist_tag.json +19 -4
- package/dist/specification/src/sync/common/generate/utils.d.ts +5 -3
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +7 -4
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/i18n.json +4 -1
- package/dist/specification/src/sync/common/index.d.ts +1 -0
- package/dist/specification/src/sync/common/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/index.js +1 -0
- package/dist/specification/src/sync/common/index.js.map +1 -1
- package/dist/specification/src/sync/common/rules.d.ts +5 -0
- package/dist/specification/src/sync/common/rules.d.ts.map +1 -0
- package/dist/specification/src/sync/common/rules.js +98 -0
- package/dist/specification/src/sync/common/rules.js.map +1 -0
- package/dist/specification/src/sync/v4/application.d.ts +19 -2
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +40 -4
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +0 -10
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +76 -139
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +54 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +164 -2
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/export.js +3 -1
- package/dist/specification/src/sync/v4/export/export.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +2 -45
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.d.ts +23 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +85 -0
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/listReport.d.ts +10 -1
- package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/listReport.js +143 -40
- package/dist/specification/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.js +2 -1
- package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts +18 -9
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +32 -20
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/types/src/common/types.d.ts +23 -1
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +14 -1
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts +19 -19
- package/dist/types/src/v4/controls/Table.d.ts +44 -3
- package/dist/types/src/v4/controls/Table.d.ts.map +1 -1
- package/dist/types/src/v4/controls/Table.js.map +1 -1
- package/dist/types/src/v4/webapp/manifest/sapUiPageV4.d.ts +1 -0
- package/dist/types/src/v4/webapp/manifest/sapUiPageV4.d.ts.map +1 -1
- package/dist/types/src/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { XMLElement } from '@xml-tools/ast';
|
|
2
|
+
import type { MacrosSchemaMetadata } from '@sap/ux-specification-types';
|
|
2
3
|
/**
|
|
3
4
|
* Method to get value of xml attribute by attribute name.
|
|
4
5
|
*
|
|
@@ -15,4 +16,26 @@ export declare function getAttribute(node: XMLElement, name: string): string | u
|
|
|
15
16
|
* @returns {XMLElement | undefined} Found children XML node
|
|
16
17
|
*/
|
|
17
18
|
export declare function getNodeByName(node: XMLElement, name: string): XMLElement | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Adds displayInfo to metadata if the node is a higher-level building block.
|
|
21
|
+
* Skips custom XML elements like Column, Action, FilterField.
|
|
22
|
+
*
|
|
23
|
+
* @param {XMLElement} node Parsed XML element.
|
|
24
|
+
* @param {string} name Node name.
|
|
25
|
+
* @param {MacrosSchemaMetadata} metadata Metadata object to update.
|
|
26
|
+
*/
|
|
27
|
+
export declare function addDisplayInfoForBuildingBlock(node: XMLElement, name: string, metadata: MacrosSchemaMetadata): void;
|
|
28
|
+
/**
|
|
29
|
+
* Returns a description and optional icon for a view node.
|
|
30
|
+
* - For higher-level building blocks, description is "<name> #value" for 'id', or "<name> value" for others.
|
|
31
|
+
* - For custom building blocks, uses the attribute value directly, or the node name if not found.
|
|
32
|
+
*
|
|
33
|
+
* @param {XMLElement} node Parsed XML element.
|
|
34
|
+
* @param {string} name Node name.
|
|
35
|
+
* @returns {{ description: string; icon?: string }} Object containing the description and optional icon.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getViewNodeDescriptionAndIcon(node: XMLElement, name: string): {
|
|
38
|
+
description: string;
|
|
39
|
+
icon?: string;
|
|
40
|
+
};
|
|
18
41
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/sync/v4/generate/fpm-custom-page/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/sync/v4/generate/fpm-custom-page/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAIxE;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAEpF;AAsCD;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAKnH;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAwBpH"}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAttribute = getAttribute;
|
|
4
4
|
exports.getNodeByName = getNodeByName;
|
|
5
|
+
exports.addDisplayInfoForBuildingBlock = addDisplayInfoForBuildingBlock;
|
|
6
|
+
exports.getViewNodeDescriptionAndIcon = getViewNodeDescriptionAndIcon;
|
|
7
|
+
const customBuildingBlockElements = ['Column', 'Action', 'FilterField'];
|
|
5
8
|
/**
|
|
6
9
|
* Method to get value of xml attribute by attribute name.
|
|
7
10
|
*
|
|
@@ -22,4 +25,86 @@ function getAttribute(node, name) {
|
|
|
22
25
|
function getNodeByName(node, name) {
|
|
23
26
|
return node.subElements?.find((child) => child.name === name);
|
|
24
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the first matching attribute value from descriptionProperties, or undefined.
|
|
30
|
+
*
|
|
31
|
+
* @param {XMLElement} node - The XML element to search for display attributes.
|
|
32
|
+
* @returns {{ key: string; value: string } | undefined} The matching attribute object, or undefined if none found.
|
|
33
|
+
*/
|
|
34
|
+
function getDisplayAttribute(node) {
|
|
35
|
+
const descriptionProperties = ['id', 'key', 'title', 'text', 'label', 'header'];
|
|
36
|
+
const attributes = node.attributes || [];
|
|
37
|
+
for (const prop of descriptionProperties) {
|
|
38
|
+
const attr = attributes.find((attribute) => attribute.key === prop);
|
|
39
|
+
if (attr) {
|
|
40
|
+
return attr;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Extracts display info for UI rendering.
|
|
47
|
+
* Returns "(#value)" for 'id' attributes, "(value)" for others, or undefined if not found.
|
|
48
|
+
*
|
|
49
|
+
* @param node XML element to search.
|
|
50
|
+
* @returns Formatted display string or undefined.
|
|
51
|
+
* @example
|
|
52
|
+
* // { key: 'id', value: 'My_ID_Table' } => "(#My_ID_Table)"
|
|
53
|
+
* // { key: 'title', value: 'Sales in Europe' } => "(Sales in Europe)"
|
|
54
|
+
*/
|
|
55
|
+
function extractDisplayInfo(node) {
|
|
56
|
+
const attributeFound = getDisplayAttribute(node);
|
|
57
|
+
if (attributeFound) {
|
|
58
|
+
return attributeFound.key === 'id' ? `(#${attributeFound.value})` : `(${attributeFound.value})`;
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Adds displayInfo to metadata if the node is a higher-level building block.
|
|
64
|
+
* Skips custom XML elements like Column, Action, FilterField.
|
|
65
|
+
*
|
|
66
|
+
* @param {XMLElement} node Parsed XML element.
|
|
67
|
+
* @param {string} name Node name.
|
|
68
|
+
* @param {MacrosSchemaMetadata} metadata Metadata object to update.
|
|
69
|
+
*/
|
|
70
|
+
function addDisplayInfoForBuildingBlock(node, name, metadata) {
|
|
71
|
+
if (!customBuildingBlockElements.includes(name)) {
|
|
72
|
+
const value = extractDisplayInfo(node);
|
|
73
|
+
metadata.macroDisplayInfo = { name, value };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns a description and optional icon for a view node.
|
|
78
|
+
* - For higher-level building blocks, description is "<name> #value" for 'id', or "<name> value" for others.
|
|
79
|
+
* - For custom building blocks, uses the attribute value directly, or the node name if not found.
|
|
80
|
+
*
|
|
81
|
+
* @param {XMLElement} node Parsed XML element.
|
|
82
|
+
* @param {string} name Node name.
|
|
83
|
+
* @returns {{ description: string; icon?: string }} Object containing the description and optional icon.
|
|
84
|
+
*/
|
|
85
|
+
function getViewNodeDescriptionAndIcon(node, name) {
|
|
86
|
+
const controlIconMap = {
|
|
87
|
+
Table: 'Table',
|
|
88
|
+
FilterBar: 'Filter',
|
|
89
|
+
Chart: 'Chart',
|
|
90
|
+
Page: 'Page'
|
|
91
|
+
};
|
|
92
|
+
let description;
|
|
93
|
+
if (!customBuildingBlockElements.includes(name)) {
|
|
94
|
+
const attr = getDisplayAttribute(node);
|
|
95
|
+
if (attr) {
|
|
96
|
+
const prefix = attr.key === 'id' ? '#' : '';
|
|
97
|
+
description = `${name} ${prefix}${attr.value}`;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
description = name;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
const attr = getDisplayAttribute(node);
|
|
105
|
+
description = attr ? attr.value : name;
|
|
106
|
+
}
|
|
107
|
+
const icon = controlIconMap[name];
|
|
108
|
+
return icon ? { description, icon } : { description };
|
|
109
|
+
}
|
|
25
110
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../src/sync/v4/generate/fpm-custom-page/utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../src/sync/v4/generate/fpm-custom-page/utils.ts"],"names":[],"mappings":";;AAYA,oCAEC;AASD,sCAEC;AA8CD,wEAKC;AAWD,sEAwBC;AA5GD,MAAM,2BAA2B,GAAG,CAAC,QA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CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Visualization } from '@sap/ux-specification-types';
|
|
2
|
-
import type { ExtensionLogger, GenerateAppSchemaParameters } from '@sap/ux-specification-types';
|
|
2
|
+
import type { ExtensionLogger, v4, GenerateAppSchemaParameters } from '@sap/ux-specification-types';
|
|
3
3
|
import type { AnnotationTerm, EntityType, ConvertedMetadata } from '@sap-ux/vocabularies-types';
|
|
4
4
|
import type { SelectionFields } from '@sap-ux/vocabularies-types/vocabularies/UI';
|
|
5
5
|
import type { Definition } from 'typescript-json-schema';
|
|
6
|
+
export interface SchemaAdjustmentParameters {
|
|
7
|
+
generateParameters: GenerateAppSchemaParameters;
|
|
8
|
+
appSchema: Definition;
|
|
9
|
+
v4Page: v4.SapUiAppPageV4;
|
|
10
|
+
tableDefinitionId: string;
|
|
11
|
+
facetDefinitionId: string;
|
|
12
|
+
viewKey?: string;
|
|
13
|
+
entityType?: EntityType;
|
|
14
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* Adds the selection fields to the app schema, as properties of the FilterBar.
|
|
8
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listReport.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v4/generate/listReport.ts"],"names":[],"mappings":"AAcA,OAAO,EAKH,aAAa,
|
|
1
|
+
{"version":3,"file":"listReport.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v4/generate/listReport.ts"],"names":[],"mappings":"AAcA,OAAO,EAKH,aAAa,EAWhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,KAAK,EAAE,cAAc,EAAa,UAAU,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC3G,O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otation;
|
|
8
8
|
exports.generateListReportSchemaV4 = generateListReportSchemaV4;
|
|
9
9
|
const utils_1 = require("../utils/utils");
|
|
10
|
+
const utils_2 = require("../utils/utils");
|
|
10
11
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
11
12
|
const i18next_1 = __importDefault(require("i18next"));
|
|
12
13
|
const extensionLogger_1 = require("../../../extensionLogger");
|
|
@@ -153,7 +154,7 @@ function applyCustomFilterFields(appSchema, selectionFieldsDefinition, v4Page) {
|
|
|
153
154
|
selectionFieldsDefinition.additionalProperties = {
|
|
154
155
|
$ref: `#/definitions/${ux_specification_types_1.DefinitionName.CustomFilterField}`
|
|
155
156
|
};
|
|
156
|
-
(0,
|
|
157
|
+
(0, utils_2.addCustomFilterFieldDefinition)(appSchema, selectionFieldsDefinition, v4Page);
|
|
157
158
|
const customSectionDefinition = appSchema.definitions[ux_specification_types_1.DefinitionName.CustomFilterFieldPosition];
|
|
158
159
|
if (typeof customSectionDefinition === 'object') {
|
|
159
160
|
(0, common_1.addDescriptiveEnumDefinition)(appSchema, selectionFieldsDefinition, {
|
|
@@ -478,22 +479,28 @@ function addALPViews(appSchema, viewsPaths, generateParameters, templateAnnotati
|
|
|
478
479
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
479
480
|
lineItemId: ux_specification_types_1.DefinitionName.LineItems
|
|
480
481
|
};
|
|
481
|
-
(0,
|
|
482
|
+
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem, ux_specification_types_1.DefinitionName.ViewTableColumn);
|
|
482
483
|
if (target) {
|
|
483
484
|
appSchema.definitions[ux_specification_types_1.DefinitionName.ALPTable][ux_specification_types_1.SchemaTag.annotationPath] = target;
|
|
484
485
|
}
|
|
485
|
-
|
|
486
|
-
|
|
486
|
+
const schemaAdjustmentParameters = {
|
|
487
|
+
generateParameters,
|
|
488
|
+
appSchema,
|
|
489
|
+
v4Page,
|
|
490
|
+
tableDefinitionId: ux_specification_types_1.DefinitionName.ALPTable,
|
|
491
|
+
facetDefinitionId: ux_specification_types_1.DefinitionName.LineItems
|
|
492
|
+
};
|
|
493
|
+
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
487
494
|
const pathParts = annotations[viewAnnotation].fullyQualifiedName.split('@');
|
|
488
495
|
tableView[ux_specification_types_1.SchemaTag.annotationPath] = `/${pathParts[0]}/@${pathParts[1]}`;
|
|
489
496
|
tableView[ux_specification_types_1.SchemaTag.key] = 'secondary';
|
|
490
497
|
tableView[ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.key, value: 'secondary' }];
|
|
491
498
|
}
|
|
492
|
-
(0,
|
|
499
|
+
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger);
|
|
493
500
|
// Table toolbar actions with custom actions
|
|
494
501
|
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(ux_specification_types_1.DefinitionName.LineItems)}>`;
|
|
495
|
-
(0,
|
|
496
|
-
(0,
|
|
502
|
+
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, undefined, schemaIdForToolbarActions);
|
|
503
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForToolbarActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
497
504
|
}
|
|
498
505
|
/**
|
|
499
506
|
* Modifies the app schema, adds the right line chart settings.
|
|
@@ -544,16 +551,92 @@ function addViewChart(inputParameters, UIAnnotations, appSchema, viewsDefinition
|
|
|
544
551
|
title: titleOnHover
|
|
545
552
|
};
|
|
546
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* Retrieves the line item reference for a specified view and entity type.
|
|
556
|
+
*
|
|
557
|
+
* @param {SapUiAppPageV4} v4Page - The page object containing application-specific settings and views configuration.
|
|
558
|
+
* @param {EntityType} entityType - The entity type definition for which the line item reference is required.
|
|
559
|
+
* @param {string} viewKey - The key identifying the desired view configuration.
|
|
560
|
+
* @param {string} lineItemTerm - The term representing the line item annotation.
|
|
561
|
+
* @returns {string} The resolved line item reference in the form of a path or annotation term.
|
|
562
|
+
*/
|
|
563
|
+
function getLineItemRef(v4Page, entityType, viewKey, lineItemTerm) {
|
|
564
|
+
const path = (v4Page?.options?.settings?.views?.paths ?? []).find((path) => path.key === viewKey);
|
|
565
|
+
if (path === undefined) {
|
|
566
|
+
return `@${lineItemTerm}`;
|
|
567
|
+
}
|
|
568
|
+
const { annotationPath, entitySet } = path;
|
|
569
|
+
const viewAnnotationPath = (annotationPath ?? '').split(ux_specification_types_1.UIVOCABULARYDOT)[1];
|
|
570
|
+
const lineItemReference = entityType?.annotations?.UI?.[viewAnnotationPath]?.PresentationVariant?.Visualizations?.[0]?.value ??
|
|
571
|
+
`@${lineItemTerm}`;
|
|
572
|
+
return entitySet ? `/${entitySet}/${lineItemReference}` : lineItemReference;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Adjusts the schema definition related to the creation fields in the list report (LR) table.
|
|
576
|
+
* This function modifies the app schema to handle the creation mode and relevant settings for the table.
|
|
577
|
+
*
|
|
578
|
+
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - An object containing parameters required for schema adjustments.
|
|
579
|
+
* It includes the application schema, table definition ID, facet definition ID, and the V4 page information.
|
|
580
|
+
* @returns {void} This function does not return any value.
|
|
581
|
+
*/
|
|
582
|
+
function adjustCreationFieldsDefinition(schemaAdjustmentParameters) {
|
|
583
|
+
const { appSchema, tableDefinitionId, facetDefinitionId, v4Page, generateParameters, viewKey } = schemaAdjustmentParameters;
|
|
584
|
+
// when the table view is created, the entity type may differ from the one used for the table
|
|
585
|
+
// schemaAdjustmentParameters contains the entity type used for the view
|
|
586
|
+
const entityType = schemaAdjustmentParameters.entityType ?? generateParameters.entityType;
|
|
587
|
+
const lineItemRef = getLineItemRef(v4Page, entityType, viewKey, entityType?.annotations?.UI?.LineItem?.term);
|
|
588
|
+
// set specific implementation for creation fields in the LR table
|
|
589
|
+
const creationModeDefinitionKey = (0, common_1.getFacetDefinitionKey)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionId);
|
|
590
|
+
const tableDefinition = appSchema.definitions[tableDefinitionId];
|
|
591
|
+
const creationModeProperty = tableDefinition.properties[ux_specification_types_1.PropertyName.creationMode];
|
|
592
|
+
creationModeProperty.$ref = (0, common_1.getFacetDefinitionLink)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionId);
|
|
593
|
+
const creationModeDefinition = appSchema.definitions[creationModeDefinitionKey] ??
|
|
594
|
+
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.TableCreationModeLR, facetDefinitionId, appSchema);
|
|
595
|
+
const context = {
|
|
596
|
+
page: v4Page,
|
|
597
|
+
schema: creationModeDefinition,
|
|
598
|
+
parameters: {
|
|
599
|
+
lineItemRef,
|
|
600
|
+
tableDefinition
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
// for the AnalyticalTable we don't set the creation mode property
|
|
604
|
+
common_1.manifestDrivenSchemaProcessor.apply(ux_specification_types_1.RuleName.LRCreationModeForAnalyticalTable, context);
|
|
605
|
+
// the TreeTable has some specific properties in the creation mode
|
|
606
|
+
common_1.manifestDrivenSchemaProcessor.apply(ux_specification_types_1.RuleName.LRCreationModeForNonTreeTable, context);
|
|
607
|
+
// only in CreationDialog mode is the creationFields property allowed
|
|
608
|
+
common_1.manifestDrivenSchemaProcessor.apply(ux_specification_types_1.RuleName.LRCreationModeForNonCreationDialogMode, context);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Adjusts the schema for a table by making necessary changes such as populating creation fields,
|
|
612
|
+
* adjusting creation field definitions, and adding enum mappings for mass edit functionalities.
|
|
613
|
+
*
|
|
614
|
+
* @param {SchemaAdjustmentParameters} schemaAdjustmentParameters - Object containing the parameters required for schema adjustments. Includes the generate parameters, application schema, table definition ID, and facet definition ID.
|
|
615
|
+
* @returns {void} This function does not return a value; it performs in-place adjustments to the schema provided through the input parameters.
|
|
616
|
+
*/
|
|
617
|
+
function applyLRTableSchemaAdjustments(schemaAdjustmentParameters) {
|
|
618
|
+
const { generateParameters, appSchema, tableDefinitionId, facetDefinitionId } = schemaAdjustmentParameters;
|
|
619
|
+
const { entityType } = generateParameters;
|
|
620
|
+
// in the future, all postgeneration adjustments for the LR Page should be done here
|
|
621
|
+
// populate the creation fields for the table with the data from the columns
|
|
622
|
+
(0, utils_1.initializeCreationModeSchema)(appSchema, facetDefinitionId, entityType, ux_specification_types_1.DefinitionName.TableCreationModeLR);
|
|
623
|
+
// remove unnecessary properties from the creation mode aggregation according to the table type
|
|
624
|
+
adjustCreationFieldsDefinition(schemaAdjustmentParameters);
|
|
625
|
+
// add columns to a enum, in this case enableMassEdit -> visibleFields and ignoredFields
|
|
626
|
+
(0, utils_2.addEnumForEnableMassEdit)(appSchema, tableDefinitionId, facetDefinitionId);
|
|
627
|
+
}
|
|
547
628
|
/**
|
|
548
629
|
* Modifies the app schema, adds the right line item settings as derived from the visualization.
|
|
549
630
|
*
|
|
550
|
-
* @param inputParameters -
|
|
551
|
-
* @param viewsDefinition -
|
|
552
|
-
* @param visualization - visualization
|
|
553
|
-
* @param templateAnnotation -
|
|
554
|
-
* @param {GenerateAppSchemaParameters} generateParameters -
|
|
631
|
+
* @param {ViewsParameters} inputParameters - The parameters required for generating and defining the line items in the view schema.
|
|
632
|
+
* @param {Definition} viewsDefinition - The existing schema definition for views that will be updated with new view line items.
|
|
633
|
+
* @param {string} visualization - The visualization format or mode for the line items, used to determine the associated annotations.
|
|
634
|
+
* @param {string} templateAnnotation - The template annotation to infer metadata for the line items.
|
|
635
|
+
* @param {GenerateAppSchemaParameters} generateParameters - Parameters essential for schema generation, including OData service metadata.
|
|
636
|
+
* @param {v4.SapUiAppPageV4} v4Page - The V4 application page configuration where adjustments and schema changes will apply.
|
|
637
|
+
* @returns {void} No return value.
|
|
555
638
|
*/
|
|
556
|
-
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, generateParameters) {
|
|
639
|
+
function addViewLineItems(inputParameters, viewsDefinition, visualization, templateAnnotation, generateParameters, v4Page) {
|
|
557
640
|
const tableId = `${ux_specification_types_1.DefinitionName.LRTableView}<${inputParameters.viewKey}>`;
|
|
558
641
|
const viewId = `${ux_specification_types_1.DefinitionName.LineItemsOfView}::${inputParameters.viewKey}`;
|
|
559
642
|
const lrTableView = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.LRTableView, inputParameters.viewKey, inputParameters.appSchema);
|
|
@@ -586,9 +669,17 @@ function addViewLineItems(inputParameters, viewsDefinition, visualization, templ
|
|
|
586
669
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
587
670
|
lineItemId: viewId
|
|
588
671
|
};
|
|
589
|
-
(0,
|
|
590
|
-
|
|
591
|
-
|
|
672
|
+
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem, ux_specification_types_1.DefinitionName.ViewTableColumn, ux_specification_types_1.DefinitionName.ViewCustomColumn, ux_specification_types_1.DefinitionName.ViewCustomAction);
|
|
673
|
+
const schemaAdjustmentParameters = {
|
|
674
|
+
generateParameters,
|
|
675
|
+
appSchema: inputParameters.appSchema,
|
|
676
|
+
v4Page,
|
|
677
|
+
tableDefinitionId: tableId,
|
|
678
|
+
facetDefinitionId: viewId,
|
|
679
|
+
viewKey: inputParameters.viewKey,
|
|
680
|
+
entityType: inputParameters.targetEntityType
|
|
681
|
+
};
|
|
682
|
+
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
592
683
|
}
|
|
593
684
|
/**
|
|
594
685
|
* Adds the schema tags to a given view.
|
|
@@ -641,8 +732,8 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
|
|
|
641
732
|
const viewColumnDefinition = (0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomColumn, sectionId, commonInputParameters.appSchema);
|
|
642
733
|
(0, common_1.addDefinitionRef)(viewColumnDefinition.properties.position, ux_specification_types_1.DefinitionName.ViewPosition, sectionId);
|
|
643
734
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewPosition, sectionId, commonInputParameters.appSchema);
|
|
644
|
-
(0,
|
|
645
|
-
(0,
|
|
735
|
+
(0, utils_2.addCustomColumnDefinition)(commonInputParameters.appSchema, v4Page, generateParameters.logger, `${ux_specification_types_1.DefinitionName.ViewCustomColumn}<${sectionId}>`, sectionId, sectionIdInManifest);
|
|
736
|
+
(0, utils_2.addFragmentEnumForAnchor)(commonInputParameters.appSchema, sectionId, v4Page, `${ux_specification_types_1.DefinitionName.ViewPosition}<${sectionId}>`, sectionIdInManifest);
|
|
646
737
|
// Remove generic position
|
|
647
738
|
if (commonInputParameters.appSchema.definitions.Position) {
|
|
648
739
|
delete commonInputParameters.appSchema.definitions.Position;
|
|
@@ -650,14 +741,14 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
|
|
|
650
741
|
// Table toolbar actions with custom actions
|
|
651
742
|
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${sectionId}>`;
|
|
652
743
|
const customActionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomAction}<${sectionId}>`;
|
|
653
|
-
(0,
|
|
744
|
+
(0, utils_2.addCustomActionDefinition)(commonInputParameters.appSchema, v4Page, generateParameters.logger, customActionDefinitionKey, schemaIdForToolbarActions, sectionIdInManifest);
|
|
654
745
|
// Anchor selection
|
|
655
746
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.ViewCustomActionPosition, sectionId, commonInputParameters.appSchema);
|
|
656
747
|
const customActionPositionDefinitionKey = `${ux_specification_types_1.DefinitionName.ViewCustomActionPosition}<${sectionId}>`;
|
|
657
748
|
const customActionDefinition = commonInputParameters.appSchema.definitions[customActionDefinitionKey];
|
|
658
749
|
customActionDefinition.properties.position.$ref =
|
|
659
750
|
`${common_1.DEFINITION_LINK_PREFIX}${customActionPositionDefinitionKey}`;
|
|
660
|
-
(0,
|
|
751
|
+
(0, utils_2.addEnumForActionAnchor)(commonInputParameters.appSchema, schemaIdForToolbarActions, customActionPositionDefinitionKey);
|
|
661
752
|
}
|
|
662
753
|
/**
|
|
663
754
|
* Adds definition parts to a LR View (LineItem/Chart).
|
|
@@ -673,7 +764,7 @@ function addViewCustomExtensions(commonInputParameters, generateParameters, visu
|
|
|
673
764
|
function addLRViewParts(visualization, viewsDefinition, commonInputParameters, generateParameters, v4Page, uiAnnotations, view) {
|
|
674
765
|
if (visualization?.indexOf(ux_specification_types_1.Visualization.LineItem) > -1) {
|
|
675
766
|
//Add Line item view
|
|
676
|
-
addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, generateParameters);
|
|
767
|
+
addViewLineItems(commonInputParameters, viewsDefinition, visualization, commonInputParameters.targetAnnotation, generateParameters, v4Page);
|
|
677
768
|
addViewCustomExtensions(commonInputParameters, generateParameters, visualization, v4Page);
|
|
678
769
|
}
|
|
679
770
|
else if (visualization?.indexOf('Chart') > -1) {
|
|
@@ -786,20 +877,26 @@ function adaptTableDefinition(appSchema, generateParameters, templateAnnotation,
|
|
|
786
877
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
787
878
|
lineItemId: annotationTermInSchema
|
|
788
879
|
};
|
|
789
|
-
(0,
|
|
880
|
+
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem);
|
|
790
881
|
const annotationTermQualifier = annotationTerm.split('#')?.[1];
|
|
791
882
|
const sectionIdInManifest = annotationTermQualifier
|
|
792
883
|
? `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}#${annotationTermQualifier}`
|
|
793
884
|
: `@${"com.sap.vocabularies.UI.v1.LineItem" /* UIAnnotationTerms.LineItem */}`;
|
|
794
|
-
(0,
|
|
795
|
-
(0,
|
|
796
|
-
|
|
797
|
-
|
|
885
|
+
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger, undefined, annotationTermInSchema, sectionIdInManifest);
|
|
886
|
+
(0, utils_2.addFragmentEnumForAnchor)(appSchema, annotationTermInSchema, v4Page, undefined, sectionIdInManifest);
|
|
887
|
+
const schemaAdjustmentParameters = {
|
|
888
|
+
generateParameters,
|
|
889
|
+
appSchema,
|
|
890
|
+
v4Page,
|
|
891
|
+
tableDefinitionId: `${tableDefinitionName}SPV`,
|
|
892
|
+
facetDefinitionId: annotationTermInSchema
|
|
893
|
+
};
|
|
894
|
+
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
798
895
|
// Table toolbar actions with custom actions
|
|
799
896
|
const schemaIdForToolbarActions = `${ux_specification_types_1.DefinitionName.Actions}<${annotationTermInSchema}>`;
|
|
800
897
|
const customColumnDefinitionName = (0, common_1.getCustomExtensionDefinitionName)(appSchema, annotationTermInSchema, ux_specification_types_1.DefinitionName.CustomTableAction);
|
|
801
|
-
(0,
|
|
802
|
-
(0,
|
|
898
|
+
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, (0, common_1.getDefinitionKey)(customColumnDefinitionName), schemaIdForToolbarActions, sectionIdInManifest);
|
|
899
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForToolbarActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
803
900
|
}
|
|
804
901
|
else {
|
|
805
902
|
tableDefinition.properties.toolBar['$ref'] = `${common_1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ToolBarLR}`;
|
|
@@ -820,18 +917,24 @@ function adaptTableDefinition(appSchema, generateParameters, templateAnnotation,
|
|
|
820
917
|
oDataServiceAVT: generateParameters.serviceAVT,
|
|
821
918
|
lineItemId: ux_specification_types_1.DefinitionName.LineItems
|
|
822
919
|
};
|
|
823
|
-
(0,
|
|
824
|
-
(0,
|
|
825
|
-
(0,
|
|
826
|
-
|
|
827
|
-
|
|
920
|
+
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem);
|
|
921
|
+
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger);
|
|
922
|
+
(0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
|
|
923
|
+
const schemaAdjustmentParameters = {
|
|
924
|
+
generateParameters,
|
|
925
|
+
appSchema,
|
|
926
|
+
v4Page,
|
|
927
|
+
tableDefinitionId: tableDefinitionName,
|
|
928
|
+
facetDefinitionId: ux_specification_types_1.DefinitionName.LineItems
|
|
929
|
+
};
|
|
930
|
+
applyLRTableSchemaAdjustments(schemaAdjustmentParameters);
|
|
828
931
|
if (lineItemAnnotation && !v4Page.options?.settings?.views?.paths) {
|
|
829
932
|
tableDefinition[ux_specification_types_1.SchemaTag.annotationPath] = (0, common_1.createAnnotationPath)(generateParameters.entityType?.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
|
|
830
933
|
}
|
|
831
934
|
// Table toolbar actions with custom actions
|
|
832
935
|
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(ux_specification_types_1.DefinitionName.LineItems)}>`;
|
|
833
|
-
(0,
|
|
834
|
-
(0,
|
|
936
|
+
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, undefined, schemaIdForActions);
|
|
937
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForActions, ux_specification_types_1.DefinitionName.CustomActionPosition);
|
|
835
938
|
}
|
|
836
939
|
}
|
|
837
940
|
/**
|
|
@@ -866,7 +969,7 @@ function addTableAndViews(appSchema, v4Page, generateParameters, alias) {
|
|
|
866
969
|
const viewsPaths = v4Page.options?.settings?.views?.paths;
|
|
867
970
|
const entityType = generateParameters.entityType;
|
|
868
971
|
const defaultAnnotation = getDefaultAnnotationPath(v4Page, generateParameters.entityType, generateParameters.templateType);
|
|
869
|
-
const tableDefinitionName = (0,
|
|
972
|
+
const tableDefinitionName = (0, utils_2.alignSchemaWithTemplateType)(appSchema, generateParameters);
|
|
870
973
|
// Add filter bar
|
|
871
974
|
addFilterBar(entityType, appSchema, v4Page, alias);
|
|
872
975
|
if (generateParameters.templateType === ux_specification_types_1.TemplateType.ListReportObjectPageV4) {
|
|
@@ -884,7 +987,7 @@ function addTableAndViews(appSchema, v4Page, generateParameters, alias) {
|
|
|
884
987
|
}
|
|
885
988
|
else if (generateParameters.templateType === ux_specification_types_1.TemplateType.AnalyticalListPageV4) {
|
|
886
989
|
addALPViews(appSchema, viewsPaths, generateParameters, defaultAnnotation, v4Page, tableDefinitionName);
|
|
887
|
-
(0,
|
|
990
|
+
(0, utils_2.addFragmentEnumForAnchor)(appSchema, ux_specification_types_1.DefinitionName.LineItems, v4Page);
|
|
888
991
|
}
|
|
889
992
|
}
|
|
890
993
|
/**
|
|
@@ -906,12 +1009,12 @@ function addHeaderActions(appSchema, v4Page, logger) {
|
|
|
906
1009
|
const customActionDefinition = appSchema.definitions[customActionDefinitionKey];
|
|
907
1010
|
customActionDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
908
1011
|
customActionDefinition.description = 'Custom Action';
|
|
909
|
-
(0,
|
|
1012
|
+
(0, utils_2.addHeaderFooterCustomActionDefinition)(appSchema, v4Page, logger, customActionDefinitionKey, headerActionsDefinitionKey);
|
|
910
1013
|
const facetKey = ux_specification_types_1.DefinitionName.CustomHeaderActionPosition;
|
|
911
1014
|
(0, common_1.parseSchemaDefinition)(facetKey, facetKey, appSchema, false);
|
|
912
1015
|
// Anchor selection
|
|
913
1016
|
customActionDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${facetKey}`;
|
|
914
|
-
(0,
|
|
1017
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, headerActionsDefinitionKey, facetKey);
|
|
915
1018
|
}
|
|
916
1019
|
/**
|
|
917
1020
|
* Generates an app specific schema for the FE V4 ListReport from the generic schema.
|
|
@@ -945,7 +1048,7 @@ function generateListReportSchemaV4(generateParameters, genericSchema, templateN
|
|
|
945
1048
|
});
|
|
946
1049
|
return appSchema;
|
|
947
1050
|
}
|
|
948
|
-
const v4Page = (0,
|
|
1051
|
+
const v4Page = (0, utils_2.findPageV4)(pages, templateName, generateParameters.entitySet, contextPath);
|
|
949
1052
|
if (!v4Page) {
|
|
950
1053
|
return appSchema;
|
|
951
1054
|
}
|