@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
|
@@ -10,8 +10,6 @@ const extensionLogger_1 = require("../../../../extensionLogger");
|
|
|
10
10
|
const i18next_1 = __importDefault(require("i18next"));
|
|
11
11
|
const i18n_1 = require("../../../../i18n/i18n");
|
|
12
12
|
const utils_1 = require("../../import/utils");
|
|
13
|
-
const xml_js_1 = require("xml-js");
|
|
14
|
-
const controls_1 = require("../../export/controls");
|
|
15
13
|
const factory_1 = require("../../export/factory");
|
|
16
14
|
const types_1 = require("../../types");
|
|
17
15
|
/**
|
|
@@ -39,133 +37,25 @@ function addSettings(importParameters, listReportConfig, factory, pageKey) {
|
|
|
39
37
|
index_1.transferSettingsOfObject(listReportConfig.table.toolBar, importParameters.manifest, importParameters.jsonSchema['definitions']['ToolBar'], pageKey, importParameters.logger);
|
|
40
38
|
if (importParameters.jsonSchema['definitions']['Actions<LineItems>']) {
|
|
41
39
|
for (const actionProperty in importParameters.jsonSchema['definitions']['Actions<LineItems>'].properties) {
|
|
42
|
-
const actionKey = actionProperty
|
|
40
|
+
const actionKey = actionProperty;
|
|
43
41
|
listReportConfig.table.toolBar.actions[actionKey] = factory.createInstance(common_1.PageType.ListReport, 'Action');
|
|
44
42
|
index_1.transferSettingsOfObject(listReportConfig.table.toolBar.actions[actionKey], importParameters.manifest, importParameters.jsonSchema['definitions']['Action'], pageKey, importParameters.logger);
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
|
-
//
|
|
48
|
-
listReportConfig.filterBar = factory.createInstance(common_1.PageType.ListReport,
|
|
49
|
-
index_1.transferSettingsOfObject(listReportConfig.filterBar, importParameters.manifest, importParameters.jsonSchema['definitions'][
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (const actionKey in config.table.toolBar.actions) {
|
|
59
|
-
if (Object.keys(config.table.toolBar.actions[actionKey]).length === 0) {
|
|
60
|
-
delete config.table.toolBar.actions[actionKey];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (Object.keys(config.table.toolBar.actions).length === 0) {
|
|
64
|
-
delete config.table.toolBar.actions;
|
|
65
|
-
}
|
|
66
|
-
if (Object.keys(config.table.toolBar).length === 0) {
|
|
67
|
-
delete config.table.toolBar;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function evaluateFragmentColumn(column, viewExtensionsOfPage, manifestKey, keyPart3, config, extensionType, cellsFragmentName) {
|
|
72
|
-
if (column['customData'] || column['table:customData']) {
|
|
73
|
-
const p13nData = column['customData']
|
|
74
|
-
? column['customData']['core:CustomData']._attributes.value
|
|
75
|
-
: column['table:customData']['core:CustomData']._attributes.value;
|
|
76
|
-
const columnParts = JSON.parse(p13nData.substr(1, p13nData.length));
|
|
77
|
-
let columnText = column['Text'] && column['Text']._attributes && column['Text']._attributes['text'];
|
|
78
|
-
if (!columnText) {
|
|
79
|
-
columnText = column['Label'] && column['Label']._attributes && column['Label']._attributes['text'];
|
|
80
|
-
}
|
|
81
|
-
const customElement = {
|
|
82
|
-
id: column._attributes && column._attributes['id'],
|
|
83
|
-
text: columnText,
|
|
84
|
-
columnKey: columnParts['columnKey'],
|
|
85
|
-
columnIndex: columnParts['columnIndex'] !== undefined ? Number(columnParts['columnIndex']) : undefined,
|
|
86
|
-
leadingProperty: columnParts['leadingProperty'],
|
|
87
|
-
className: viewExtensionsOfPage[manifestKey].className,
|
|
88
|
-
fragmentName: viewExtensionsOfPage[manifestKey].fragmentName,
|
|
89
|
-
tabKey: keyPart3,
|
|
90
|
-
extensionType
|
|
91
|
-
};
|
|
92
|
-
if (cellsFragmentName) {
|
|
93
|
-
customElement.cellsFragmentName = cellsFragmentName;
|
|
94
|
-
}
|
|
95
|
-
if (!config.table['columns']['custom']) {
|
|
96
|
-
config.table['columns']['custom'] = [];
|
|
97
|
-
}
|
|
98
|
-
const customColumns = config.table['columns']['custom'];
|
|
99
|
-
customColumns.push(customElement);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function addFragments(config, manifest, v2Page, pageType, fragments, objectPageSectionData) {
|
|
103
|
-
if (!fragments) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const targetKeyEntitySet = '|' + (objectPageSectionData && objectPageSectionData.target ? objectPageSectionData.target : v2Page.entitySet);
|
|
107
|
-
if (manifest[common_1.ManifestSection.ui5] &&
|
|
108
|
-
manifest[common_1.ManifestSection.ui5]['extends'] &&
|
|
109
|
-
manifest[common_1.ManifestSection.ui5]['extends']['extensions'] &&
|
|
110
|
-
manifest[common_1.ManifestSection.ui5]['extends']['extensions']['sap.ui.viewExtensions']) {
|
|
111
|
-
const viewExtension = common_1.PAGETYPE_VIEW_EXTENSION_TEMPLATE_MAP.get(pageType);
|
|
112
|
-
const viewExtensionsOfPage = manifest[common_1.ManifestSection.ui5]['extends']['extensions']['sap.ui.viewExtensions'][viewExtension];
|
|
113
|
-
if (viewExtensionsOfPage) {
|
|
114
|
-
for (const manifestKey of Object.keys(viewExtensionsOfPage)) {
|
|
115
|
-
const manifestKeyParts = manifestKey.split('|');
|
|
116
|
-
const [keyExtensionType, keyEntitySet] = manifestKeyParts;
|
|
117
|
-
// If Object Page section have key, then Ignore it as it is not from QuickVariantSelectionX
|
|
118
|
-
const referenceId = manifestKeyParts[2];
|
|
119
|
-
const keyTab = objectPageSectionData && referenceId === objectPageSectionData.key ? undefined : referenceId;
|
|
120
|
-
const extensionType = common_2.ViewTemplateType[keyExtensionType];
|
|
121
|
-
if (extensionType && '|' + keyEntitySet === targetKeyEntitySet) {
|
|
122
|
-
const fragmentType = viewExtensionsOfPage[manifestKey].type
|
|
123
|
-
? viewExtensionsOfPage[manifestKey].type.toLowerCase()
|
|
124
|
-
: 'xml';
|
|
125
|
-
let fragmentName = viewExtensionsOfPage[manifestKey].fragmentName;
|
|
126
|
-
if (!fragmentName) {
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
// Responsive Table ==> check cells' fragment name
|
|
130
|
-
let cellsFragmentName;
|
|
131
|
-
if (extensionType === common_2.ViewTemplateType.ResponsiveTableColumnsExtension) {
|
|
132
|
-
for (const cellsKey of Object.keys(viewExtensionsOfPage)) {
|
|
133
|
-
const [cellsKeyType, cellsKeyEntitySet, cellsKeyTab] = cellsKey.split('|');
|
|
134
|
-
if (cellsKeyType === common_2.ViewTemplateType.ResponsiveTableCellsExtension &&
|
|
135
|
-
cellsKeyEntitySet === keyEntitySet &&
|
|
136
|
-
cellsKeyTab === referenceId) {
|
|
137
|
-
cellsFragmentName = viewExtensionsOfPage[cellsKey].fragmentName;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// Retrieve information from fragment
|
|
142
|
-
const fragmentParts = fragmentName.split('.');
|
|
143
|
-
fragmentName = fragmentParts[fragmentParts.length - 1] + common_2.FRAGMENTNAMEPART + fragmentType;
|
|
144
|
-
const filteredFragments = fragments.filter((fragment) => fragment['dataSourceUri'].endsWith(fragmentName));
|
|
145
|
-
if (filteredFragments[0]) {
|
|
146
|
-
const fragmentJson = JSON.parse(xml_js_1.xml2json(filteredFragments[0].fileContent, { compact: true }));
|
|
147
|
-
const fragmentDefintion = fragmentJson[controls_1.FRAGMENT_DEFINITION];
|
|
148
|
-
const columnDefinition = controls_1.getRootCustomColumnFromFragmentJSON(fragmentDefintion);
|
|
149
|
-
if (columnDefinition) {
|
|
150
|
-
if (!config.table['columns']) {
|
|
151
|
-
config.table['columns'] = {};
|
|
152
|
-
}
|
|
153
|
-
if (Array.isArray(columnDefinition)) {
|
|
154
|
-
for (let j = 0; j < columnDefinition.length; j++) {
|
|
155
|
-
evaluateFragmentColumn(columnDefinition[j], viewExtensionsOfPage, manifestKey, keyTab, config, extensionType, cellsFragmentName);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
evaluateFragmentColumn(columnDefinition, viewExtensionsOfPage, manifestKey, keyTab, config, extensionType, cellsFragmentName);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
45
|
+
//FilterBar:
|
|
46
|
+
listReportConfig.filterBar = factory.createInstance(common_1.PageType.ListReport, common_2.DefinitionName.ListReportFilterBar, listReportConfig.filterBar);
|
|
47
|
+
index_1.transferSettingsOfObject(listReportConfig.filterBar, importParameters.manifest, importParameters.jsonSchema['definitions'][common_2.DefinitionName.ListReportFilterBar], pageKey, importParameters.logger);
|
|
48
|
+
//Footer:
|
|
49
|
+
listReportConfig.footer = { actions: {} };
|
|
50
|
+
const footerAction = importParameters.jsonSchema['definitions']['FooterActions<LineItems>'];
|
|
51
|
+
if (footerAction) {
|
|
52
|
+
for (const actionProperty in footerAction.properties) {
|
|
53
|
+
const actionKey = actionProperty.replace('/', '::');
|
|
54
|
+
listReportConfig.footer.actions[actionKey] = factory.createInstance(common_1.PageType.ListReport, 'FooterAction');
|
|
55
|
+
index_1.transferSettingsOfObject(listReportConfig.footer.actions[actionKey], importParameters.manifest, importParameters.jsonSchema['definitions']['Action'], pageKey, importParameters.logger);
|
|
165
56
|
}
|
|
166
57
|
}
|
|
167
58
|
}
|
|
168
|
-
exports.addFragments = addFragments;
|
|
169
59
|
/**
|
|
170
60
|
* Creates the configuration file content for a list report V2
|
|
171
61
|
* @param {ImportListReportV2Parameters} importParameters - object comprising all input data
|
|
@@ -222,8 +112,8 @@ function createListReportConfig(importParameters) {
|
|
|
222
112
|
index_1.addFlex(config, change, importParameters.jsonSchema, importParameters.logger);
|
|
223
113
|
}
|
|
224
114
|
});
|
|
225
|
-
addFragments(config, importParameters.manifest, v2Page, common_1.PageType.ListReport, importParameters.fragments);
|
|
226
|
-
removeEmptySettings(config);
|
|
115
|
+
index_1.addFragments(config, importParameters.manifest, v2Page, common_1.PageType.ListReport, importParameters.fragments);
|
|
116
|
+
utils_1.removeEmptySettings(config);
|
|
227
117
|
return config;
|
|
228
118
|
}
|
|
229
119
|
exports.createListReportConfig = createListReportConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listReport.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/pages/listReport.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"listReport.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/pages/listReport.ts"],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
|
@@ -13,7 +13,6 @@ const sapUiPageV2_1 = require("../.../../../../../specification/v2/webapp/manife
|
|
|
13
13
|
const i18next_1 = __importDefault(require("i18next"));
|
|
14
14
|
const i18n_1 = require("../../../../i18n/i18n");
|
|
15
15
|
const common_2 = require("../../../../specification/common");
|
|
16
|
-
const listReport_1 = require("../pages/listReport");
|
|
17
16
|
const factory_1 = require("../../export/factory");
|
|
18
17
|
const types_1 = require("../../types");
|
|
19
18
|
const common_3 = require("../common");
|
|
@@ -25,9 +24,12 @@ const common_3 = require("../common");
|
|
|
25
24
|
function getSingleSelectorIdPart(selectorIdParts, facetID) {
|
|
26
25
|
const lastIdParts = selectorIdParts[0].split('-');
|
|
27
26
|
const id = lastIdParts[lastIdParts.length - 1];
|
|
28
|
-
if (selectorIdParts[0].indexOf(
|
|
27
|
+
if (selectorIdParts[0].indexOf('::action::') >= 0 || selectorIdParts[0].startsWith('action::')) {
|
|
29
28
|
// Object Page ToolBar Actions
|
|
30
|
-
facetID =
|
|
29
|
+
facetID =
|
|
30
|
+
lastIdParts[0].split('::action::')[0] ||
|
|
31
|
+
lastIdParts[0].split(`${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}::`)[1].split('::')[0];
|
|
32
|
+
facetID = `${common_1.ActionTitlePrefix}${facetID}`;
|
|
31
33
|
}
|
|
32
34
|
else if (selectorIdParts[0].indexOf("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) >= 0 ||
|
|
33
35
|
selectorIdParts[0].indexOf('UI.LineItem') >= 0 ||
|
|
@@ -91,7 +93,7 @@ function prepareFlexChanges(changes, entitySet, logger) {
|
|
|
91
93
|
const change = common_1.parseChangeString(changeString);
|
|
92
94
|
if (change && ((_a = change.controlId) === null || _a === void 0 ? void 0 : _a.includes(sapUiPageV2_1.FE_TEMPLATE_V2_OBJECT_PAGE)) && ((_b = change.controlId) === null || _b === void 0 ? void 0 : _b.includes(entitySet))) {
|
|
93
95
|
let selectorId = change.controlId.split('--')[1].replace(/:3a:3a/g, '::');
|
|
94
|
-
const complexIdMatch =
|
|
96
|
+
const complexIdMatch = /.+DataField.+:::sSmartTableId::.+/;
|
|
95
97
|
if (complexIdMatch.exec(selectorId) !== null) {
|
|
96
98
|
selectorId = selectorId.split('template:::TableColumn:::')[1];
|
|
97
99
|
}
|
|
@@ -121,9 +123,11 @@ function prepareFlexChanges(changes, entitySet, logger) {
|
|
|
121
123
|
});
|
|
122
124
|
return result;
|
|
123
125
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Returns the type of a given section
|
|
128
|
+
* @param schemaSection - current section
|
|
129
|
+
* @returns {SectionTypeV2} - type of section, differentiated by level (Sub/Section)
|
|
130
|
+
*/
|
|
127
131
|
const getSectionType = (schemaSection) => {
|
|
128
132
|
var _a, _b, _c;
|
|
129
133
|
let reference;
|
|
@@ -140,6 +144,149 @@ const getSectionType = (schemaSection) => {
|
|
|
140
144
|
return types_1.SectionTypeV2.SubSection;
|
|
141
145
|
}
|
|
142
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* Import of flex changes of a table to the config JSON of OP
|
|
149
|
+
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
150
|
+
* @param propertyKey - key of the current property in the app schema
|
|
151
|
+
* @param configPart - part of the configuration to be filled
|
|
152
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
153
|
+
* @param sectionTitle - title of the section (optional)
|
|
154
|
+
* @param sectionId - ID of the given section (optional)
|
|
155
|
+
*/
|
|
156
|
+
function importFlexChangesOfTable(flexChanges, propertyKey, configPart, importParameters, sectionTitle, sectionId) {
|
|
157
|
+
const unescapedId = sectionId === null || sectionId === void 0 ? void 0 : sectionId.replace(/::@com.sap.vocabularies/g, v2_1.VOCWITHSLASH);
|
|
158
|
+
for (const selector in flexChanges) {
|
|
159
|
+
const flexChange = flexChanges[selector];
|
|
160
|
+
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
161
|
+
const isTableColumn = propertyKey === 'columns' && flexChange.controlType === common_1.ControlType.TableColumn;
|
|
162
|
+
let facetIds;
|
|
163
|
+
if (sectionTitle) {
|
|
164
|
+
facetIds = [sectionTitle];
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
facetIds = [sectionId, unescapedId];
|
|
168
|
+
}
|
|
169
|
+
if ((propertyIdMatch || isTableColumn) && facetIds.indexOf(flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) > -1) {
|
|
170
|
+
table_1.addFlexForTable(configPart, flexChanges[selector], importParameters.jsonSchema);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Import of (regular) flex changes to the config JSON of OP
|
|
176
|
+
* @param schemaDefinition - current section of the app specific schema
|
|
177
|
+
* @param configPart - part of the configuration to be filled
|
|
178
|
+
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
179
|
+
* @param propertyKey - key of the current property in the app schema
|
|
180
|
+
* @param sectionTitle - title of the section (optional)
|
|
181
|
+
* @param controlId - ID of the given control, for e.g. GroupElement, Action (optional)
|
|
182
|
+
*/
|
|
183
|
+
function importFlexChanges(schemaDefinition, configPart, flexChanges, propertyKey, sectionTitle, controlId) {
|
|
184
|
+
var _a, _b;
|
|
185
|
+
// Comprises list of flexChanges that do not require a faacet id
|
|
186
|
+
const SupportedFlexChangesWithoutFacetId = [
|
|
187
|
+
common_1.ControlType.Avatar,
|
|
188
|
+
common_1.ControlType.ObjectPageLayout,
|
|
189
|
+
common_1.ControlType.DynamicPage
|
|
190
|
+
];
|
|
191
|
+
for (const selector in flexChanges) {
|
|
192
|
+
const flexChange = flexChanges[selector];
|
|
193
|
+
const controlIdMatch = new RegExp(`.*${controlId}\\d?$`).test(selector);
|
|
194
|
+
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
195
|
+
const schemaControlType = (_a = schemaDefinition['properties'][flexChange.propertyId]) === null || _a === void 0 ? void 0 : _a.controlType;
|
|
196
|
+
const controlTypeMatch = flexChange.controlType === schemaControlType;
|
|
197
|
+
const isFlexChangeSupproted = SupportedFlexChangesWithoutFacetId.includes(flexChange.controlType);
|
|
198
|
+
if (flexChange.controlType === common_1.ControlType.SmartGroup &&
|
|
199
|
+
propertyIdMatch &&
|
|
200
|
+
controlTypeMatch &&
|
|
201
|
+
controlIdMatch) {
|
|
202
|
+
configPart[propertyKey] = flexChange.newValue;
|
|
203
|
+
}
|
|
204
|
+
else if ((((_b = flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) === null || _b === void 0 ? void 0 : _b.includes(common_1.ActionTitlePrefix)) &&
|
|
205
|
+
!sectionTitle &&
|
|
206
|
+
controlIdMatch &&
|
|
207
|
+
propertyIdMatch &&
|
|
208
|
+
controlTypeMatch) ||
|
|
209
|
+
((selector.includes(sectionTitle) || selector.includes(schemaDefinition['title'])) &&
|
|
210
|
+
propertyIdMatch &&
|
|
211
|
+
controlTypeMatch)) {
|
|
212
|
+
configPart[propertyKey] = flexChange.newValue;
|
|
213
|
+
}
|
|
214
|
+
else if ((flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) === undefined && propertyIdMatch && controlTypeMatch && isFlexChangeSupproted) {
|
|
215
|
+
configPart[propertyKey] = flexChange.newValue;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Checks for deprecated properties and writes them to the log
|
|
221
|
+
* @param manifestSection - given section in the manifest
|
|
222
|
+
* @param deprecatedProperties - list of deperecated properties
|
|
223
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
224
|
+
* @param manifestPath - manifest path, as calcualted by the sync rule
|
|
225
|
+
*/
|
|
226
|
+
function checkDeprecatedProperties(manifestSection, deprecatedProperties, importParameters, manifestPath) {
|
|
227
|
+
if (manifestSection && deprecatedProperties) {
|
|
228
|
+
for (const key in manifestSection) {
|
|
229
|
+
const deprecated = deprecatedProperties[key];
|
|
230
|
+
if (deprecated) {
|
|
231
|
+
extensionLogger_1.log(importParameters.logger, {
|
|
232
|
+
severity: "warning" /* Warning */,
|
|
233
|
+
message: common_1.getTextForDeprecated(key, deprecated),
|
|
234
|
+
location: {
|
|
235
|
+
path: 'webapp/manifest.json/',
|
|
236
|
+
range: manifestPath.split('/')
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
delete deprecatedProperties[key];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Imports manifest settings to the object page config
|
|
246
|
+
* @param syncRule - sync rule for accessing the reflect-metadata
|
|
247
|
+
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
248
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
249
|
+
* @param configPart - part of the configuration to be filled
|
|
250
|
+
* @param propertyKey - key of the current property of the schema definition
|
|
251
|
+
* @param deprecatedProperties - list od deperecated properties
|
|
252
|
+
* @param sectionId - ID of the given section (optional)
|
|
253
|
+
* @param sectionTitle - title of the section (optional)
|
|
254
|
+
*/
|
|
255
|
+
function importManifestSetting(syncRule, pageKeys, importParameters, configPart, propertyKey, deprecatedProperties, sectionId, sectionTitle) {
|
|
256
|
+
const sectionIdInManifest = sectionId ? sectionId.replace(/\/@/g, '::').replace(/@com.sap/g, 'com.sap') : undefined;
|
|
257
|
+
let manifestPath;
|
|
258
|
+
let manifestSection;
|
|
259
|
+
if (sectionTitle) {
|
|
260
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionTitle);
|
|
261
|
+
if (Object.values(manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath)).length !== 0) {
|
|
262
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
266
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
271
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
272
|
+
}
|
|
273
|
+
const importHandler = syncRule.manifest.import;
|
|
274
|
+
if (importHandler && typeof importHandler === 'function') {
|
|
275
|
+
const value = importHandler(manifestSection, sectionId);
|
|
276
|
+
if (value !== undefined) {
|
|
277
|
+
configPart[propertyKey] = value;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
const manifestKey = syncRule.manifest.key || propertyKey;
|
|
282
|
+
if (manifestKey in manifestSection) {
|
|
283
|
+
configPart[propertyKey] = manifestSection[manifestKey];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// Check for deprecated properties.
|
|
287
|
+
checkDeprecatedProperties(manifestSection, deprecatedProperties, importParameters, manifestPath);
|
|
288
|
+
return manifestSection;
|
|
289
|
+
}
|
|
143
290
|
/**
|
|
144
291
|
* Transfers settings from manifest and flexChanges to object page config
|
|
145
292
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
@@ -148,105 +295,57 @@ const getSectionType = (schemaSection) => {
|
|
|
148
295
|
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
149
296
|
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
150
297
|
* @param sectionId - ID of the given section (optional)
|
|
298
|
+
* @param sectionTitle - Facet ID of the given section mentioned in annotations (optional)
|
|
151
299
|
* @param actionId - ID of the given action (optional)
|
|
152
300
|
*/
|
|
153
301
|
function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefinition, pageKeys, flexChanges, sectionId, sectionTitle, actionId) {
|
|
154
|
-
var _a;
|
|
155
302
|
if (!schemaDefinition) {
|
|
156
303
|
return;
|
|
157
304
|
}
|
|
158
|
-
let deprecatedProperties =
|
|
159
|
-
let manifestSection = {};
|
|
305
|
+
let deprecatedProperties = {};
|
|
160
306
|
if (configPart === null || configPart === void 0 ? void 0 : configPart.getDeprecated) {
|
|
161
307
|
deprecatedProperties = configPart.getDeprecated();
|
|
162
308
|
}
|
|
163
|
-
const unescapedId = sectionId && sectionId.replace(/::@com.sap.vocabularies/g, v2_1.VOCWITHSLASH);
|
|
164
309
|
for (const propertyKey in schemaDefinition['properties'] || schemaDefinition) {
|
|
165
310
|
const syncRule = common_1.getReflectMetadata(configPart, propertyKey);
|
|
166
311
|
if (syncRule || propertyKey === 'columns') {
|
|
167
|
-
if (propertyKey === 'columns' || (syncRule
|
|
312
|
+
if (propertyKey === 'columns' || (syncRule === null || syncRule === void 0 ? void 0 : syncRule.flex)) {
|
|
168
313
|
if (sectionId) {
|
|
169
|
-
|
|
170
|
-
const flexChange = flexChanges[selector];
|
|
171
|
-
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
172
|
-
const isTableColumn = propertyKey === 'columns' && flexChange.controlType === common_1.ControlType.TableColumn;
|
|
173
|
-
const facetIds = [sectionId, unescapedId, sectionTitle];
|
|
174
|
-
if ((propertyIdMatch || isTableColumn) && facetIds.indexOf(flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) > -1) {
|
|
175
|
-
table_1.addFlexForTable(configPart, flexChanges[selector], importParameters.jsonSchema);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
314
|
+
importFlexChangesOfTable(flexChanges, propertyKey, configPart, importParameters, sectionTitle, sectionId);
|
|
178
315
|
}
|
|
179
316
|
else {
|
|
180
|
-
|
|
181
|
-
const flexChange = flexChanges[selector];
|
|
182
|
-
const actionIdMatch = !actionId || new RegExp(`.*${actionId}\\d?$`).test(selector);
|
|
183
|
-
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
184
|
-
const schemaControlType = (_a = schemaDefinition['properties'][flexChange.propertyId]) === null || _a === void 0 ? void 0 : _a.controlType;
|
|
185
|
-
const controlTypeMatch = flexChange.controlType === schemaControlType;
|
|
186
|
-
if (
|
|
187
|
-
// Actions
|
|
188
|
-
(flexChange.facetId === 'action' && !sectionTitle && actionIdMatch && propertyIdMatch) ||
|
|
189
|
-
(!sectionTitle && actionIdMatch && propertyIdMatch && controlTypeMatch) ||
|
|
190
|
-
// Sections
|
|
191
|
-
(selector.includes(sectionTitle) && actionIdMatch && propertyIdMatch && controlTypeMatch)) {
|
|
192
|
-
addFlexToConfig(configPart, propertyKey, flexChange.newValue);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
317
|
+
importFlexChanges(schemaDefinition, configPart, flexChanges, propertyKey, sectionTitle, actionId);
|
|
195
318
|
}
|
|
196
319
|
}
|
|
197
320
|
else if (syncRule.manifest) {
|
|
198
|
-
|
|
199
|
-
? sectionId.replace(/\/@/g, '::').replace(/@com.sap/g, 'com.sap')
|
|
200
|
-
: undefined;
|
|
201
|
-
let path;
|
|
202
|
-
if (sectionTitle) {
|
|
203
|
-
path = syncRule.manifest.path(pageKeys, {}, sectionTitle);
|
|
204
|
-
if (Object.values(manifest_1.getManifestSectionByPathV2(importParameters.manifest, path)).length !== 0) {
|
|
205
|
-
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
path = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
209
|
-
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
path = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
214
|
-
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, path);
|
|
215
|
-
}
|
|
216
|
-
const importHandler = syncRule.manifest.import;
|
|
217
|
-
if (importHandler && typeof importHandler === 'function') {
|
|
218
|
-
const value = importHandler(manifestSection, sectionId);
|
|
219
|
-
if (value !== undefined) {
|
|
220
|
-
configPart[propertyKey] = value;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
const manifestKey = syncRule.manifest.key || propertyKey;
|
|
225
|
-
if (manifestKey in manifestSection) {
|
|
226
|
-
configPart[propertyKey] = manifestSection[manifestKey];
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
// Check for deprecated properties.
|
|
230
|
-
if (manifestSection && deprecatedProperties) {
|
|
231
|
-
for (const key in manifestSection) {
|
|
232
|
-
const deprecated = deprecatedProperties[key];
|
|
233
|
-
if (deprecated) {
|
|
234
|
-
extensionLogger_1.log(importParameters.logger, {
|
|
235
|
-
severity: "warning" /* Warning */,
|
|
236
|
-
message: common_1.getTextForDeprecated(key, deprecated),
|
|
237
|
-
location: {
|
|
238
|
-
path: 'webapp/manifest.json/',
|
|
239
|
-
range: path.split('/')
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
delete deprecatedProperties[key];
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
321
|
+
importManifestSetting(syncRule, pageKeys, importParameters, configPart, propertyKey, deprecatedProperties, sectionId, sectionTitle);
|
|
246
322
|
}
|
|
247
323
|
}
|
|
248
324
|
}
|
|
249
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
*
|
|
328
|
+
* @param actionType - type of action
|
|
329
|
+
* @param configActionId - id of action in config
|
|
330
|
+
* @param {ActionTypeV2|string} importTypeId - type of action that was be initiated
|
|
331
|
+
* @returns {string} actionId - to be used for import of flex changes
|
|
332
|
+
*/
|
|
333
|
+
function getActionId(actionType, configActionId, importTypeId, facetId) {
|
|
334
|
+
if (actionType === types_1.ActionTypeV2.Form) {
|
|
335
|
+
return `${configActionId}::${facetId}::${importTypeId}`;
|
|
336
|
+
}
|
|
337
|
+
else if (actionType === types_1.ActionTypeV2.OPFooter) {
|
|
338
|
+
return `${configActionId}::Determining`;
|
|
339
|
+
}
|
|
340
|
+
else if (actionType === types_1.ActionTypeV2.OPToolBar) {
|
|
341
|
+
return configActionId.includes('sAction::')
|
|
342
|
+
? configActionId.split('sAction::')[1]
|
|
343
|
+
: configActionId.replace(':2f', '::');
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
return configActionId;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
250
349
|
/**
|
|
251
350
|
* Fills the action of the configuration
|
|
252
351
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
@@ -255,25 +354,17 @@ function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefi
|
|
|
255
354
|
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
256
355
|
* @param {ActionTypeV2|string} importTypeId - type of action that should be initiated
|
|
257
356
|
*/
|
|
258
|
-
function fillActions(importParameters, actionProperties, configPart, configParameters, importTypeId) {
|
|
259
|
-
let actionId, configActionId;
|
|
357
|
+
function fillActions(importParameters, actionProperties, configPart, configParameters, importTypeId, facetId) {
|
|
260
358
|
configPart['actions'] = {};
|
|
261
|
-
importTypeId = importTypeId.replace(/@/g, '::');
|
|
262
359
|
const actionType = importTypeId.split('::').pop();
|
|
263
360
|
if (configParameters.flexChanges.constructor === Object && Object.keys(configParameters.flexChanges).length !== 0) {
|
|
264
361
|
for (const actionProperty in actionProperties) {
|
|
265
|
-
configActionId = actionProperty.replace(/@/g, '::');
|
|
266
|
-
|
|
267
|
-
actionId = `${configActionId}${importTypeId}`;
|
|
268
|
-
}
|
|
269
|
-
else if (actionType === types_1.ActionTypeV2.Footer) {
|
|
270
|
-
actionId = `${configActionId}::Determining`;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
actionId = configActionId;
|
|
274
|
-
}
|
|
362
|
+
const configActionId = actionProperty.replace(/@/g, '::');
|
|
363
|
+
const actionId = getActionId(actionType, configActionId, importTypeId, facetId);
|
|
275
364
|
configPart['actions'][configActionId] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, actionType);
|
|
276
|
-
|
|
365
|
+
if (actionId) {
|
|
366
|
+
transferSettingsAndFlexChanges(importParameters, configPart['actions'][configActionId], importParameters.jsonSchema['definitions'][actionType], configParameters.pageKeys, configParameters.flexChanges, undefined, undefined, actionId);
|
|
367
|
+
}
|
|
277
368
|
if (Object.keys(configPart['actions'][configActionId]).length === 0) {
|
|
278
369
|
delete configPart['actions'][configActionId];
|
|
279
370
|
}
|
|
@@ -344,7 +435,7 @@ function fillTableInConfig(importParameters, sectionPart, manifestSettings, conf
|
|
|
344
435
|
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['table'], localJsonSchema, configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
345
436
|
const toolBarActions = JSON.parse(JSON.stringify(schemaDefinitions))[`Actions<${sectionPart.id}>`];
|
|
346
437
|
if (toolBarActions === null || toolBarActions === void 0 ? void 0 : toolBarActions['properties']) {
|
|
347
|
-
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.
|
|
438
|
+
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.OPToolBar);
|
|
348
439
|
}
|
|
349
440
|
if (Object.keys(configPart[sectionPart.id]['table']['toolBar']).length === 0) {
|
|
350
441
|
delete configPart[sectionPart.id]['table']['toolBar'];
|
|
@@ -359,17 +450,17 @@ function fillTableInConfig(importParameters, sectionPart, manifestSettings, conf
|
|
|
359
450
|
* @param {object} configPart - the given part of the object page config
|
|
360
451
|
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
361
452
|
*/
|
|
362
|
-
function fillCustomColumnsInConfig(importParameters, escapedSectionId,
|
|
453
|
+
function fillCustomColumnsInConfig(importParameters, escapedSectionId, configPart, v2Page) {
|
|
363
454
|
const customColumnSchemaProp = importParameters.jsonSchema['definitions'][escapedSectionId].properties.custom;
|
|
364
455
|
const customColumnTarget = customColumnSchemaProp
|
|
365
|
-
?
|
|
456
|
+
? common_1.getTargetFromCustomColumnRef(customColumnSchemaProp.$ref)
|
|
366
457
|
: undefined;
|
|
367
458
|
if (customColumnTarget) {
|
|
368
459
|
const objectPageSectionData = {
|
|
369
|
-
key:
|
|
460
|
+
key: escapedSectionId.replace('@', ''),
|
|
370
461
|
target: customColumnTarget
|
|
371
462
|
};
|
|
372
|
-
|
|
463
|
+
common_3.addFragments(configPart[escapedSectionId], importParameters.manifest, v2Page, common_2.PageType.ObjectPage, importParameters.fragments, objectPageSectionData);
|
|
373
464
|
}
|
|
374
465
|
}
|
|
375
466
|
/**
|
|
@@ -410,8 +501,9 @@ function fillFormSection(importParameters, sectionPart, configPart, configParame
|
|
|
410
501
|
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
411
502
|
}
|
|
412
503
|
const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
|
|
504
|
+
const formFacetId = sectionTitle || sectionPart.id.replace(/@/g, '::').replace(/::com/g, 'com');
|
|
413
505
|
if (formActions && formActions['properties']) {
|
|
414
|
-
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters,
|
|
506
|
+
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters, types_1.ActionTypeV2.Form, formFacetId);
|
|
415
507
|
}
|
|
416
508
|
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
417
509
|
if (formFields['properties']) {
|
|
@@ -460,8 +552,9 @@ function fillSubSection(importParameters, sectionPart, manifestSettings, configP
|
|
|
460
552
|
*/
|
|
461
553
|
function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, configParameters) {
|
|
462
554
|
for (const sectionId in sectionProperties) {
|
|
555
|
+
const escapedSectionId = sectionId.replace(/\/@/g, '::');
|
|
463
556
|
const sectionPart = {
|
|
464
|
-
id:
|
|
557
|
+
id: escapedSectionId,
|
|
465
558
|
type: getSectionType(sectionProperties[sectionId]),
|
|
466
559
|
schema: sectionProperties[sectionId]
|
|
467
560
|
};
|
|
@@ -473,7 +566,7 @@ function fillSectionsInConfig(importParameters, sectionProperties, manifestSetti
|
|
|
473
566
|
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
474
567
|
fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
475
568
|
// Custom column ref
|
|
476
|
-
fillCustomColumnsInConfig(importParameters,
|
|
569
|
+
fillCustomColumnsInConfig(importParameters, escapedSectionId, configPart, configParameters.v2Page);
|
|
477
570
|
break;
|
|
478
571
|
}
|
|
479
572
|
case types_1.SectionTypeV2.SectionChart:
|
|
@@ -533,7 +626,7 @@ function fillConfig(importParameters, configParameters) {
|
|
|
533
626
|
objectPageConfig.footer = {};
|
|
534
627
|
const footerAction = importParameters.jsonSchema['definitions']['FooterActions'];
|
|
535
628
|
if (footerAction) {
|
|
536
|
-
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.
|
|
629
|
+
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.OPFooter);
|
|
537
630
|
}
|
|
538
631
|
// Transfer Layout information
|
|
539
632
|
objectPageConfig.layout = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|