@sap/ux-specification 1.84.42 → 1.84.45
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 +51 -16
- package/dist/documentation/runDocu-min.js +1 -1
- 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/documentation/v4/v4-ApplicationV4.html +1 -1
- package/dist/documentation/v4/v4-FreestylePage.html +48 -0
- package/dist/documentation/v4/v4-ListReport.html +1 -1
- package/dist/documentation/v4/v4-ObjectPage.html +1 -1
- package/dist/index-min.js +1 -1
- package/dist/schemas/v2/AnalyticalListPageConfig.json +3 -2
- package/dist/schemas/v2/ApplicationV2.json +10 -1
- package/dist/schemas/v2/ListReportConfig.json +5 -4
- package/dist/schemas/v2/ObjectPageConfig.json +20 -19
- package/dist/schemas/v4/ApplicationV4.json +14 -1
- package/dist/schemas/v4/FreestylePageConfig.json +10 -0
- package/dist/schemas/v4/ListReportConfig.json +123 -37
- package/dist/scripts/to-json-schema.js +2 -2
- package/dist/scripts/to-json-schema.js.map +1 -1
- package/dist/src/api.js +5 -1
- package/dist/src/api.js.map +1 -1
- package/dist/src/apiTypes.d.ts +9 -1
- package/dist/src/specification/common/page.d.ts +1 -1
- package/dist/src/specification/schemaAccess.d.ts +2 -1
- package/dist/src/specification/schemaAccess.js +1 -0
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/specification/v2/controls/Table.d.ts +1 -0
- package/dist/src/specification/v2/controls/Table.js.map +1 -1
- package/dist/src/specification/v4/ApplicationV4.d.ts +4 -0
- package/dist/src/specification/v4/controls/Table.d.ts +42 -1
- package/dist/src/specification/v4/pages/FreestylePageConfig.d.ts +2 -0
- package/dist/src/specification/v4/pages/FreestylePageConfig.js +3 -0
- package/dist/src/specification/v4/pages/FreestylePageConfig.js.map +1 -0
- package/dist/src/specification/v4/pages/index.d.ts +1 -0
- package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +9 -4
- package/dist/src/specification/v4/webapp/manifest/sapUi5.js.map +1 -1
- package/dist/src/sync/common/appProvider.d.ts +1 -1
- package/dist/src/sync/common/appProvider.js +10 -8
- package/dist/src/sync/common/appProvider.js.map +1 -1
- package/dist/src/sync/common/generate/utils.d.ts +16 -16
- package/dist/src/sync/common/generate/utils.js +50 -38
- package/dist/src/sync/common/generate/utils.js.map +1 -1
- package/dist/src/sync/common/importProject.js +16 -5
- package/dist/src/sync/common/importProject.js.map +1 -1
- package/dist/src/sync/common/types.d.ts +3 -2
- package/dist/src/sync/common/types.js +2 -1
- package/dist/src/sync/common/types.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +5 -3
- package/dist/src/sync/common/utils.js +22 -12
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +14 -5
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/export.d.ts +2 -1
- package/dist/src/sync/v2/export/export.js +3 -4
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/generate/overviewPage.js.map +1 -1
- package/dist/src/sync/v4/export/controls/Table.d.ts +12 -2
- package/dist/src/sync/v4/export/controls/Table.js +65 -4
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
- package/dist/src/sync/v4/export/export.js +23 -16
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/flexibleColumnLayout.js +14 -6
- package/dist/src/sync/v4/export/flexibleColumnLayout.js.map +1 -1
- package/dist/src/sync/v4/export/manifest.js +20 -26
- package/dist/src/sync/v4/export/manifest.js.map +1 -1
- package/dist/src/sync/v4/export/pages/FreestylePage.d.ts +5 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.js +9 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.js.map +1 -0
- package/dist/src/sync/v4/export/pages/index.d.ts +1 -0
- package/dist/src/sync/v4/export/pages/index.js +1 -0
- package/dist/src/sync/v4/export/pages/index.js.map +1 -1
- package/dist/src/sync/v4/export/utils.d.ts +6 -0
- package/dist/src/sync/v4/export/utils.js +17 -0
- package/dist/src/sync/v4/export/utils.js.map +1 -1
- package/dist/src/sync/v4/generate/freestylePage.d.ts +10 -0
- package/dist/src/sync/v4/generate/freestylePage.js +15 -0
- package/dist/src/sync/v4/generate/freestylePage.js.map +1 -0
- package/dist/src/sync/v4/generate/generate.d.ts +12 -0
- package/dist/src/sync/v4/generate/generate.js +23 -0
- package/dist/src/sync/v4/generate/generate.js.map +1 -1
- package/dist/src/sync/v4/generate/index.d.ts +2 -1
- package/dist/src/sync/v4/generate/index.js +3 -0
- package/dist/src/sync/v4/generate/index.js.map +1 -1
- package/dist/src/sync/v4/generate/listReport.js +22 -11
- package/dist/src/sync/v4/generate/listReport.js.map +1 -1
- package/dist/src/sync/v4/generate/objectPage.js +119 -113
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/app/appProvider.d.ts +4 -17
- package/dist/src/sync/v4/import/app/appProvider.js +3 -305
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts +45 -0
- package/dist/src/sync/v4/import/app/baseAppProvider.js +339 -0
- package/dist/src/sync/v4/import/app/baseAppProvider.js.map +1 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts +7 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.js +11 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.js.map +1 -0
- package/dist/src/sync/v4/import/app/index.d.ts +3 -0
- package/dist/src/sync/v4/import/app/index.js +12 -0
- package/dist/src/sync/v4/import/app/index.js.map +1 -0
- package/dist/src/sync/v4/import/pages/listReport.js +5 -5
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
- package/dist/src/sync/v4/import/pages/objectPage.js +3 -3
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v4/import/utils.js +1 -1
- package/dist/src/sync/v4/import/utils.js.map +1 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaFFV4.test.d.ts +1 -0
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaFFV4.test.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,312 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const common_1 = require("../../../common");
|
|
9
|
-
const listReport_1 = require("../pages/listReport");
|
|
10
|
-
const objectPage_1 = require("../pages/objectPage");
|
|
11
|
-
const v4_1 = require("../../../../specification/v4");
|
|
12
|
-
const common_2 = require("../../../../specification/common");
|
|
13
|
-
const utils_1 = require("../../import/utils");
|
|
14
|
-
const schemaAccess_1 = require("../../../../specification/schemaAccess");
|
|
15
|
-
const extensionLogger_1 = require("../../../../extensionLogger");
|
|
16
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
17
|
-
var Constants;
|
|
18
|
-
(function (Constants) {
|
|
19
|
-
Constants["OptionalQuery"] = ":?query:";
|
|
20
|
-
Constants["Component"] = "sap/fe/AppComponent";
|
|
21
|
-
Constants["Namespace"] = "sap.fe.templates";
|
|
22
|
-
})(Constants = exports.Constants || (exports.Constants = {}));
|
|
23
|
-
// Store controller names which should be handled latelly
|
|
24
|
-
const unhandledControllers = [];
|
|
25
|
-
// Store route associations
|
|
26
|
-
let associations = {};
|
|
27
|
-
/**
|
|
28
|
-
* Sort in following way
|
|
29
|
-
* 1. string targets first
|
|
30
|
-
* 2. Then sort targets as array by elements count - from lowest to highest(ASC)
|
|
31
|
-
* @param {SapUi5RoutingRoute} route1 - First instance of router to compare.
|
|
32
|
-
* @param {SapUi5RoutingRoute} route2 - Second instance of router to compare.
|
|
33
|
-
* @return {number} Compare result.
|
|
34
|
-
*/
|
|
35
|
-
function routesSorter(route1, route2) {
|
|
36
|
-
const target1 = route1.target;
|
|
37
|
-
const target2 = route2.target;
|
|
38
|
-
const isT1Array = Array.isArray(target1);
|
|
39
|
-
const isT2Array = Array.isArray(target2);
|
|
40
|
-
if (isT1Array && isT2Array) {
|
|
41
|
-
return target1.length - target2.length;
|
|
42
|
-
}
|
|
43
|
-
if (!isT1Array && !isT2Array) {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
return !isT1Array ? -1 : 1;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Method to resolve target and return target name as string.
|
|
50
|
-
* Thing is that we can receive target as array of targets and we need detect which target is unique target in that array.
|
|
51
|
-
* @param {SapUi5RoutingRouteTarget} target - Target to resolve.
|
|
52
|
-
* @param {Array<string>} usedTargets - Array of resolved targets(which means that those targets are not unique anymore).
|
|
53
|
-
* @return {string} Resolved unique target namet.
|
|
54
|
-
*/
|
|
55
|
-
function resolveTarget(target, usedTargets = []) {
|
|
56
|
-
if (!Array.isArray(target)) {
|
|
57
|
-
return target;
|
|
58
|
-
}
|
|
59
|
-
let targetParts = target;
|
|
60
|
-
for (const usedTarget of usedTargets) {
|
|
61
|
-
targetParts = targetParts.filter((targetPart) => !usedTarget.includes(targetPart));
|
|
62
|
-
}
|
|
63
|
-
return targetParts[0];
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Method which populates object with routings routes associations.
|
|
67
|
-
* @param {SapUi5RoutingRoute} routes - Routing routes.
|
|
68
|
-
* @return {object} Map object of association routes.
|
|
69
|
-
*/
|
|
70
|
-
function populateAssociations(routes) {
|
|
71
|
-
const routesAssociations = {};
|
|
72
|
-
routes = routes.concat().sort(routesSorter);
|
|
73
|
-
const resolvedTargets = [];
|
|
74
|
-
for (const route of routes) {
|
|
75
|
-
const parts = route.pattern.split(':')[0].split('/');
|
|
76
|
-
let target;
|
|
77
|
-
if (Array.isArray(route.target)) {
|
|
78
|
-
target = resolveTarget(route.target, resolvedTargets);
|
|
79
|
-
resolvedTargets.push(route.target);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
target = route.target;
|
|
83
|
-
}
|
|
84
|
-
for (const part of parts) {
|
|
85
|
-
const prop = part.split('(')[0];
|
|
86
|
-
routesAssociations[target] = routesAssociations[target] ? `${routesAssociations[target]}.${prop}` : prop;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return routesAssociations;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Determines the page type of a routing target
|
|
93
|
-
* @param target - routing target, as defined in manifest
|
|
94
|
-
* @param logger - logger for error messages
|
|
95
|
-
* @param routingTargetId - ID of the routing target
|
|
96
|
-
* @returns the page type
|
|
97
|
-
*/
|
|
98
|
-
function determinePageType(target, logger, routingTargetId) {
|
|
99
|
-
let pageType;
|
|
100
|
-
if (target['name']) {
|
|
101
|
-
if (target['name'] === v4_1.FE_TEMPLATE_V4_CUSTOM_PAGE) {
|
|
102
|
-
pageType = common_2.PageTypeV4.CustomPage;
|
|
103
|
-
}
|
|
104
|
-
else if (target['name'].endsWith(common_2.PageTypeV4.ListReport) ||
|
|
105
|
-
target['name'].endsWith(common_2.PageTypeV4.AnalyticalListPage)) {
|
|
106
|
-
pageType = common_2.PageTypeV4.ListReport;
|
|
107
|
-
}
|
|
108
|
-
else if (target['name'].endsWith(common_2.PageTypeV4.ObjectPage)) {
|
|
109
|
-
pageType = common_2.PageTypeV4.ObjectPage;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
pageType = undefined;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else if ('viewId' in target) {
|
|
116
|
-
pageType = common_2.PageTypeV4.CustomPage;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
extensionLogger_1.log(logger, {
|
|
120
|
-
severity: "error" /* Error */,
|
|
121
|
-
message: i18next_1.default.t('INVALIDTARGETDEFINITION', { target: JSON.stringify(target) }),
|
|
122
|
-
location: {
|
|
123
|
-
path: common_1.MANIFESTPATH,
|
|
124
|
-
range: [`${v4_1.ManifestSection.ui5}/routing/targets/${routingTargetId}`]
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
if (target['viewType'] === 'XML' && 'viewName' in target) {
|
|
128
|
-
pageType = common_2.PageTypeV4.CustomPage;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return pageType;
|
|
132
|
-
}
|
|
133
|
-
function convertSettingsToConfig(params) {
|
|
134
|
-
const schemaId = common_1.generatePageId(params.page.pageType, params.page.entitySet, params.target['viewId'] || (params.pageType === common_2.PageTypeV4.CustomPage && params.target['id']));
|
|
135
|
-
if (!schemaId) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
// Get the JSON schema for the page. If no page specific schema exists, fall back top the generic schema for the page type
|
|
139
|
-
const jsonSchema = Object.keys(params.schemas).find((element) => element.includes(schemaId)) ||
|
|
140
|
-
Object.keys(params.schemas).find((element) => element.includes(schemaId.slice(0, -1))) ||
|
|
141
|
-
Object.keys(params.schemas).find((element) => element.includes(params.page.pageType));
|
|
142
|
-
if (jsonSchema) {
|
|
143
|
-
if (params.page.pageType === common_2.PageTypeV4.ObjectPage) {
|
|
144
|
-
const importParameters = {
|
|
145
|
-
manifest: params.manifest,
|
|
146
|
-
jsonSchema: params.schemas[jsonSchema],
|
|
147
|
-
routingId: params.id,
|
|
148
|
-
logger: params.logger
|
|
149
|
-
};
|
|
150
|
-
params.page.config = objectPage_1.createObjectPageConfigV4(importParameters);
|
|
151
|
-
}
|
|
152
|
-
else if (params.templateType === common_1.TemplateType.ListReportObjectPageV4) {
|
|
153
|
-
const importParameters = {
|
|
154
|
-
manifest: params.manifest,
|
|
155
|
-
jsonSchema: params.schemas[jsonSchema],
|
|
156
|
-
logger: params.logger
|
|
157
|
-
};
|
|
158
|
-
params.page.config = listReport_1.createListReportConfig(importParameters, schemaAccess_1.SchemaType.ListReport);
|
|
159
|
-
}
|
|
160
|
-
else if (params.templateType === common_1.TemplateType.AnalyticalListPageV4) {
|
|
161
|
-
const importParameters = {
|
|
162
|
-
manifest: params.manifest,
|
|
163
|
-
jsonSchema: params.schemas[jsonSchema],
|
|
164
|
-
logger: params.logger
|
|
165
|
-
};
|
|
166
|
-
params.page.config = listReport_1.createListReportConfig(importParameters, schemaAccess_1.SchemaType.AnalyticalListPage);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Updates the class variable collecting the unhandled controllers
|
|
172
|
-
* @param target - current routing target
|
|
173
|
-
*/
|
|
174
|
-
function updateUnhandledControllers(target) {
|
|
175
|
-
if ('viewId' in target) {
|
|
176
|
-
// There no 'options' for custom page target -
|
|
177
|
-
// we need check target's controller source for navigation
|
|
178
|
-
const viewParts = target.viewName.split('.');
|
|
179
|
-
unhandledControllers.push(viewParts[viewParts.length - 1]);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Determines the Pages(app.json) using routing configuration from manifest and creates the configuration for each page
|
|
184
|
-
* @param manifest - manifest.json of the app
|
|
185
|
-
* @param schemas - list of JSON schemas of all pages
|
|
186
|
-
*/
|
|
187
|
-
function getPagesAndConfigs(manifest, schemas, templateType, logger) {
|
|
188
|
-
const pages = {};
|
|
189
|
-
const routing = manifest[v4_1.ManifestSection.ui5].routing;
|
|
190
|
-
associations = populateAssociations(routing.routes);
|
|
191
|
-
for (const id in routing.targets) {
|
|
192
|
-
const target = routing.targets[id];
|
|
193
|
-
const pageType = determinePageType(target, logger, id);
|
|
194
|
-
const page = {
|
|
195
|
-
pageType: pageType
|
|
196
|
-
};
|
|
197
|
-
// Entity set
|
|
198
|
-
if (target.options) {
|
|
199
|
-
page.entitySet = target.options.settings.entitySet;
|
|
200
|
-
}
|
|
201
|
-
if (target.controlAggregation) {
|
|
202
|
-
page.controlAggregation = target.controlAggregation;
|
|
203
|
-
}
|
|
204
|
-
if (associations[id] && associations[id].indexOf('.') !== -1) {
|
|
205
|
-
const parts = associations[id].split('.');
|
|
206
|
-
page.navigationProperty = parts[parts.length - 1];
|
|
207
|
-
}
|
|
208
|
-
// Custom page's view object
|
|
209
|
-
if ('viewId' in target) {
|
|
210
|
-
// Populate view of custom page
|
|
211
|
-
page.view = {
|
|
212
|
-
id: target.viewId,
|
|
213
|
-
name: target.viewName
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
else if (pageType === common_2.PageTypeV4.CustomPage) {
|
|
217
|
-
const customPageName = target['viewName'];
|
|
218
|
-
page.view = Object.assign(Object.assign({}, (target.id && { id: target.id })), (customPageName && { name: customPageName }));
|
|
219
|
-
}
|
|
220
|
-
// Page navigation object
|
|
221
|
-
// Please note that it is moved to end as in result it would be stringified into 'json' file as last property
|
|
222
|
-
if (target.options) {
|
|
223
|
-
if (target.options.settings.variantManagement) {
|
|
224
|
-
page.variantManagement = target.options.settings.variantManagement;
|
|
225
|
-
}
|
|
226
|
-
page.navigation = {};
|
|
227
|
-
for (const name in target.options.settings.navigation) {
|
|
228
|
-
const navigationRoute = target.options.settings.navigation[name];
|
|
229
|
-
page.navigation[navigationRoute.detail.route] = associations[navigationRoute.detail.route];
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
updateUnhandledControllers(target);
|
|
233
|
-
// Get layout from route
|
|
234
|
-
const route = routing.routes.find((routingRoute) => routingRoute.name === 'BookingObjectPage');
|
|
235
|
-
if (route && 'layout' in route) {
|
|
236
|
-
page.defaultLayoutType = route.layout;
|
|
237
|
-
}
|
|
238
|
-
pages[id] = page;
|
|
239
|
-
// convert settings to config
|
|
240
|
-
const conversionParameters = {
|
|
241
|
-
target,
|
|
242
|
-
pageType,
|
|
243
|
-
manifest,
|
|
244
|
-
schemas,
|
|
245
|
-
logger,
|
|
246
|
-
page,
|
|
247
|
-
id,
|
|
248
|
-
templateType
|
|
249
|
-
};
|
|
250
|
-
convertSettingsToConfig(conversionParameters);
|
|
251
|
-
}
|
|
252
|
-
return pages;
|
|
253
|
-
}
|
|
254
|
-
exports.getPagesAndConfigs = getPagesAndConfigs;
|
|
255
|
-
/**
|
|
256
|
-
* Get the id of the page that is to open when the application is started.
|
|
257
|
-
* @param routing UI5 routing configuration
|
|
258
|
-
*/
|
|
259
|
-
function getHome(routing) {
|
|
260
|
-
let routeHome;
|
|
261
|
-
for (const route of routing.routes) {
|
|
262
|
-
//find the home, i.e. route which starts with ':?query:' pattern for List Report,
|
|
263
|
-
//resp. doesn't contain '/' for Form Page
|
|
264
|
-
if (route.pattern.startsWith(':?query:')) {
|
|
265
|
-
routeHome = route;
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
else if (route.pattern.indexOf('/') === -1) {
|
|
269
|
-
routeHome = route;
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return routeHome ? resolveTarget(routeHome.target) : resolveTarget(routing.routes[0].target);
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Method which detects app settings from manifest.
|
|
277
|
-
* Currently only one setting is detected -Flexible Column Layout
|
|
278
|
-
* @param routing UI5 routing configuration.
|
|
279
|
-
* @return {AppSettings} Application settings.
|
|
280
|
-
*/
|
|
281
|
-
function getSettings(routing) {
|
|
282
|
-
return routing.config && routing.config.flexibleColumnLayout
|
|
283
|
-
? {
|
|
284
|
-
flexibleColumnLayout: routing.config.flexibleColumnLayout
|
|
285
|
-
}
|
|
286
|
-
: undefined;
|
|
287
|
-
}
|
|
288
|
-
class V4AppProvider extends appProvider_1.AppProvider {
|
|
3
|
+
const baseAppProvider_1 = require("./baseAppProvider");
|
|
4
|
+
class V4AppProvider extends baseAppProvider_1.BaseAppProvider {
|
|
289
5
|
constructor(manifest, schemas, templateType, logger) {
|
|
290
|
-
|
|
291
|
-
const appSettings = new application_1.AppSettings();
|
|
292
|
-
const schemaFile = common_1.getSchemaFilePath(schemaAccess_1.SchemaType.Application);
|
|
293
|
-
const appSchema = schemas[schemaFile.filename];
|
|
294
|
-
utils_1.transferSettingsOfObject(appSettings, manifest, appSchema['definitions']['AppSettings'], '', []);
|
|
295
|
-
super(manifest, schemas, getHome(manifest[v4_1.ManifestSection.ui5].routing), getPagesAndConfigs(manifest, schemas, templateType, logger), common_2.FioriElementsVersion.v4, Object.assign(Object.assign({}, getSettings(manifest[v4_1.ManifestSection.ui5].routing)), appSettings), logger);
|
|
296
|
-
this.unhandledControllers = unhandledControllers;
|
|
6
|
+
super(manifest, schemas, templateType, logger);
|
|
297
7
|
}
|
|
298
8
|
}
|
|
299
9
|
exports.V4AppProvider = V4AppProvider;
|
|
300
|
-
function getPages(manifest, targetName) {
|
|
301
|
-
const routing = manifest[v4_1.ManifestSection.ui5].routing;
|
|
302
|
-
const pages = {};
|
|
303
|
-
for (const id in routing.targets) {
|
|
304
|
-
const v4Page = routing.targets[id];
|
|
305
|
-
if (v4Page['name'] === targetName) {
|
|
306
|
-
pages[id] = v4Page;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
return pages;
|
|
310
|
-
}
|
|
311
|
-
exports.getPages = getPages;
|
|
312
10
|
//# sourceMappingURL=appProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appProvider.js","sourceRoot":"","sources":["../../../../../../src/sync/v4/import/app/appProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appProvider.js","sourceRoot":"","sources":["../../../../../../src/sync/v4/import/app/appProvider.ts"],"names":[],"mappings":";;AAGA,uDAAoD;AAEpD,MAAa,aAAc,SAAQ,iCAAe;IAC9C,YAAmB,QAAkB,EAAE,OAAc,EAAE,YAA0B,EAAE,MAAwB;QACvG,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACJ;AAJD,sCAIC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AppProvider } from '../../../common/appProvider';
|
|
2
|
+
import { AppSettings } from '../../application';
|
|
3
|
+
import type { Files } from '../../../common';
|
|
4
|
+
import { TemplateType } from '../../../common';
|
|
5
|
+
import type { SapUiAppPagesV4, SapUi5RoutingV4, Manifest, Pages, Page, RoutingTargetOptions } from '../../../../specification/v4';
|
|
6
|
+
import { PageTypeV4 } from '../../../../specification/common';
|
|
7
|
+
import type { ExtensionLogger } from '../../../..';
|
|
8
|
+
export declare enum Constants {
|
|
9
|
+
OptionalQuery = ":?query:",
|
|
10
|
+
Component = "sap/fe/AppComponent",
|
|
11
|
+
Namespace = "sap.fe.templates"
|
|
12
|
+
}
|
|
13
|
+
export declare const unhandledControllers: Array<string>;
|
|
14
|
+
export declare type ConversionParameters = {
|
|
15
|
+
target: RoutingTargetOptions;
|
|
16
|
+
pageType: PageTypeV4;
|
|
17
|
+
manifest: Manifest;
|
|
18
|
+
schemas: Files;
|
|
19
|
+
logger: ExtensionLogger;
|
|
20
|
+
page: Page;
|
|
21
|
+
id: string;
|
|
22
|
+
templateType: TemplateType;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Determines the Pages(app.json) using routing configuration from manifest and creates the configuration for each page
|
|
26
|
+
* @param manifest - manifest.json of the app
|
|
27
|
+
* @param schemas - list of JSON schemas of all pages
|
|
28
|
+
*/
|
|
29
|
+
export declare function getPagesAndConfigs(manifest: Manifest, schemas: Files, templateType: TemplateType, logger?: ExtensionLogger): Pages;
|
|
30
|
+
/**
|
|
31
|
+
* Get the id of the page that is to open when the application is started.
|
|
32
|
+
* @param routing UI5 routing configuration
|
|
33
|
+
*/
|
|
34
|
+
export declare function getHome(routing: SapUi5RoutingV4): string;
|
|
35
|
+
/**
|
|
36
|
+
* Method which detects app settings from manifest.
|
|
37
|
+
* Currently only one setting is detected -Flexible Column Layout
|
|
38
|
+
* @param routing UI5 routing configuration.
|
|
39
|
+
* @return {AppSettings} Application settings.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getSettings(routing: SapUi5RoutingV4): AppSettings;
|
|
42
|
+
export declare function getPages(manifest: Manifest, targetName: string): SapUiAppPagesV4;
|
|
43
|
+
export declare abstract class BaseAppProvider extends AppProvider {
|
|
44
|
+
constructor(manifest: Manifest, schemas: Files, templateType: TemplateType, logger?: ExtensionLogger);
|
|
45
|
+
}
|