@sap-ux/preview-middleware 0.13.20 → 0.13.22
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/dist/base/flp.js +1 -4
- package/dist/client/adp/api-handler.js +141 -141
- package/dist/client/adp/command-executor.js +54 -54
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +185 -185
- package/dist/client/adp/controllers/BaseDialog.controller.js +74 -74
- package/dist/client/adp/controllers/ControllerExtension.controller.js +179 -179
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +90 -90
- package/dist/client/adp/init-dialogs.js +74 -74
- package/dist/client/adp/init.js +5 -0
- package/dist/client/adp/init.ts +6 -2
- package/dist/client/adp/ui5-version-utils.js +63 -63
- package/dist/client/adp/utils.js +61 -61
- package/dist/client/cpe/changes/flex-change.js +51 -51
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +35 -35
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/nodes.js +84 -84
- package/dist/client/cpe/outline/utils.js +37 -37
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +49 -49
- package/dist/client/cpe/utils.js +48 -48
- package/dist/client/flp/WorkspaceConnector.js +84 -84
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +77 -77
- package/dist/client/flp/init.js +220 -220
- package/dist/client/flp/initConnectors.js +33 -33
- package/dist/client/flp/initRta.js +178 -178
- package/package.json +4 -4
package/dist/client/flp/init.js
CHANGED
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/base/Log", "sap/ui/core/IconPool", "sap/base/i18n/ResourceBundle", "sap/base/util/UriParameters"], function (Log, IconPool, ResourceBundle, UriParameters) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* SAPUI5 delivered namespaces from https://ui5.sap.com/#/api/sap
|
|
8
|
-
*/
|
|
9
|
-
const UI5_LIBS = ['sap.apf', 'sap.base', 'sap.chart', 'sap.collaboration', 'sap.f', 'sap.fe', 'sap.fileviewer', 'sap.gantt', 'sap.landvisz', 'sap.m', 'sap.ndc', 'sap.ovp', 'sap.rules', 'sap.suite', 'sap.tnt', 'sap.ui', 'sap.uiext', 'sap.ushell', 'sap.uxap', 'sap.viz', 'sap.webanalytics', 'sap.zen'];
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Check whether a specific dependency is a custom library, and if yes, add it to the map.
|
|
13
|
-
*
|
|
14
|
-
* @param dependency dependency from the manifest
|
|
15
|
-
* @param customLibs map containing the required custom libraries
|
|
16
|
-
*/
|
|
17
|
-
function addKeys(dependency, customLibs) {
|
|
18
|
-
Object.keys(dependency).forEach(function (key) {
|
|
19
|
-
// ignore libs or Components that start with SAPUI5 delivered namespaces
|
|
20
|
-
if (!UI5_LIBS.some(function (substring) {
|
|
21
|
-
return key === substring || key.startsWith(substring + '.');
|
|
22
|
-
})) {
|
|
23
|
-
customLibs[key] = true;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Fetch the manifest for all the given application urls and generate a string containing all required custom library ids.
|
|
30
|
-
*
|
|
31
|
-
* @param appUrls urls pointing to included applications
|
|
32
|
-
* @returns Promise of a comma separated list of all required libraries.
|
|
33
|
-
*/
|
|
34
|
-
function getManifestLibs(appUrls) {
|
|
35
|
-
const result = {};
|
|
36
|
-
const promises = [];
|
|
37
|
-
for (const url of appUrls) {
|
|
38
|
-
promises.push(fetch(`${url}/manifest.json`).then(async resp => {
|
|
39
|
-
const manifest = await resp.json();
|
|
40
|
-
if (manifest) {
|
|
41
|
-
if (manifest['sap.ui5'] && manifest['sap.ui5'].dependencies) {
|
|
42
|
-
if (manifest['sap.ui5'].dependencies.libs) {
|
|
43
|
-
addKeys(manifest['sap.ui5'].dependencies.libs, result);
|
|
44
|
-
}
|
|
45
|
-
if (manifest['sap.ui5'].dependencies.components) {
|
|
46
|
-
addKeys(manifest['sap.ui5'].dependencies.components, result);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (manifest['sap.ui5'] && manifest['sap.ui5'].componentUsages) {
|
|
50
|
-
addKeys(manifest['sap.ui5'].componentUsages, result);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
return Promise.all(promises).then(() => Object.keys(result).join(','));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Register the custom libraries and their url with the UI5 loader.
|
|
60
|
-
*
|
|
61
|
-
* @param dataFromAppIndex data returned from the app index service
|
|
62
|
-
*/
|
|
63
|
-
function registerModules(dataFromAppIndex) {
|
|
64
|
-
Object.keys(dataFromAppIndex).forEach(function (moduleDefinitionKey) {
|
|
65
|
-
const moduleDefinition = dataFromAppIndex[moduleDefinitionKey];
|
|
66
|
-
if (moduleDefinition && moduleDefinition.dependencies) {
|
|
67
|
-
moduleDefinition.dependencies.forEach(function (dependency) {
|
|
68
|
-
if (dependency.url && dependency.url.length > 0 && dependency.type === 'UI5LIB') {
|
|
69
|
-
Log.info('Registering Library ' + dependency.componentId + ' from server ' + dependency.url);
|
|
70
|
-
const compId = dependency.componentId.replace(/\./g, '/');
|
|
71
|
-
const config = {
|
|
72
|
-
paths: {}
|
|
73
|
-
};
|
|
74
|
-
config.paths[compId] = dependency.url;
|
|
75
|
-
sap.ui.loader.config(config);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Fetch the manifest from the given application urls, then parse them for custom libs, and finally request their urls.
|
|
84
|
-
*
|
|
85
|
-
* @param appUrls application urls
|
|
86
|
-
* @returns returns a promise when the registration is completed.
|
|
87
|
-
*/
|
|
88
|
-
async function registerComponentDependencyPaths(appUrls) {
|
|
89
|
-
const libs = await getManifestLibs(appUrls);
|
|
90
|
-
if (libs && libs.length > 0) {
|
|
91
|
-
let url = '/sap/bc/ui2/app_index/ui5_app_info?id=' + libs;
|
|
92
|
-
const sapClient = UriParameters.fromQuery(window.location.search).get('sap-client');
|
|
93
|
-
if (sapClient && sapClient.length === 3) {
|
|
94
|
-
url = url + '&sap-client=' + sapClient;
|
|
95
|
-
}
|
|
96
|
-
const response = await fetch(url);
|
|
97
|
-
try {
|
|
98
|
-
registerModules(await response.json());
|
|
99
|
-
} catch (error) {
|
|
100
|
-
Log.error(`Registering of reuse libs failed. Error:${error}`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Register SAP fonts that are also registered in a productive Fiori launchpad.
|
|
107
|
-
*/
|
|
108
|
-
function registerSAPFonts() {
|
|
109
|
-
//Fiori Theme font family and URI
|
|
110
|
-
const fioriTheme = {
|
|
111
|
-
fontFamily: 'SAP-icons-TNT',
|
|
112
|
-
fontURI: sap.ui.require.toUrl('sap/tnt/themes/base/fonts/')
|
|
113
|
-
};
|
|
114
|
-
//Registering to the icon pool
|
|
115
|
-
IconPool.registerFont(fioriTheme);
|
|
116
|
-
//SAP Business Suite Theme font family and URI
|
|
117
|
-
const suiteTheme = {
|
|
118
|
-
fontFamily: 'BusinessSuiteInAppSymbols',
|
|
119
|
-
fontURI: sap.ui.require.toUrl('sap/ushell/themes/base/fonts/')
|
|
120
|
-
};
|
|
121
|
-
//Registering to the icon pool
|
|
122
|
-
IconPool.registerFont(suiteTheme);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Read the application title from the resource bundle and set it as document title.
|
|
127
|
-
*
|
|
128
|
-
* @param i18nKey optional parameter to define the i18n key to be used for the title.
|
|
129
|
-
*/
|
|
130
|
-
function setI18nTitle() {
|
|
131
|
-
let i18nKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'appTitle';
|
|
132
|
-
const locale = sap.ui.getCore().getConfiguration().getLanguage();
|
|
133
|
-
const resourceBundle = ResourceBundle.create({
|
|
134
|
-
url: 'i18n/i18n.properties',
|
|
135
|
-
locale
|
|
136
|
-
});
|
|
137
|
-
if (resourceBundle.hasText(i18nKey)) {
|
|
138
|
-
document.title = resourceBundle.getText(i18nKey) ?? document.title;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Apply additional configuration and initialize sandbox.
|
|
144
|
-
*
|
|
145
|
-
* @param params init parameters read from the script tag
|
|
146
|
-
* @param params.appUrls JSON containing a string array of application urls
|
|
147
|
-
* @param params.flex JSON containing the flex configuration
|
|
148
|
-
* @param params.customInit path to the custom init module to be called
|
|
149
|
-
* @returns promise
|
|
150
|
-
*/
|
|
151
|
-
async function init(_ref) {
|
|
152
|
-
let {
|
|
153
|
-
appUrls,
|
|
154
|
-
flex,
|
|
155
|
-
customInit
|
|
156
|
-
} = _ref;
|
|
157
|
-
// Register RTA if configured
|
|
158
|
-
if (flex) {
|
|
159
|
-
sap.ushell.Container.attachRendererCreatedEvent(async function () {
|
|
160
|
-
const lifecycleService = await sap.ushell.Container.getServiceAsync('AppLifeCycle');
|
|
161
|
-
lifecycleService.attachAppLoaded(event => {
|
|
162
|
-
const version = sap.ui.version;
|
|
163
|
-
const minor = parseInt(version.split('.')[1], 10);
|
|
164
|
-
const view = event.getParameter('componentInstance');
|
|
165
|
-
const flexSettings = JSON.parse(flex);
|
|
166
|
-
const pluginScript = flexSettings.pluginScript ?? '';
|
|
167
|
-
let libs = [];
|
|
168
|
-
if (minor > 71) {
|
|
169
|
-
libs.push('sap/ui/rta/api/startAdaptation');
|
|
170
|
-
} else {
|
|
171
|
-
libs.push('open/ux/preview/client/flp/initRta');
|
|
172
|
-
}
|
|
173
|
-
if (flexSettings.pluginScript) {
|
|
174
|
-
libs.push(pluginScript);
|
|
175
|
-
delete flexSettings.pluginScript;
|
|
176
|
-
}
|
|
177
|
-
const options = {
|
|
178
|
-
rootControl: view,
|
|
179
|
-
validateAppVersion: false,
|
|
180
|
-
flexSettings
|
|
181
|
-
};
|
|
182
|
-
sap.ui.require(libs, async function (startAdaptation, pluginScript) {
|
|
183
|
-
await startAdaptation(options, pluginScript);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Load custom library paths if configured
|
|
190
|
-
if (appUrls) {
|
|
191
|
-
await registerComponentDependencyPaths(JSON.parse(appUrls));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Load custom initialization module
|
|
195
|
-
if (customInit) {
|
|
196
|
-
sap.ui.require([customInit]);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// init
|
|
200
|
-
setI18nTitle();
|
|
201
|
-
registerSAPFonts();
|
|
202
|
-
const renderer = await sap.ushell.Container.createRenderer(undefined, true);
|
|
203
|
-
renderer.placeAt('content');
|
|
204
|
-
}
|
|
205
|
-
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
206
|
-
if (bootstrapConfig) {
|
|
207
|
-
init({
|
|
208
|
-
appUrls: bootstrapConfig.getAttribute('data-open-ux-preview-libs-manifests'),
|
|
209
|
-
flex: bootstrapConfig.getAttribute('data-open-ux-preview-flex-settings'),
|
|
210
|
-
customInit: bootstrapConfig.getAttribute('data-open-ux-preview-customInit')
|
|
211
|
-
}).catch(() => Log.error('Sandbox initialization failed.'));
|
|
212
|
-
}
|
|
213
|
-
var __exports = {
|
|
214
|
-
__esModule: true
|
|
215
|
-
};
|
|
216
|
-
__exports.registerComponentDependencyPaths = registerComponentDependencyPaths;
|
|
217
|
-
__exports.registerSAPFonts = registerSAPFonts;
|
|
218
|
-
__exports.setI18nTitle = setI18nTitle;
|
|
219
|
-
__exports.init = init;
|
|
220
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log", "sap/ui/core/IconPool", "sap/base/i18n/ResourceBundle", "sap/base/util/UriParameters"], function (Log, IconPool, ResourceBundle, UriParameters) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* SAPUI5 delivered namespaces from https://ui5.sap.com/#/api/sap
|
|
8
|
+
*/
|
|
9
|
+
const UI5_LIBS = ['sap.apf', 'sap.base', 'sap.chart', 'sap.collaboration', 'sap.f', 'sap.fe', 'sap.fileviewer', 'sap.gantt', 'sap.landvisz', 'sap.m', 'sap.ndc', 'sap.ovp', 'sap.rules', 'sap.suite', 'sap.tnt', 'sap.ui', 'sap.uiext', 'sap.ushell', 'sap.uxap', 'sap.viz', 'sap.webanalytics', 'sap.zen'];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Check whether a specific dependency is a custom library, and if yes, add it to the map.
|
|
13
|
+
*
|
|
14
|
+
* @param dependency dependency from the manifest
|
|
15
|
+
* @param customLibs map containing the required custom libraries
|
|
16
|
+
*/
|
|
17
|
+
function addKeys(dependency, customLibs) {
|
|
18
|
+
Object.keys(dependency).forEach(function (key) {
|
|
19
|
+
// ignore libs or Components that start with SAPUI5 delivered namespaces
|
|
20
|
+
if (!UI5_LIBS.some(function (substring) {
|
|
21
|
+
return key === substring || key.startsWith(substring + '.');
|
|
22
|
+
})) {
|
|
23
|
+
customLibs[key] = true;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Fetch the manifest for all the given application urls and generate a string containing all required custom library ids.
|
|
30
|
+
*
|
|
31
|
+
* @param appUrls urls pointing to included applications
|
|
32
|
+
* @returns Promise of a comma separated list of all required libraries.
|
|
33
|
+
*/
|
|
34
|
+
function getManifestLibs(appUrls) {
|
|
35
|
+
const result = {};
|
|
36
|
+
const promises = [];
|
|
37
|
+
for (const url of appUrls) {
|
|
38
|
+
promises.push(fetch(`${url}/manifest.json`).then(async resp => {
|
|
39
|
+
const manifest = await resp.json();
|
|
40
|
+
if (manifest) {
|
|
41
|
+
if (manifest['sap.ui5'] && manifest['sap.ui5'].dependencies) {
|
|
42
|
+
if (manifest['sap.ui5'].dependencies.libs) {
|
|
43
|
+
addKeys(manifest['sap.ui5'].dependencies.libs, result);
|
|
44
|
+
}
|
|
45
|
+
if (manifest['sap.ui5'].dependencies.components) {
|
|
46
|
+
addKeys(manifest['sap.ui5'].dependencies.components, result);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (manifest['sap.ui5'] && manifest['sap.ui5'].componentUsages) {
|
|
50
|
+
addKeys(manifest['sap.ui5'].componentUsages, result);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
return Promise.all(promises).then(() => Object.keys(result).join(','));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Register the custom libraries and their url with the UI5 loader.
|
|
60
|
+
*
|
|
61
|
+
* @param dataFromAppIndex data returned from the app index service
|
|
62
|
+
*/
|
|
63
|
+
function registerModules(dataFromAppIndex) {
|
|
64
|
+
Object.keys(dataFromAppIndex).forEach(function (moduleDefinitionKey) {
|
|
65
|
+
const moduleDefinition = dataFromAppIndex[moduleDefinitionKey];
|
|
66
|
+
if (moduleDefinition && moduleDefinition.dependencies) {
|
|
67
|
+
moduleDefinition.dependencies.forEach(function (dependency) {
|
|
68
|
+
if (dependency.url && dependency.url.length > 0 && dependency.type === 'UI5LIB') {
|
|
69
|
+
Log.info('Registering Library ' + dependency.componentId + ' from server ' + dependency.url);
|
|
70
|
+
const compId = dependency.componentId.replace(/\./g, '/');
|
|
71
|
+
const config = {
|
|
72
|
+
paths: {}
|
|
73
|
+
};
|
|
74
|
+
config.paths[compId] = dependency.url;
|
|
75
|
+
sap.ui.loader.config(config);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Fetch the manifest from the given application urls, then parse them for custom libs, and finally request their urls.
|
|
84
|
+
*
|
|
85
|
+
* @param appUrls application urls
|
|
86
|
+
* @returns returns a promise when the registration is completed.
|
|
87
|
+
*/
|
|
88
|
+
async function registerComponentDependencyPaths(appUrls) {
|
|
89
|
+
const libs = await getManifestLibs(appUrls);
|
|
90
|
+
if (libs && libs.length > 0) {
|
|
91
|
+
let url = '/sap/bc/ui2/app_index/ui5_app_info?id=' + libs;
|
|
92
|
+
const sapClient = UriParameters.fromQuery(window.location.search).get('sap-client');
|
|
93
|
+
if (sapClient && sapClient.length === 3) {
|
|
94
|
+
url = url + '&sap-client=' + sapClient;
|
|
95
|
+
}
|
|
96
|
+
const response = await fetch(url);
|
|
97
|
+
try {
|
|
98
|
+
registerModules(await response.json());
|
|
99
|
+
} catch (error) {
|
|
100
|
+
Log.error(`Registering of reuse libs failed. Error:${error}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Register SAP fonts that are also registered in a productive Fiori launchpad.
|
|
107
|
+
*/
|
|
108
|
+
function registerSAPFonts() {
|
|
109
|
+
//Fiori Theme font family and URI
|
|
110
|
+
const fioriTheme = {
|
|
111
|
+
fontFamily: 'SAP-icons-TNT',
|
|
112
|
+
fontURI: sap.ui.require.toUrl('sap/tnt/themes/base/fonts/')
|
|
113
|
+
};
|
|
114
|
+
//Registering to the icon pool
|
|
115
|
+
IconPool.registerFont(fioriTheme);
|
|
116
|
+
//SAP Business Suite Theme font family and URI
|
|
117
|
+
const suiteTheme = {
|
|
118
|
+
fontFamily: 'BusinessSuiteInAppSymbols',
|
|
119
|
+
fontURI: sap.ui.require.toUrl('sap/ushell/themes/base/fonts/')
|
|
120
|
+
};
|
|
121
|
+
//Registering to the icon pool
|
|
122
|
+
IconPool.registerFont(suiteTheme);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Read the application title from the resource bundle and set it as document title.
|
|
127
|
+
*
|
|
128
|
+
* @param i18nKey optional parameter to define the i18n key to be used for the title.
|
|
129
|
+
*/
|
|
130
|
+
function setI18nTitle() {
|
|
131
|
+
let i18nKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'appTitle';
|
|
132
|
+
const locale = sap.ui.getCore().getConfiguration().getLanguage();
|
|
133
|
+
const resourceBundle = ResourceBundle.create({
|
|
134
|
+
url: 'i18n/i18n.properties',
|
|
135
|
+
locale
|
|
136
|
+
});
|
|
137
|
+
if (resourceBundle.hasText(i18nKey)) {
|
|
138
|
+
document.title = resourceBundle.getText(i18nKey) ?? document.title;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Apply additional configuration and initialize sandbox.
|
|
144
|
+
*
|
|
145
|
+
* @param params init parameters read from the script tag
|
|
146
|
+
* @param params.appUrls JSON containing a string array of application urls
|
|
147
|
+
* @param params.flex JSON containing the flex configuration
|
|
148
|
+
* @param params.customInit path to the custom init module to be called
|
|
149
|
+
* @returns promise
|
|
150
|
+
*/
|
|
151
|
+
async function init(_ref) {
|
|
152
|
+
let {
|
|
153
|
+
appUrls,
|
|
154
|
+
flex,
|
|
155
|
+
customInit
|
|
156
|
+
} = _ref;
|
|
157
|
+
// Register RTA if configured
|
|
158
|
+
if (flex) {
|
|
159
|
+
sap.ushell.Container.attachRendererCreatedEvent(async function () {
|
|
160
|
+
const lifecycleService = await sap.ushell.Container.getServiceAsync('AppLifeCycle');
|
|
161
|
+
lifecycleService.attachAppLoaded(event => {
|
|
162
|
+
const version = sap.ui.version;
|
|
163
|
+
const minor = parseInt(version.split('.')[1], 10);
|
|
164
|
+
const view = event.getParameter('componentInstance');
|
|
165
|
+
const flexSettings = JSON.parse(flex);
|
|
166
|
+
const pluginScript = flexSettings.pluginScript ?? '';
|
|
167
|
+
let libs = [];
|
|
168
|
+
if (minor > 71) {
|
|
169
|
+
libs.push('sap/ui/rta/api/startAdaptation');
|
|
170
|
+
} else {
|
|
171
|
+
libs.push('open/ux/preview/client/flp/initRta');
|
|
172
|
+
}
|
|
173
|
+
if (flexSettings.pluginScript) {
|
|
174
|
+
libs.push(pluginScript);
|
|
175
|
+
delete flexSettings.pluginScript;
|
|
176
|
+
}
|
|
177
|
+
const options = {
|
|
178
|
+
rootControl: view,
|
|
179
|
+
validateAppVersion: false,
|
|
180
|
+
flexSettings
|
|
181
|
+
};
|
|
182
|
+
sap.ui.require(libs, async function (startAdaptation, pluginScript) {
|
|
183
|
+
await startAdaptation(options, pluginScript);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Load custom library paths if configured
|
|
190
|
+
if (appUrls) {
|
|
191
|
+
await registerComponentDependencyPaths(JSON.parse(appUrls));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Load custom initialization module
|
|
195
|
+
if (customInit) {
|
|
196
|
+
sap.ui.require([customInit]);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// init
|
|
200
|
+
setI18nTitle();
|
|
201
|
+
registerSAPFonts();
|
|
202
|
+
const renderer = await sap.ushell.Container.createRenderer(undefined, true);
|
|
203
|
+
renderer.placeAt('content');
|
|
204
|
+
}
|
|
205
|
+
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
206
|
+
if (bootstrapConfig) {
|
|
207
|
+
init({
|
|
208
|
+
appUrls: bootstrapConfig.getAttribute('data-open-ux-preview-libs-manifests'),
|
|
209
|
+
flex: bootstrapConfig.getAttribute('data-open-ux-preview-flex-settings'),
|
|
210
|
+
customInit: bootstrapConfig.getAttribute('data-open-ux-preview-customInit')
|
|
211
|
+
}).catch(() => Log.error('Sandbox initialization failed.'));
|
|
212
|
+
}
|
|
213
|
+
var __exports = {
|
|
214
|
+
__esModule: true
|
|
215
|
+
};
|
|
216
|
+
__exports.registerComponentDependencyPaths = registerComponentDependencyPaths;
|
|
217
|
+
__exports.registerSAPFonts = registerSAPFonts;
|
|
218
|
+
__exports.setI18nTitle = setI18nTitle;
|
|
219
|
+
__exports.init = init;
|
|
220
|
+
return __exports;
|
|
221
221
|
});
|
|
222
222
|
//# sourceMappingURL=init.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define([], function () {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Initializes UI5 connectors based on the current UI5 version.
|
|
8
|
-
*
|
|
9
|
-
* For UI5 versions below 1.72, this function dynamically requires and executes a FakeLrepConnector.
|
|
10
|
-
* For UI5 versions 1.72 and above, it defines a local connector that reuses the WorkspaceConnector.
|
|
11
|
-
* This setup allows for flexibility in using different connectors based on the UI5 version.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* intiConnectors(); // Simply call the function without any arguments.
|
|
15
|
-
* @returns {void}
|
|
16
|
-
*/
|
|
17
|
-
function initConnectors() {
|
|
18
|
-
const version = sap.ui.version;
|
|
19
|
-
const minor = parseInt(version.split('.')[1], 10);
|
|
20
|
-
if (minor < 72) {
|
|
21
|
-
sap.ui.require(['open/ux/preview/client/flp/enableFakeConnector'], function (enableFakeConnector) {
|
|
22
|
-
enableFakeConnector();
|
|
23
|
-
});
|
|
24
|
-
} else {
|
|
25
|
-
sap.ui.define('custom.connectors.WorkspaceConnector', ['open/ux/preview/client/flp/WorkspaceConnector'], connector => connector, true);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
initConnectors();
|
|
29
|
-
var __exports = {
|
|
30
|
-
__esModule: true
|
|
31
|
-
};
|
|
32
|
-
__exports.initConnectors = initConnectors;
|
|
33
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Initializes UI5 connectors based on the current UI5 version.
|
|
8
|
+
*
|
|
9
|
+
* For UI5 versions below 1.72, this function dynamically requires and executes a FakeLrepConnector.
|
|
10
|
+
* For UI5 versions 1.72 and above, it defines a local connector that reuses the WorkspaceConnector.
|
|
11
|
+
* This setup allows for flexibility in using different connectors based on the UI5 version.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* intiConnectors(); // Simply call the function without any arguments.
|
|
15
|
+
* @returns {void}
|
|
16
|
+
*/
|
|
17
|
+
function initConnectors() {
|
|
18
|
+
const version = sap.ui.version;
|
|
19
|
+
const minor = parseInt(version.split('.')[1], 10);
|
|
20
|
+
if (minor < 72) {
|
|
21
|
+
sap.ui.require(['open/ux/preview/client/flp/enableFakeConnector'], function (enableFakeConnector) {
|
|
22
|
+
enableFakeConnector();
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
sap.ui.define('custom.connectors.WorkspaceConnector', ['open/ux/preview/client/flp/WorkspaceConnector'], connector => connector, true);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
initConnectors();
|
|
29
|
+
var __exports = {
|
|
30
|
+
__esModule: true
|
|
31
|
+
};
|
|
32
|
+
__exports.initConnectors = initConnectors;
|
|
33
|
+
return __exports;
|
|
34
34
|
});
|
|
35
35
|
//# sourceMappingURL=initConnectors.js.map
|