@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
|
@@ -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"],"names":[],"mappings":";;;;;AAAA,2CAAsG;AAEtG,6DAA6E;AAC7E,4CAAkF;AAClF,iEAA+D;AAC/D,sDAA8B;AAC9B,gDAAiD;AA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
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 = `Action ID: ${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,131 @@ 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 actionId - ID of the given action (optional)
|
|
182
|
+
*/
|
|
183
|
+
function importFlexChanges(schemaDefinition, configPart, flexChanges, propertyKey, sectionTitle, actionId) {
|
|
184
|
+
var _a, _b;
|
|
185
|
+
for (const selector in flexChanges) {
|
|
186
|
+
const flexChange = flexChanges[selector];
|
|
187
|
+
const actionIdMatch = !actionId || new RegExp(`.*${actionId}\\d?$`).test(selector);
|
|
188
|
+
const propertyIdMatch = flexChange.propertyId === propertyKey;
|
|
189
|
+
const schemaControlType = (_a = schemaDefinition['properties'][flexChange.propertyId]) === null || _a === void 0 ? void 0 : _a.controlType;
|
|
190
|
+
const controlTypeMatch = flexChange.controlType === schemaControlType;
|
|
191
|
+
if (
|
|
192
|
+
// Actions
|
|
193
|
+
(((_b = flexChange === null || flexChange === void 0 ? void 0 : flexChange.facetId) === null || _b === void 0 ? void 0 : _b.includes(common_1.ActionTitlePrefix)) && !sectionTitle && actionIdMatch && propertyIdMatch) ||
|
|
194
|
+
(!sectionTitle && actionIdMatch && propertyIdMatch && controlTypeMatch) ||
|
|
195
|
+
// Sections
|
|
196
|
+
(selector.includes(sectionTitle) && actionIdMatch && propertyIdMatch && controlTypeMatch)) {
|
|
197
|
+
configPart[propertyKey] = flexChange.newValue;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Checks for deprecated properties and writes them to the log
|
|
203
|
+
* @param manifestSection - given section in the manifest
|
|
204
|
+
* @param deprecatedProperties - list of deperecated properties
|
|
205
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
206
|
+
* @param manifestPath - manifest path, as calcualted by the sync rule
|
|
207
|
+
*/
|
|
208
|
+
function checkDeprecatedProperties(manifestSection, deprecatedProperties, importParameters, manifestPath) {
|
|
209
|
+
if (manifestSection && deprecatedProperties) {
|
|
210
|
+
for (const key in manifestSection) {
|
|
211
|
+
const deprecated = deprecatedProperties[key];
|
|
212
|
+
if (deprecated) {
|
|
213
|
+
extensionLogger_1.log(importParameters.logger, {
|
|
214
|
+
severity: "warning" /* Warning */,
|
|
215
|
+
message: common_1.getTextForDeprecated(key, deprecated),
|
|
216
|
+
location: {
|
|
217
|
+
path: 'webapp/manifest.json/',
|
|
218
|
+
range: manifestPath.split('/')
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
delete deprecatedProperties[key];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Imports manifest settings to the object page config
|
|
228
|
+
* @param syncRule - sync rule for accessing the reflect-metadata
|
|
229
|
+
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
230
|
+
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
231
|
+
* @param configPart - part of the configuration to be filled
|
|
232
|
+
* @param propertyKey - key of the current property of the schema definition
|
|
233
|
+
* @param deprecatedProperties - list od deperecated properties
|
|
234
|
+
* @param sectionId - ID of the given section (optional)
|
|
235
|
+
* @param sectionTitle - title of the section (optional)
|
|
236
|
+
*/
|
|
237
|
+
function importManifestSetting(syncRule, pageKeys, importParameters, configPart, propertyKey, deprecatedProperties, sectionId, sectionTitle) {
|
|
238
|
+
const sectionIdInManifest = sectionId ? sectionId.replace(/\/@/g, '::').replace(/@com.sap/g, 'com.sap') : undefined;
|
|
239
|
+
let manifestPath;
|
|
240
|
+
let manifestSection;
|
|
241
|
+
if (sectionTitle) {
|
|
242
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionTitle);
|
|
243
|
+
if (Object.values(manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath)).length !== 0) {
|
|
244
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
248
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
manifestPath = syncRule.manifest.path(pageKeys, {}, sectionIdInManifest);
|
|
253
|
+
manifestSection = manifest_1.getManifestSectionByPathV2(importParameters.manifest, manifestPath);
|
|
254
|
+
}
|
|
255
|
+
const importHandler = syncRule.manifest.import;
|
|
256
|
+
if (importHandler && typeof importHandler === 'function') {
|
|
257
|
+
const value = importHandler(manifestSection, sectionId);
|
|
258
|
+
if (value !== undefined) {
|
|
259
|
+
configPart[propertyKey] = value;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
const manifestKey = syncRule.manifest.key || propertyKey;
|
|
264
|
+
if (manifestKey in manifestSection) {
|
|
265
|
+
configPart[propertyKey] = manifestSection[manifestKey];
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Check for deprecated properties.
|
|
269
|
+
checkDeprecatedProperties(manifestSection, deprecatedProperties, importParameters, manifestPath);
|
|
270
|
+
return manifestSection;
|
|
271
|
+
}
|
|
143
272
|
/**
|
|
144
273
|
* Transfers settings from manifest and flexChanges to object page config
|
|
145
274
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
@@ -148,105 +277,57 @@ const getSectionType = (schemaSection) => {
|
|
|
148
277
|
* @param pageKeys - list of page keys (comprises the one entry describing the given page)
|
|
149
278
|
* @param flexChanges - list of flex changes (pre-processed by prepareFlexChanges)
|
|
150
279
|
* @param sectionId - ID of the given section (optional)
|
|
280
|
+
* @param sectionTitle - Facet ID of the given section mentioned in annotations (optional)
|
|
151
281
|
* @param actionId - ID of the given action (optional)
|
|
152
282
|
*/
|
|
153
283
|
function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefinition, pageKeys, flexChanges, sectionId, sectionTitle, actionId) {
|
|
154
|
-
var _a;
|
|
155
284
|
if (!schemaDefinition) {
|
|
156
285
|
return;
|
|
157
286
|
}
|
|
158
|
-
let deprecatedProperties =
|
|
159
|
-
let manifestSection = {};
|
|
287
|
+
let deprecatedProperties = {};
|
|
160
288
|
if (configPart === null || configPart === void 0 ? void 0 : configPart.getDeprecated) {
|
|
161
289
|
deprecatedProperties = configPart.getDeprecated();
|
|
162
290
|
}
|
|
163
|
-
const unescapedId = sectionId && sectionId.replace(/::@com.sap.vocabularies/g, v2_1.VOCWITHSLASH);
|
|
164
291
|
for (const propertyKey in schemaDefinition['properties'] || schemaDefinition) {
|
|
165
292
|
const syncRule = common_1.getReflectMetadata(configPart, propertyKey);
|
|
166
293
|
if (syncRule || propertyKey === 'columns') {
|
|
167
|
-
if (propertyKey === 'columns' || (syncRule
|
|
294
|
+
if (propertyKey === 'columns' || (syncRule === null || syncRule === void 0 ? void 0 : syncRule.flex)) {
|
|
168
295
|
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
|
-
}
|
|
296
|
+
importFlexChangesOfTable(flexChanges, propertyKey, configPart, importParameters, sectionTitle, sectionId);
|
|
178
297
|
}
|
|
179
298
|
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
|
-
}
|
|
299
|
+
importFlexChanges(schemaDefinition, configPart, flexChanges, propertyKey, sectionTitle, actionId);
|
|
195
300
|
}
|
|
196
301
|
}
|
|
197
302
|
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
|
-
}
|
|
303
|
+
importManifestSetting(syncRule, pageKeys, importParameters, configPart, propertyKey, deprecatedProperties, sectionId, sectionTitle);
|
|
246
304
|
}
|
|
247
305
|
}
|
|
248
306
|
}
|
|
249
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* @param actionType - type of action
|
|
311
|
+
* @param configActionId - id of action in config
|
|
312
|
+
* @param {ActionTypeV2|string} importTypeId - type of action that was be initiated
|
|
313
|
+
* @returns {string} actionId - to be used for import of flex changes
|
|
314
|
+
*/
|
|
315
|
+
function getActionId(actionType, configActionId, importTypeId, facetId) {
|
|
316
|
+
if (actionType === types_1.ActionTypeV2.Form) {
|
|
317
|
+
return `${configActionId}::${facetId}::${importTypeId}`;
|
|
318
|
+
}
|
|
319
|
+
else if (actionType === types_1.ActionTypeV2.OPFooter) {
|
|
320
|
+
return `${configActionId}::Determining`;
|
|
321
|
+
}
|
|
322
|
+
else if (actionType === types_1.ActionTypeV2.OPToolBar) {
|
|
323
|
+
return configActionId.includes('sAction::')
|
|
324
|
+
? configActionId.split('sAction::')[1]
|
|
325
|
+
: configActionId.replace(':2f', '::');
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
return configActionId;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
250
331
|
/**
|
|
251
332
|
* Fills the action of the configuration
|
|
252
333
|
* @param {ImportObjectPageV2Parameters} importParameters - object comprising all input data
|
|
@@ -255,25 +336,17 @@ function transferSettingsAndFlexChanges(importParameters, configPart, schemaDefi
|
|
|
255
336
|
* @param {ObjectPageV2ConfigParameters} configParameters - container for factory, pageKeys, flexChanges, v2Page, ObjectPageConfig
|
|
256
337
|
* @param {ActionTypeV2|string} importTypeId - type of action that should be initiated
|
|
257
338
|
*/
|
|
258
|
-
function fillActions(importParameters, actionProperties, configPart, configParameters, importTypeId) {
|
|
259
|
-
let actionId, configActionId;
|
|
339
|
+
function fillActions(importParameters, actionProperties, configPart, configParameters, importTypeId, facetId) {
|
|
260
340
|
configPart['actions'] = {};
|
|
261
|
-
importTypeId = importTypeId.replace(/@/g, '::');
|
|
262
341
|
const actionType = importTypeId.split('::').pop();
|
|
263
342
|
if (configParameters.flexChanges.constructor === Object && Object.keys(configParameters.flexChanges).length !== 0) {
|
|
264
343
|
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
|
-
}
|
|
344
|
+
const configActionId = actionProperty.replace(/@/g, '::');
|
|
345
|
+
const actionId = getActionId(actionType, configActionId, importTypeId, facetId);
|
|
275
346
|
configPart['actions'][configActionId] = configParameters.factory.createInstance(common_2.PageType.ObjectPage, actionType);
|
|
276
|
-
|
|
347
|
+
if (actionId) {
|
|
348
|
+
transferSettingsAndFlexChanges(importParameters, configPart['actions'][configActionId], importParameters.jsonSchema['definitions'][actionType], configParameters.pageKeys, configParameters.flexChanges, undefined, undefined, actionId);
|
|
349
|
+
}
|
|
277
350
|
if (Object.keys(configPart['actions'][configActionId]).length === 0) {
|
|
278
351
|
delete configPart['actions'][configActionId];
|
|
279
352
|
}
|
|
@@ -344,7 +417,7 @@ function fillTableInConfig(importParameters, sectionPart, manifestSettings, conf
|
|
|
344
417
|
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id]['table'], localJsonSchema, configParameters.pageKeys, configParameters.flexChanges, sectionPart.id, sectionTitle);
|
|
345
418
|
const toolBarActions = JSON.parse(JSON.stringify(schemaDefinitions))[`Actions<${sectionPart.id}>`];
|
|
346
419
|
if (toolBarActions === null || toolBarActions === void 0 ? void 0 : toolBarActions['properties']) {
|
|
347
|
-
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.
|
|
420
|
+
fillActions(importParameters, toolBarActions.properties, configPart[sectionPart.id]['table']['toolBar'], configParameters, types_1.ActionTypeV2.OPToolBar);
|
|
348
421
|
}
|
|
349
422
|
if (Object.keys(configPart[sectionPart.id]['table']['toolBar']).length === 0) {
|
|
350
423
|
delete configPart[sectionPart.id]['table']['toolBar'];
|
|
@@ -359,17 +432,17 @@ function fillTableInConfig(importParameters, sectionPart, manifestSettings, conf
|
|
|
359
432
|
* @param {object} configPart - the given part of the object page config
|
|
360
433
|
* @param {SapUiAppPageV2} v2Page - v2 page from manifest.
|
|
361
434
|
*/
|
|
362
|
-
function fillCustomColumnsInConfig(importParameters, escapedSectionId,
|
|
435
|
+
function fillCustomColumnsInConfig(importParameters, escapedSectionId, configPart, v2Page) {
|
|
363
436
|
const customColumnSchemaProp = importParameters.jsonSchema['definitions'][escapedSectionId].properties.custom;
|
|
364
437
|
const customColumnTarget = customColumnSchemaProp
|
|
365
|
-
?
|
|
438
|
+
? common_1.getTargetFromCustomColumnRef(customColumnSchemaProp.$ref)
|
|
366
439
|
: undefined;
|
|
367
440
|
if (customColumnTarget) {
|
|
368
441
|
const objectPageSectionData = {
|
|
369
|
-
key:
|
|
442
|
+
key: escapedSectionId.replace('@', ''),
|
|
370
443
|
target: customColumnTarget
|
|
371
444
|
};
|
|
372
|
-
|
|
445
|
+
common_3.addFragments(configPart[escapedSectionId], importParameters.manifest, v2Page, common_2.PageType.ObjectPage, importParameters.fragments, objectPageSectionData);
|
|
373
446
|
}
|
|
374
447
|
}
|
|
375
448
|
/**
|
|
@@ -410,8 +483,9 @@ function fillFormSection(importParameters, sectionPart, configPart, configParame
|
|
|
410
483
|
transferSettingsAndFlexChanges(importParameters, configPart[sectionPart.id], sectionPart.schema, configParameters.pageKeys, configParameters.flexChanges, undefined, sectionTitle);
|
|
411
484
|
}
|
|
412
485
|
const formActions = importParameters.jsonSchema['definitions'][`SectionActions${formId}`];
|
|
486
|
+
const formFacetId = sectionTitle || sectionPart.id.replace(/@/g, '::').replace(/::com/g, 'com');
|
|
413
487
|
if (formActions && formActions['properties']) {
|
|
414
|
-
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters,
|
|
488
|
+
fillActions(importParameters, formActions.properties, configPart[sectionPart.id]['form'], configParameters, types_1.ActionTypeV2.Form, formFacetId);
|
|
415
489
|
}
|
|
416
490
|
const formFields = importParameters.jsonSchema['definitions'][`SectionFields${formId}`];
|
|
417
491
|
if (formFields['properties']) {
|
|
@@ -460,8 +534,9 @@ function fillSubSection(importParameters, sectionPart, manifestSettings, configP
|
|
|
460
534
|
*/
|
|
461
535
|
function fillSectionsInConfig(importParameters, sectionProperties, manifestSettings, configPart, configParameters) {
|
|
462
536
|
for (const sectionId in sectionProperties) {
|
|
537
|
+
const escapedSectionId = sectionId.replace(/\/@/g, '::');
|
|
463
538
|
const sectionPart = {
|
|
464
|
-
id:
|
|
539
|
+
id: escapedSectionId,
|
|
465
540
|
type: getSectionType(sectionProperties[sectionId]),
|
|
466
541
|
schema: sectionProperties[sectionId]
|
|
467
542
|
};
|
|
@@ -473,7 +548,7 @@ function fillSectionsInConfig(importParameters, sectionProperties, manifestSetti
|
|
|
473
548
|
importParameters.jsonSchema['definitions'][`${sectionPart.type}<${sectionId}>`];
|
|
474
549
|
fillTableInConfig(importParameters, sectionPart, manifestSettings, configPart, configParameters);
|
|
475
550
|
// Custom column ref
|
|
476
|
-
fillCustomColumnsInConfig(importParameters,
|
|
551
|
+
fillCustomColumnsInConfig(importParameters, escapedSectionId, configPart, configParameters.v2Page);
|
|
477
552
|
break;
|
|
478
553
|
}
|
|
479
554
|
case types_1.SectionTypeV2.SectionChart:
|
|
@@ -533,7 +608,7 @@ function fillConfig(importParameters, configParameters) {
|
|
|
533
608
|
objectPageConfig.footer = {};
|
|
534
609
|
const footerAction = importParameters.jsonSchema['definitions']['FooterActions'];
|
|
535
610
|
if (footerAction) {
|
|
536
|
-
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.
|
|
611
|
+
fillActions(importParameters, footerAction.properties, objectPageConfig.footer, configParameters, types_1.ActionTypeV2.OPFooter);
|
|
537
612
|
}
|
|
538
613
|
// Transfer Layout information
|
|
539
614
|
objectPageConfig.layout = configParameters.factory.createInstance(common_2.PageType.ObjectPage, 'ObjectPageLayout');
|