@sap/ux-specification 1.71.49 → 1.71.52
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 +53 -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/index-min.js +1 -1
- package/dist/schemas/v2/AnalyticalListPageConfig.json +86 -2
- package/dist/schemas/v2/ListReportConfig.json +88 -4
- package/dist/schemas/v2/ObjectPageConfig.json +89 -33
- package/dist/scripts/runDocu.js +30 -7
- package/dist/scripts/runDocu.js.map +1 -1
- package/dist/scripts/to-json-schema.js +27 -32
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/src/api.js +3 -3
- package/dist/src/api.js.map +1 -1
- package/dist/src/apiTypes.d.ts +1 -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 +19 -2
- 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 +3 -2
- 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 +87 -20
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +27 -0
- package/dist/src/sync/common/generate/utils.js +118 -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 +10 -17
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +31 -17
- 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 +10 -1
- package/dist/src/sync/common/utils.js +26 -23
- 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 +3 -3
- package/dist/src/sync/v2/export/controls/FilterBar.js +20 -27
- 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 +4 -4
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +12 -15
- 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 +3 -2
- 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/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 +12 -3
- 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 +277 -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 -17
- 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 +27 -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 +14 -124
- 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/test/unit/utils.test.d.ts +1 -1
- package/package.json +7 -10
- 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,27 +9,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const decorators_1 = require("../../../common/decoration/decorators");
|
|
10
10
|
const common_1 = require("../../../common");
|
|
11
11
|
exports.FacetTitlePrefix = 'Facet ID: ';
|
|
12
|
-
exports.getTableSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType,
|
|
13
|
-
const
|
|
14
|
-
const breadcrumbsTrail = [
|
|
12
|
+
exports.getTableSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType, facetId) => {
|
|
13
|
+
const convertedId = common_1.convertSectionId(breadcrumbs[1], facetId);
|
|
14
|
+
const breadcrumbsTrail = [convertedId, 'Table'];
|
|
15
15
|
return common_1.buildControlIdFromParent(baseId, breadcrumbsTrail);
|
|
16
16
|
};
|
|
17
|
-
exports.getFormSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType,
|
|
18
|
-
const
|
|
19
|
-
const breadcrumbsTrail = [
|
|
17
|
+
exports.getFormSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType, facetId) => {
|
|
18
|
+
const convertedId = common_1.convertSectionId(breadcrumbs[1], facetId);
|
|
19
|
+
const breadcrumbsTrail = [convertedId, 'FormGroup'];
|
|
20
20
|
return common_1.buildControlIdFromParent(baseId, breadcrumbsTrail);
|
|
21
21
|
};
|
|
22
|
-
exports.getSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
facetId = breadcrumbs[breadcrumbs.length - 1].replace('@', '');
|
|
26
|
-
}
|
|
27
|
-
const breadcrumbsTrail = [facetId, 'Section'];
|
|
22
|
+
exports.getSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType, facetId) => {
|
|
23
|
+
const convertedId = common_1.convertSectionId(breadcrumbs[1], facetId);
|
|
24
|
+
const breadcrumbsTrail = [convertedId, 'Section'];
|
|
28
25
|
return common_1.buildControlIdFromParent(baseId, breadcrumbsTrail);
|
|
29
26
|
};
|
|
30
|
-
exports.getSubSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType,
|
|
31
|
-
const
|
|
32
|
-
const breadcrumbsTrail = [
|
|
27
|
+
exports.getSubSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType, facetId) => {
|
|
28
|
+
const convertedId = common_1.convertSectionId(breadcrumbs[1], facetId);
|
|
29
|
+
const breadcrumbsTrail = [convertedId, 'SubSection'];
|
|
33
30
|
return common_1.buildControlIdFromParent(baseId, breadcrumbsTrail);
|
|
34
31
|
};
|
|
35
32
|
class ObjectPageSectionV2 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectPageSectionsV2.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/controls/ObjectPageSectionsV2.ts"],"names":[],"mappings":";;;;;;;;AAKA,sEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"ObjectPageSectionsV2.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/controls/ObjectPageSectionsV2.ts"],"names":[],"mappings":";;;;;;;;AAKA,sEAAiE;AACjE,4CAOyB;AAEZ,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAEhC,QAAA,wBAAwB,GAAG,CACpC,MAAc,EACd,aAAuB,EACvB,WAAqB,EACrB,WAAgC,EAChC,OAAe,EACT,EAAE;IACR,MAAM,WAAW,GAAG,yBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,iCAAwB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC9D,CAAC,CAAC;AACW,QAAA,uBAAuB,GAAG,CACnC,MAAc,EACd,aAAuB,EACvB,WAAqB,EACrB,WAAgC,EAChC,OAAe,EACT,EAAE;IACR,MAAM,WAAW,GAAG,yBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACpD,OAAO,iCAAwB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEW,QAAA,mBAAmB,GAAG,CAC/B,MAAc,EAC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AAC,oBAAW,CAAC,OAAO;YACnD,gBAAgB,EAAE,2BAAkB;SACvC;QACD,QAAQ,EAAE,2CAAkC;KAC/C,CAAC;yDACgB;AATtB,4DAUC;AAED,MAAa,sBAAsB;CAUlC;AADG;IARC,qBAAQ,CAAC;QACN,IAAI,EAAE;YACF,SAAS,EAAE,8BAAsB;YACjC,WAAW,EAAE,GAAgB,EAAE,CAAC,oBAAW,CAAC,UAAU;YACtD,gBAAgB,EAAE,2BAAkB;SACvC;QACD,QAAQ,EAAE,2CAAkC;KAC/C,CAAC;uDACgB;AATtB,wDAUC;AAED,MAAa,0BAA0B;CAUtC;AADG;IARC,qBAAQ,CAAC;QACN,IAAI,EAAE;YACF,SAAS,EAAE,+BAAuB;YAClC,WAAW,EAAE,GAAgB,EAAE,CAAC,oBAAW,CAAC,UAAU;YACtD,gBAAgB,EAAE,2BAAkB;SACvC;QACD,QAAQ,EAAE,2CAAkC;KAC/C,CAAC;2DACgB;AATtB,gEAUC;AAED,MAAa,2BAA2B;CAUvC;AADG;IARC,qBAAQ,CAAC;QACN,IAAI,EAAE;YACF,SAAS,EAAE,gCAAwB;YACnC,WAAW,EAAE,GAAgB,EAAE,CAAC,oBAAW,CAAC,UAAU;YACtD,gBAAgB,EAAE,2BAAkB;SACvC;QACD,QAAQ,EAAE,2CAAkC;KAC/C,CAAC;4DACgB;AATtB,kEAUC"}
|
|
@@ -15,12 +15,14 @@ const common_1 = require("../../../common");
|
|
|
15
15
|
* @param {string} baseId Base Id of the control
|
|
16
16
|
* @param {string[]} _idBreadcrumbs
|
|
17
17
|
* @param {string[]} breadcrumbs
|
|
18
|
+
* @param {ControlTypeFunction} controlType
|
|
19
|
+
* @param {string} facetID title from the app schema (comprising for instance the facet ID)
|
|
18
20
|
* @returns {string} stable ID of Object Page Toolbar Action button
|
|
19
21
|
*/
|
|
20
|
-
const getActionButtonId = (baseId, _idBreadcrumbs, breadcrumbs) => {
|
|
21
|
-
const
|
|
22
|
-
const section = breadcrumbs[1]
|
|
23
|
-
return `${baseId}${section}::action::${
|
|
22
|
+
const getActionButtonId = (baseId, _idBreadcrumbs, breadcrumbs, _controlType, facetID) => {
|
|
23
|
+
const { actionId } = common_1.getActionBreadcrumbParts(breadcrumbs);
|
|
24
|
+
const section = common_1.convertSectionId(breadcrumbs[1], facetID);
|
|
25
|
+
return `${baseId}${section}::action::${actionId.replace(':2f', '::')}`;
|
|
24
26
|
};
|
|
25
27
|
const flexRuleForToolBarActionOP = {
|
|
26
28
|
controlId: getActionButtonId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectPageToolBarAction.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/controls/ObjectPageToolBarAction.ts"],"names":[],"mappings":";;;;;;;;AACA,2DAA0E;AAC1E,iDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"ObjectPageToolBarAction.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/controls/ObjectPageToolBarAction.ts"],"names":[],"mappings":";;;;;;;;AACA,2DAA0E;AAC1E,iDAAoD;AACpD,4CAAiH;AAEjH;;;;;;;;;GASG;AACH,MAAM,iBAAiB,GAAG,CACtB,MAAc,EACd,cAAwB,EACxB,WAAqB,EACrB,YAAY,EACZ,OAAe,EACT,EAAE;IACR,MAAM,EAAE,QAAQ,EAAE,GAAG,iCAAwB,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,yBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,GAAG,MAAM,GAAG,OAAO,aAAa,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG;IAC/B,SAAS,EAAE,iBAAiB;IAC5B,WAAW,EAAE,GAAgB,EAAE,CAAC,mBAAW,CAAC,MAAM;IAClD,gBAAgB,EAAE,+BAAkB;CACvC,CAAC;AAEF,MAAa,uBAAuB;CA0BnC;AArBG;IAJC,qBAAQ,CAAC;QACN,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,2CAAkC;KAC/C,CAAC;wDACe;AAKjB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,0BAA0B;KACnC,CAAC;wDACe;AAKjB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,0BAA0B;KACnC,CAAC;qDACkB;AAKpB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,0BAA0B;KACnC,CAAC;2DACwB;AAK1B;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,0BAA0B;KACnC,CAAC;qDACgB;AAzBtB,0DA0BC"}
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
import { TableColumn as TableColumnConfig,
|
|
1
|
+
import { ButtonType, HAlign, SapUiCoreURI, TableColumn as TableColumnConfig, TableColumnAction as TableColumnActionConfig, TableCustomColumn as TableCustomColumnConfig, TableColumnExtensionTypeV2 } from '../../../../specification/v2';
|
|
2
2
|
import { SAPUI5_FRAGMENT_CLASS } from '../../../../specification/common/webapp/manifest';
|
|
3
3
|
export declare class TableColumn implements TableColumnConfig {
|
|
4
4
|
width?: string;
|
|
5
5
|
hAlign?: HAlign;
|
|
6
6
|
}
|
|
7
|
+
export declare class TableColumnAction implements TableColumnActionConfig {
|
|
8
|
+
width?: string;
|
|
9
|
+
hAlign?: HAlign;
|
|
10
|
+
tooltip?: string;
|
|
11
|
+
icon?: SapUiCoreURI;
|
|
12
|
+
activeIcon?: SapUiCoreURI;
|
|
13
|
+
type?: ButtonType;
|
|
14
|
+
}
|
|
15
|
+
export declare class TableColumnActionIntentBased extends TableColumnAction {
|
|
16
|
+
width?: string;
|
|
17
|
+
hAlign?: HAlign;
|
|
18
|
+
tooltip?: string;
|
|
19
|
+
icon?: SapUiCoreURI;
|
|
20
|
+
activeIcon?: SapUiCoreURI;
|
|
21
|
+
type?: ButtonType;
|
|
22
|
+
}
|
|
7
23
|
/**
|
|
8
|
-
* No sync rules are defined for table custom columns, as they are
|
|
24
|
+
* No sync rules are defined for table custom columns, as they are transferred altogether, by function exportToFragment.
|
|
9
25
|
* This approach is needed to support inserts as well as deletions of manifest extensions and fragments
|
|
10
26
|
*/
|
|
11
27
|
export declare class TableCustomColumn implements TableCustomColumnConfig {
|
|
@@ -6,9 +6,66 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const Action_1 = require("./Action");
|
|
9
10
|
const types_1 = require("../../../common/types");
|
|
10
11
|
const decoration_1 = require("../../../common/decoration");
|
|
11
12
|
const common_1 = require("../../../common");
|
|
13
|
+
/**
|
|
14
|
+
* Create stable ID for Action Column
|
|
15
|
+
*
|
|
16
|
+
* @param {string} baseId Base Id of the control
|
|
17
|
+
* @param {string[]} _idBreadcrumbs
|
|
18
|
+
* @param {string[]} breadcrumbs
|
|
19
|
+
* @returns {string} stable ID of Action Column
|
|
20
|
+
*/
|
|
21
|
+
const buildColumnActionId = (baseId, idBreadcrumbs, breadcrumbs) => {
|
|
22
|
+
const columnTemplate = 'template:::TableColumn';
|
|
23
|
+
const { actionType, actionId } = common_1.getActionBreadcrumbParts(breadcrumbs);
|
|
24
|
+
const smartTableId = `sSmartTableId::${idBreadcrumbs[0]}`;
|
|
25
|
+
return `${baseId}${columnTemplate}:::${actionType}:::${smartTableId}:::sAction::${actionId}`;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Create stable ID for Intent Based Action Column
|
|
29
|
+
*
|
|
30
|
+
* @param {string} baseId Base Id of the control
|
|
31
|
+
* @param {string[]} _idBreadcrumbs
|
|
32
|
+
* @param {string[]} breadcrumbs
|
|
33
|
+
* @returns {string} stable ID of Action Column
|
|
34
|
+
*/
|
|
35
|
+
const buildColumnIntentBasedId = (baseId, idBreadcrumbs, breadcrumbs) => {
|
|
36
|
+
const columnTemplate = 'template:::TableColumn';
|
|
37
|
+
const { actionType, actionId, semanticObjectId } = common_1.getActionBreadcrumbParts(breadcrumbs);
|
|
38
|
+
const smartTableId = `sSmartTableId::${idBreadcrumbs[0]}`;
|
|
39
|
+
return `${baseId}${columnTemplate}:::${actionType}:::${smartTableId}:::sSemanticObject::${semanticObjectId}:::sAction::${actionId}`;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Create stable ID for Column Action button
|
|
43
|
+
*
|
|
44
|
+
* @param {string} baseId Base Id of the control
|
|
45
|
+
* @param {string[]} _idBreadcrumbs
|
|
46
|
+
* @param {string[]} breadcrumbs
|
|
47
|
+
* @returns {string} stable ID of Column Action button
|
|
48
|
+
*/
|
|
49
|
+
const buildColumnActionButtonId = (baseId, _idBreadcrumbs, breadcrumbs) => {
|
|
50
|
+
const { actionId } = common_1.getActionBreadcrumbParts(breadcrumbs);
|
|
51
|
+
return `${baseId}action::${actionId.replace(':2f', '::')}`;
|
|
52
|
+
};
|
|
53
|
+
// TableColumnAction column properties
|
|
54
|
+
const flexRuleForColumn = {
|
|
55
|
+
controlId: buildColumnActionId,
|
|
56
|
+
controlType: () => types_1.ControlType.TableColumn,
|
|
57
|
+
createFlexChange: decoration_1.exportToFlexChange
|
|
58
|
+
};
|
|
59
|
+
// TableColumnAction action properties
|
|
60
|
+
const flexRuleForColumnAction = {
|
|
61
|
+
controlId: buildColumnActionButtonId,
|
|
62
|
+
controlType: () => types_1.ControlType.Button,
|
|
63
|
+
createFlexChange: decoration_1.exportToFlexChange
|
|
64
|
+
};
|
|
65
|
+
// TableColumnActionIntentBased main properties
|
|
66
|
+
const flexRuleForColumnIntentBased = Object.assign(Object.assign({}, flexRuleForColumn), { controlId: buildColumnIntentBasedId });
|
|
67
|
+
// TableColumnActionIntentBased action properties
|
|
68
|
+
const flexRuleForColumnIntentBasedAction = Object.assign(Object.assign({}, flexRuleForColumnAction), { controlId: Action_1.buildIntentBasedActionId });
|
|
12
69
|
class TableColumn {
|
|
13
70
|
}
|
|
14
71
|
__decorate([
|
|
@@ -31,8 +88,76 @@ __decorate([
|
|
|
31
88
|
})
|
|
32
89
|
], TableColumn.prototype, "hAlign", void 0);
|
|
33
90
|
exports.TableColumn = TableColumn;
|
|
91
|
+
class TableColumnAction {
|
|
92
|
+
}
|
|
93
|
+
__decorate([
|
|
94
|
+
decoration_1.syncRule({
|
|
95
|
+
flex: flexRuleForColumn
|
|
96
|
+
})
|
|
97
|
+
], TableColumnAction.prototype, "width", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
decoration_1.syncRule({
|
|
100
|
+
flex: flexRuleForColumn,
|
|
101
|
+
generate: common_1.addPatternForBindingChangeOfEnumLR
|
|
102
|
+
})
|
|
103
|
+
], TableColumnAction.prototype, "hAlign", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
decoration_1.syncRule({
|
|
106
|
+
flex: flexRuleForColumnAction
|
|
107
|
+
})
|
|
108
|
+
], TableColumnAction.prototype, "tooltip", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
decoration_1.syncRule({
|
|
111
|
+
flex: flexRuleForColumnAction
|
|
112
|
+
})
|
|
113
|
+
], TableColumnAction.prototype, "icon", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
decoration_1.syncRule({
|
|
116
|
+
flex: flexRuleForColumnAction
|
|
117
|
+
})
|
|
118
|
+
], TableColumnAction.prototype, "activeIcon", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
decoration_1.syncRule({
|
|
121
|
+
flex: flexRuleForColumnAction
|
|
122
|
+
})
|
|
123
|
+
], TableColumnAction.prototype, "type", void 0);
|
|
124
|
+
exports.TableColumnAction = TableColumnAction;
|
|
125
|
+
class TableColumnActionIntentBased extends TableColumnAction {
|
|
126
|
+
}
|
|
127
|
+
__decorate([
|
|
128
|
+
decoration_1.syncRule({
|
|
129
|
+
flex: flexRuleForColumnIntentBased
|
|
130
|
+
})
|
|
131
|
+
], TableColumnActionIntentBased.prototype, "width", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
decoration_1.syncRule({
|
|
134
|
+
flex: flexRuleForColumnIntentBased,
|
|
135
|
+
generate: common_1.addPatternForBindingChangeOfEnumLR
|
|
136
|
+
})
|
|
137
|
+
], TableColumnActionIntentBased.prototype, "hAlign", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
decoration_1.syncRule({
|
|
140
|
+
flex: flexRuleForColumnIntentBasedAction
|
|
141
|
+
})
|
|
142
|
+
], TableColumnActionIntentBased.prototype, "tooltip", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
decoration_1.syncRule({
|
|
145
|
+
flex: flexRuleForColumnIntentBasedAction
|
|
146
|
+
})
|
|
147
|
+
], TableColumnActionIntentBased.prototype, "icon", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
decoration_1.syncRule({
|
|
150
|
+
flex: flexRuleForColumnIntentBasedAction
|
|
151
|
+
})
|
|
152
|
+
], TableColumnActionIntentBased.prototype, "activeIcon", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
decoration_1.syncRule({
|
|
155
|
+
flex: flexRuleForColumnIntentBasedAction
|
|
156
|
+
})
|
|
157
|
+
], TableColumnActionIntentBased.prototype, "type", void 0);
|
|
158
|
+
exports.TableColumnActionIntentBased = TableColumnActionIntentBased;
|
|
34
159
|
/**
|
|
35
|
-
* No sync rules are defined for table custom columns, as they are
|
|
160
|
+
* No sync rules are defined for table custom columns, as they are transferred altogether, by function exportToFragment.
|
|
36
161
|
* This approach is needed to support inserts as well as deletions of manifest extensions and fragments
|
|
37
162
|
*/
|
|
38
163
|
class TableCustomColumn {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableColumn.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/controls/TableColumn.ts"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"TableColumn.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/controls/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KpB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,uBAAuB;KAChC,CAAC;qDACwB;AAK1B;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,uBAAuB;KAChC,CAAC;+CACgB;AA9BtB,8CA+BC;AAED,MAAa,4BAA6B,SAAQ,iBAAiB;CA+BlE;AA3BG;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,4BAA4B;KACrC,CAAC;2DACa;AAMf;IAJC,qBAAQ,CAAC;QACN,IAAI,EAAE,4BAA4B;QAClC,QAAQ,EAAE,2CAAkC;KAC/C,CAAC;4DACc;AAKhB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,kCAAkC;KAC3C,CAAC;6DACe;AAKjB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,kCAAkC;KAC3C,CAAC;0DACkB;AAKpB;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,kCAAkC;KAC3C,CAAC;gEACwB;AAK1B;IAHC,qBAAQ,CAAC;QACN,IAAI,EAAE,kCAAkC;KAC3C,CAAC;0DACgB;AA9BtB,oEA+BC;AAED;;;GAGG;AACH,MAAa,iBAAiB;CAW7B;AAXD,8CAWC"}
|
|
@@ -254,7 +254,9 @@ function evaluateFlexRule(transferParameters, breadcrumbs, syncRule, ids, title,
|
|
|
254
254
|
}
|
|
255
255
|
const controlId = syncRule.flex.controlId(transferParameters.baseId, ids, localBreadcrumbs, syncRule.flex.controlType, title);
|
|
256
256
|
const flexChange = common_1.fillFlexChangeContent(configObject, syncRule, transferParameters.ui5Version, key, controlId);
|
|
257
|
-
const
|
|
257
|
+
const localManifest = JSON.parse(JSON.stringify(transferParameters.exportResults.manifest));
|
|
258
|
+
localManifest['sap.app'].id = transferParameters.appId;
|
|
259
|
+
const completeFlexChange = syncRule.flex.createFlexChange(flexChange, localManifest);
|
|
258
260
|
const flexChangeExists = transferParameters.exportResults.flexChanges.find((change) => {
|
|
259
261
|
let result = false, oldChange = JSON.parse(change);
|
|
260
262
|
oldChange = {
|
|
@@ -294,13 +296,11 @@ function evaluateManifestRule(transferParameters, path, syncRule, key, configObj
|
|
|
294
296
|
transferParameters.nextDefinition['targetDefinition'].type === 'object' &&
|
|
295
297
|
transferParameters.nextDefinition['targetDefinition'].properties)) {
|
|
296
298
|
const exportHandler = syncRule.manifest.export;
|
|
297
|
-
if (exportHandler
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
manifestSection[manifestKey] = configObject[key];
|
|
303
|
-
}
|
|
299
|
+
if (exportHandler && typeof exportHandler === 'function') {
|
|
300
|
+
exportHandler(manifestSection, configObject, key, manifestKey);
|
|
301
|
+
}
|
|
302
|
+
else if (exportHandler !== false) {
|
|
303
|
+
manifestSection[manifestKey] = configObject[key];
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
else if (transferParameters.propertyDefinition['type'] !== 'array' &&
|
|
@@ -316,42 +316,57 @@ function evaluateManifestRule(transferParameters, path, syncRule, key, configObj
|
|
|
316
316
|
common_1.deleteEmptyStructure(transferParameters.exportResults.manifest, path);
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
319
|
-
*
|
|
319
|
+
* Determines the path to a manifest setting, based on the syncRule
|
|
320
320
|
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
321
|
-
* @param syncRule - export rule from the object classes decorator
|
|
322
|
-
* @param configObject - current (sub)object of the configuration file
|
|
323
321
|
* @param breadcrumbs - list of breadcrumbs, i.e. ID parts for building the stable ID
|
|
324
|
-
* @param
|
|
322
|
+
* @param {SyncRule} syncRule - export rule from the object classes decorator
|
|
323
|
+
* @param configObject - current (sub)object of the configuration file
|
|
325
324
|
* @param title - title from the app schema (comprising for instance the facet ID)
|
|
326
|
-
* @
|
|
325
|
+
* @returns the path to the manifest setting
|
|
327
326
|
*/
|
|
328
|
-
function
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
if (breadcrumbs[
|
|
332
|
-
|
|
333
|
-
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[2]);
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
path = syncRule.manifest.path(transferParameters.pageKeys, {}, (title === null || title === void 0 ? void 0 : title.startsWith(common_1.FacetTitlePrefix)) ? title.split(common_1.FacetTitlePrefix)[1] : breadcrumbs[1], breadcrumbs[breadcrumbs.length - 1]);
|
|
337
|
-
path = path.replace('/@', '::').replace(/VOCWITHCOLONS/g, '::com.sap.vocabularies');
|
|
338
|
-
}
|
|
327
|
+
function getManifestPath(transferParameters, breadcrumbs, syncRule, configObject, title) {
|
|
328
|
+
let path;
|
|
329
|
+
if (breadcrumbs[0] === 'sections') {
|
|
330
|
+
if (breadcrumbs[1] === 'custom') {
|
|
331
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[2]);
|
|
339
332
|
}
|
|
340
|
-
else
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[breadcrumbs.length - 1]);
|
|
346
|
-
}
|
|
333
|
+
else {
|
|
334
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, {}, (title === null || title === void 0 ? void 0 : title.startsWith(common_1.FacetTitlePrefix)) ? title.split(common_1.FacetTitlePrefix)[1] : breadcrumbs[1], breadcrumbs[breadcrumbs.length - 1]);
|
|
335
|
+
path = path.replace('/@', '::').replace(/VOCWITHCOLONS/g, '::com.sap.vocabularies');
|
|
347
336
|
}
|
|
348
|
-
|
|
349
|
-
|
|
337
|
+
}
|
|
338
|
+
else if (breadcrumbs[0] === 'table') {
|
|
339
|
+
if (breadcrumbs[1] === 'columns' && breadcrumbs[2] === 'custom') {
|
|
340
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, transferParameters.exportResults.manifest, configObject['tabKey']);
|
|
350
341
|
}
|
|
351
342
|
else {
|
|
352
|
-
path = syncRule.manifest.path(transferParameters.pageKeys);
|
|
343
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[breadcrumbs.length - 1]);
|
|
353
344
|
}
|
|
354
|
-
|
|
345
|
+
}
|
|
346
|
+
else if (breadcrumbs[0] === 'keyPerformanceIndicators') {
|
|
347
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, transferParameters.exportResults.manifest, title);
|
|
348
|
+
}
|
|
349
|
+
else if (breadcrumbs[0] === 'filterBar' && breadcrumbs[1] === 'selectionFields') {
|
|
350
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, transferParameters.exportResults.manifest, breadcrumbs.slice(2).join('/'));
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
path = syncRule.manifest.path(transferParameters.pageKeys);
|
|
354
|
+
}
|
|
355
|
+
return path;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Evaluates an export rule for a property or object, transfers to flex change or manifest setting
|
|
359
|
+
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
360
|
+
* @param {SyncRule} syncRule - export rule from the object classes decorator
|
|
361
|
+
* @param configObject - current (sub)object of the configuration file
|
|
362
|
+
* @param breadcrumbs - list of breadcrumbs, i.e. ID parts for building the stable ID
|
|
363
|
+
* @param ids - list of parent & child ids
|
|
364
|
+
* @param title - title from the app schema (comprising for instance the facet ID)
|
|
365
|
+
* @param key - key of the given property
|
|
366
|
+
*/
|
|
367
|
+
function evaluateExportRule(transferParameters, syncRule, configObject, breadcrumbs, ids, title, key) {
|
|
368
|
+
if (!syncRule) {
|
|
369
|
+
return;
|
|
355
370
|
}
|
|
356
371
|
//eliminate subsections' hierarchy
|
|
357
372
|
let index = breadcrumbs.indexOf('subsections');
|
|
@@ -363,7 +378,7 @@ function evaluateExportRule(transferParameters, syncRule, configObject, breadcru
|
|
|
363
378
|
evaluateFlexRule(transferParameters, breadcrumbs, syncRule, ids, title, configObject, key);
|
|
364
379
|
}
|
|
365
380
|
else if (syncRule.manifest) {
|
|
366
|
-
const path = getManifestPath();
|
|
381
|
+
const path = getManifestPath(transferParameters, breadcrumbs, syncRule, configObject, title);
|
|
367
382
|
evaluateManifestRule(transferParameters, path, syncRule, key, configObject);
|
|
368
383
|
}
|
|
369
384
|
}
|
|
@@ -409,16 +424,51 @@ function deleteObsoleteColumnsFromFragment(path, exportResults, entitySet, confi
|
|
|
409
424
|
}
|
|
410
425
|
}
|
|
411
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* Clusters the custom columns if a config by the extension's path in manifest
|
|
429
|
+
* @param customColumnsInConfig - list of all custom columns in config
|
|
430
|
+
* @param schemaDefinition - schema definition of the table custom column
|
|
431
|
+
* @param v2Page - current page in manifest
|
|
432
|
+
* @param entitySet - current entity set
|
|
433
|
+
* @param sectionKey key of the section (in case of OP)
|
|
434
|
+
* @returns the custom columns, clustered by the manifest path
|
|
435
|
+
*/
|
|
436
|
+
function clusterConfigColumnsByPath(customColumnsInConfig, schemaDefinition, v2Page, entitySet, sectionKey) {
|
|
437
|
+
const cluster = {};
|
|
438
|
+
for (const customColumn of customColumnsInConfig) {
|
|
439
|
+
//verify that mandatory parameters are filled
|
|
440
|
+
if (!customColumn['className'] ||
|
|
441
|
+
!customColumn['fragmentName'] ||
|
|
442
|
+
!customColumn['columnKey'] ||
|
|
443
|
+
!customColumn['extensionType']) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
//check fragment name
|
|
447
|
+
if (schemaDefinition['properties']['fragmentName']['pattern']) {
|
|
448
|
+
const namePattern = new RegExp(schemaDefinition['properties']['fragmentName']['pattern']);
|
|
449
|
+
if (namePattern.test(customColumn['fragmentName']) === false) {
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const { path, viewTemplateType } = controls_1.getCustomColumnPath(v2Page, entitySet, customColumn.tabKey || sectionKey, customColumn['extensionType']);
|
|
454
|
+
if (!cluster[path]) {
|
|
455
|
+
cluster[path] = {
|
|
456
|
+
viewTemplateType: viewTemplateType,
|
|
457
|
+
columns: []
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
cluster[path].columns.push(customColumn);
|
|
461
|
+
}
|
|
462
|
+
return cluster;
|
|
463
|
+
}
|
|
412
464
|
/**
|
|
413
465
|
* Transfers column extensions to manifest and fragment files
|
|
414
|
-
* @param {
|
|
415
|
-
* @param {
|
|
416
|
-
* @param {string} appId - id of the Fiori elements app, which is usually namespace.appid
|
|
466
|
+
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
467
|
+
* @param {TableCustomColumns} customColumnsInConfig - config part comprising the table custom columns
|
|
417
468
|
* @param {object} schemaDefinition - Column schema definition
|
|
418
|
-
* @param {SapUiAppPageV2} page - Page object from manifest.
|
|
419
469
|
* @param {ObjectPageSectionData} [objectPageSectionData] - Object Page section's data containing target and key options.
|
|
420
470
|
*/
|
|
421
|
-
function transferColumnExtensions(transferParameters,
|
|
471
|
+
function transferColumnExtensions(transferParameters, customColumnsInConfig, schemaDefinition, objectPageSectionData) {
|
|
422
472
|
const sectionKey = objectPageSectionData ? objectPageSectionData.key : undefined;
|
|
423
473
|
const sectionTarget = objectPageSectionData ? objectPageSectionData.target : undefined;
|
|
424
474
|
const entitySet = sectionTarget || transferParameters.v2Page.entitySet;
|
|
@@ -427,39 +477,14 @@ function transferColumnExtensions(transferParameters, config, schemaDefinition,
|
|
|
427
477
|
if (!path) {
|
|
428
478
|
continue;
|
|
429
479
|
}
|
|
430
|
-
deleteObsoleteColumnsFromFragment(path, transferParameters.exportResults, entitySet,
|
|
480
|
+
deleteObsoleteColumnsFromFragment(path, transferParameters.exportResults, entitySet, customColumnsInConfig, sectionKey, extensionType, transferParameters.appId);
|
|
431
481
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
for (let index = 0; index < config.length; index++) {
|
|
436
|
-
const customColumn = config[index];
|
|
437
|
-
//verify that mandatory parameters are filled
|
|
438
|
-
if (!customColumn['className'] ||
|
|
439
|
-
!customColumn['fragmentName'] ||
|
|
440
|
-
!customColumn['columnKey'] ||
|
|
441
|
-
!customColumn['extensionType']) {
|
|
442
|
-
continue;
|
|
443
|
-
}
|
|
444
|
-
//check fragment name
|
|
445
|
-
if (schemaDefinition['properties']['fragmentName']['pattern']) {
|
|
446
|
-
const namePattern = new RegExp(schemaDefinition['properties']['fragmentName']['pattern']);
|
|
447
|
-
if (namePattern.test(customColumn['fragmentName']) === false) {
|
|
448
|
-
continue;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
const { path, viewTemplateType } = controls_1.getCustomColumnPath(transferParameters.v2Page, entitySet, customColumn.tabKey || sectionKey, customColumn['extensionType']);
|
|
452
|
-
if (!cluster[path]) {
|
|
453
|
-
cluster[path] = {
|
|
454
|
-
viewTemplateType: viewTemplateType,
|
|
455
|
-
columns: []
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
cluster[path].columns.push(customColumn);
|
|
459
|
-
}
|
|
482
|
+
if (customColumnsInConfig) {
|
|
483
|
+
//cluster existing custom columns by manifest path (or tab key)
|
|
484
|
+
const cluster = clusterConfigColumnsByPath(customColumnsInConfig, schemaDefinition, transferParameters.v2Page, entitySet, sectionKey);
|
|
460
485
|
//Export to fragment
|
|
461
486
|
for (const path in cluster) {
|
|
462
|
-
controls_1.
|
|
487
|
+
controls_1.exportCustomColumnsToFragment(transferParameters.exportResults, path, cluster[path].columns, transferParameters.appId, cluster[path].viewTemplateType, transferParameters.logger);
|
|
463
488
|
}
|
|
464
489
|
}
|
|
465
490
|
}
|
|
@@ -514,6 +539,9 @@ function getSectionId(breadcrumbs, title) {
|
|
|
514
539
|
return common_1.convertSectionId(sectionId, title);
|
|
515
540
|
}
|
|
516
541
|
function transferIndexTable(currentConfigObject, transferParameters, title, propertyDefinition, key, ids, breadcrumbs) {
|
|
542
|
+
if (!currentConfigObject || !(propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.additionalProperties)) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
517
545
|
Object.keys(currentConfigObject).forEach((newKey) => {
|
|
518
546
|
const nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject[newKey], propertyDefinition.additionalProperties, key, transferParameters.factory, transferParameters.pageType);
|
|
519
547
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
@@ -522,7 +550,7 @@ function transferIndexTable(currentConfigObject, transferParameters, title, prop
|
|
|
522
550
|
}
|
|
523
551
|
function transferCustomColumns(propertyDefinition, breadcrumbs, title, transferParameters, configObject, nextDefinition) {
|
|
524
552
|
let objectPageSectionData;
|
|
525
|
-
const target =
|
|
553
|
+
const target = common_1.getTargetFromCustomColumnRef(propertyDefinition.$ref);
|
|
526
554
|
if (target) {
|
|
527
555
|
objectPageSectionData = {
|
|
528
556
|
target,
|
|
@@ -531,6 +559,15 @@ function transferCustomColumns(propertyDefinition, breadcrumbs, title, transferP
|
|
|
531
559
|
}
|
|
532
560
|
transferColumnExtensions(transferParameters, configObject === null || configObject === void 0 ? void 0 : configObject.custom, nextDefinition.targetDefinition, objectPageSectionData);
|
|
533
561
|
}
|
|
562
|
+
function handleAnyOfDefinitions(propertyDefinition, transferParameters, title, currentConfigObject, key, ids, breadcrumbs) {
|
|
563
|
+
propertyDefinition['anyOf'].forEach((element) => {
|
|
564
|
+
const nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject, element, key, transferParameters.factory, transferParameters.pageType);
|
|
565
|
+
if (nextDefinition) {
|
|
566
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
567
|
+
transferManifestEntriesAndFlexChange(transferParameters, nextDefinition.configObject, ids, [...breadcrumbs, key], nextDefinition.targetDefinition, nextDefinition.title);
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
}
|
|
534
571
|
/**
|
|
535
572
|
* Function that traverses the content of the current object. It reads decorators and fills manifest entries and flex changes
|
|
536
573
|
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
@@ -542,51 +579,42 @@ function transferCustomColumns(propertyDefinition, breadcrumbs, title, transferP
|
|
|
542
579
|
*/
|
|
543
580
|
function transferManifestEntriesAndFlexChange(transferParameters, configObject, parentIds, breadcrumbs, schemaDefinition, title) {
|
|
544
581
|
let currentConfigObject;
|
|
545
|
-
if (schemaDefinition
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
582
|
+
if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition['properties'])) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
for (const key in schemaDefinition['properties']) {
|
|
586
|
+
currentConfigObject = configObject && configObject[key];
|
|
587
|
+
const childId = configObject && common_1.getChildId(configObject, key);
|
|
588
|
+
const ids = childId ? [...parentIds, childId] : parentIds;
|
|
589
|
+
const syncRule = common_1.getReflectMetadata(configObject, key);
|
|
590
|
+
const propertyDefinition = (transferParameters.propertyDefinition = schemaDefinition['properties'][key]);
|
|
591
|
+
const nextDefinition = (transferParameters.nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject, propertyDefinition, key, transferParameters.factory, transferParameters.pageType));
|
|
592
|
+
//Evaluate sync rule for the export
|
|
593
|
+
evaluateExportRule(transferParameters, syncRule, configObject, [...breadcrumbs], ids, title, key);
|
|
594
|
+
//index table
|
|
595
|
+
transferIndexTable(currentConfigObject, transferParameters, title, propertyDefinition, key, ids, breadcrumbs);
|
|
596
|
+
if (currentConfigObject === undefined || typeof currentConfigObject === 'object') {
|
|
597
|
+
if ((propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.type) === 'array' &&
|
|
598
|
+
(breadcrumbs[0] === 'sections' || breadcrumbs[0] === 'subsections') &&
|
|
599
|
+
key === 'custom') {
|
|
600
|
+
transferManifestExtensions(transferParameters, configObject[key], transferParameters.pageKeys[transferParameters.pageKeys.length - 1], ids, [...breadcrumbs, key], propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.items);
|
|
555
601
|
}
|
|
556
|
-
if (
|
|
557
|
-
|
|
558
|
-
|
|
602
|
+
else if (nextDefinition && key === 'custom') {
|
|
603
|
+
transferCustomColumns(propertyDefinition, breadcrumbs, title, transferParameters, configObject, nextDefinition);
|
|
604
|
+
continue;
|
|
559
605
|
}
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
(breadcrumbs[0] === 'sections' || breadcrumbs[0] === 'subsections') &&
|
|
563
|
-
key === 'custom') {
|
|
564
|
-
transferManifestExtensions(transferParameters, configObject[key], transferParameters.pageKeys[transferParameters.pageKeys.length - 1], ids, [...breadcrumbs, key], propertyDefinition.items);
|
|
565
|
-
continue;
|
|
566
|
-
}
|
|
567
|
-
if (nextDefinition && key === 'custom') {
|
|
568
|
-
transferCustomColumns(propertyDefinition, breadcrumbs, title, transferParameters, configObject, nextDefinition);
|
|
569
|
-
continue;
|
|
570
|
-
}
|
|
571
|
-
else if (nextDefinition) {
|
|
572
|
-
transferManifestEntriesAndFlexChange(transferParameters, nextDefinition.configObject, ids, [...breadcrumbs, key], nextDefinition.targetDefinition, nextDefinition.title);
|
|
573
|
-
}
|
|
574
|
-
else if (propertyDefinition['anyOf']) {
|
|
575
|
-
propertyDefinition['anyOf'].forEach((element) => {
|
|
576
|
-
nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject, element, key, transferParameters.factory, transferParameters.pageType);
|
|
577
|
-
if (nextDefinition) {
|
|
578
|
-
transferManifestEntriesAndFlexChange(transferParameters, nextDefinition.configObject, ids, [...breadcrumbs, key], nextDefinition.targetDefinition, nextDefinition.title);
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
}
|
|
606
|
+
else if (nextDefinition) {
|
|
607
|
+
transferManifestEntriesAndFlexChange(transferParameters, nextDefinition.configObject, ids, [...breadcrumbs, key], nextDefinition.targetDefinition, nextDefinition.title);
|
|
582
608
|
}
|
|
583
|
-
else if (propertyDefinition
|
|
584
|
-
propertyDefinition
|
|
585
|
-
//empty config ==> delete all given extensions
|
|
586
|
-
transferColumnExtensions(transferParameters, [], transferParameters.appSchema['definitions']['TableCustomColumn']);
|
|
587
|
-
continue;
|
|
609
|
+
else if (propertyDefinition['anyOf']) {
|
|
610
|
+
handleAnyOfDefinitions(propertyDefinition, transferParameters, title, currentConfigObject, key, ids, breadcrumbs);
|
|
588
611
|
}
|
|
589
612
|
}
|
|
613
|
+
else if ((propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.$ref) === common_1.DEFINITION_LINK_PREFIX + 'TableCustomColumns') {
|
|
614
|
+
//empty config ==> delete all given extensions
|
|
615
|
+
transferColumnExtensions(transferParameters, [], transferParameters.appSchema['definitions']['TableCustomColumn']);
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
590
618
|
}
|
|
591
619
|
}
|
|
592
620
|
exports.transferManifestEntriesAndFlexChange = transferManifestEntriesAndFlexChange;
|