@sap-ux/preview-middleware 0.25.2 → 0.25.3

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.
@@ -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(globalThis.location.hash);
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(globalThis.location.search);
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, @sap-ux/fiori-tools/sap-no-global-variable
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
- globalThis.location.reload();
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 = {
@@ -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(globalThis.location.hash);
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(globalThis.location.search);
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, @sap-ux/fiori-tools/sap-no-global-variable
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
- globalThis.location.reload();
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.2",
12
+ "version": "0.25.3",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
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.101",
30
+ "@sap-ux/adp-tooling": "0.18.102",
31
31
  "@sap-ux/btp-utils": "1.1.11",
32
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.22",
33
33
  "@sap-ux/feature-toggle": "0.3.7",