@sap-ux/preview-middleware 0.20.29 → 0.20.30

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.
@@ -195,6 +195,9 @@ sap.ui.define([
195
195
  }
196
196
  async function init(_ref) {
197
197
  let {appUrls, flex, customInit, enhancedHomePage, enableCardGenerator} = _ref;
198
+ if (enhancedHomePage) {
199
+ initCdm();
200
+ }
198
201
  const urlParams = new URLSearchParams(window.location.search);
199
202
  const container = sap?.ushell?.Container ?? (await __ui5_require_async('sap/ushell/Container')).default;
200
203
  let scenario = '';
@@ -263,7 +266,7 @@ sap.ui.define([
263
266
  setI18nTitle(resourceBundle);
264
267
  registerSAPFonts();
265
268
  if (enhancedHomePage) {
266
- await initCdm(container);
269
+ await container.init('cdm');
267
270
  }
268
271
  const renderer = ui5VersionInfo.major < 2 && !ui5VersionInfo.label?.includes('legacy-free') ? await container.createRenderer(undefined, true) : await container.createRendererInternal(undefined, true);
269
272
  renderer.placeAt('content');
@@ -305,6 +305,12 @@ export async function init({
305
305
  enhancedHomePage?: boolean | null;
306
306
  enableCardGenerator?: boolean
307
307
  }): Promise<void> {
308
+ // Set CDM configuration before importing ushell container
309
+ // to ensure proper configuration pickup during bootstrap
310
+ if (enhancedHomePage) {
311
+ initCdm();
312
+ }
313
+
308
314
  const urlParams = new URLSearchParams(window.location.search);
309
315
  const container = sap?.ushell?.Container ??
310
316
  (await import('sap/ushell/Container')).default as unknown as typeof sap.ushell.Container;
@@ -389,7 +395,7 @@ export async function init({
389
395
  registerSAPFonts();
390
396
 
391
397
  if (enhancedHomePage) {
392
- await initCdm(container);
398
+ await container.init('cdm');
393
399
  }
394
400
 
395
401
  const renderer =
@@ -6,10 +6,9 @@ sap.ui.define([], function () {
6
6
  /**
7
7
  * Initializes the CDM (Common Data Model) configuration for the SAP Fiori Launchpad.
8
8
  *
9
- * @param {sap.ushell.Container} container - The SAP Fiori Launchpad container.
10
- * @returns {Promise<void>} A promise that resolves when the initialization is complete.
9
+ * @returns {void}
11
10
  */
12
- async function initCdm(container) {
11
+ function initCdm() {
13
12
  window['sap-ushell-config'] = {
14
13
  defaultRenderer: 'fiori2',
15
14
  renderers: {
@@ -112,7 +111,6 @@ sap.ui.define([], function () {
112
111
  }
113
112
  }
114
113
  };
115
- await container.init('cdm');
116
114
  }
117
115
  return initCdm;
118
116
  });
@@ -3,10 +3,9 @@ import { Window } from 'types/global';
3
3
  /**
4
4
  * Initializes the CDM (Common Data Model) configuration for the SAP Fiori Launchpad.
5
5
  *
6
- * @param {sap.ushell.Container} container - The SAP Fiori Launchpad container.
7
- * @returns {Promise<void>} A promise that resolves when the initialization is complete.
6
+ * @returns {void}
8
7
  */
9
- export default async function initCdm(container: typeof sap.ushell.Container): Promise<void> {
8
+ export default function initCdm(): void {
10
9
  (window as unknown as Window)['sap-ushell-config'] = {
11
10
  defaultRenderer: 'fiori2',
12
11
  renderers: {
@@ -113,6 +112,4 @@ export default async function initCdm(container: typeof sap.ushell.Container): P
113
112
  }
114
113
  }
115
114
  };
116
-
117
- await container.init('cdm');
118
115
  }
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.20.29",
12
+ "version": "0.20.30",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "ejs": "3.1.10",
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
- "@sap-ux/adp-tooling": "0.14.19",
28
+ "@sap-ux/adp-tooling": "0.14.20",
29
29
  "@sap-ux/btp-utils": "1.1.0",
30
30
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.6",
31
31
  "@sap-ux/feature-toggle": "0.3.0",
@@ -49,7 +49,7 @@
49
49
  "nock": "13.4.0",
50
50
  "npm-run-all2": "6.2.0",
51
51
  "supertest": "6.3.3",
52
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.14.6",
52
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.14.7",
53
53
  "@sap-ux/axios-extension": "1.21.4",
54
54
  "@sap-ux/i18n": "0.3.0",
55
55
  "@sap-ux/store": "1.1.0",