@sap/ux-specification 1.90.18 → 1.90.21
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 +65 -2
- package/dist/documentation/runDocu-min.js +1 -1
- package/dist/documentation/styleDocu.css +7 -14
- package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
- package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
- package/dist/documentation/v2/v2-ListReport.html +1 -1
- package/dist/documentation/v2/v2-ObjectPage.html +1 -1
- package/dist/documentation/v2/v2-OverviewPage.html +1 -1
- package/dist/documentation/v4/v4-AnalyticalListPage.html +1 -1
- package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
- package/dist/documentation/v4/v4-ListReport.html +1 -1
- package/dist/documentation/v4/v4-ObjectPage.html +1 -1
- package/dist/index-min.js +1 -1
- package/dist/schemas/v2/AnalyticalListPageConfig.json +149 -15
- package/dist/schemas/v2/ListReportConfig.json +149 -15
- package/dist/schemas/v2/ObjectPageConfig.json +89 -33
- package/dist/schemas/v2/OverviewPageConfig.json +57 -16
- package/dist/schemas/v4/AnalyticalListPageConfig.json +43 -86
- package/dist/schemas/v4/ListReportConfig.json +43 -86
- package/dist/schemas/v4/ObjectPageConfig.json +70 -109
- package/dist/scripts/runDocu.js +30 -7
- package/dist/scripts/runDocu.js.map +1 -1
- package/dist/scripts/to-json-schema.js +31 -37
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/specification/v2/index-min.js +1 -1
- package/dist/specification/v4/index-min.js +1 -1
- package/dist/src/api.js +9 -9
- package/dist/src/api.js.map +1 -1
- package/dist/src/apiTypes.d.ts +5 -2
- package/dist/src/specification/schemaAccess.js +1 -3
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/specification/v2/controls/Action.d.ts +19 -2
- package/dist/src/specification/v2/controls/FilterBar.d.ts +70 -22
- package/dist/src/specification/v2/controls/FilterBar.js +24 -0
- package/dist/src/specification/v2/controls/FilterBar.js.map +1 -1
- package/dist/src/specification/v2/controls/Footer.d.ts +20 -0
- package/dist/src/specification/v2/controls/{ObjectPageFooter.js → Footer.js} +1 -1
- package/dist/src/specification/v2/controls/Footer.js.map +1 -0
- package/dist/src/specification/v2/controls/Table.d.ts +8 -1
- package/dist/src/specification/v2/controls/Table.js.map +1 -1
- package/dist/src/specification/v2/controls/ToolBar.d.ts +1 -8
- package/dist/src/specification/v2/controls/index.d.ts +1 -2
- package/dist/src/specification/v2/controls/index.js.map +1 -1
- package/dist/src/specification/v2/pages/AnalyticalListPageConfig.d.ts +2 -1
- package/dist/src/specification/v2/pages/ListReportConfig.d.ts +2 -1
- package/dist/src/specification/v2/pages/OverviewPageConfig.d.ts +36 -2
- package/dist/src/specification/v2/pages/OverviewPageConfig.js.map +1 -1
- package/dist/src/specification/v4/controls/ObjectPageFooter.d.ts +2 -2
- package/dist/src/specification/v4/controls/ObjectPageHeaderSection.d.ts +2 -14
- package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +7 -7
- package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +5 -6
- package/dist/src/specification/v4/controls/Table.d.ts +2 -7
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +59 -10
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js +6 -0
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js.map +1 -1
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/decoration/control.d.ts +11 -1
- package/dist/src/sync/common/decoration/control.js +29 -3
- package/dist/src/sync/common/decoration/control.js.map +1 -1
- package/dist/src/sync/common/decoration/factory.js +2 -4
- package/dist/src/sync/common/decoration/factory.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +9 -0
- package/dist/src/sync/common/generate/objectPage.js +89 -43
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +33 -0
- package/dist/src/sync/common/generate/utils.js +123 -3
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/i18n.json +2 -0
- package/dist/src/sync/common/import/utils.d.ts +8 -1
- package/dist/src/sync/common/import/utils.js +15 -4
- package/dist/src/sync/common/import/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.js +13 -22
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +30 -16
- package/dist/src/sync/common/types.js +25 -1
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +11 -3
- package/dist/src/sync/common/utils.js +147 -69
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +15 -0
- package/dist/src/sync/v2/export/controls/Action.js +68 -15
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts +18 -6
- package/dist/src/sync/v2/export/controls/FilterBar.js +102 -65
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
- package/dist/src/sync/v2/export/controls/FormAction.js +3 -2
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +239 -164
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +2 -2
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +9 -9
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +5 -5
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +15 -18
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +6 -4
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts +18 -2
- package/dist/src/sync/v2/export/controls/TableColumn.js +126 -1
- package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v2/export/export.js +140 -112
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.js +2 -5
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts +2 -1
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +3 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/export/pages/ListReport.d.ts +2 -1
- package/dist/src/sync/v2/export/pages/ListReport.js +3 -0
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +2 -1
- package/dist/src/sync/v2/export/pages/OverviewPage.js +32 -2
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
- package/dist/src/sync/v2/export/view-controller-generator.d.ts +16 -21
- package/dist/src/sync/v2/export/view-controller-generator.js +20 -36
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +14 -6
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.js +13 -4
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts +1 -5
- package/dist/src/sync/v2/generate/objectPage.js +16 -42
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +22 -11
- package/dist/src/sync/v2/generate/utils.js +282 -110
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.d.ts +22 -4
- package/dist/src/sync/v2/import/common/index.js +237 -27
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/controls/table.js +3 -2
- package/dist/src/sync/v2/import/controls/table.js.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +36 -5
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.d.ts +0 -5
- package/dist/src/sync/v2/import/pages/listReport.js +21 -122
- package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +200 -107
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.d.ts +4 -6
- package/dist/src/sync/v2/import/utils.js +43 -11
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +8 -1
- package/dist/src/sync/v2/types.js +8 -1
- package/dist/src/sync/v2/types.js.map +1 -1
- package/dist/src/sync/v4/application.d.ts +1 -1
- package/dist/src/sync/v4/application.js +1 -1
- package/dist/src/sync/v4/application.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js +3 -3
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +3 -7
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js +2 -25
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/TableColumn.d.ts +1 -6
- package/dist/src/sync/v4/export/controls/TableColumn.js +0 -33
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/src/sync/v4/export/controls/ToolBar.d.ts +5 -1
- package/dist/src/sync/v4/export/controls/ToolBar.js +3 -0
- package/dist/src/sync/v4/export/controls/ToolBar.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +20 -16
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/manifest.d.ts +1 -1
- package/dist/src/sync/v4/export/manifest.js +43 -31
- package/dist/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/src/sync/v4/export/pages/AnalyticalListPage.d.ts +2 -2
- package/dist/src/sync/v4/export/pages/ListReport.d.ts +2 -2
- package/dist/src/sync/v4/export/pages/ObjectPage.d.ts +2 -2
- package/dist/src/sync/v4/export/types.d.ts +3 -0
- package/dist/src/sync/v4/generate/generate.d.ts +4 -2
- package/dist/src/sync/v4/generate/generate.js +15 -6
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/listReport.d.ts +7 -6
- package/dist/src/sync/v4/generate/listReport.js +50 -34
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +94 -90
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/pages/analyticalListPage.d.ts +2 -2
- package/dist/src/sync/v4/import/pages/analyticalListPage.js +0 -1
- package/dist/src/sync/v4/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v4/import/pages/listReport.d.ts +3 -3
- package/dist/src/sync/v4/import/pages/listReport.js +34 -23
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +2 -2
- package/dist/src/sync/v4/import/pages/objectPage.js +21 -16
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.js +6 -5
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/src/sync/v4/utils/utils.d.ts +14 -1
- package/dist/src/sync/v4/utils/utils.js +62 -26
- package/dist/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/test/unit/utils.test.d.ts +1 -1
- package/package.json +5 -8
- package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +0 -11
- package/dist/src/specification/v2/controls/ObjectPageFooter.js.map +0 -1
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.d.ts +0 -28
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.js +0 -3
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.js.map +0 -1
- package/dist/test/test-utils/metadataParser.d.ts +0 -19
|
@@ -9,10 +9,11 @@ import { ExtensionLogger } from '../../../apiTypes';
|
|
|
9
9
|
* @param annotations - list of all annotation files (file content plus URI as identifier)
|
|
10
10
|
* @param manifest - manifest.json of the app
|
|
11
11
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
12
|
+
* @param {FileData[]} fragments - list of fragment files and their content
|
|
12
13
|
*
|
|
13
14
|
* @returns the app specific JSON schema
|
|
14
15
|
*/
|
|
15
|
-
export declare function generateObjectPageInterfaceV4(genericSchema: object, entitySet: string, annotations: FileData[], manifest: object, logger?: ExtensionLogger): object;
|
|
16
|
+
export declare function generateObjectPageInterfaceV4(genericSchema: object, entitySet: string, annotations: FileData[], manifest: object, logger?: ExtensionLogger, fragments?: FileData[]): object;
|
|
16
17
|
/**
|
|
17
18
|
* Generates the app specific schema of a list report out of the generic schema.
|
|
18
19
|
* Generic types are replaced by information from the app specific annotations.
|
|
@@ -21,7 +22,8 @@ export declare function generateObjectPageInterfaceV4(genericSchema: object, ent
|
|
|
21
22
|
* @param entitySetName - the base entity set of the given page
|
|
22
23
|
* @param annotations - list of all annotation files (file content plus URI as identifier)
|
|
23
24
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
25
|
+
* @param manifest - manifest.json of the app
|
|
24
26
|
*
|
|
25
27
|
* @returns the app specific JSON schema
|
|
26
28
|
*/
|
|
27
|
-
export declare function generateListReportInterfaceV4(genericSchema: object, entitySetName: string, annotations: FileData[], logger?: ExtensionLogger): object;
|
|
29
|
+
export declare function generateListReportInterfaceV4(genericSchema: object, entitySetName: string, annotations: FileData[], logger?: ExtensionLogger, manifest?: object): object;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const utils_1 = require("../../common/utils");
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
const __1 = require("../../..");
|
|
6
|
+
const v4_1 = require("../../../v4");
|
|
6
7
|
/**
|
|
7
8
|
* Generates the app specific schema of an object page out of the generic schema for the same page.
|
|
8
9
|
* Generic types are replaced by information from the app specific annotations.
|
|
@@ -12,15 +13,16 @@ const __1 = require("../../..");
|
|
|
12
13
|
* @param annotations - list of all annotation files (file content plus URI as identifier)
|
|
13
14
|
* @param manifest - manifest.json of the app
|
|
14
15
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
16
|
+
* @param {FileData[]} fragments - list of fragment files and their content
|
|
15
17
|
*
|
|
16
18
|
* @returns the app specific JSON schema
|
|
17
19
|
*/
|
|
18
|
-
function generateObjectPageInterfaceV4(genericSchema, entitySet, annotations, manifest, logger) {
|
|
20
|
+
function generateObjectPageInterfaceV4(genericSchema, entitySet, annotations, manifest, logger, fragments) {
|
|
19
21
|
const serviceAVT = utils_1.parseAndMergeAndConvert(annotations, logger);
|
|
20
22
|
const generateParameters = {
|
|
21
23
|
fioriElementsVersion: __1.FioriElementsVersion.v4,
|
|
22
24
|
manifest,
|
|
23
|
-
fragments
|
|
25
|
+
fragments,
|
|
24
26
|
serviceAVT,
|
|
25
27
|
logger
|
|
26
28
|
};
|
|
@@ -35,13 +37,20 @@ exports.generateObjectPageInterfaceV4 = generateObjectPageInterfaceV4;
|
|
|
35
37
|
* @param entitySetName - the base entity set of the given page
|
|
36
38
|
* @param annotations - list of all annotation files (file content plus URI as identifier)
|
|
37
39
|
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
40
|
+
* @param manifest - manifest.json of the app
|
|
38
41
|
*
|
|
39
42
|
* @returns the app specific JSON schema
|
|
40
43
|
*/
|
|
41
|
-
function generateListReportInterfaceV4(genericSchema, entitySetName, annotations, logger) {
|
|
42
|
-
const
|
|
43
|
-
const entitySet =
|
|
44
|
-
|
|
44
|
+
function generateListReportInterfaceV4(genericSchema, entitySetName, annotations, logger, manifest) {
|
|
45
|
+
const serviceAVT = utils_1.parseAndMergeAndConvert(annotations, logger);
|
|
46
|
+
const entitySet = serviceAVT.entitySets.find((es) => es.name === entitySetName);
|
|
47
|
+
const generateParameters = {
|
|
48
|
+
fioriElementsVersion: __1.FioriElementsVersion.v4,
|
|
49
|
+
manifest,
|
|
50
|
+
serviceAVT,
|
|
51
|
+
logger
|
|
52
|
+
};
|
|
53
|
+
return _1.generateListReportSchemaV4(generateParameters, genericSchema, entitySet, v4_1.FE_TEMPLATE_V4_LIST_REPORT);
|
|
45
54
|
}
|
|
46
55
|
exports.generateListReportInterfaceV4 = generateListReportInterfaceV4;
|
|
47
56
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../../src/sync/v4/generate/generate.ts"],"names":[],"mappings":";;AACA,8CAA6D;AAC7D,wBAA2E;AAE3E,gCAAgD;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../../src/sync/v4/generate/generate.ts"],"names":[],"mappings":";;AACA,8CAA6D;AAC7D,wBAA2E;AAE3E,gCAAgD;AAChD,oCAAyD;AAEzD;;;;;;;;;;;;GAYG;AACH,SAAgB,6BAA6B,CACzC,aAAqB,EACrB,SAAiB,EACjB,WAAuB,EACvB,QAAgB,EAChB,MAAwB,EACxB,SAAsB;IAEtB,MAAM,UAAU,GAAG,+BAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,kBAAkB,GAAgC;QACpD,oBAAoB,EAAE,wBAAoB,CAAC,EAAE;QAC7C,QAAQ;QACR,SAAS;QACT,UAAU;QACV,MAAM;KACT,CAAC;IACF,OAAO,6BAA0B,CAAC,kBAAkB,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;AACpF,CAAC;AAjBD,sEAiBC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,6BAA6B,CACzC,aAAqB,EACrB,aAAqB,EACrB,WAAuB,EACvB,MAAwB,EACxB,QAAiB;IAEjB,MAAM,UAAU,GAAG,+BAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;IAChF,MAAM,kBAAkB,GAAgC;QACpD,oBAAoB,EAAE,wBAAoB,CAAC,EAAE;QAC7C,QAAQ;QACR,UAAU;QACV,MAAM;KACT,CAAC;IAEF,OAAO,6BAA0B,CAAC,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,+BAA0B,CAAC,CAAC;AAChH,CAAC;AAjBD,sEAiBC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { GenerateAppSchemaParameters } from '../../../apiTypes';
|
|
2
|
+
import { EntitySet } from '@sap-ux/annotation-converter';
|
|
1
3
|
import { ConverterOutput, EntityType } from '@sap-ux/vocabularies-types';
|
|
2
|
-
import { ExtensionLogger } from '../../../apiTypes';
|
|
3
4
|
export declare function addEnumForVariantPaths(entityType: EntityType, appSchema: object, oDataServiceAVT: ConverterOutput): void;
|
|
4
5
|
/**
|
|
5
6
|
* Generates an app specific schema for the FE V4 Listreport from the generic schema.
|
|
6
7
|
* Generic types are replaced by information from the app specific annotations.
|
|
8
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
9
|
+
* @param genericSchema - generic JSON schema of an object page
|
|
10
|
+
* @param {EntitySet} entitySet - entity set (AVT object) that is relevant for the given page
|
|
11
|
+
* @param {string} templateName - allows to distinguish list report from ALP
|
|
7
12
|
*
|
|
8
|
-
* @param {object} genericSchema - generic JSON schema of a list report
|
|
9
|
-
* @param {string} entityTypeName - the base entity type of the given page
|
|
10
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by Annotation Vocabularies Tool
|
|
11
|
-
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
12
13
|
* @returns {object} application-specific schema of the list report
|
|
13
14
|
*/
|
|
14
|
-
export declare function generateListReportSchemaV4(
|
|
15
|
+
export declare function generateListReportSchemaV4(generateParameters: GenerateAppSchemaParameters, genericSchema: object, entitySet: EntitySet, templateName: string): object;
|
|
@@ -3,9 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../utils/utils");
|
|
7
|
+
const __1 = require("../../..");
|
|
8
|
+
const v4_1 = require("../../../v4");
|
|
6
9
|
const i18next_1 = __importDefault(require("i18next"));
|
|
7
10
|
const extensionLogger_1 = require("../../../extensionLogger");
|
|
8
|
-
const utils_1 = require("../utils/utils");
|
|
9
11
|
const common_1 = require("../../common");
|
|
10
12
|
/**
|
|
11
13
|
* Adds the selection fields to the app schema, as properties of the Filterbar
|
|
@@ -23,7 +25,6 @@ function addSelectionFields(entityType, appSchema, selectionFieldsAnnotation) {
|
|
|
23
25
|
}
|
|
24
26
|
let i = 0;
|
|
25
27
|
selectionFieldsAnnotation.forEach((selectionField) => {
|
|
26
|
-
var _a;
|
|
27
28
|
let description = selectionField.value;
|
|
28
29
|
const fieldDefinition = 'SelectionField::' + common_1.prepareRef(selectionField.value);
|
|
29
30
|
if (selectionField.type === 'PropertyPath') {
|
|
@@ -33,16 +34,8 @@ function addSelectionFields(entityType, appSchema, selectionFieldsAnnotation) {
|
|
|
33
34
|
$ref: common_1.DEFINITION_LINK_PREFIX + fieldDefinition,
|
|
34
35
|
propertyIndex: i
|
|
35
36
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
properties: {},
|
|
39
|
-
description,
|
|
40
|
-
annotationPath: `${selectionFieldsDefinition.annotationPath}/${i}`,
|
|
41
|
-
isViewNode: true,
|
|
42
|
-
additionalProperties: false,
|
|
43
|
-
annotationType: selectionField === null || selectionField === void 0 ? void 0 : selectionField.type,
|
|
44
|
-
dataType: (_a = selectionField === null || selectionField === void 0 ? void 0 : selectionField.$target) === null || _a === void 0 ? void 0 : _a.type.replace('Edm.', '')
|
|
45
|
-
};
|
|
37
|
+
const dataType = common_1.determineDataType(selectionField);
|
|
38
|
+
appSchema['definitions'][fieldDefinition] = Object.assign({ type: 'object', properties: {}, description, annotationPath: `${selectionFieldsDefinition.annotationPath}/${i}`, isViewNode: true, additionalProperties: false, annotationType: selectionField === null || selectionField === void 0 ? void 0 : selectionField.type }, (dataType && { dataType }));
|
|
46
39
|
i++;
|
|
47
40
|
});
|
|
48
41
|
}
|
|
@@ -55,40 +48,63 @@ exports.addEnumForVariantPaths = addEnumForVariantPaths;
|
|
|
55
48
|
/**
|
|
56
49
|
* Generates an app specific schema for the FE V4 Listreport from the generic schema.
|
|
57
50
|
* Generic types are replaced by information from the app specific annotations.
|
|
51
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
52
|
+
* @param genericSchema - generic JSON schema of an object page
|
|
53
|
+
* @param {EntitySet} entitySet - entity set (AVT object) that is relevant for the given page
|
|
54
|
+
* @param {string} templateName - allows to distinguish list report from ALP
|
|
58
55
|
*
|
|
59
|
-
* @param {object} genericSchema - generic JSON schema of a list report
|
|
60
|
-
* @param {string} entityTypeName - the base entity type of the given page
|
|
61
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by Annotation Vocabularies Tool
|
|
62
|
-
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
63
56
|
* @returns {object} application-specific schema of the list report
|
|
64
57
|
*/
|
|
65
|
-
function generateListReportSchemaV4(
|
|
58
|
+
function generateListReportSchemaV4(generateParameters, genericSchema, entitySet, templateName) {
|
|
66
59
|
var _a, _b, _c, _d;
|
|
67
60
|
const appSchema = JSON.parse(JSON.stringify(genericSchema));
|
|
68
|
-
const entityType =
|
|
61
|
+
const entityType = entitySet === null || entitySet === void 0 ? void 0 : entitySet.entityType;
|
|
69
62
|
if (!entityType) {
|
|
70
|
-
extensionLogger_1.log(logger, {
|
|
63
|
+
extensionLogger_1.log(generateParameters.logger, {
|
|
71
64
|
severity: "error" /* Error */,
|
|
72
|
-
message: i18next_1.default.t('NOENTITYTYPE'
|
|
65
|
+
message: i18next_1.default.t('NOENTITYTYPE'),
|
|
73
66
|
location: {
|
|
74
67
|
path: common_1.METADATAPATH
|
|
75
68
|
}
|
|
76
69
|
});
|
|
70
|
+
return appSchema;
|
|
77
71
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
72
|
+
if (!(generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT)) {
|
|
73
|
+
return appSchema;
|
|
74
|
+
}
|
|
75
|
+
const alias = common_1.findAlias(common_1.UIVOCABULARY, generateParameters.serviceAVT);
|
|
76
|
+
const lineItemAnnotation = (_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;
|
|
77
|
+
appSchema['definitions']['Table'].properties.toolBar.$ref = `${common_1.DEFINITION_LINK_PREFIX}ToolBar<LineItems>`;
|
|
78
|
+
utils_1.addLineItemsType(appSchema, lineItemAnnotation, entityType, generateParameters.serviceAVT);
|
|
79
|
+
addEnumForVariantPaths(entityType, appSchema, generateParameters.serviceAVT);
|
|
80
|
+
const selectionFieldAnnotation = (_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.SelectionFields;
|
|
81
|
+
addSelectionFields(entityType, appSchema, selectionFieldAnnotation);
|
|
82
|
+
// Switch from generic column to specific definition
|
|
83
|
+
appSchema['definitions']['Table'].properties['columns'] = {
|
|
84
|
+
$ref: common_1.DEFINITION_LINK_PREFIX + 'LineItems'
|
|
85
|
+
};
|
|
86
|
+
delete appSchema['definitions']['GenericColumns'];
|
|
87
|
+
delete appSchema['definitions']['ToolBar'];
|
|
88
|
+
delete appSchema['definitions']['Actions'];
|
|
89
|
+
delete appSchema['definitions']['Action'];
|
|
90
|
+
if (generateParameters.manifest) {
|
|
91
|
+
//Find page in targets
|
|
92
|
+
const pages = generateParameters.manifest[__1.ManifestSection.ui5].routing.targets;
|
|
93
|
+
if (!pages) {
|
|
94
|
+
extensionLogger_1.log(generateParameters.logger, {
|
|
95
|
+
severity: "error" /* Error */,
|
|
96
|
+
message: i18next_1.default.t('NOPAGES', { appId: generateParameters.manifest['sap.app']['id'] }),
|
|
97
|
+
location: {
|
|
98
|
+
path: v4_1.MANIFESTPATH,
|
|
99
|
+
range: [__1.ManifestSection.generic]
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return appSchema;
|
|
103
|
+
}
|
|
104
|
+
const v4Page = utils_1.findPageV4(pages, templateName, entitySet, generateParameters.logger);
|
|
105
|
+
if (!v4Page) {
|
|
106
|
+
return appSchema;
|
|
107
|
+
}
|
|
92
108
|
}
|
|
93
109
|
return appSchema;
|
|
94
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listReport.js","sourceRoot":"","sources":["../../../../../src/sync/v4/generate/listReport.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"listReport.js","sourceRoot":"","sources":["../../../../../src/sync/v4/generate/listReport.ts"],"names":[],"mappings":";;;;;AACA,0CAA8D;AAE9D,gCAA2C;AAC3C,oCAA2D;AAQ3D,sDAA8B;AAC9B,8DAA4D;AAC5D,yCAYsB;AAEtB;;;;;GAKG;AACH,SAAS,kBAAkB,CACvB,UAAsB,EACtB,SAAiB,EACjB,yBAA0D;IAE1D,MAAM,yBAAyB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC;IAC3E,yBAAyB,CAAC,oBAAoB,GAAG,KAAK,CAAC;IACvD,yBAAyB,CAAC,UAAU,GAAG,EAAE,CAAC;IAC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AM,EAAE;YACT,OAAO,SAAS,CAAC;SACpB;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AA7DD,gEA6DC"}
|
|
@@ -39,69 +39,46 @@ function addHeaderActionCallBackV4(entityType, appSchema, actionAnnotation, head
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Adds definitions for collection facet items in object page sections to the app schema
|
|
44
|
-
* @param {FacetConfigs} facet - current facet.
|
|
45
|
-
* @param {string} facetKey - facet key.
|
|
46
|
-
* @param {object} sections - schema of current sections definition.
|
|
47
|
-
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
48
|
-
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
49
|
-
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
50
|
-
*/
|
|
51
|
-
function handleCollection(facet, facetKey, sections, appSchema, oDataServiceAVT, sectionPrefix) {
|
|
52
|
-
sections['properties'][facetKey].properties = {
|
|
53
|
-
subsections: {
|
|
54
|
-
additionalProperties: false,
|
|
55
|
-
type: 'object',
|
|
56
|
-
properties: {},
|
|
57
|
-
annotationPath: facet.annotationPath,
|
|
58
|
-
isViewNode: true,
|
|
59
|
-
description: 'Subsections'
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const subSections = sections['properties'][facetKey].properties.subsections;
|
|
63
|
-
for (const key in facet['facets']) {
|
|
64
|
-
addSection(facet['facets'], key, subSections, appSchema, oDataServiceAVT, sectionPrefix);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
42
|
/**
|
|
68
43
|
* Adds definitions for line items in object page sections to the app schema
|
|
69
44
|
* @param facet - the given facet from the UI annotations
|
|
70
|
-
* @param
|
|
45
|
+
* @param facetIdInSchema - key of the facet, as used in schema
|
|
46
|
+
* @param facetIdInManifest - key of the facet, as used in annotation
|
|
71
47
|
* @param facets - list of all facets
|
|
72
48
|
* @param appSchema - app schema in general
|
|
73
49
|
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
50
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
51
|
+
* @param {ExtensionLogger} logger - logger for exceptions
|
|
74
52
|
*/
|
|
75
|
-
function handleLineItem(facet,
|
|
53
|
+
function handleLineItem(facet, facetIdInManifest, facetIdInSchema, facets, appSchema, oDataServiceAVT, v4Page, logger) {
|
|
76
54
|
let navigationProperty = '', annotation = '';
|
|
77
|
-
[navigationProperty, annotation] =
|
|
78
|
-
const schemaIdForOpSection =
|
|
55
|
+
[navigationProperty, annotation] = facetIdInSchema.split('::');
|
|
56
|
+
const schemaIdForOpSection = `ObjectPageSectionTableV4<${facetIdInSchema}>`;
|
|
79
57
|
appSchema['definitions'][schemaIdForOpSection] = JSON.parse(JSON.stringify(appSchema['definitions']['ObjectPageSectionTableV4']));
|
|
80
|
-
const schemaIdForTable = `ObjectPageTable<${
|
|
58
|
+
const schemaIdForTable = `ObjectPageTable<${facetIdInSchema}>`;
|
|
81
59
|
appSchema['definitions'][schemaIdForOpSection].properties.table.$ref = `${common_2.DEFINITION_LINK_PREFIX}${schemaIdForTable}`;
|
|
82
|
-
appSchema['definitions'][schemaIdForTable] = JSON.parse(JSON.stringify(appSchema['definitions'][
|
|
60
|
+
appSchema['definitions'][schemaIdForTable] = JSON.parse(JSON.stringify(appSchema['definitions'][v4_1.DefinitionName.ObjectPageTable]));
|
|
83
61
|
appSchema['definitions'][schemaIdForOpSection].annotationPath = facet.annotationPath;
|
|
84
|
-
common_2.addSectionTitleAndDescription(facet, appSchema['definitions'][schemaIdForOpSection],
|
|
85
|
-
appSchema['definitions'][schemaIdForOpSection].properties.table.$ref =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
appSchema['definitions'][idForTable] = JSON.parse(JSON.stringify(appSchema['definitions']['ObjectPageTable']));
|
|
62
|
+
common_2.addSectionTitleAndDescription(facet, appSchema['definitions'][schemaIdForOpSection], facetIdInSchema);
|
|
63
|
+
appSchema['definitions'][schemaIdForOpSection].properties.table.$ref = `${common_2.DEFINITION_LINK_PREFIX}ObjectPageTable<${facetIdInSchema}>`;
|
|
64
|
+
const idForTable = `ObjectPageTable<${facetIdInSchema}>`;
|
|
65
|
+
appSchema['definitions'][idForTable] = JSON.parse(JSON.stringify(appSchema['definitions'][v4_1.DefinitionName.ObjectPageTable]));
|
|
89
66
|
if (facet.entityType && annotation) {
|
|
90
67
|
appSchema['definitions'][idForTable].annotationPath = `/${facet.entityType.fullyQualifiedName}/${annotation}`;
|
|
91
68
|
}
|
|
92
69
|
appSchema['definitions'][idForTable].properties['columns'] = {
|
|
93
|
-
$ref: common_2.DEFINITION_LINK_PREFIX +
|
|
70
|
+
$ref: common_2.DEFINITION_LINK_PREFIX + facetIdInSchema
|
|
94
71
|
};
|
|
95
|
-
appSchema['definitions'][idForTable].properties['toolBar'].$ref = `${common_2.DEFINITION_LINK_PREFIX}ObjectPageToolBar<${
|
|
72
|
+
appSchema['definitions'][idForTable].properties['toolBar'].$ref = `${common_2.DEFINITION_LINK_PREFIX}ObjectPageToolBar<${facetIdInSchema}>`;
|
|
96
73
|
//adjust quickVariantSelection
|
|
97
|
-
appSchema['definitions'][idForTable].properties['quickVariantSelection'].$ref = `${common_2.DEFINITION_LINK_PREFIX}QuickVariantSelectionV4OP<${
|
|
98
|
-
appSchema['definitions'][`QuickVariantSelectionV4OP<${
|
|
99
|
-
appSchema['definitions'][`AnnotationPathAsObject<${
|
|
100
|
-
appSchema['definitions'][`QuickVariantSelectionV4OP<${
|
|
101
|
-
common_2.addEnumForSingleTabVariant(facet.entityType, appSchema, `AnnotationPathAsObject<${
|
|
74
|
+
appSchema['definitions'][idForTable].properties['quickVariantSelection'].$ref = `${common_2.DEFINITION_LINK_PREFIX}QuickVariantSelectionV4OP<${facetIdInSchema}>`;
|
|
75
|
+
appSchema['definitions'][`QuickVariantSelectionV4OP<${facetIdInSchema}>`] = JSON.parse(JSON.stringify(appSchema['definitions']['QuickVariantSelectionV4OP']));
|
|
76
|
+
appSchema['definitions'][`AnnotationPathAsObject<${facetIdInSchema}>`] = JSON.parse(JSON.stringify(appSchema['definitions']['AnnotationPathAsObject']));
|
|
77
|
+
appSchema['definitions'][`QuickVariantSelectionV4OP<${facetIdInSchema}>`].properties.paths.items.$ref = `${common_2.DEFINITION_LINK_PREFIX}AnnotationPathAsObject<${facetIdInSchema}>`;
|
|
78
|
+
common_2.addEnumForSingleTabVariant(facet.entityType, appSchema, `AnnotationPathAsObject<${facetIdInSchema}>`);
|
|
102
79
|
for (const facetKey in facets) {
|
|
103
|
-
if (facets[facetKey].base ===
|
|
104
|
-
utils_1.addLineItemsType(appSchema, facets[facetKey].target, facets[facetKey].entityType, oDataServiceAVT,
|
|
80
|
+
if (facets[facetKey].base === common_2.FacetBase.LineItem && facetKey.includes(navigationProperty)) {
|
|
81
|
+
utils_1.addLineItemsType(appSchema, facets[facetKey].target, facets[facetKey].entityType, oDataServiceAVT, v4_1.DefinitionName.ObjectPageTableColumn, facetIdInSchema);
|
|
105
82
|
}
|
|
106
83
|
}
|
|
107
84
|
}
|
|
@@ -129,7 +106,26 @@ function handleFormIdentification(facet, facetKey, sections, appSchema, sectionP
|
|
|
129
106
|
common_2.handleForm(sectionPrefix, facet, appSchema['definitions'][formDefinitionKey], appSchema, common_1.FioriElementsVersion.v4, withActions);
|
|
130
107
|
}
|
|
131
108
|
/**
|
|
132
|
-
* Adds definitions for DataPoint
|
|
109
|
+
* Adds definitions for DataPoint items in object page sections to the app schema
|
|
110
|
+
* @param {FacetConfigs} facet - current facet.
|
|
111
|
+
* @param {string} facetKey - facet key.
|
|
112
|
+
* @param {object} sections - schema of current sections definition.
|
|
113
|
+
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
114
|
+
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
115
|
+
* @param {SectionType} facetDefinitionKey - key to identify new definition
|
|
116
|
+
*/
|
|
117
|
+
function handleChartAndDataPoint(facet, facetKey, sections, appSchema, facetDefinitionKey) {
|
|
118
|
+
sections['properties'][facetKey] = {
|
|
119
|
+
$ref: `${common_2.DEFINITION_LINK_PREFIX}${facetDefinitionKey}`
|
|
120
|
+
};
|
|
121
|
+
appSchema['definitions'][facetDefinitionKey] = JSON.parse(JSON.stringify(appSchema['definitions'][`CommonHeaderFacetSettings`]));
|
|
122
|
+
common_2.addTargetTitleAndSectionDescription(facet, appSchema['definitions'][facetDefinitionKey], facetKey);
|
|
123
|
+
appSchema['definitions'][facetDefinitionKey]['annotationPath'] = facet.annotationPath;
|
|
124
|
+
appSchema['definitions'][facetDefinitionKey]['dataType'] = common_2.determineDataTypeOfTarget(facet === null || facet === void 0 ? void 0 : facet.target);
|
|
125
|
+
appSchema['definitions'][facetDefinitionKey]['isViewNode'] = true;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Adds definitions for Address and Contact items in object page sections to the app schema
|
|
133
129
|
* @param {FacetConfigs} facet - current facet.
|
|
134
130
|
* @param {string} facetKey - facet key.
|
|
135
131
|
* @param {object} sections - schema of current sections definition.
|
|
@@ -137,7 +133,7 @@ function handleFormIdentification(facet, facetKey, sections, appSchema, sectionP
|
|
|
137
133
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
138
134
|
* @param {SectionType} facetDefinitionKey - key to identify new definition
|
|
139
135
|
*/
|
|
140
|
-
function
|
|
136
|
+
function handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefix, facetDefinitionKey) {
|
|
141
137
|
sections['properties'][facetKey] = {
|
|
142
138
|
$ref: `${common_2.DEFINITION_LINK_PREFIX}${facetDefinitionKey}`
|
|
143
139
|
};
|
|
@@ -148,38 +144,56 @@ function handleDataPointAddressContact(facet, facetKey, sections, appSchema, sec
|
|
|
148
144
|
}
|
|
149
145
|
/**
|
|
150
146
|
* Creates a section definition in app schema.
|
|
147
|
+
* @param {GenerateSchemaParameters} generateParameters - list of API input parameters
|
|
151
148
|
* @param {FacetConfigs} facets - list of all facets.
|
|
152
149
|
* @param {string} facetKey - facet key.
|
|
153
150
|
* @param {object} sections - schema of current sections definition.
|
|
154
151
|
* @param {object} appSchema - app specific schema that potentially gets enhanced.
|
|
155
152
|
* @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
156
153
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
154
|
+
* @param {SapUiAppPageV4} v4Page Current page in manifest
|
|
157
155
|
*/
|
|
158
|
-
function addSection(facets, facetKey, sections, appSchema,
|
|
156
|
+
function addSection(generateParameters, facets, facetKey, sections, appSchema, sectionPrefix, v4Page) {
|
|
159
157
|
const facet = facets[facetKey];
|
|
160
|
-
const
|
|
158
|
+
const facetKeyInSchema = facetKey.replace('#', '::');
|
|
161
159
|
if (facet.base === 'CollectionFacet') {
|
|
162
160
|
//handle collection facets
|
|
163
161
|
sections['properties'][facetKey] = common_2.createSectionWithoutProperties(facet, facetKey);
|
|
164
|
-
|
|
162
|
+
sections['properties'][facetKey].properties = {
|
|
163
|
+
subsections: {
|
|
164
|
+
additionalProperties: false,
|
|
165
|
+
type: 'object',
|
|
166
|
+
properties: {},
|
|
167
|
+
annotationPath: facet.annotationPath,
|
|
168
|
+
isViewNode: true,
|
|
169
|
+
description: 'Subsections'
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const subSections = sections['properties'][facetKey].properties.subsections;
|
|
173
|
+
for (const key in facet['facets']) {
|
|
174
|
+
addSection(generateParameters, facet['facets'], key, subSections, appSchema, sectionPrefix, v4Page);
|
|
175
|
+
}
|
|
165
176
|
}
|
|
166
177
|
else if (facet.base === 'LineItem' && sectionPrefix === v4_1.SectionType.Section) {
|
|
167
|
-
const tableDefinitionKey = `ObjectPage${sectionPrefix}TableV4<${
|
|
178
|
+
const tableDefinitionKey = `ObjectPage${sectionPrefix}TableV4<${facetKeyInSchema}>`;
|
|
168
179
|
//handle reference facet (if comprising line item)
|
|
169
180
|
sections['properties'][facetKey] = {
|
|
170
181
|
$ref: `${common_2.DEFINITION_LINK_PREFIX}${tableDefinitionKey}`
|
|
171
182
|
};
|
|
172
|
-
handleLineItem(facet,
|
|
183
|
+
handleLineItem(facet, facetKey, facetKeyInSchema, facets, appSchema, generateParameters.serviceAVT, v4Page, generateParameters.logger);
|
|
173
184
|
}
|
|
174
185
|
else if (facet.base === common_2.FacetBase.Form || facet.base === common_2.FacetBase.Identification) {
|
|
175
|
-
const formDefinitionKey = `ObjectPage${sectionPrefix}Form<${
|
|
186
|
+
const formDefinitionKey = `ObjectPage${sectionPrefix}Form<${facetKeyInSchema}>`;
|
|
176
187
|
handleFormIdentification(facet, facetKey, sections, appSchema, sectionPrefix, formDefinitionKey);
|
|
177
188
|
}
|
|
178
189
|
else if (facet.base === common_2.FacetBase.DataPoint ||
|
|
179
|
-
facet.base === common_2.FacetBase.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
(facet.base === common_2.FacetBase.Chart && sectionPrefix === v4_1.SectionType.HeaderSection)) {
|
|
191
|
+
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${facetKeyInSchema}>`;
|
|
192
|
+
handleChartAndDataPoint(facet, facetKey, sections, appSchema, facetDefinitionKey);
|
|
193
|
+
}
|
|
194
|
+
else if (facet.base === common_2.FacetBase.Address || facet.base === common_2.FacetBase.Contact) {
|
|
195
|
+
const facetDefinitionKey = `ObjectPage${sectionPrefix}${facet.base}<${facetKeyInSchema}>`;
|
|
196
|
+
handleAddressContact(facet, facetKey, sections, appSchema, sectionPrefix, facetDefinitionKey);
|
|
183
197
|
}
|
|
184
198
|
else {
|
|
185
199
|
sections['properties'][facetKey] = common_2.createSectionWithoutProperties(facet, facetKey);
|
|
@@ -190,10 +204,9 @@ function addSection(facets, facetKey, sections, appSchema, oDataServiceAVT, sect
|
|
|
190
204
|
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
191
205
|
* @param {object} appSchema - application specific JSON schema
|
|
192
206
|
* @param {EntityType} entityType - current entity type
|
|
193
|
-
* @param {
|
|
194
|
-
* @param pages {SapUiAppPageV4[]} - list of (manifest) pages
|
|
207
|
+
* @param {SapUiAppPageV4} v4Page - current page
|
|
195
208
|
*/
|
|
196
|
-
function addSections(generateParameters, appSchema, entityType,
|
|
209
|
+
function addSections(generateParameters, appSchema, entityType, v4Page) {
|
|
197
210
|
// Get facet annotations
|
|
198
211
|
const facets = common_2.getObjectPageFacets(entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, common_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
199
212
|
if (!facets) {
|
|
@@ -201,15 +214,9 @@ function addSections(generateParameters, appSchema, entityType, entitySetName, p
|
|
|
201
214
|
return;
|
|
202
215
|
}
|
|
203
216
|
const sections = appSchema['definitions']['Sections'];
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
pages[element].name === v4_1.FE_TEMPLATE_V4_OBJECT_PAGE) {
|
|
208
|
-
for (const facetKey in facets) {
|
|
209
|
-
addSection(facets, facetKey, sections, appSchema, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, v4_1.SectionType.Section);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
});
|
|
217
|
+
for (const facetKey in facets) {
|
|
218
|
+
addSection(generateParameters, facets, facetKey, sections, appSchema, v4_1.SectionType.Section, v4Page);
|
|
219
|
+
}
|
|
213
220
|
// Custom sections as part of sections
|
|
214
221
|
if (appSchema['definitions']['CustomSections']) {
|
|
215
222
|
sections.properties = Object.assign(Object.assign({}, sections.properties), appSchema['definitions']['CustomSections'].properties);
|
|
@@ -220,10 +227,9 @@ function addSections(generateParameters, appSchema, entityType, entitySetName, p
|
|
|
220
227
|
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
221
228
|
* @param {object} appSchema - application specific JSON schema
|
|
222
229
|
* @param {EntityType} entityType - current entity type
|
|
223
|
-
* @param {
|
|
224
|
-
* @param pages {SapUiAppPageV4[]} - list of (manifest) pages
|
|
230
|
+
* @param {SapUiAppPageV4} v4Page - current page in manifest
|
|
225
231
|
*/
|
|
226
|
-
function addHeaderSections(generateParameters, appSchema, entityType,
|
|
232
|
+
function addHeaderSections(generateParameters, appSchema, entityType, v4Page) {
|
|
227
233
|
// Get facet annotations
|
|
228
234
|
const facets = common_2.getObjectPageHeaderFacets(entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, common_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
229
235
|
const sections = appSchema['definitions']['HeaderSections'];
|
|
@@ -232,15 +238,9 @@ function addHeaderSections(generateParameters, appSchema, entityType, entitySetN
|
|
|
232
238
|
if (!facets) {
|
|
233
239
|
return;
|
|
234
240
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
pages[element].name === v4_1.FE_TEMPLATE_V4_OBJECT_PAGE) {
|
|
239
|
-
for (const facetKey in facets) {
|
|
240
|
-
addSection(facets, facetKey, sections, appSchema, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, v4_1.SectionType.HeaderSection);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
});
|
|
241
|
+
for (const facetKey in facets) {
|
|
242
|
+
addSection(generateParameters, facets, facetKey, sections, appSchema, v4_1.SectionType.HeaderSection, v4Page);
|
|
243
|
+
}
|
|
244
244
|
//delete generic definitions
|
|
245
245
|
delete appSchema['definitions']['ObjectPageHeaderSectionForm'];
|
|
246
246
|
delete appSchema['definitions']['ObjectPageHeaderSectionChart'];
|
|
@@ -292,20 +292,18 @@ function addRelatedFacetKeysType(generateParameters, schema, entityType, entityS
|
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Add Object Page Header to app-specific schema
|
|
295
|
-
*
|
|
296
295
|
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
297
296
|
* @param {object} appSchema Schema of the app
|
|
298
297
|
* @param {EntityType} entityType - current entity type
|
|
299
|
-
* @param
|
|
300
|
-
* @param pages {SapUiAppPageV4[]} - list of (manifest) pages
|
|
298
|
+
* @param {SapUiAppPageV4} v4Page - current page in manifest
|
|
301
299
|
*/
|
|
302
|
-
function addHeader(generateParameters, appSchema, entityType,
|
|
300
|
+
function addHeader(generateParameters, appSchema, entityType, v4Page) {
|
|
303
301
|
common_2.addCommonHeaderSchema(appSchema, entityType);
|
|
304
302
|
// Add header actions
|
|
305
303
|
common_2.addHeaderActions(appSchema, entityType, generateParameters === null || generateParameters === void 0 ? void 0 : generateParameters.serviceAVT, addHeaderActionCallBackV4);
|
|
306
304
|
// Add header sections
|
|
307
|
-
appSchema['definitions']['HeaderSections']['annotationPath'] = `/${
|
|
308
|
-
addHeaderSections(generateParameters, appSchema, entityType,
|
|
305
|
+
appSchema['definitions']['HeaderSections']['annotationPath'] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.HeaderFacets" /* HeaderFacets */}`;
|
|
306
|
+
addHeaderSections(generateParameters, appSchema, entityType, v4Page);
|
|
309
307
|
}
|
|
310
308
|
/**
|
|
311
309
|
* Generates an app specific schema out of the generic schema.
|
|
@@ -343,6 +341,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
343
341
|
path: v4_1.MANIFESTPATH
|
|
344
342
|
}
|
|
345
343
|
});
|
|
344
|
+
return appSchema;
|
|
346
345
|
}
|
|
347
346
|
//initialize sections
|
|
348
347
|
appSchema['definitions']['Sections'] = {
|
|
@@ -365,11 +364,15 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
365
364
|
});
|
|
366
365
|
return appSchema;
|
|
367
366
|
}
|
|
367
|
+
const v4Page = utils_1.findPageV4(pages, v4_1.FE_TEMPLATE_V4_OBJECT_PAGE, entitySet, generateParameters.logger);
|
|
368
|
+
if (!v4Page) {
|
|
369
|
+
return appSchema;
|
|
370
|
+
}
|
|
368
371
|
// Add Header
|
|
369
|
-
addHeader(generateParameters, appSchema, entityType,
|
|
372
|
+
addHeader(generateParameters, appSchema, entityType, v4Page);
|
|
370
373
|
// Add sections
|
|
371
374
|
appSchema['definitions']['Sections']['annotationPath'] = `/${entitySet.entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Facets" /* Facets */}`;
|
|
372
|
-
addSections(generateParameters, appSchema, entityType,
|
|
375
|
+
addSections(generateParameters, appSchema, entityType, v4Page);
|
|
373
376
|
// Custom Section facets
|
|
374
377
|
addRelatedFacetKeysType(generateParameters, appSchema, entityType, entitySet.name, pages);
|
|
375
378
|
// Add Footer (actions only)
|
|
@@ -379,7 +382,8 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, entityTyp
|
|
|
379
382
|
delete appSchema['definitions']['GenericSections'];
|
|
380
383
|
delete appSchema['definitions']['ObjectPageSubSections'];
|
|
381
384
|
delete appSchema['definitions']['ObjectPageTable'];
|
|
382
|
-
delete appSchema['definitions']['
|
|
385
|
+
delete appSchema['definitions']['GenericColumnsOP'];
|
|
386
|
+
delete appSchema['definitions']['CommonHeaderFacetSettings'];
|
|
383
387
|
delete appSchema['definitions']['ObjectPageSectionTableV4'];
|
|
384
388
|
delete appSchema['definitions']['ObjectPageSectionForm'];
|
|
385
389
|
delete appSchema['definitions']['ObjectPageSectionDataPoint'];
|