@sap-ux/preview-middleware 0.25.2 → 0.25.4
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.d.ts +5 -0
- package/dist/base/flp.js +18 -0
- package/dist/client/flp/init.js +6 -8
- package/dist/client/flp/init.ts +5 -8
- package/package.json +6 -6
package/dist/base/flp.d.ts
CHANGED
|
@@ -172,6 +172,11 @@ export declare class FlpSandbox {
|
|
|
172
172
|
* to load the changes in an Adaptation project.
|
|
173
173
|
*/
|
|
174
174
|
private removeAsyncHintsRequests;
|
|
175
|
+
/**
|
|
176
|
+
* For UI5 versions below 1.120, flexExtensionPointEnabled must be removed from the application
|
|
177
|
+
* dependencies manifest. Older UI5 versions cannot handle this property at bootstrap time.
|
|
178
|
+
*/
|
|
179
|
+
private removeFlexExtensionPointEnabled;
|
|
175
180
|
/**
|
|
176
181
|
* Try finding a locate-reuse-libs script in the project.
|
|
177
182
|
*
|
package/dist/base/flp.js
CHANGED
|
@@ -195,6 +195,9 @@ class FlpSandbox {
|
|
|
195
195
|
if (ui5Version.major === 1 && ui5Version.minor <= 71) {
|
|
196
196
|
this.removeAsyncHintsRequests();
|
|
197
197
|
}
|
|
198
|
+
if (ui5Version.major === 1 && ui5Version.minor < 120) {
|
|
199
|
+
this.removeFlexExtensionPointEnabled();
|
|
200
|
+
}
|
|
198
201
|
const config = structuredClone(this.templateConfig);
|
|
199
202
|
if (!config.ui5.libs.includes('sap.ui.rta')) {
|
|
200
203
|
// sap.ui.rta needs to be added to the list of preload libs for variants management and adaptation projects
|
|
@@ -352,6 +355,9 @@ class FlpSandbox {
|
|
|
352
355
|
? req.protocol
|
|
353
356
|
: (req.headers.referer?.substring(0, req.headers.referer.indexOf(':')) ?? 'http'), req.headers.host, this.templateConfig.baseUrl);
|
|
354
357
|
this.checkDeleteConnectors(ui5Version.major, ui5Version.minor, ui5Version.isCdn);
|
|
358
|
+
if (ui5Version.major === 1 && ui5Version.minor < 120) {
|
|
359
|
+
this.removeFlexExtensionPointEnabled();
|
|
360
|
+
}
|
|
355
361
|
//for consistency reasons, we also add the baseUrl to the HTML here, although it is only used in editor mode
|
|
356
362
|
const html = (0, ejs_1.render)(this.getSandboxTemplate(ui5Version), this.templateConfig);
|
|
357
363
|
this.sendResponse(res, 'text/html', 200, html);
|
|
@@ -455,6 +461,18 @@ class FlpSandbox {
|
|
|
455
461
|
}
|
|
456
462
|
}
|
|
457
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* For UI5 versions below 1.120, flexExtensionPointEnabled must be removed from the application
|
|
466
|
+
* dependencies manifest. Older UI5 versions cannot handle this property at bootstrap time.
|
|
467
|
+
*/
|
|
468
|
+
removeFlexExtensionPointEnabled() {
|
|
469
|
+
for (const app in this.templateConfig.apps) {
|
|
470
|
+
const manifest = this.templateConfig.apps[app].applicationDependencies?.manifest;
|
|
471
|
+
if (manifest?.['sap.ui5']?.flexExtensionPointEnabled !== undefined) {
|
|
472
|
+
delete manifest['sap.ui5'].flexExtensionPointEnabled;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
458
476
|
/**
|
|
459
477
|
* Try finding a locate-reuse-libs script in the project.
|
|
460
478
|
*
|
package/dist/client/flp/init.js
CHANGED
|
@@ -133,7 +133,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
133
133
|
* @param container the UShell container
|
|
134
134
|
*/
|
|
135
135
|
async function resetAppState(container) {
|
|
136
|
-
const urlParams = new URLSearchParams(
|
|
136
|
+
const urlParams = new URLSearchParams(window.location.hash);
|
|
137
137
|
const appStateValue = urlParams.get('sap-iapp-state') ?? urlParams.get('/?sap-iapp-state');
|
|
138
138
|
if (appStateValue) {
|
|
139
139
|
const appStateService = await container.getServiceAsync('AppState');
|
|
@@ -266,7 +266,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
266
266
|
if (enhancedHomePage) {
|
|
267
267
|
initCdm();
|
|
268
268
|
}
|
|
269
|
-
const urlParams = new URLSearchParams(
|
|
269
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
270
270
|
const container = sap?.ushell?.Container ?? (await __ui5_require_async('sap/ushell/Container')).default;
|
|
271
271
|
let scenario = '';
|
|
272
272
|
const ui5VersionInfo = await getUi5Version();
|
|
@@ -277,10 +277,6 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
277
277
|
container.attachRendererCreatedEvent(async function () {
|
|
278
278
|
const lifecycleService = await container.getServiceAsync('AppLifeCycle');
|
|
279
279
|
lifecycleService.attachAppLoaded(event => {
|
|
280
|
-
// Prevent starting RTA when the FLP home component (#Shell-home) fires attachAppLoaded before the user navigates to the actual app.
|
|
281
|
-
if (!globalThis.location.hash || globalThis.location.hash.startsWith('#Shell-home')) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
280
|
const view = event.getParameter('componentInstance');
|
|
285
281
|
const pluginScript = flexSettings.pluginScript ?? '';
|
|
286
282
|
const libs = [];
|
|
@@ -362,7 +358,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
362
358
|
renderer.placeAt('content');
|
|
363
359
|
}
|
|
364
360
|
|
|
365
|
-
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-dom-access,@sap-ux/fiori-tools/sap-browser-api-warning
|
|
361
|
+
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-dom-access,@sap-ux/fiori-tools/sap-browser-api-warning
|
|
366
362
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
367
363
|
if (bootstrapConfig) {
|
|
368
364
|
init({
|
|
@@ -402,7 +398,9 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
402
398
|
type: MessageBarType.warning
|
|
403
399
|
});
|
|
404
400
|
}
|
|
405
|
-
|
|
401
|
+
|
|
402
|
+
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-location-reload
|
|
403
|
+
window.location.reload();
|
|
406
404
|
}
|
|
407
405
|
}
|
|
408
406
|
var __exports = {
|
package/dist/client/flp/init.ts
CHANGED
|
@@ -168,7 +168,7 @@ function registerModules(dataFromAppIndex: AppIndexData) {
|
|
|
168
168
|
* @param container the UShell container
|
|
169
169
|
*/
|
|
170
170
|
export async function resetAppState(container: typeof sap.ushell.Container): Promise<void> {
|
|
171
|
-
const urlParams = new URLSearchParams(
|
|
171
|
+
const urlParams = new URLSearchParams(window.location.hash);
|
|
172
172
|
const appStateValue = urlParams.get('sap-iapp-state') ?? urlParams.get('/?sap-iapp-state');
|
|
173
173
|
if (appStateValue) {
|
|
174
174
|
const appStateService = await container.getServiceAsync<AppState>('AppState');
|
|
@@ -308,7 +308,7 @@ export async function init({
|
|
|
308
308
|
initCdm();
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
const urlParams = new URLSearchParams(
|
|
311
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
312
312
|
const container =
|
|
313
313
|
sap?.ushell?.Container ??
|
|
314
314
|
((await import('sap/ushell/Container')).default as unknown as typeof sap.ushell.Container);
|
|
@@ -321,10 +321,6 @@ export async function init({
|
|
|
321
321
|
container.attachRendererCreatedEvent(async function () {
|
|
322
322
|
const lifecycleService = await container.getServiceAsync<AppLifeCycle>('AppLifeCycle');
|
|
323
323
|
lifecycleService.attachAppLoaded((event) => {
|
|
324
|
-
// Prevent starting RTA when the FLP home component (#Shell-home) fires attachAppLoaded before the user navigates to the actual app.
|
|
325
|
-
if (!globalThis.location.hash || globalThis.location.hash.startsWith('#Shell-home')) {
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
324
|
const view = event.getParameter('componentInstance');
|
|
329
325
|
const pluginScript = flexSettings.pluginScript ?? '';
|
|
330
326
|
|
|
@@ -412,7 +408,7 @@ export async function init({
|
|
|
412
408
|
renderer.placeAt('content');
|
|
413
409
|
}
|
|
414
410
|
|
|
415
|
-
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-dom-access,@sap-ux/fiori-tools/sap-browser-api-warning
|
|
411
|
+
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-dom-access,@sap-ux/fiori-tools/sap-browser-api-warning
|
|
416
412
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
417
413
|
if (bootstrapConfig) {
|
|
418
414
|
init({
|
|
@@ -446,6 +442,7 @@ export async function handleHigherLayerChanges(error: unknown, ui5VersionInfo: U
|
|
|
446
442
|
});
|
|
447
443
|
}
|
|
448
444
|
|
|
449
|
-
|
|
445
|
+
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-location-reload
|
|
446
|
+
window.location.reload();
|
|
450
447
|
}
|
|
451
448
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.25.
|
|
12
|
+
"version": "0.25.4",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"qrcode": "1.5.4",
|
|
29
29
|
"@sap/bas-sdk": "3.13.3",
|
|
30
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
30
|
+
"@sap-ux/adp-tooling": "0.18.102",
|
|
31
31
|
"@sap-ux/btp-utils": "1.1.11",
|
|
32
|
-
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.22",
|
|
33
32
|
"@sap-ux/feature-toggle": "0.3.7",
|
|
34
33
|
"@sap-ux/logger": "0.8.3",
|
|
34
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.22",
|
|
35
35
|
"@sap-ux/project-access": "1.35.16",
|
|
36
|
-
"@sap-ux/
|
|
37
|
-
"@sap-ux/
|
|
36
|
+
"@sap-ux/i18n": "0.3.10",
|
|
37
|
+
"@sap-ux/system-access": "0.7.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@sap-ux-private/playwright": "0.2.13",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"npm-run-all2": "8.0.4",
|
|
55
55
|
"supertest": "7.2.2",
|
|
56
56
|
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.19.1",
|
|
57
|
-
"@sap-ux/axios-extension": "1.25.26",
|
|
58
57
|
"@sap-ux/store": "1.5.11",
|
|
58
|
+
"@sap-ux/axios-extension": "1.25.26",
|
|
59
59
|
"@sap-ux/ui5-info": "0.13.16"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|