@sap/ux-specification 1.96.104 → 1.96.105
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 +531 -478
- 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 +247 -243
- package/dist/index-min.js.map +4 -4
- package/dist/schemas/v2/AnalyticalListPageConfig.json +3 -3
- package/dist/schemas/v2/ListReportConfig.json +5 -5
- package/dist/schemas/v2/ListReportNewConfig.json +1 -1
- package/dist/schemas/v2/ObjectPageConfig.json +5 -5
- package/dist/schemas/v4/ApplicationV4.json +1 -1
- package/dist/schemas/v4/ListReportConfig.json +24 -6
- package/dist/schemas/v4/ObjectPageConfig.json +8 -2
- package/dist/specification/package.json +13 -11
- package/dist/specification/scripts/extractDocu.js +18 -1
- package/dist/specification/scripts/extractDocu.js.map +1 -1
- package/dist/specification/scripts/generate-validity-report.d.ts +15 -0
- package/dist/specification/scripts/generate-validity-report.d.ts.map +1 -0
- package/dist/specification/scripts/generate-validity-report.js +327 -0
- package/dist/specification/scripts/generate-validity-report.js.map +1 -0
- package/dist/specification/src/api.js +1 -1
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +501 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.js +497 -0
- package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -0
- package/dist/specification/src/sync/common/decoration/decorators.d.ts +149 -23
- package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/decorators.js +369 -74
- package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.d.ts +1 -0
- package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
- package/dist/specification/src/sync/common/decoration/index.js +1 -0
- package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
- package/dist/specification/src/sync/common/dist_tag.json +8 -3
- package/dist/specification/src/sync/common/i18n.json +2 -1
- package/dist/specification/src/sync/common/utils.d.ts +22 -6
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +122 -18
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js +2 -0
- package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/listReport.js +3 -1
- package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/objectPage.js +2 -0
- package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.d.ts +1 -9
- package/dist/specification/src/sync/v2/generate/overviewPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.js +30 -1
- package/dist/specification/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/app/appProvider.js +2 -0
- package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts +2 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js +5 -0
- package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.d.ts +2 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/listReport.js +5 -0
- package/dist/specification/src/sync/v2/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.js +2 -1
- package/dist/specification/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v2/import/utils.d.ts +28 -1
- package/dist/specification/src/sync/v2/import/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/utils.js +37 -0
- package/dist/specification/src/sync/v2/import/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +12 -2
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +19 -2
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/application.d.ts +20 -2
- package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/application.js +27 -2
- package/dist/specification/src/sync/v4/application.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js +2 -1
- package/dist/specification/src/sync/v4/export/controls/FilterBar.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts +4 -3
- package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Header.js +7 -3
- package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +1 -0
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -0
- package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js +2 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +1 -13
- package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts +21 -8
- package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/Table.js +39 -41
- package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/TableColumn.js +2 -2
- package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +2 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +2 -1
- package/dist/specification/src/sync/v4/export/controls/ToolBarAction.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 +25 -3
- package/dist/specification/src/sync/v4/export/export.js.map +1 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.js +1 -1
- package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
- 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 +10 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/index.d.ts +1 -1
- package/dist/specification/src/sync/v4/generate/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/index.js +1 -1
- package/dist/specification/src/sync/v4/generate/index.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts +73 -0
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js +333 -0
- package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/{listReport.d.ts → list-report/listReport.d.ts} +21 -14
- package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/generate/{listReport.js → list-report/listReport.js} +121 -136
- package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -0
- package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/objectPage.js +142 -49
- package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.js +2 -1
- package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts +9 -7
- package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/App.js +4 -8
- package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +2 -9
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +2 -11
- package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +177 -46
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +498 -152
- package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +17 -22
- package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/Page.js +15 -22
- package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts +1 -0
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js +17 -9
- package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/index.d.ts +5 -0
- package/dist/specification/src/sync/v4/sync-rules/index.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/index.js +21 -0
- package/dist/specification/src/sync/v4/sync-rules/index.js.map +1 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/sync-rules/utils.js +4 -0
- package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -1
- package/dist/specification/src/sync/v4/utils/index.d.ts +2 -0
- package/dist/specification/src/sync/v4/utils/index.d.ts.map +1 -0
- package/dist/specification/src/sync/v4/utils/index.js +18 -0
- package/dist/specification/src/sync/v4/utils/index.js.map +1 -0
- package/dist/specification/src/sync/v4/utils/utils.d.ts +9 -1
- package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/utils/utils.js +18 -3
- package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
- package/dist/specification/test/test-projects/v2sttaProdMan2/webapp/manifest.json +550 -0
- package/dist/specification/test/test-projects/v4new/webapp/manifest.json +147 -0
- package/dist/specification/test/test-utils/utils.d.ts +71 -0
- package/dist/specification/test/test-utils/utils.d.ts.map +1 -0
- package/dist/specification/test/test-utils/utils.js +400 -0
- package/dist/specification/test/test-utils/utils.js.map +1 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts +274 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.d.ts.map +1 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.js +583 -0
- package/dist/specification/test/unit/decorators/validity-test-utils.js.map +1 -0
- package/dist/types/src/apiTypes.d.ts +2 -3
- package/dist/types/src/apiTypes.d.ts.map +1 -1
- package/dist/types/src/apiTypes.js.map +1 -1
- package/dist/types/src/common/types.d.ts +119 -13
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v2/controls/ObjectPageTable.d.ts +1 -1
- package/dist/types/src/v2/controls/Table.d.ts +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts +1 -1
- package/dist/types/src/v4/controls/ObjectPageTable.d.ts.map +1 -1
- package/dist/types/src/v4/controls/Table.d.ts +3 -3
- package/dist/types/src/v4/controls/Table.d.ts.map +1 -1
- package/package.json +14 -12
- package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +0 -107
- package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +0 -1
- package/dist/specification/src/sync/v4/generate/ListReportUtils.js +0 -374
- package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +0 -1
- package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +0 -1
- package/dist/specification/src/sync/v4/generate/listReport.js.map +0 -1
|
@@ -10,9 +10,10 @@ const extensionLogger_1 = require("../../../extensionLogger");
|
|
|
10
10
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
11
11
|
const common_1 = require("../../common");
|
|
12
12
|
const utils_1 = require("../utils/utils");
|
|
13
|
+
const utils_2 = require("../utils/utils");
|
|
13
14
|
const StableIdHelper_1 = require("../../v4/utils/StableIdHelper");
|
|
14
15
|
const pageExtensions_1 = require("./fpm-custom-page/pageExtensions");
|
|
15
|
-
const
|
|
16
|
+
const utils_3 = require("../../v2/generate/utils");
|
|
16
17
|
const ROOT_PROPERTIES_ORDER = ['header', 'layout', 'sections', 'footer'];
|
|
17
18
|
const CRITICAL_ACTION_TYPES = [
|
|
18
19
|
'UI.CriticalityType/Positive',
|
|
@@ -256,12 +257,12 @@ function addHeaderActionCallBackV4(entityType, appSchema, identification, header
|
|
|
256
257
|
const { criticalActions = [], unCriticalActions = [] } = identification ? groupByCriticality(identification) : {};
|
|
257
258
|
addGroupedHeaderActions(criticalActions, generateParameters.serviceAVT, appSchema, entityType, headerActions, ux_specification_types_1.ActionType.Criticality);
|
|
258
259
|
if (generateParameters.entitySet) {
|
|
259
|
-
const isDeletable = (0,
|
|
260
|
-
const isUpdatable = (0,
|
|
260
|
+
const isDeletable = (0, utils_3.isEntityDeletable)(generateParameters.entitySet);
|
|
261
|
+
const isUpdatable = (0, utils_3.isEntityUpdatable)(generateParameters.entitySet);
|
|
261
262
|
// Add standard header actions
|
|
262
263
|
// If ReadOnly, and all capabilities restrictions are set to true or When nothing exists i.e. no capabilities annotation and no draft root, show only Delete button
|
|
263
264
|
// If DraftRoot + DraftNode and dynamic value for restriction - show Edit and Delete, if bool == false then hide the button
|
|
264
|
-
if ((0,
|
|
265
|
+
if ((0, utils_3.isDraftEnabled)(generateParameters.entitySet) && isUpdatable) {
|
|
265
266
|
const editAction = addStandardHeaderAction('Edit', appSchema, headerActions, criticalActions.length);
|
|
266
267
|
setAnnotationPathFromEntitySetOrEntityType(editAction, generateParameters.entitySet, entityType, 'UpdateHidden');
|
|
267
268
|
}
|
|
@@ -275,7 +276,7 @@ function addHeaderActionCallBackV4(entityType, appSchema, identification, header
|
|
|
275
276
|
addCopyAction(unCriticalActions, generateParameters.serviceAVT, appSchema, entityType, headerActions, nextIndex);
|
|
276
277
|
addGroupedHeaderActions(unCriticalActions, generateParameters.serviceAVT, appSchema, entityType, headerActions, ux_specification_types_1.ActionType.Annotation, nextIndex);
|
|
277
278
|
// Add custom header actions
|
|
278
|
-
addHeaderFooterCustomActionsOP(appSchema, pageInManifest, ux_specification_types_1.DefinitionName.CustomHeaderActionOP, generateParameters
|
|
279
|
+
addHeaderFooterCustomActionsOP(appSchema, pageInManifest, ux_specification_types_1.DefinitionName.CustomHeaderActionOP, generateParameters);
|
|
279
280
|
addRelatedAppsButton(headerActions);
|
|
280
281
|
}
|
|
281
282
|
/**
|
|
@@ -315,9 +316,9 @@ function addFooterActionCallBackV4(entityType, appSchema, footerActions, identif
|
|
|
315
316
|
* @param v4Page Current page in manifest
|
|
316
317
|
* @param lineItemId - identifier of the current table in schema
|
|
317
318
|
* @param facetIdInManifest - identifier of the current object page section in manifest
|
|
318
|
-
* @param
|
|
319
|
+
* @param {GenerateAppSchemaParameters} generateParameters - Parameters required for generating the application schema.
|
|
319
320
|
*/
|
|
320
|
-
function addCustomColumnsOP(appSchema, v4Page, lineItemId, facetIdInManifest,
|
|
321
|
+
function addCustomColumnsOP(appSchema, v4Page, lineItemId, facetIdInManifest, generateParameters) {
|
|
321
322
|
// Create type specific copy of 'TableCustomColumnOP'
|
|
322
323
|
const useDefinitionAsKey = lineItemId !== ux_specification_types_1.DefinitionName.LineItems &&
|
|
323
324
|
lineItemId !== 'LineItemsOfSPV::LineItem' &&
|
|
@@ -330,16 +331,16 @@ function addCustomColumnsOP(appSchema, v4Page, lineItemId, facetIdInManifest, lo
|
|
|
330
331
|
customColumnDefinition.description = 'Custom Column';
|
|
331
332
|
// Update definitions for type specific custom columns
|
|
332
333
|
const schemaId = `${ux_specification_types_1.DefinitionName.CustomColumnOP}<${lineItemId}>`;
|
|
333
|
-
(0,
|
|
334
|
+
(0, utils_2.addCustomColumnDefinition)(appSchema, v4Page, generateParameters.logger, schemaId, lineItemId, facetIdInManifest);
|
|
334
335
|
const facetKey = useDefinitionAsKey ? lineItemId : ux_specification_types_1.DefinitionName.PositionOP;
|
|
335
336
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.PositionOP, facetKey, appSchema, useDefinitionAsKey);
|
|
336
337
|
const positionId = useDefinitionAsKey ? `${ux_specification_types_1.DefinitionName.PositionOP}<${lineItemId}>` : ux_specification_types_1.DefinitionName.PositionOP;
|
|
337
338
|
customColumnDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${positionId}`;
|
|
338
|
-
(0,
|
|
339
|
+
(0, utils_2.addFragmentEnumForAnchor)(appSchema, lineItemId, v4Page, positionId, facetIdInManifest.replace(/::/g, '/'));
|
|
339
340
|
//Table custom column: Add enum for properties
|
|
340
341
|
const lineItems = appSchema.definitions[lineItemId];
|
|
341
342
|
if (lineItems) {
|
|
342
|
-
(0,
|
|
343
|
+
(0, utils_2.addEnumForProperties)(lineItems, customColumnDefinition);
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
346
|
/**
|
|
@@ -349,9 +350,10 @@ function addCustomColumnsOP(appSchema, v4Page, lineItemId, facetIdInManifest, lo
|
|
|
349
350
|
* @param v4Page Current page in manifest
|
|
350
351
|
* @param lineItemId - identifier of the current table in schema
|
|
351
352
|
* @param facetIdInManifest - identifier of the current object page section in manifest
|
|
352
|
-
* @param
|
|
353
|
+
* @param {GenerateAppSchemaParameters} generateParameters - Parameters required for generating the application schema.
|
|
354
|
+
* @returns Schema ID for actions definition.
|
|
353
355
|
*/
|
|
354
|
-
function addTableCustomActionsOP(appSchema, v4Page, lineItemId, facetIdInManifest,
|
|
356
|
+
function addTableCustomActionsOP(appSchema, v4Page, lineItemId, facetIdInManifest, generateParameters) {
|
|
355
357
|
// Create type specific copy of 'TableCustomActionOP'
|
|
356
358
|
const useDefinitionAsKey = lineItemId !== ux_specification_types_1.DefinitionName.LineItems &&
|
|
357
359
|
lineItemId !== 'LineItemsOfSPV::LineItem' &&
|
|
@@ -365,7 +367,7 @@ function addTableCustomActionsOP(appSchema, v4Page, lineItemId, facetIdInManifes
|
|
|
365
367
|
// Update definitions for type specific custom columns
|
|
366
368
|
const schemaId = `${ux_specification_types_1.DefinitionName.CustomTableActionOP}<${lineItemId}>`;
|
|
367
369
|
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.Actions}<${(0, common_1.prepareRef)(lineItemId)}>`;
|
|
368
|
-
(0,
|
|
370
|
+
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, schemaId, schemaIdForActions, facetIdInManifest);
|
|
369
371
|
const facetKey = useDefinitionAsKey ? lineItemId : ux_specification_types_1.DefinitionName.CustomActionPositionOP;
|
|
370
372
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.CustomActionPositionOP, facetKey, appSchema, useDefinitionAsKey);
|
|
371
373
|
// Anchor selection
|
|
@@ -373,7 +375,8 @@ function addTableCustomActionsOP(appSchema, v4Page, lineItemId, facetIdInManifes
|
|
|
373
375
|
? `${ux_specification_types_1.DefinitionName.CustomActionPositionOP}<${lineItemId}>`
|
|
374
376
|
: ux_specification_types_1.DefinitionName.CustomActionPositionOP;
|
|
375
377
|
customActionDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${positionId}`;
|
|
376
|
-
(0,
|
|
378
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForActions, positionId);
|
|
379
|
+
return schemaIdForActions;
|
|
377
380
|
}
|
|
378
381
|
/**
|
|
379
382
|
* Object Page specific custom action enhancements to header and footer.
|
|
@@ -381,23 +384,23 @@ function addTableCustomActionsOP(appSchema, v4Page, lineItemId, facetIdInManifes
|
|
|
381
384
|
* @param appSchema - app schema of the object page
|
|
382
385
|
* @param v4Page - current page in manifest
|
|
383
386
|
* @param customActionDefinitionKey - custom action key used in definitions
|
|
384
|
-
* @param
|
|
387
|
+
* @param generateParameters - list of API input parameters
|
|
385
388
|
*/
|
|
386
|
-
function addHeaderFooterCustomActionsOP(appSchema, v4Page, customActionDefinitionKey,
|
|
389
|
+
function addHeaderFooterCustomActionsOP(appSchema, v4Page, customActionDefinitionKey, generateParameters) {
|
|
387
390
|
const customActionDefinition = appSchema.definitions[customActionDefinitionKey];
|
|
388
391
|
customActionDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
389
392
|
customActionDefinition.description = CUSTOM_ACTION_DEFINITION_DESCRIPTION;
|
|
390
393
|
const schemaIdForActions = customActionDefinitionKey === ux_specification_types_1.DefinitionName.CustomHeaderActionOP
|
|
391
394
|
? ux_specification_types_1.DefinitionName.ObjectPageHeaderActions
|
|
392
395
|
: ux_specification_types_1.DefinitionName.FooterActions;
|
|
393
|
-
(0,
|
|
396
|
+
(0, utils_2.addHeaderFooterCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, customActionDefinitionKey, schemaIdForActions);
|
|
394
397
|
const facetKey = customActionDefinitionKey === ux_specification_types_1.DefinitionName.CustomHeaderActionOP
|
|
395
398
|
? ux_specification_types_1.DefinitionName.CustomHeaderActionPositionOP
|
|
396
399
|
: ux_specification_types_1.DefinitionName.CustomFooterActionPositionOP;
|
|
397
400
|
(0, common_1.parseSchemaDefinition)(facetKey, facetKey, appSchema, false);
|
|
398
401
|
// Anchor selection
|
|
399
402
|
customActionDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${facetKey}`;
|
|
400
|
-
(0,
|
|
403
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForActions, facetKey);
|
|
401
404
|
if (appSchema.definitions[schemaIdForActions]) {
|
|
402
405
|
appSchema.definitions[schemaIdForActions].additionalProperties = {
|
|
403
406
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${customActionDefinitionKey}`
|
|
@@ -411,26 +414,28 @@ function addHeaderFooterCustomActionsOP(appSchema, v4Page, customActionDefinitio
|
|
|
411
414
|
* @param v4Page - current page in manifest
|
|
412
415
|
* @param formItemId - identifier of the current form in schema
|
|
413
416
|
* @param facetIdInManifest - identifier of the current object page section in manifest
|
|
414
|
-
* @param
|
|
417
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
418
|
+
* @returns Schema ID for actions definition.
|
|
415
419
|
*/
|
|
416
|
-
function addFormCustomActionsOP(appSchema, v4Page, formItemId, facetIdInManifest,
|
|
420
|
+
function addFormCustomActionsOP(appSchema, v4Page, formItemId, facetIdInManifest, generateParameters) {
|
|
417
421
|
const customActionDefinitionKey = `${ux_specification_types_1.DefinitionName.CustomFormActionOP}<${formItemId}>`;
|
|
418
422
|
const customActionDefinition = appSchema.definitions[customActionDefinitionKey];
|
|
419
423
|
customActionDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
420
424
|
customActionDefinition.description = CUSTOM_ACTION_DEFINITION_DESCRIPTION;
|
|
421
425
|
const schemaId = `${ux_specification_types_1.DefinitionName.CustomFormActionOP}<${formItemId}>`;
|
|
422
426
|
const schemaIdForActions = `${ux_specification_types_1.DefinitionName.SectionActions}<${(0, common_1.prepareRef)(formItemId)}>`;
|
|
423
|
-
(0,
|
|
427
|
+
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, schemaId, schemaIdForActions, facetIdInManifest);
|
|
424
428
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.CustomActionPositionOP, formItemId, appSchema, true);
|
|
425
429
|
// Anchor selection
|
|
426
430
|
const positionId = `${ux_specification_types_1.DefinitionName.CustomActionPositionOP}<${formItemId}>`;
|
|
427
431
|
customActionDefinition.properties.position.$ref = `${common_1.DEFINITION_LINK_PREFIX}${positionId}`;
|
|
428
|
-
(0,
|
|
432
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, schemaIdForActions, positionId);
|
|
429
433
|
if (appSchema.definitions[schemaIdForActions]) {
|
|
430
434
|
appSchema.definitions[schemaIdForActions].additionalProperties = {
|
|
431
435
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${customActionDefinitionKey}`
|
|
432
436
|
};
|
|
433
437
|
}
|
|
438
|
+
return schemaIdForActions;
|
|
434
439
|
}
|
|
435
440
|
/**
|
|
436
441
|
* Adds definitions for line items in object page sections to the app schema.
|
|
@@ -471,14 +476,16 @@ function handleLineItem(generateParameters, facet, facetKey, appSchema, lineItem
|
|
|
471
476
|
oDataServiceAVT,
|
|
472
477
|
lineItemId
|
|
473
478
|
};
|
|
474
|
-
(0,
|
|
475
|
-
addCustomColumnsOP(appSchema, v4Page, lineItemId, facetKey,
|
|
476
|
-
|
|
479
|
+
(0, utils_2.addLineItemsTypeToSchema)(dataForLineItem, ux_specification_types_1.DefinitionName.ObjectPageTableColumn, ux_specification_types_1.DefinitionName.CustomColumnOP, ux_specification_types_1.DefinitionName.CustomTableActionOP);
|
|
480
|
+
addCustomColumnsOP(appSchema, v4Page, lineItemId, facetKey, generateParameters);
|
|
481
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, lineItemId, generateParameters, facetKey);
|
|
482
|
+
const schemaIdForActions = addTableCustomActionsOP(appSchema, v4Page, lineItemId, facetKey, generateParameters);
|
|
483
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, schemaIdForActions, generateParameters, facetKey);
|
|
477
484
|
addManifestPathsToPropertiesOP(appSchema, ux_specification_types_1.DefinitionName.ObjectPageTable, tableDefinition, {
|
|
478
485
|
pageName: v4Page.id,
|
|
479
486
|
manifest: generateParameters.manifest,
|
|
480
487
|
sectionId: facetKey
|
|
481
|
-
});
|
|
488
|
+
}, true);
|
|
482
489
|
return tableDefinition;
|
|
483
490
|
}
|
|
484
491
|
/**
|
|
@@ -515,9 +522,9 @@ function handleSectionTable(facet, facetKey, appSchema, lineItemFacet, generateP
|
|
|
515
522
|
* @param {object} sections - schema of current sections definition
|
|
516
523
|
* @param {object} appSchema - app specific schema of the object page that gets enhanced
|
|
517
524
|
* @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
|
|
518
|
-
* @param {
|
|
525
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
519
526
|
*/
|
|
520
|
-
function handleFormIdentification(facet, v4Page, facetKey, sections, appSchema, sectionPrefix,
|
|
527
|
+
function handleFormIdentification(facet, v4Page, facetKey, sections, appSchema, sectionPrefix, generateParameters) {
|
|
521
528
|
let definitionType;
|
|
522
529
|
if (sectionPrefix === ux_specification_types_1.SectionType.Section) {
|
|
523
530
|
definitionType = ux_specification_types_1.DefinitionName.ObjectPageSectionForm;
|
|
@@ -541,11 +548,13 @@ function handleFormIdentification(facet, v4Page, facetKey, sections, appSchema,
|
|
|
541
548
|
const formItemId = (0, common_1.getFacetKeyInSchema)(facetKey);
|
|
542
549
|
if (facet.base === ux_specification_types_1.FacetBase.Form) {
|
|
543
550
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.CustomFormActionOP, targetId, appSchema);
|
|
544
|
-
addFormCustomActionsOP(appSchema, v4Page, targetId, formItemId,
|
|
551
|
+
const schemaIdForActions = addFormCustomActionsOP(appSchema, v4Page, targetId, formItemId, generateParameters);
|
|
552
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, schemaIdForActions, generateParameters, facetKey);
|
|
545
553
|
}
|
|
546
554
|
// Add custom fields
|
|
547
555
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.CustomField, targetId, appSchema);
|
|
548
|
-
addFormCustomFieldsOP(appSchema, v4Page, sectionPrefix, targetId, formItemId,
|
|
556
|
+
const schemaIdForFields = addFormCustomFieldsOP(appSchema, v4Page, sectionPrefix, targetId, formItemId, generateParameters);
|
|
557
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, schemaIdForFields, generateParameters, facetKey);
|
|
549
558
|
}
|
|
550
559
|
/**
|
|
551
560
|
* Adds definitions for header sections (DataPoint, Chart) in object page sections to the app schema.
|
|
@@ -875,12 +884,12 @@ function createCustomSubSectionReference(appSchema, id, featureToggles) {
|
|
|
875
884
|
/**
|
|
876
885
|
* Method applies custom action definitions to custom sections.
|
|
877
886
|
*
|
|
878
|
-
* @param appSchema - app schema of the object page
|
|
879
|
-
* @param v4Page Current page in manifest
|
|
880
|
-
* @param customSectionRef - reference to custom section definition
|
|
881
|
-
* @param
|
|
887
|
+
* @param {Definition} appSchema - app schema of the object page
|
|
888
|
+
* @param {v4.SapUiAppPageV4} v4Page Current page in manifest
|
|
889
|
+
* @param {string} customSectionRef - reference to custom section definition
|
|
890
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
882
891
|
*/
|
|
883
|
-
function applyCustomActionsToCustomSections(appSchema, v4Page, customSectionRef,
|
|
892
|
+
function applyCustomActionsToCustomSections(appSchema, v4Page, customSectionRef, generateParameters) {
|
|
884
893
|
// add specific definitions for custom sections and custom actions from manifest
|
|
885
894
|
const sectionsInManifest = v4Page.options?.settings?.content?.body?.sections;
|
|
886
895
|
if (sectionsInManifest) {
|
|
@@ -908,9 +917,10 @@ function applyCustomActionsToCustomSections(appSchema, v4Page, customSectionRef,
|
|
|
908
917
|
// set custom action as view node
|
|
909
918
|
customActionOPDef[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
910
919
|
// add custom actions definitions
|
|
911
|
-
(0,
|
|
920
|
+
(0, utils_2.addCustomActionDefinition)(appSchema, v4Page, generateParameters.logger, customActionDefinitionName, customActionsDefinitionName, sectionId);
|
|
912
921
|
// add anchors
|
|
913
|
-
(0,
|
|
922
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, customActionsDefinitionName, customActionPositionOPDefinitionName);
|
|
923
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, customActionsDefinitionName, generateParameters, sectionId);
|
|
914
924
|
}
|
|
915
925
|
}
|
|
916
926
|
}
|
|
@@ -940,7 +950,7 @@ function applyCustomSections(sections, appSchema, generateParameters, v4Page, cu
|
|
|
940
950
|
sections.additionalProperties = {
|
|
941
951
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${customSectionRef}`
|
|
942
952
|
};
|
|
943
|
-
(0,
|
|
953
|
+
(0, utils_2.addCustomSectionDefinition)(appSchema, sections, v4Page, customSectionRef, isMergedSections, facetKey, generateParameters.logger);
|
|
944
954
|
const sectionDefinition = appSchema.definitions[customSectionRef];
|
|
945
955
|
if (typeof sectionDefinition === 'object') {
|
|
946
956
|
(0, common_1.addDescriptiveEnumDefinition)(appSchema, sections, {
|
|
@@ -957,7 +967,7 @@ function applyCustomSections(sections, appSchema, generateParameters, v4Page, cu
|
|
|
957
967
|
const customSectionCustomActions = appSchema.definitions[ux_specification_types_1.DefinitionName.ObjectPageCustomSectionActions];
|
|
958
968
|
// initially define no actions for section
|
|
959
969
|
customSectionCustomActions.properties = {};
|
|
960
|
-
applyCustomActionsToCustomSections(appSchema, v4Page, customSectionRef, generateParameters
|
|
970
|
+
applyCustomActionsToCustomSections(appSchema, v4Page, customSectionRef, generateParameters);
|
|
961
971
|
}
|
|
962
972
|
const relatedFacet = sectionDefinition.properties.relatedFacet;
|
|
963
973
|
if (customSectionRef?.includes(ux_specification_types_1.DefinitionName.ObjectPageCustomSubSectionFragment) &&
|
|
@@ -1050,7 +1060,7 @@ function addSection(generateParameters, facets, facetKey, sections, appSchema, s
|
|
|
1050
1060
|
}
|
|
1051
1061
|
case ux_specification_types_1.FacetBase.Form:
|
|
1052
1062
|
case ux_specification_types_1.FacetBase.Identification: {
|
|
1053
|
-
handleFormIdentification(facet, v4Page, facetKey, sections, appSchema, sectionPrefix, generateParameters
|
|
1063
|
+
handleFormIdentification(facet, v4Page, facetKey, sections, appSchema, sectionPrefix, generateParameters);
|
|
1054
1064
|
break;
|
|
1055
1065
|
}
|
|
1056
1066
|
case ux_specification_types_1.FacetBase.DataPoint: {
|
|
@@ -1096,6 +1106,7 @@ function addSections(generateParameters, appSchema, v4Page) {
|
|
|
1096
1106
|
}
|
|
1097
1107
|
// add custom sections
|
|
1098
1108
|
applyCustomSections(sections, appSchema, generateParameters, v4Page, ux_specification_types_1.DefinitionName.ObjectPageCustomSectionFragment);
|
|
1109
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, ux_specification_types_1.DefinitionName.Sections, generateParameters);
|
|
1099
1110
|
}
|
|
1100
1111
|
/**
|
|
1101
1112
|
* Derives the header sections from the UI.HeaderFacets annotation and adds them to the schema.
|
|
@@ -1139,12 +1150,28 @@ function addHeader(generateParameters, appSchema, v4Page) {
|
|
|
1139
1150
|
(0, common_1.addCommonHeaderSchema)(appSchema, entityType);
|
|
1140
1151
|
// Add header actions
|
|
1141
1152
|
(0, common_1.addHeaderActions)(appSchema, entityType, generateParameters, addHeaderActionCallBackV4, v4Page);
|
|
1153
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, ux_specification_types_1.DefinitionName.ObjectPageHeaderActions, generateParameters);
|
|
1142
1154
|
// Add header sections
|
|
1143
1155
|
if (entityType) {
|
|
1144
1156
|
appSchema.definitions[ux_specification_types_1.DefinitionName.HeaderSections][ux_specification_types_1.SchemaTag.annotationPath] =
|
|
1145
1157
|
`/${entityType.fullyQualifiedName}/@${"com.sap.vocabularies.UI.v1.HeaderFacets" /* UIAnnotationTerms.HeaderFacets */}`;
|
|
1146
1158
|
}
|
|
1147
1159
|
addHeaderSections(generateParameters, appSchema, entityType, v4Page);
|
|
1160
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, ux_specification_types_1.DefinitionName.HeaderSections, generateParameters);
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* Add Object Page Footer to app-specific schema.
|
|
1164
|
+
*
|
|
1165
|
+
* @param generateParameters - list of API input parameters
|
|
1166
|
+
* @param appSchema Schema of the object page
|
|
1167
|
+
* @param v4Page - current page in manifest
|
|
1168
|
+
*/
|
|
1169
|
+
function addFooter(generateParameters, appSchema, v4Page) {
|
|
1170
|
+
// Currently only actions are supported for footer
|
|
1171
|
+
(0, common_1.addFooterActions)(appSchema, generateParameters, ux_specification_types_1.FioriElementsVersion.v4, addFooterActionCallBackV4);
|
|
1172
|
+
addHeaderFooterCustomActionsOP(appSchema, v4Page, ux_specification_types_1.DefinitionName.CustomFooterActionOP, generateParameters);
|
|
1173
|
+
(0, utils_2.addEnumForActionAnchor)(appSchema, ux_specification_types_1.DefinitionName.FooterActions, ux_specification_types_1.DefinitionName.CustomFooterActionPositionOP);
|
|
1174
|
+
addManifestPathsToDefinitionPropertiesOP(appSchema, v4Page.id, ux_specification_types_1.DefinitionName.FooterActions, generateParameters);
|
|
1148
1175
|
}
|
|
1149
1176
|
/**
|
|
1150
1177
|
* Adds 'manifestPath' to each property in a definition based on metadata sync rules.
|
|
@@ -1153,14 +1180,21 @@ function addHeader(generateParameters, appSchema, v4Page) {
|
|
|
1153
1180
|
* @param definitionName - The name of the definition/class whose properties are being processed.
|
|
1154
1181
|
* @param definition - The definition object containing property schemas.
|
|
1155
1182
|
* @param pathParams - Additional context required to compute manifest paths.
|
|
1183
|
+
* @param handleRelative - A flag indicating whether to use relative paths for definition properties.
|
|
1156
1184
|
*/
|
|
1157
|
-
function addManifestPathsToPropertiesOP(appSchema, definitionName, definition, pathParams) {
|
|
1185
|
+
function addManifestPathsToPropertiesOP(appSchema, definitionName, definition, pathParams, handleRelative = false) {
|
|
1158
1186
|
(0, utils_1.addManifestPathsToProperties)(appSchema, definitionName, definition, {
|
|
1159
1187
|
...pathParams,
|
|
1160
1188
|
targetAnnotation: pathParams.sectionId?.replace('::', '/'),
|
|
1161
1189
|
targetAnnotationEncoded: pathParams.sectionId,
|
|
1162
|
-
pathsParts: [
|
|
1163
|
-
|
|
1190
|
+
pathsParts: [
|
|
1191
|
+
pathParams.sectionId,
|
|
1192
|
+
pathParams.columnKey,
|
|
1193
|
+
pathParams.targetAnnotation,
|
|
1194
|
+
pathParams.configObject,
|
|
1195
|
+
pathParams.originalIds
|
|
1196
|
+
]
|
|
1197
|
+
}, handleRelative);
|
|
1164
1198
|
}
|
|
1165
1199
|
/**
|
|
1166
1200
|
* Adds 'manifestPath' to static nodes in schema.
|
|
@@ -1169,6 +1203,8 @@ function addManifestPathsToPropertiesOP(appSchema, definitionName, definition, p
|
|
|
1169
1203
|
* @param pathParams - Additional context required to compute manifest paths.
|
|
1170
1204
|
*/
|
|
1171
1205
|
function addManifestPathsToStaticNodes(appSchema, pathParams) {
|
|
1206
|
+
// Add "manifestPath" for current page
|
|
1207
|
+
appSchema['manifestPath'] = (0, utils_1.getPageManifestPath)(pathParams);
|
|
1172
1208
|
// Root level - rules stored on page class level
|
|
1173
1209
|
addManifestPathsToPropertiesOP(appSchema, ux_specification_types_1.PageTypeV4.ObjectPage, appSchema, pathParams);
|
|
1174
1210
|
// Other definitions
|
|
@@ -1229,7 +1265,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, contextPa
|
|
|
1229
1265
|
});
|
|
1230
1266
|
return appSchema;
|
|
1231
1267
|
}
|
|
1232
|
-
const v4Page = (0,
|
|
1268
|
+
const v4Page = (0, utils_2.findPageV4)(pages, ux_specification_types_1.v4.FE_TEMPLATE_V4_OBJECT_PAGE, generateParameters.entitySet, contextPath);
|
|
1233
1269
|
if (!v4Page) {
|
|
1234
1270
|
return appSchema;
|
|
1235
1271
|
}
|
|
@@ -1258,8 +1294,7 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, contextPa
|
|
|
1258
1294
|
}
|
|
1259
1295
|
addSections(generateParameters, appSchema, v4Page);
|
|
1260
1296
|
// Add Footer (actions only)
|
|
1261
|
-
(
|
|
1262
|
-
addHeaderFooterCustomActionsOP(appSchema, v4Page, ux_specification_types_1.DefinitionName.CustomFooterActionOP, generateParameters.logger);
|
|
1297
|
+
addFooter(generateParameters, appSchema, v4Page);
|
|
1263
1298
|
// Add "manifestPath" on root.page level properties
|
|
1264
1299
|
addManifestPathsToStaticNodes(appSchema, {
|
|
1265
1300
|
pageName: v4Page.id,
|
|
@@ -1300,9 +1335,10 @@ function generateObjectPageSchemaV4(generateParameters, genericSchema, contextPa
|
|
|
1300
1335
|
* @param sectionPrefix - Indicates whether the section is a header or a standard section (from `SectionType` enum).
|
|
1301
1336
|
* @param formItemId - Unique identifier of the current form within the schema.
|
|
1302
1337
|
* @param fieldGroupInManifest - Identifier of the corresponding section (facet) in the manifest.
|
|
1303
|
-
* @param
|
|
1338
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters
|
|
1339
|
+
* @returns Schema ID for fields definition.
|
|
1304
1340
|
*/
|
|
1305
|
-
function addFormCustomFieldsOP(appSchema, v4Page, sectionPrefix, formItemId, fieldGroupInManifest,
|
|
1341
|
+
function addFormCustomFieldsOP(appSchema, v4Page, sectionPrefix, formItemId, fieldGroupInManifest, generateParameters) {
|
|
1306
1342
|
const customFieldDefinitionKey = `${ux_specification_types_1.DefinitionName.CustomField}<${formItemId}>`;
|
|
1307
1343
|
const customFieldDefinition = appSchema.definitions[customFieldDefinitionKey];
|
|
1308
1344
|
customFieldDefinition[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
@@ -1310,7 +1346,7 @@ function addFormCustomFieldsOP(appSchema, v4Page, sectionPrefix, formItemId, fie
|
|
|
1310
1346
|
const schemaId = `${ux_specification_types_1.DefinitionName.CustomField}<${formItemId}>`;
|
|
1311
1347
|
const fieldsDefinitionKey = sectionPrefix === ux_specification_types_1.SectionType.HeaderSection ? ux_specification_types_1.DefinitionName.HeaderSectionFields : ux_specification_types_1.DefinitionName.SectionFields;
|
|
1312
1348
|
const schemaIdForFields = `${fieldsDefinitionKey}<${(0, common_1.prepareRef)(formItemId)}>`;
|
|
1313
|
-
(0, utils_1.addCustomFieldDefinition)(appSchema, v4Page, fieldGroupInManifest, logger, schemaId, schemaIdForFields);
|
|
1349
|
+
(0, utils_1.addCustomFieldDefinition)(appSchema, v4Page, fieldGroupInManifest, generateParameters.logger, schemaId, schemaIdForFields);
|
|
1314
1350
|
(0, common_1.parseSchemaDefinition)(ux_specification_types_1.DefinitionName.CustomFieldPosition, formItemId, appSchema, true);
|
|
1315
1351
|
// Anchor selection
|
|
1316
1352
|
const positionId = `${ux_specification_types_1.DefinitionName.CustomFieldPosition}<${formItemId}>`;
|
|
@@ -1327,5 +1363,62 @@ function addFormCustomFieldsOP(appSchema, v4Page, sectionPrefix, formItemId, fie
|
|
|
1327
1363
|
$ref: `${common_1.DEFINITION_LINK_PREFIX}${customFieldDefinitionKey}`
|
|
1328
1364
|
};
|
|
1329
1365
|
}
|
|
1366
|
+
return schemaIdForFields;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Enhances the Object Page schema with manifest paths for definition and properties.
|
|
1370
|
+
*
|
|
1371
|
+
* This function extends the app schema (`appSchema`) by adding manifestPath to definition and properties on the Object Page.
|
|
1372
|
+
*
|
|
1373
|
+
* @param {Definition} appSchema - The application schema object representing the Object Page structure.
|
|
1374
|
+
* @param {string} pageId - Identifier of the page.
|
|
1375
|
+
* @param {string} definitionName - Identifier of the corresponding definition.
|
|
1376
|
+
* @param {GenerateAppSchemaParameters} generateParameters - list of API input parameters.
|
|
1377
|
+
* @param {string} facetKey - Identifier of the section (facet key or custom section id) in manifest in case of custom columns.
|
|
1378
|
+
*/
|
|
1379
|
+
function addManifestPathsToDefinitionPropertiesOP(appSchema, pageId, definitionName, generateParameters, facetKey) {
|
|
1380
|
+
const matchingDefinition = appSchema.definitions[definitionName];
|
|
1381
|
+
const properties = matchingDefinition?.properties ?? {};
|
|
1382
|
+
const isSections = [`${ux_specification_types_1.DefinitionName.HeaderSections}`, `${ux_specification_types_1.DefinitionName.Sections}`].includes(definitionName);
|
|
1383
|
+
for (const key in properties) {
|
|
1384
|
+
const property = matchingDefinition.properties[key];
|
|
1385
|
+
let sectionId;
|
|
1386
|
+
// Current logic checks for subsections at first level, we meed to introduce recursion? for next levels
|
|
1387
|
+
if (isSections) {
|
|
1388
|
+
const subSections = property.properties?.['subsections']?.['properties'];
|
|
1389
|
+
if (subSections) {
|
|
1390
|
+
Object.keys(subSections).forEach((subSectionId) => {
|
|
1391
|
+
// subsections requires array like paths for sync rule resolution
|
|
1392
|
+
const originalIds = ['sections', key, 'subsections', subSectionId];
|
|
1393
|
+
addManifestPathsToPropertiesOP(appSchema, undefined, subSections[subSectionId], {
|
|
1394
|
+
pageName: pageId,
|
|
1395
|
+
sectionId: key,
|
|
1396
|
+
columnKey: subSectionId,
|
|
1397
|
+
originalIds,
|
|
1398
|
+
manifest: generateParameters.manifest
|
|
1399
|
+
}, true);
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
else {
|
|
1403
|
+
// Check OP facets for sectionId resolution
|
|
1404
|
+
const facets = (0, common_1.getObjectPageHeaderFacets)(generateParameters.entityType, generateParameters.serviceAVT, ux_specification_types_1.FioriElementsVersion.v4, generateParameters.logger);
|
|
1405
|
+
sectionId = facets[key]?.ID ?? key;
|
|
1406
|
+
addManifestPathsToPropertiesOP(appSchema, undefined, property, {
|
|
1407
|
+
pageName: pageId,
|
|
1408
|
+
sectionId,
|
|
1409
|
+
manifest: generateParameters.manifest
|
|
1410
|
+
}, true);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
else {
|
|
1414
|
+
sectionId = facetKey;
|
|
1415
|
+
addManifestPathsToPropertiesOP(appSchema, undefined, property, {
|
|
1416
|
+
pageName: pageId,
|
|
1417
|
+
sectionId,
|
|
1418
|
+
columnKey: key,
|
|
1419
|
+
manifest: generateParameters.manifest
|
|
1420
|
+
}, true);
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1330
1423
|
}
|
|
1331
1424
|
//# sourceMappingURL=objectPage.js.map
|