@sap/ux-specification 1.71.49 → 1.71.50
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 +21 -0
- 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 +72 -2
- package/dist/schemas/v2/ListReportConfig.json +74 -4
- package/dist/schemas/v2/ObjectPageConfig.json +89 -33
- 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 +2 -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 +8 -0
- package/dist/src/sync/common/generate/objectPage.js +18 -6
- package/dist/src/sync/common/generate/objectPage.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +1 -0
- package/dist/src/sync/common/generate/utils.js +19 -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 +14 -3
- 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 +29 -15
- 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 +21 -16
- 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 +15 -15
- 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 +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +2 -2
- 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 +134 -111
- 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 +10 -5
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
- package/dist/src/sync/v2/generate/listReport.js +8 -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 +10 -10
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +15 -11
- package/dist/src/sync/v2/generate/utils.js +239 -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 +182 -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 +32 -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 -8
- package/dist/src/specification/v2/controls/ObjectPageFooter.d.ts +0 -11
- package/dist/src/specification/v2/controls/ObjectPageFooter.js.map +0 -1
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.d.ts +0 -28
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.js +0 -3
- package/dist/src/specification/v2/controls/ObjectPageFooterAction.js.map +0 -1
- package/dist/test/test-utils/metadataParser.d.ts +0 -19
|
@@ -9,8 +9,8 @@ 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 facetId =
|
|
12
|
+
exports.getTableSectionControlId = (baseId, idBreadcrumbs, breadcrumbs, controlType, facetID) => {
|
|
13
|
+
const facetId = common_1.convertSectionId(breadcrumbs[1], facetID);
|
|
14
14
|
const breadcrumbsTrail = [facetId, 'Table'];
|
|
15
15
|
return common_1.buildControlIdFromParent(baseId, breadcrumbsTrail);
|
|
16
16
|
};
|
|
@@ -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":"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"}
|
|
@@ -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/TableColumn.ts"],"names":[],"mappings":"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"}
|
|
@@ -294,13 +294,11 @@ function evaluateManifestRule(transferParameters, path, syncRule, key, configObj
|
|
|
294
294
|
transferParameters.nextDefinition['targetDefinition'].type === 'object' &&
|
|
295
295
|
transferParameters.nextDefinition['targetDefinition'].properties)) {
|
|
296
296
|
const exportHandler = syncRule.manifest.export;
|
|
297
|
-
if (exportHandler
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
manifestSection[manifestKey] = configObject[key];
|
|
303
|
-
}
|
|
297
|
+
if (exportHandler && typeof exportHandler === 'function') {
|
|
298
|
+
exportHandler(manifestSection, configObject, key, manifestKey);
|
|
299
|
+
}
|
|
300
|
+
else if (exportHandler !== false) {
|
|
301
|
+
manifestSection[manifestKey] = configObject[key];
|
|
304
302
|
}
|
|
305
303
|
}
|
|
306
304
|
else if (transferParameters.propertyDefinition['type'] !== 'array' &&
|
|
@@ -316,42 +314,54 @@ function evaluateManifestRule(transferParameters, path, syncRule, key, configObj
|
|
|
316
314
|
common_1.deleteEmptyStructure(transferParameters.exportResults.manifest, path);
|
|
317
315
|
}
|
|
318
316
|
/**
|
|
319
|
-
*
|
|
317
|
+
* Determines the path to a manifest setting, based on the syncRule
|
|
320
318
|
* @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
319
|
* @param breadcrumbs - list of breadcrumbs, i.e. ID parts for building the stable ID
|
|
324
|
-
* @param
|
|
320
|
+
* @param {SyncRule} syncRule - export rule from the object classes decorator
|
|
321
|
+
* @param configObject - current (sub)object of the configuration file
|
|
325
322
|
* @param title - title from the app schema (comprising for instance the facet ID)
|
|
326
|
-
* @
|
|
323
|
+
* @returns the path to the manifest setting
|
|
327
324
|
*/
|
|
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
|
-
}
|
|
325
|
+
function getManifestPath(transferParameters, breadcrumbs, syncRule, configObject, title) {
|
|
326
|
+
let path;
|
|
327
|
+
if (breadcrumbs[0] === 'sections') {
|
|
328
|
+
if (breadcrumbs[1] === 'custom') {
|
|
329
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[2]);
|
|
339
330
|
}
|
|
340
|
-
else
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[breadcrumbs.length - 1]);
|
|
346
|
-
}
|
|
331
|
+
else {
|
|
332
|
+
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]);
|
|
333
|
+
path = path.replace('/@', '::').replace(/VOCWITHCOLONS/g, '::com.sap.vocabularies');
|
|
347
334
|
}
|
|
348
|
-
|
|
349
|
-
|
|
335
|
+
}
|
|
336
|
+
else if (breadcrumbs[0] === 'table') {
|
|
337
|
+
if (breadcrumbs[1] === 'columns' && breadcrumbs[2] === 'custom') {
|
|
338
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, transferParameters.exportResults.manifest, configObject['tabKey']);
|
|
350
339
|
}
|
|
351
340
|
else {
|
|
352
|
-
path = syncRule.manifest.path(transferParameters.pageKeys);
|
|
341
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, {}, breadcrumbs[breadcrumbs.length - 1]);
|
|
353
342
|
}
|
|
354
|
-
|
|
343
|
+
}
|
|
344
|
+
else if (breadcrumbs[0] === 'keyPerformanceIndicators') {
|
|
345
|
+
path = syncRule.manifest.path(transferParameters.pageKeys, transferParameters.exportResults.manifest, title);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
path = syncRule.manifest.path(transferParameters.pageKeys);
|
|
349
|
+
}
|
|
350
|
+
return path;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Evaluates an export rule for a property or object, transfers to flex change or manifest setting
|
|
354
|
+
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
355
|
+
* @param {SyncRule} syncRule - export rule from the object classes decorator
|
|
356
|
+
* @param configObject - current (sub)object of the configuration file
|
|
357
|
+
* @param breadcrumbs - list of breadcrumbs, i.e. ID parts for building the stable ID
|
|
358
|
+
* @param ids - list of parent & child ids
|
|
359
|
+
* @param title - title from the app schema (comprising for instance the facet ID)
|
|
360
|
+
* @param key - key of the given property
|
|
361
|
+
*/
|
|
362
|
+
function evaluateExportRule(transferParameters, syncRule, configObject, breadcrumbs, ids, title, key) {
|
|
363
|
+
if (!syncRule) {
|
|
364
|
+
return;
|
|
355
365
|
}
|
|
356
366
|
//eliminate subsections' hierarchy
|
|
357
367
|
let index = breadcrumbs.indexOf('subsections');
|
|
@@ -363,7 +373,7 @@ function evaluateExportRule(transferParameters, syncRule, configObject, breadcru
|
|
|
363
373
|
evaluateFlexRule(transferParameters, breadcrumbs, syncRule, ids, title, configObject, key);
|
|
364
374
|
}
|
|
365
375
|
else if (syncRule.manifest) {
|
|
366
|
-
const path = getManifestPath();
|
|
376
|
+
const path = getManifestPath(transferParameters, breadcrumbs, syncRule, configObject, title);
|
|
367
377
|
evaluateManifestRule(transferParameters, path, syncRule, key, configObject);
|
|
368
378
|
}
|
|
369
379
|
}
|
|
@@ -409,16 +419,51 @@ function deleteObsoleteColumnsFromFragment(path, exportResults, entitySet, confi
|
|
|
409
419
|
}
|
|
410
420
|
}
|
|
411
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* Clusters the custom columns if a config by the extension's path in manifest
|
|
424
|
+
* @param customColumnsInConfig - list of all custom columns in config
|
|
425
|
+
* @param schemaDefinition - schema definition of the table custom column
|
|
426
|
+
* @param v2Page - current page in manifest
|
|
427
|
+
* @param entitySet - current entity set
|
|
428
|
+
* @param sectionKey key of the section (in case of OP)
|
|
429
|
+
* @returns the custom columns, clustered by the manifest path
|
|
430
|
+
*/
|
|
431
|
+
function clusterConfigColumnsByPath(customColumnsInConfig, schemaDefinition, v2Page, entitySet, sectionKey) {
|
|
432
|
+
const cluster = {};
|
|
433
|
+
for (const customColumn of customColumnsInConfig) {
|
|
434
|
+
//verify that mandatory parameters are filled
|
|
435
|
+
if (!customColumn['className'] ||
|
|
436
|
+
!customColumn['fragmentName'] ||
|
|
437
|
+
!customColumn['columnKey'] ||
|
|
438
|
+
!customColumn['extensionType']) {
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
//check fragment name
|
|
442
|
+
if (schemaDefinition['properties']['fragmentName']['pattern']) {
|
|
443
|
+
const namePattern = new RegExp(schemaDefinition['properties']['fragmentName']['pattern']);
|
|
444
|
+
if (namePattern.test(customColumn['fragmentName']) === false) {
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
const { path, viewTemplateType } = controls_1.getCustomColumnPath(v2Page, entitySet, customColumn.tabKey || sectionKey, customColumn['extensionType']);
|
|
449
|
+
if (!cluster[path]) {
|
|
450
|
+
cluster[path] = {
|
|
451
|
+
viewTemplateType: viewTemplateType,
|
|
452
|
+
columns: []
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
cluster[path].columns.push(customColumn);
|
|
456
|
+
}
|
|
457
|
+
return cluster;
|
|
458
|
+
}
|
|
412
459
|
/**
|
|
413
460
|
* 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
|
|
461
|
+
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
462
|
+
* @param {TableCustomColumns} customColumnsInConfig - config part comprising the table custom columns
|
|
417
463
|
* @param {object} schemaDefinition - Column schema definition
|
|
418
|
-
* @param {SapUiAppPageV2} page - Page object from manifest.
|
|
419
464
|
* @param {ObjectPageSectionData} [objectPageSectionData] - Object Page section's data containing target and key options.
|
|
420
465
|
*/
|
|
421
|
-
function transferColumnExtensions(transferParameters,
|
|
466
|
+
function transferColumnExtensions(transferParameters, customColumnsInConfig, schemaDefinition, objectPageSectionData) {
|
|
422
467
|
const sectionKey = objectPageSectionData ? objectPageSectionData.key : undefined;
|
|
423
468
|
const sectionTarget = objectPageSectionData ? objectPageSectionData.target : undefined;
|
|
424
469
|
const entitySet = sectionTarget || transferParameters.v2Page.entitySet;
|
|
@@ -427,39 +472,14 @@ function transferColumnExtensions(transferParameters, config, schemaDefinition,
|
|
|
427
472
|
if (!path) {
|
|
428
473
|
continue;
|
|
429
474
|
}
|
|
430
|
-
deleteObsoleteColumnsFromFragment(path, transferParameters.exportResults, entitySet,
|
|
475
|
+
deleteObsoleteColumnsFromFragment(path, transferParameters.exportResults, entitySet, customColumnsInConfig, sectionKey, extensionType, transferParameters.appId);
|
|
431
476
|
}
|
|
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
|
-
}
|
|
477
|
+
if (customColumnsInConfig) {
|
|
478
|
+
//cluster existing custom columns by manifest path (or tab key)
|
|
479
|
+
const cluster = clusterConfigColumnsByPath(customColumnsInConfig, schemaDefinition, transferParameters.v2Page, entitySet, sectionKey);
|
|
460
480
|
//Export to fragment
|
|
461
481
|
for (const path in cluster) {
|
|
462
|
-
controls_1.
|
|
482
|
+
controls_1.exportCustomColumnsToFragment(transferParameters.exportResults, path, cluster[path].columns, transferParameters.appId, cluster[path].viewTemplateType, transferParameters.logger);
|
|
463
483
|
}
|
|
464
484
|
}
|
|
465
485
|
}
|
|
@@ -514,6 +534,9 @@ function getSectionId(breadcrumbs, title) {
|
|
|
514
534
|
return common_1.convertSectionId(sectionId, title);
|
|
515
535
|
}
|
|
516
536
|
function transferIndexTable(currentConfigObject, transferParameters, title, propertyDefinition, key, ids, breadcrumbs) {
|
|
537
|
+
if (!currentConfigObject || !(propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.additionalProperties)) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
517
540
|
Object.keys(currentConfigObject).forEach((newKey) => {
|
|
518
541
|
const nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject[newKey], propertyDefinition.additionalProperties, key, transferParameters.factory, transferParameters.pageType);
|
|
519
542
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
@@ -522,7 +545,7 @@ function transferIndexTable(currentConfigObject, transferParameters, title, prop
|
|
|
522
545
|
}
|
|
523
546
|
function transferCustomColumns(propertyDefinition, breadcrumbs, title, transferParameters, configObject, nextDefinition) {
|
|
524
547
|
let objectPageSectionData;
|
|
525
|
-
const target =
|
|
548
|
+
const target = common_1.getTargetFromCustomColumnRef(propertyDefinition.$ref);
|
|
526
549
|
if (target) {
|
|
527
550
|
objectPageSectionData = {
|
|
528
551
|
target,
|
|
@@ -531,6 +554,15 @@ function transferCustomColumns(propertyDefinition, breadcrumbs, title, transferP
|
|
|
531
554
|
}
|
|
532
555
|
transferColumnExtensions(transferParameters, configObject === null || configObject === void 0 ? void 0 : configObject.custom, nextDefinition.targetDefinition, objectPageSectionData);
|
|
533
556
|
}
|
|
557
|
+
function handleAnyOfDefinitions(propertyDefinition, transferParameters, title, currentConfigObject, key, ids, breadcrumbs) {
|
|
558
|
+
propertyDefinition['anyOf'].forEach((element) => {
|
|
559
|
+
const nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject, element, key, transferParameters.factory, transferParameters.pageType);
|
|
560
|
+
if (nextDefinition) {
|
|
561
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
562
|
+
transferManifestEntriesAndFlexChange(transferParameters, nextDefinition.configObject, ids, [...breadcrumbs, key], nextDefinition.targetDefinition, nextDefinition.title);
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
534
566
|
/**
|
|
535
567
|
* Function that traverses the content of the current object. It reads decorators and fills manifest entries and flex changes
|
|
536
568
|
* @param {TransferParameterTypeV2} transferParameters - list of input parameters for the recursive function call
|
|
@@ -542,51 +574,42 @@ function transferCustomColumns(propertyDefinition, breadcrumbs, title, transferP
|
|
|
542
574
|
*/
|
|
543
575
|
function transferManifestEntriesAndFlexChange(transferParameters, configObject, parentIds, breadcrumbs, schemaDefinition, title) {
|
|
544
576
|
let currentConfigObject;
|
|
545
|
-
if (schemaDefinition
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
577
|
+
if (!(schemaDefinition === null || schemaDefinition === void 0 ? void 0 : schemaDefinition['properties'])) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
for (const key in schemaDefinition['properties']) {
|
|
581
|
+
currentConfigObject = configObject && configObject[key];
|
|
582
|
+
const childId = configObject && common_1.getChildId(configObject, key);
|
|
583
|
+
const ids = childId ? [...parentIds, childId] : parentIds;
|
|
584
|
+
const syncRule = common_1.getReflectMetadata(configObject, key);
|
|
585
|
+
const propertyDefinition = (transferParameters.propertyDefinition = schemaDefinition['properties'][key]);
|
|
586
|
+
const nextDefinition = (transferParameters.nextDefinition = common_1.getNextTargetDefinition(transferParameters.appSchema, title, currentConfigObject, propertyDefinition, key, transferParameters.factory, transferParameters.pageType));
|
|
587
|
+
//Evaluate sync rule for the export
|
|
588
|
+
evaluateExportRule(transferParameters, syncRule, configObject, [...breadcrumbs], ids, title, key);
|
|
589
|
+
//index table
|
|
590
|
+
transferIndexTable(currentConfigObject, transferParameters, title, propertyDefinition, key, ids, breadcrumbs);
|
|
591
|
+
if (currentConfigObject === undefined || typeof currentConfigObject === 'object') {
|
|
592
|
+
if ((propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.type) === 'array' &&
|
|
593
|
+
(breadcrumbs[0] === 'sections' || breadcrumbs[0] === 'subsections') &&
|
|
594
|
+
key === 'custom') {
|
|
595
|
+
transferManifestExtensions(transferParameters, configObject[key], transferParameters.pageKeys[transferParameters.pageKeys.length - 1], ids, [...breadcrumbs, key], propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.items);
|
|
555
596
|
}
|
|
556
|
-
if (
|
|
557
|
-
|
|
558
|
-
|
|
597
|
+
else if (nextDefinition && key === 'custom') {
|
|
598
|
+
transferCustomColumns(propertyDefinition, breadcrumbs, title, transferParameters, configObject, nextDefinition);
|
|
599
|
+
continue;
|
|
559
600
|
}
|
|
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
|
-
}
|
|
601
|
+
else if (nextDefinition) {
|
|
602
|
+
transferManifestEntriesAndFlexChange(transferParameters, nextDefinition.configObject, ids, [...breadcrumbs, key], nextDefinition.targetDefinition, nextDefinition.title);
|
|
582
603
|
}
|
|
583
|
-
else if (propertyDefinition
|
|
584
|
-
propertyDefinition
|
|
585
|
-
//empty config ==> delete all given extensions
|
|
586
|
-
transferColumnExtensions(transferParameters, [], transferParameters.appSchema['definitions']['TableCustomColumn']);
|
|
587
|
-
continue;
|
|
604
|
+
else if (propertyDefinition['anyOf']) {
|
|
605
|
+
handleAnyOfDefinitions(propertyDefinition, transferParameters, title, currentConfigObject, key, ids, breadcrumbs);
|
|
588
606
|
}
|
|
589
607
|
}
|
|
608
|
+
else if ((propertyDefinition === null || propertyDefinition === void 0 ? void 0 : propertyDefinition.$ref) === common_1.DEFINITION_LINK_PREFIX + 'TableCustomColumns') {
|
|
609
|
+
//empty config ==> delete all given extensions
|
|
610
|
+
transferColumnExtensions(transferParameters, [], transferParameters.appSchema['definitions']['TableCustomColumn']);
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
590
613
|
}
|
|
591
614
|
}
|
|
592
615
|
exports.transferManifestEntriesAndFlexChange = transferManifestEntriesAndFlexChange;
|