@sap/ux-specification 1.71.93 → 1.71.95
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 +63 -1
- 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-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/index-min.js +37 -37
- package/dist/index-min.js.map +4 -4
- package/dist/package.json +6 -6
- package/dist/schemas/v2/AnalyticalListPageConfig.json +42 -4
- package/dist/schemas/v2/ListReportConfig.json +107 -69
- package/dist/schemas/v2/ObjectPageConfig.json +92 -24
- package/dist/src/sync/common/distTagEvaluator.d.ts.map +1 -1
- package/dist/src/sync/common/distTagEvaluator.js +9 -2
- package/dist/src/sync/common/distTagEvaluator.js.map +1 -1
- package/dist/src/sync/common/generate/objectPage.d.ts +6 -5
- package/dist/src/sync/common/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/common/generate/objectPage.js +117 -86
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/common/generate/utils.js +6 -4
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/i18n.json +3 -1
- package/dist/src/sync/common/importProject.d.ts.map +1 -1
- package/dist/src/sync/common/importProject.js +20 -10
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +8 -7
- package/dist/src/sync/common/utils.d.ts.map +1 -1
- package/dist/src/sync/common/utils.js +29 -22
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.d.ts +21 -0
- package/dist/src/sync/v2/export/controls/Action.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Action.js +93 -1
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +2 -4
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +13 -3
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/export/manifest.js +1 -1
- package/dist/src/sync/v2/export/manifest.js.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/analyticalListReport.js +2 -0
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/listReport.js +6 -2
- package/dist/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +61 -62
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +20 -0
- package/dist/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/utils.js +62 -2
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.d.ts +2 -2
- package/dist/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
- package/dist/src/sync/v2/import/app/appProvider.js +41 -18
- package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v2/import/common/index.d.ts +9 -0
- package/dist/src/sync/v2/import/common/index.d.ts.map +1 -1
- package/dist/src/sync/v2/import/common/index.js +44 -19
- package/dist/src/sync/v2/import/common/index.js.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +6 -27
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/listReport.js +20 -31
- package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +84 -62
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/import/utils.d.ts +14 -0
- package/dist/src/sync/v2/import/utils.d.ts.map +1 -1
- package/dist/src/sync/v2/import/utils.js +68 -5
- package/dist/src/sync/v2/import/utils.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +6 -1
- package/dist/src/sync/v2/types.d.ts.map +1 -1
- package/dist/src/sync/v2/types.js +6 -1
- package/dist/src/sync/v2/types.js.map +1 -1
- package/package.json +6 -6
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.DistTagEvaluator = void 0;
|
|
30
|
+
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
30
31
|
const extensionLogger_1 = require("../../extensionLogger");
|
|
31
32
|
const i18next_1 = __importDefault(require("i18next"));
|
|
32
33
|
const distTagsJSON = __importStar(require("./dist_tag.json"));
|
|
@@ -89,7 +90,10 @@ class DistTagEvaluator {
|
|
|
89
90
|
const message = i18next_1.default.t('UNKNOWNMINUI5VERSION', { minUI5Version });
|
|
90
91
|
(0, extensionLogger_1.log)(logger, {
|
|
91
92
|
severity: "info" /* LogSeverity.Info */,
|
|
92
|
-
message
|
|
93
|
+
message,
|
|
94
|
+
location: {
|
|
95
|
+
path: ux_specification_types_1.MANIFESTPATH
|
|
96
|
+
}
|
|
93
97
|
});
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
@@ -98,7 +102,10 @@ class DistTagEvaluator {
|
|
|
98
102
|
const message = i18next_1.default.t('WRONGMINUI5VERSION', { minUI5Version });
|
|
99
103
|
(0, extensionLogger_1.log)(logger, {
|
|
100
104
|
severity: "warning" /* LogSeverity.Warning */,
|
|
101
|
-
message
|
|
105
|
+
message,
|
|
106
|
+
location: {
|
|
107
|
+
path: ux_specification_types_1.MANIFESTPATH
|
|
108
|
+
}
|
|
102
109
|
});
|
|
103
110
|
}
|
|
104
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distTagEvaluator.js","sourceRoot":"","sources":["../../../../src/sync/common/distTagEvaluator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"distTagEvaluator.js","sourceRoot":"","sources":["../../../../src/sync/common/distTagEvaluator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wEAAwE;AACxE,2DAA4C;AAC5C,sDAA8B;AAC9B,8DAAgD;AAChD,wDAAsE;AAEtE,MAAa,gBAAgB;IAGzB;QACI,IAAI,gBAAgB,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9C,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;SACjE;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,mBAAmB;QACtB,gBAAgB,CAAC,cAAc,GAAG,EAAE,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,cAAc;QACjB,OAAO,sBAAkB,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,oBAAoB;QACvB,IAAI,MAAM,GAAa,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;QAEvC,IAAI,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACxC,IAAI,WAAW,EAAE;YACb,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBACjC,oCAAoC;gBACpC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;aAChC;iBAAM;gBACH,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;gBACrE,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;gBACxE,IAAI,GAAG,EAAE;oBACL,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;iBACxB;aACJ;SACJ;QACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACI,yBAAyB,CAAC,aAAqB,EAAE,MAAuB;QAC3E,mHAAmH;QACnH,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,EAAE;YAC9C,OAAO;SACV;QACD,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACjD,MAAM,OAAO,GAAG,iBAAO,CAAC,CAAC,CAAC,sBAAsB,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;YACrE,IAAA,qBAAG,EAAC,MAAM,EAAE;gBACR,QAAQ,+BAAkB;gBAC1B,OAAO;gBACP,QAAQ,EAAE;oBACN,IAAI,EAAE,qCAAY;iBACrB;aACJ,CAAC,CAAC;YACH,OAAO;SACV;QACD,MAAM,aAAa,GACf,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACvG,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;YAC1D,MAAM,OAAO,GAAG,iBAAO,CAAC,CAAC,CAAC,oBAAoB,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;YACnE,IAAA,qBAAG,EAAC,MAAM,EAAE;gBACR,QAAQ,qCAAqB;gBAC7B,OAAO;gBACP,QAAQ,EAAE;oBACN,IAAI,EAAE,qCAAY;iBACrB;aACJ,CAAC,CAAC;SACN;IACL,CAAC;;AAnFL,4CAoFC;AAnFU,+BAAc,GAAa,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConvertedMetadata, EntitySet, EntityType } from '@sap-ux/vocabularies-types';
|
|
2
2
|
import type { FacetConfig, GenerateAppSchemaParameters } from '@sap/ux-specification-types';
|
|
3
|
-
import { FioriElementsVersion, SectionType } from '@sap/ux-specification-types';
|
|
3
|
+
import { FioriElementsVersion, SectionType, v2 } from '@sap/ux-specification-types';
|
|
4
4
|
import type { Definition } from 'typescript-json-schema';
|
|
5
5
|
/**
|
|
6
6
|
* Adds definitions for forms in object page sections to the app schema
|
|
@@ -34,17 +34,18 @@ export declare function getActionNameAndId(item: any, oDataServiceAVT: Converted
|
|
|
34
34
|
* Add Object Page Footer Action Buttons to app-specific schema
|
|
35
35
|
*
|
|
36
36
|
* @param {object} appSchema Schema of the app
|
|
37
|
-
* @param {
|
|
38
|
-
* @param {
|
|
37
|
+
* @param {GenerateAppSchemaParameters} generateParameters - Schema parameters
|
|
38
|
+
* @param {FioriElementsVersion} version - Fiori elements versions
|
|
39
|
+
* @param {SapUiAppPagesV2} pages - pages found in manifest
|
|
39
40
|
*/
|
|
40
|
-
export declare function addFooterActions(appSchema: Definition, generateParameters: GenerateAppSchemaParameters): void;
|
|
41
|
+
export declare function addFooterActions(appSchema: Definition, generateParameters: GenerateAppSchemaParameters, version?: FioriElementsVersion, pages?: v2.SapUiAppPagesV2): void;
|
|
41
42
|
/**
|
|
42
43
|
* Add Object Page Header Action Buttons to app-specific schema
|
|
43
44
|
* @param {object} appSchema Schema of the app
|
|
44
45
|
* @param {EntityType} entityType - current entity type
|
|
45
46
|
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
46
47
|
*/
|
|
47
|
-
export declare function addHeaderActions(appSchema: Definition, entityType: EntityType, oDataServiceAVT: ConvertedMetadata, addHeaderActionCallBack: any): void;
|
|
48
|
+
export declare function addHeaderActions(appSchema: Definition, entityType: EntityType, oDataServiceAVT: ConvertedMetadata, addHeaderActionCallBack: any, isV2?: boolean): void;
|
|
48
49
|
/**
|
|
49
50
|
* Adds common Object Page Header definitions to the app schema
|
|
50
51
|
* @param appSchema - app-specific JSOn schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectPage.d.ts","sourceRoot":"","sources":["../../../../../src/sync/common/generate/objectPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI3F,OAAO,KAAK,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"objectPage.d.ts","sourceRoot":"","sources":["../../../../../src/sync/common/generate/objectPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI3F,OAAO,KAAK,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAGH,oBAAoB,EAIpB,WAAW,EAEX,EAAE,EACL,MAAM,6BAA6B,CAAC;AAUrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AA6WzD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,WAAW,EACpB,gBAAgB,EAAE,UAAU,EAC5B,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAwDpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,iBAAiB,GAAG,MAAM,CAarG;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,GAAG,EACT,eAAe,EAAE,iBAAiB,GACnC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CA0B7D;AAsBD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,UAAU,EACrB,kBAAkB,EAAE,2BAA2B,EAC/C,OAAO,CAAC,EAAE,oBAAoB,EAC9B,KAAK,CAAC,EAAE,EAAE,CAAC,eAAe,GAC3B,IAAI,CAsEN;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,UAAU,EACrB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,iBAAiB,EAClC,uBAAuB,KAAA,EACvB,IAAI,UAAQ,GACb,IAAI,CAsCN;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAYzF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAMlH"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.determineEntitySetOfFacet = exports.addCommonHeaderSchema = exports.addHeaderActions = exports.addFooterActions = exports.getActionNameAndId = exports.replaceAlias = exports.handleForm = void 0;
|
|
4
4
|
const StableIdHelper_1 = require("../../v4/utils/StableIdHelper");
|
|
5
5
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
6
|
-
const ux_specification_types_2 = require("@sap/ux-specification-types");
|
|
7
6
|
const __1 = require("..");
|
|
7
|
+
const utils_1 = require("../../v2/generate/utils");
|
|
8
8
|
/**
|
|
9
9
|
* Copies the field properties from the generic definition to the specific field definition
|
|
10
10
|
* @param {FioriElementsVersion} version - Fiori Elements version
|
|
@@ -13,7 +13,7 @@ const __1 = require("..");
|
|
|
13
13
|
* @param {string} fieldDefinition - the unique ID for the given field definition
|
|
14
14
|
*/
|
|
15
15
|
function copyFieldProperties(version, appSchema, field, fieldDefinition) {
|
|
16
|
-
if (version ===
|
|
16
|
+
if (version === ux_specification_types_1.FioriElementsVersion.v4 && appSchema['definitions']['Field']) {
|
|
17
17
|
switch (field.$Type) {
|
|
18
18
|
case "com.sap.vocabularies.UI.v1.DataField" /* UIAnnotationTypes.DataField */:
|
|
19
19
|
case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */:
|
|
@@ -25,7 +25,7 @@ function copyFieldProperties(version, appSchema, field, fieldDefinition) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
else if (version ===
|
|
28
|
+
else if (version === ux_specification_types_1.FioriElementsVersion.v2 && appSchema['definitions']['Field']) {
|
|
29
29
|
switch (field.$Type) {
|
|
30
30
|
case "com.sap.vocabularies.UI.v1.DataField" /* UIAnnotationTypes.DataField */:
|
|
31
31
|
case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */:
|
|
@@ -46,10 +46,10 @@ function copyFieldProperties(version, appSchema, field, fieldDefinition) {
|
|
|
46
46
|
* @returns the field definition name in schema
|
|
47
47
|
*/
|
|
48
48
|
function determineFieldDefinitionName(version, fieldReferenceId, targetID, fieldReference) {
|
|
49
|
-
const fieldReferenceType = version ===
|
|
49
|
+
const fieldReferenceType = version === ux_specification_types_1.FioriElementsVersion.v2 && fieldReferenceId && fieldReferenceId.includes('::')
|
|
50
50
|
? fieldReferenceId.split('::')[0].replace('DataField', 'Field')
|
|
51
51
|
: undefined;
|
|
52
|
-
if (version ===
|
|
52
|
+
if (version === ux_specification_types_1.FioriElementsVersion.v2) {
|
|
53
53
|
return `${fieldReferenceType}<${targetID}::${fieldReference}>`;
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
@@ -64,24 +64,24 @@ function determineFieldDefinitionName(version, fieldReferenceId, targetID, field
|
|
|
64
64
|
*/
|
|
65
65
|
function addKeysTagForDataField(field, appSchema, schemaKeyOfField) {
|
|
66
66
|
if (typeof field.Value !== 'string' && field.Value.type === 'Path') {
|
|
67
|
-
appSchema.definitions[schemaKeyOfField][
|
|
67
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys] = [
|
|
68
68
|
{
|
|
69
69
|
name: 'Value',
|
|
70
70
|
value: field.Value.path
|
|
71
71
|
}
|
|
72
72
|
];
|
|
73
|
-
appSchema.definitions[schemaKeyOfField][
|
|
73
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.target] = field.Value.$target
|
|
74
74
|
? field.Value.$target.fullyQualifiedName.split('/')[0]
|
|
75
75
|
: field.Value.path;
|
|
76
76
|
}
|
|
77
77
|
else if (typeof field.Value === 'string' && field.Value) {
|
|
78
|
-
appSchema.definitions[schemaKeyOfField][
|
|
78
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys] = [
|
|
79
79
|
{
|
|
80
80
|
name: 'Value',
|
|
81
81
|
value: field.Value
|
|
82
82
|
}
|
|
83
83
|
];
|
|
84
|
-
appSchema.definitions[schemaKeyOfField][
|
|
84
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.target] = field.fullyQualifiedName.split('@')[0];
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
@@ -97,19 +97,19 @@ function addKeysTagToField(field, appSchema, schemaKeyOfField) {
|
|
|
97
97
|
addKeysTagForDataField(field, appSchema, schemaKeyOfField);
|
|
98
98
|
}
|
|
99
99
|
else if (field.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */) {
|
|
100
|
-
appSchema.definitions[schemaKeyOfField][
|
|
100
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys] = [
|
|
101
101
|
{
|
|
102
102
|
name: 'Target',
|
|
103
103
|
value: (0, __1.replaceNamespaces)(field.Target.value)
|
|
104
104
|
}
|
|
105
105
|
];
|
|
106
|
-
appSchema.definitions[schemaKeyOfField][
|
|
106
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.target] =
|
|
107
107
|
field.Target.$target.fullyQualifiedName.split('@')[0];
|
|
108
108
|
}
|
|
109
109
|
else if (field.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */) {
|
|
110
110
|
const separator = field.Action.lastIndexOf('.');
|
|
111
111
|
if (separator === -1) {
|
|
112
|
-
appSchema.definitions[schemaKeyOfField][
|
|
112
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys] = [
|
|
113
113
|
{
|
|
114
114
|
name: 'Action',
|
|
115
115
|
value: field.Action
|
|
@@ -117,29 +117,29 @@ function addKeysTagToField(field, appSchema, schemaKeyOfField) {
|
|
|
117
117
|
];
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
120
|
-
appSchema.definitions[schemaKeyOfField][
|
|
120
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys] = [
|
|
121
121
|
{
|
|
122
122
|
name: 'Action',
|
|
123
123
|
value: field.Action.substring(separator + 1, field.Action.length)
|
|
124
124
|
}
|
|
125
125
|
];
|
|
126
|
-
appSchema.definitions[schemaKeyOfField][
|
|
126
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.target] = field.Action.substring(0, separator);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
else if (field.$Type === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* UIAnnotationTypes.DataFieldForIntentBasedNavigation */) {
|
|
130
|
-
appSchema.definitions[schemaKeyOfField][
|
|
130
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys] = [
|
|
131
131
|
{
|
|
132
132
|
name: ux_specification_types_1.SchemaKeyName.semanticObject,
|
|
133
133
|
value: field.SemanticObject
|
|
134
134
|
}
|
|
135
135
|
];
|
|
136
136
|
if (field.Action) {
|
|
137
|
-
appSchema.definitions[schemaKeyOfField][
|
|
137
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.keys].push({
|
|
138
138
|
name: 'Action',
|
|
139
139
|
value: field.Action
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
appSchema.definitions[schemaKeyOfField][
|
|
142
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.target] = field.fullyQualifiedName.split('@')[0];
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
@@ -155,7 +155,7 @@ function addKeysTagToField(field, appSchema, schemaKeyOfField) {
|
|
|
155
155
|
function addField(sectionType, appSchema, field, targetID, key, section, version, withActions = true) {
|
|
156
156
|
// Calculate field reference
|
|
157
157
|
const fieldReferenceId = (0, StableIdHelper_1.getStableIdPartFromDataField)(field);
|
|
158
|
-
const fieldReference = version ===
|
|
158
|
+
const fieldReference = version === ux_specification_types_1.FioriElementsVersion.v2 && fieldReferenceId && fieldReferenceId.includes('::')
|
|
159
159
|
? fieldReferenceId.split('::').splice(1).join('::')
|
|
160
160
|
: fieldReferenceId;
|
|
161
161
|
// Determine field definition name
|
|
@@ -166,17 +166,17 @@ function addField(sectionType, appSchema, field, targetID, key, section, version
|
|
|
166
166
|
}
|
|
167
167
|
else if (field.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */ ||
|
|
168
168
|
field.$Type === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* UIAnnotationTypes.DataFieldForIntentBasedNavigation */) {
|
|
169
|
-
if (withActions && sectionType ===
|
|
170
|
-
const actionsDefinition = (0, __1.prepareRef)(`${sectionType}${
|
|
169
|
+
if (withActions && sectionType === ux_specification_types_1.SectionType.Section) {
|
|
170
|
+
const actionsDefinition = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Actions}<${targetID}>`);
|
|
171
171
|
const fieldInSchema = (appSchema.definitions[actionsDefinition].properties[fieldReference] =
|
|
172
172
|
{
|
|
173
173
|
$ref: `${__1.DEFINITION_LINK_PREFIX}${schemaKeyOfField}`
|
|
174
174
|
});
|
|
175
|
-
fieldInSchema[
|
|
175
|
+
fieldInSchema[ux_specification_types_1.SchemaTag.propertyIndex] = parseInt(key);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
else {
|
|
179
|
-
const fieldsDefinition = (0, __1.prepareRef)(`${sectionType}${
|
|
179
|
+
const fieldsDefinition = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Fields}<${targetID}>`);
|
|
180
180
|
appSchema.definitions[fieldsDefinition]['properties'][fieldReference] = {
|
|
181
181
|
$ref: `${__1.DEFINITION_LINK_PREFIX}${schemaKeyOfField}`,
|
|
182
182
|
propertyIndex: parseInt(key)
|
|
@@ -191,14 +191,14 @@ function addField(sectionType, appSchema, field, targetID, key, section, version
|
|
|
191
191
|
};
|
|
192
192
|
//Add tags
|
|
193
193
|
addKeysTagToField(field, appSchema, schemaKeyOfField);
|
|
194
|
-
appSchema.definitions[schemaKeyOfField][
|
|
195
|
-
appSchema.definitions[schemaKeyOfField][
|
|
196
|
-
appSchema.definitions[schemaKeyOfField][
|
|
194
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.annotationPath] = `/${section.entityType.fullyQualifiedName}/${field.fullyQualifiedName.split(section.entityType.fullyQualifiedName)[1]}`;
|
|
195
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.annotationType] = field.$Type;
|
|
196
|
+
appSchema.definitions[schemaKeyOfField][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
197
197
|
(0, __1.addDataTypeToDefinition)(appSchema.definitions[schemaKeyOfField], field);
|
|
198
198
|
// Copy the generic definition of field properties to the specific one
|
|
199
199
|
copyFieldProperties(version, appSchema, field, schemaKeyOfField);
|
|
200
200
|
if (field.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */ && appSchema.definitions?.['FormAction']) {
|
|
201
|
-
appSchema.definitions[schemaKeyOfField].properties = appSchema.definitions[
|
|
201
|
+
appSchema.definitions[schemaKeyOfField].properties = appSchema.definitions[ux_specification_types_1.DefinitionName.FormAction].properties;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
@@ -231,12 +231,12 @@ function addFieldsToFormDefinition(section, sectionType, appSchema, targetID, ve
|
|
|
231
231
|
if (!section.target) {
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
const formDefinition = (0, __1.prepareRef)(`${sectionType}${
|
|
235
|
-
const fieldsDefinition = (0, __1.prepareRef)(`${sectionType}${
|
|
236
|
-
const actionsDefinition = (0, __1.prepareRef)(`${sectionType}${
|
|
234
|
+
const formDefinition = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Form}<${targetID}>`);
|
|
235
|
+
const fieldsDefinition = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Fields}<${targetID}>`);
|
|
236
|
+
const actionsDefinition = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Actions}<${targetID}>`);
|
|
237
237
|
// Form definition
|
|
238
238
|
appSchema.properties['form'] = { $ref: `${__1.DEFINITION_LINK_PREFIX}${formDefinition}` };
|
|
239
|
-
if (sectionType ===
|
|
239
|
+
if (sectionType === ux_specification_types_1.SectionType.Section && withActions) {
|
|
240
240
|
appSchema['definitions'][formDefinition] = {
|
|
241
241
|
type: 'object',
|
|
242
242
|
properties: {
|
|
@@ -254,7 +254,7 @@ function addFieldsToFormDefinition(section, sectionType, appSchema, targetID, ve
|
|
|
254
254
|
description: 'Actions',
|
|
255
255
|
additionalProperties: false
|
|
256
256
|
};
|
|
257
|
-
appSchema['definitions'][actionsDefinition][
|
|
257
|
+
appSchema['definitions'][actionsDefinition][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
258
258
|
}
|
|
259
259
|
else {
|
|
260
260
|
appSchema['definitions'][formDefinition] = {
|
|
@@ -266,9 +266,9 @@ function addFieldsToFormDefinition(section, sectionType, appSchema, targetID, ve
|
|
|
266
266
|
additionalProperties: false
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
appSchema.definitions[formDefinition][
|
|
269
|
+
appSchema.definitions[formDefinition][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
270
270
|
if (section.entityType?.name) {
|
|
271
|
-
appSchema.definitions[formDefinition][
|
|
271
|
+
appSchema.definitions[formDefinition][ux_specification_types_1.SchemaTag.annotationPath] = (0, __1.createAnnotationPath)(section.entityType.fullyQualifiedName, section.target['term'], section.target['qualifier']);
|
|
272
272
|
}
|
|
273
273
|
// Fields definition
|
|
274
274
|
appSchema.definitions[fieldsDefinition] = {
|
|
@@ -277,9 +277,9 @@ function addFieldsToFormDefinition(section, sectionType, appSchema, targetID, ve
|
|
|
277
277
|
description: 'Fields',
|
|
278
278
|
additionalProperties: false
|
|
279
279
|
};
|
|
280
|
-
appSchema.definitions[fieldsDefinition][
|
|
280
|
+
appSchema.definitions[fieldsDefinition][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
281
281
|
// Add fields
|
|
282
|
-
if (section.base ===
|
|
282
|
+
if (section.base === ux_specification_types_1.FacetBase.Identification) {
|
|
283
283
|
for (const key in section.target) {
|
|
284
284
|
const field = section.target[key];
|
|
285
285
|
if (field) {
|
|
@@ -305,18 +305,18 @@ function addTagsToFormDefinition(section, appSchema, formDefinitionKey) {
|
|
|
305
305
|
const targetValue = section.target['qualifier']
|
|
306
306
|
? `${section.target['term']}#${section.target['qualifier']}`
|
|
307
307
|
: `${section.target['term']}`;
|
|
308
|
-
appSchema.definitions[formDefinitionKey][
|
|
308
|
+
appSchema.definitions[formDefinitionKey][ux_specification_types_1.SchemaTag.keys] = [
|
|
309
309
|
{
|
|
310
310
|
name: ux_specification_types_1.SchemaKeyName.target,
|
|
311
311
|
value: targetValue.replace(/com.sap.vocabularies.UI.v1./g, '')
|
|
312
312
|
}
|
|
313
313
|
];
|
|
314
|
-
appSchema.definitions[formDefinitionKey][
|
|
314
|
+
appSchema.definitions[formDefinitionKey][ux_specification_types_1.SchemaTag.target] =
|
|
315
315
|
section.target['fullyQualifiedName']?.split('@')[0];
|
|
316
316
|
}
|
|
317
|
-
appSchema.definitions[formDefinitionKey][
|
|
317
|
+
appSchema.definitions[formDefinitionKey][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
318
318
|
if (section.entityType?.name) {
|
|
319
|
-
appSchema.definitions[formDefinitionKey][
|
|
319
|
+
appSchema.definitions[formDefinitionKey][ux_specification_types_1.SchemaTag.annotationPath] = (0, __1.createAnnotationPath)(section.entityType.fullyQualifiedName, section.target['term'], section.target['qualifier']);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
/**
|
|
@@ -334,13 +334,13 @@ function handleForm(sectionType, section, appSchemaSection, appSchema, version,
|
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
const targetID = determineTargetIdOfForm(section);
|
|
337
|
-
const formDefinitionKey = (0, __1.prepareRef)(`${sectionType}${
|
|
338
|
-
const fieldsDefinitionKey = (0, __1.prepareRef)(`${sectionType}${
|
|
339
|
-
const actionsDefinitionKey = (0, __1.prepareRef)(`${sectionType}${
|
|
340
|
-
const withActions = section.base ===
|
|
337
|
+
const formDefinitionKey = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Form}<${targetID}>`);
|
|
338
|
+
const fieldsDefinitionKey = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Fields}<${targetID}>`);
|
|
339
|
+
const actionsDefinitionKey = (0, __1.prepareRef)(`${sectionType}${ux_specification_types_1.DefinitionName.Actions}<${targetID}>`);
|
|
340
|
+
const withActions = section.base === ux_specification_types_1.FacetBase.Identification && facetKey.indexOf('#') < 0 ? false : true;
|
|
341
341
|
// Form definition
|
|
342
342
|
appSchemaSection.properties.form = { $ref: `${__1.DEFINITION_LINK_PREFIX}${formDefinitionKey}` };
|
|
343
|
-
if (sectionType ===
|
|
343
|
+
if (sectionType === ux_specification_types_1.SectionType.Section && withActions) {
|
|
344
344
|
appSchema.definitions[formDefinitionKey] = {
|
|
345
345
|
type: 'object',
|
|
346
346
|
properties: {
|
|
@@ -358,7 +358,7 @@ function handleForm(sectionType, section, appSchemaSection, appSchema, version,
|
|
|
358
358
|
description: 'Actions',
|
|
359
359
|
additionalProperties: false
|
|
360
360
|
};
|
|
361
|
-
appSchema.definitions[actionsDefinitionKey][
|
|
361
|
+
appSchema.definitions[actionsDefinitionKey][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
364
364
|
appSchema.definitions[formDefinitionKey] = {
|
|
@@ -379,7 +379,7 @@ function handleForm(sectionType, section, appSchemaSection, appSchema, version,
|
|
|
379
379
|
description: 'Fields',
|
|
380
380
|
additionalProperties: false
|
|
381
381
|
};
|
|
382
|
-
appSchema.definitions[fieldsDefinitionKey][
|
|
382
|
+
appSchema.definitions[fieldsDefinitionKey][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
383
383
|
// Add fields
|
|
384
384
|
addFieldsToFormDefinition(section, sectionType, appSchema, targetID, version, withActions);
|
|
385
385
|
return targetID;
|
|
@@ -438,44 +438,65 @@ function getActionNameAndId(item, oDataServiceAVT) {
|
|
|
438
438
|
return { actionName, actionId, namespace };
|
|
439
439
|
}
|
|
440
440
|
exports.getActionNameAndId = getActionNameAndId;
|
|
441
|
+
/**
|
|
442
|
+
* Checks if requested Entity Set is same as first Object Page
|
|
443
|
+
* @param {SapUiAppPagesV2} pages - pages found in manifest
|
|
444
|
+
* @param {GenerateAppSchemaParameters} generateParameters - Schema parameters
|
|
445
|
+
* @returns {boolean} If found Object Page is first Object Page
|
|
446
|
+
*/
|
|
447
|
+
function isFirstObjectPage(pages, generateParameters) {
|
|
448
|
+
for (const key in pages) {
|
|
449
|
+
const element = pages[key];
|
|
450
|
+
if (element.component?.name === ux_specification_types_1.v2.FE_TEMPLATE_V2_OBJECT_PAGE) {
|
|
451
|
+
if (generateParameters.entitySet?.name === element.entitySet) {
|
|
452
|
+
return true;
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return isFirstObjectPage(element.pages, generateParameters);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
441
461
|
/**
|
|
442
462
|
* Add Object Page Footer Action Buttons to app-specific schema
|
|
443
463
|
*
|
|
444
464
|
* @param {object} appSchema Schema of the app
|
|
445
|
-
* @param {
|
|
446
|
-
* @param {
|
|
465
|
+
* @param {GenerateAppSchemaParameters} generateParameters - Schema parameters
|
|
466
|
+
* @param {FioriElementsVersion} version - Fiori elements versions
|
|
467
|
+
* @param {SapUiAppPagesV2} pages - pages found in manifest
|
|
447
468
|
*/
|
|
448
|
-
function addFooterActions(appSchema, generateParameters) {
|
|
449
|
-
appSchema.definitions[
|
|
469
|
+
function addFooterActions(appSchema, generateParameters, version, pages) {
|
|
470
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageFooter] = JSON.parse(JSON.stringify(appSchema.definitions[`${ux_specification_types_1.DefinitionName.ObjectPageFooter}<ObjectPageFooterActions>`]));
|
|
450
471
|
// Change reference of footer
|
|
451
472
|
appSchema.properties['footer'] = {
|
|
452
|
-
$ref: `${__1.DEFINITION_LINK_PREFIX}${
|
|
473
|
+
$ref: `${__1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ObjectPageFooter}`
|
|
453
474
|
};
|
|
454
475
|
// Add action to configuration
|
|
455
|
-
appSchema.definitions[
|
|
456
|
-
$ref: `${__1.DEFINITION_LINK_PREFIX}${
|
|
476
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageFooter].properties[ux_specification_types_1.PropertyName.actions] = {
|
|
477
|
+
$ref: `${__1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.FooterActions}`
|
|
457
478
|
};
|
|
458
|
-
const footerActions = (appSchema.definitions[
|
|
479
|
+
const footerActions = (appSchema.definitions[ux_specification_types_1.DefinitionName.FooterActions] = {
|
|
459
480
|
type: 'object',
|
|
460
481
|
properties: {},
|
|
461
482
|
description: 'Actions',
|
|
462
483
|
additionalProperties: false
|
|
463
484
|
});
|
|
464
|
-
footerActions[
|
|
465
|
-
const alias = (0, __1.findAlias)(
|
|
466
|
-
const entityType = generateParameters.entitySet
|
|
467
|
-
const actionAnnotation = alias && entityType
|
|
485
|
+
footerActions[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
486
|
+
const alias = (0, __1.findAlias)(ux_specification_types_1.UIVOCABULARY, generateParameters.serviceAVT);
|
|
487
|
+
const entityType = generateParameters.entitySet?.entityType;
|
|
488
|
+
const actionAnnotation = alias && entityType?.annotations?.[alias]?.Identification;
|
|
468
489
|
if (actionAnnotation) {
|
|
469
490
|
const convertedIdentification = actionAnnotation.fullyQualifiedName.replace(`@${"com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */}`, `/@${"com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */}`);
|
|
470
|
-
footerActions[
|
|
491
|
+
footerActions[ux_specification_types_1.SchemaTag.annotationPath] = `/${convertedIdentification}`;
|
|
471
492
|
actionAnnotation.forEach((item, index) => {
|
|
472
493
|
if (item['Determining'] && item.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */) {
|
|
473
494
|
const { actionName, actionId } = getActionNameAndId(item, generateParameters.serviceAVT);
|
|
474
495
|
const description = item.Label || actionName;
|
|
475
|
-
const actionDefinitionKey = (0, __1.prepareRef)(`${
|
|
476
|
-
if (appSchema.definitions[
|
|
496
|
+
const actionDefinitionKey = (0, __1.prepareRef)(`${ux_specification_types_1.DefinitionName.ObjectPageFooterAction}<${actionId}>`);
|
|
497
|
+
if (appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageFooterAction]) {
|
|
477
498
|
appSchema.definitions[actionDefinitionKey] = {
|
|
478
|
-
...JSON.parse(JSON.stringify(appSchema.definitions[
|
|
499
|
+
...JSON.parse(JSON.stringify(appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageFooterAction])),
|
|
479
500
|
description,
|
|
480
501
|
annotationPath: `/${convertedIdentification}/${index}`
|
|
481
502
|
};
|
|
@@ -486,8 +507,8 @@ function addFooterActions(appSchema, generateParameters) {
|
|
|
486
507
|
properties: {},
|
|
487
508
|
description: description
|
|
488
509
|
};
|
|
489
|
-
appSchema.definitions[actionDefinitionKey][
|
|
490
|
-
appSchema.definitions[actionDefinitionKey][
|
|
510
|
+
appSchema.definitions[actionDefinitionKey][ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
511
|
+
appSchema.definitions[actionDefinitionKey][ux_specification_types_1.SchemaTag.annotationPath] = `/${convertedIdentification}/${index}`;
|
|
491
512
|
}
|
|
492
513
|
footerActions.properties[actionId] = {
|
|
493
514
|
$ref: `${__1.DEFINITION_LINK_PREFIX}${actionDefinitionKey}`
|
|
@@ -495,11 +516,16 @@ function addFooterActions(appSchema, generateParameters) {
|
|
|
495
516
|
}
|
|
496
517
|
});
|
|
497
518
|
}
|
|
498
|
-
else {
|
|
499
|
-
footerActions[
|
|
519
|
+
else if (entityType) {
|
|
520
|
+
footerActions[ux_specification_types_1.SchemaTag.annotationPath] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */}`;
|
|
521
|
+
}
|
|
522
|
+
if (version === ux_specification_types_1.FioriElementsVersion.v2 &&
|
|
523
|
+
isFirstObjectPage(pages, generateParameters) &&
|
|
524
|
+
!(0, utils_1.isDraftEnabled)(entityType)) {
|
|
525
|
+
(0, utils_1.addStandardFooterActionsOP)(appSchema, footerActions);
|
|
500
526
|
}
|
|
501
|
-
delete appSchema.definitions[
|
|
502
|
-
delete appSchema.definitions[`${
|
|
527
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageFooterActions];
|
|
528
|
+
delete appSchema.definitions[`${ux_specification_types_1.DefinitionName.ObjectPageFooter}<${ux_specification_types_1.DefinitionName.ObjectPageFooterActions}>`];
|
|
503
529
|
}
|
|
504
530
|
exports.addFooterActions = addFooterActions;
|
|
505
531
|
/**
|
|
@@ -508,33 +534,36 @@ exports.addFooterActions = addFooterActions;
|
|
|
508
534
|
* @param {EntityType} entityType - current entity type
|
|
509
535
|
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
510
536
|
*/
|
|
511
|
-
function addHeaderActions(appSchema, entityType, oDataServiceAVT, addHeaderActionCallBack) {
|
|
512
|
-
|
|
513
|
-
|
|
537
|
+
function addHeaderActions(appSchema, entityType, oDataServiceAVT, addHeaderActionCallBack, isV2 = false) {
|
|
538
|
+
const actionsDefinition = ux_specification_types_1.DefinitionName.HeaderActions;
|
|
539
|
+
const actions = appSchema.definitions[actionsDefinition];
|
|
540
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeader].properties[ux_specification_types_1.PropertyName.actions] = {
|
|
541
|
+
$ref: `${__1.DEFINITION_LINK_PREFIX}${actionsDefinition}`
|
|
514
542
|
};
|
|
515
|
-
const headerActions = (appSchema.definitions[
|
|
543
|
+
const headerActions = (appSchema.definitions[actionsDefinition] = {
|
|
516
544
|
type: 'object',
|
|
517
545
|
properties: {},
|
|
518
546
|
description: 'Actions',
|
|
519
547
|
additionalProperties: false
|
|
520
548
|
});
|
|
521
|
-
headerActions[
|
|
522
|
-
const alias = (0, __1.findAlias)(
|
|
523
|
-
const identification = alias &&
|
|
524
|
-
entityType.annotations &&
|
|
525
|
-
entityType.annotations[alias] &&
|
|
526
|
-
entityType.annotations[alias].Identification;
|
|
549
|
+
headerActions[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
550
|
+
const alias = (0, __1.findAlias)(ux_specification_types_1.UIVOCABULARY, oDataServiceAVT);
|
|
551
|
+
const identification = alias && entityType?.annotations?.[alias]?.Identification;
|
|
527
552
|
if (identification) {
|
|
528
|
-
headerActions[
|
|
553
|
+
headerActions[ux_specification_types_1.SchemaTag.annotationPath] =
|
|
529
554
|
'/' +
|
|
530
555
|
identification.fullyQualifiedName.replace(`@${"com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */}`, `/@${"com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */}`);
|
|
531
556
|
identification.forEach(addHeaderActionCallBack(entityType, appSchema, identification, headerActions, oDataServiceAVT));
|
|
532
557
|
}
|
|
533
|
-
else {
|
|
534
|
-
headerActions[
|
|
558
|
+
else if (entityType) {
|
|
559
|
+
headerActions[ux_specification_types_1.SchemaTag.annotationPath] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.Identification" /* UIAnnotationTerms.Identification */}`;
|
|
560
|
+
}
|
|
561
|
+
if (isV2) {
|
|
562
|
+
// handle header actions
|
|
563
|
+
(0, utils_1.addStandardHeaderActions)(appSchema, true, actions);
|
|
535
564
|
}
|
|
536
|
-
delete appSchema.definitions[
|
|
537
|
-
delete appSchema.definitions[`${
|
|
565
|
+
delete appSchema.definitions[ux_specification_types_1.DefinitionName.GenericActions];
|
|
566
|
+
delete appSchema.definitions[`${ux_specification_types_1.DefinitionName.ObjectPageHeader}<${ux_specification_types_1.DefinitionName.GenericActions}>`];
|
|
538
567
|
}
|
|
539
568
|
exports.addHeaderActions = addHeaderActions;
|
|
540
569
|
/**
|
|
@@ -544,10 +573,12 @@ exports.addHeaderActions = addHeaderActions;
|
|
|
544
573
|
*/
|
|
545
574
|
function addCommonHeaderSchema(appSchema, entityType) {
|
|
546
575
|
appSchema.properties['header'] = {
|
|
547
|
-
$ref: `${__1.DEFINITION_LINK_PREFIX}${
|
|
576
|
+
$ref: `${__1.DEFINITION_LINK_PREFIX}${ux_specification_types_1.DefinitionName.ObjectPageHeader}`
|
|
548
577
|
};
|
|
549
|
-
appSchema.definitions[
|
|
550
|
-
|
|
578
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeader] = JSON.parse(JSON.stringify(appSchema.definitions[`${ux_specification_types_1.DefinitionName.ObjectPageHeader}<${ux_specification_types_1.DefinitionName.GenericActions}>`]));
|
|
579
|
+
if (entityType) {
|
|
580
|
+
appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageHeader][ux_specification_types_1.SchemaTag.annotationPath] = `/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.HeaderInfo" /* UIAnnotationTerms.HeaderInfo */}`;
|
|
581
|
+
}
|
|
551
582
|
}
|
|
552
583
|
exports.addCommonHeaderSchema = addCommonHeaderSchema;
|
|
553
584
|
/**
|