@sap-ux/preview-middleware 0.25.9 → 0.25.12

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.
@@ -41,6 +41,10 @@ function getIntegrationCard(multipleCard) {
41
41
  },
42
42
  entitySet: ''
43
43
  };
44
+ // sanitize URL to avoid issues with double slashes when joining paths
45
+ if (integrationCard.manifest['sap.card']?.data?.request) {
46
+ integrationCard.manifest['sap.card'].data.request.url = integrationCard.manifest['sap.card'].data.request.url.replaceAll(/\/{2,}/g, '/');
47
+ }
44
48
  prepareIntegrationCardForSaving(integrationCard.manifest);
45
49
  return integrationCard;
46
50
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "sap/ui/core/IconPool", "sap/base/i18n/ResourceBundle", "../adp/api-handler", "../utils/error", "./initCdm", "./initConnectors", "../utils/version", "../utils/info-center-message"], function (Log, ___sap_ux_private_control_property_editor_common, IconPool, ResourceBundle, ___adp_api_handler, ___utils_error, __initCdm, __initConnectors, ___utils_version, ___utils_info_center_message) {
3
+ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "sap/ui/core/IconPool", "sap/base/i18n/ResourceBundle", "../adp/api-handler", "../utils/error", "./initConnectors", "../utils/version", "../utils/info-center-message"], function (Log, ___sap_ux_private_control_property_editor_common, IconPool, ResourceBundle, ___adp_api_handler, ___utils_error, __initConnectors, ___utils_version, ___utils_info_center_message) {
4
4
  "use strict";
5
5
 
6
6
  function _interopRequireDefault(obj) {
@@ -27,7 +27,6 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
27
27
  const SCENARIO = ___sap_ux_private_control_property_editor_common["SCENARIO"];
28
28
  const getManifestAppdescr = ___adp_api_handler["getManifestAppdescr"];
29
29
  const getError = ___utils_error["getError"];
30
- const initCdm = _interopRequireDefault(__initCdm);
31
30
  const initConnectors = _interopRequireDefault(__initConnectors);
32
31
  const getUi5Version = ___utils_version["getUi5Version"];
33
32
  const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
@@ -261,11 +260,6 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
261
260
  enhancedHomePage,
262
261
  enableCardGenerator
263
262
  }) {
264
- // Set CDM configuration before importing ushell container
265
- // to ensure proper configuration pickup during bootstrap
266
- if (enhancedHomePage) {
267
- initCdm();
268
- }
269
263
  const urlParams = new URLSearchParams(window.location.search);
270
264
  const container = sap?.ushell?.Container ?? (await __ui5_require_async('sap/ushell/Container')).default;
271
265
  let scenario = '';
@@ -8,7 +8,6 @@ import ResourceBundle from 'sap/base/i18n/ResourceBundle';
8
8
  import type AppState from 'sap/ushell/services/AppState';
9
9
  import { getManifestAppdescr } from '../adp/api-handler';
10
10
  import { getError } from '../utils/error';
11
- import initCdm from './initCdm';
12
11
  import initConnectors from './initConnectors';
13
12
  import { getUi5Version, isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
14
13
  import type Component from 'sap/ui/core/Component';
@@ -302,12 +301,6 @@ export async function init({
302
301
  enhancedHomePage?: boolean | null;
303
302
  enableCardGenerator?: boolean;
304
303
  }): Promise<void> {
305
- // Set CDM configuration before importing ushell container
306
- // to ensure proper configuration pickup during bootstrap
307
- if (enhancedHomePage) {
308
- initCdm();
309
- }
310
-
311
304
  const urlParams = new URLSearchParams(window.location.search);
312
305
  const container =
313
306
  sap?.ushell?.Container ??
@@ -1,117 +1,114 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Initializes the CDM (Common Data Model) configuration for the SAP Fiori Launchpad.
8
- *
9
- * @returns {void}
10
- */
11
- function initCdm() {
12
- window['sap-ushell-config'] = {
13
- defaultRenderer: 'fiori2',
14
- renderers: {
15
- fiori2: {
16
- componentData: {
17
- config: {
18
- enableSearch: false,
19
- enableRecentActivity: true,
20
- rootIntent: 'Shell-home'
21
- }
3
+ /**
4
+ * Initializes the CDM (Common Data Model) configuration for the SAP Fiori Launchpad.
5
+ *
6
+ * @returns {void}
7
+ */
8
+ (() => {
9
+ const initScript = document.getElementById('init-cdm');
10
+ const basePath = initScript?.dataset.basePath ?? '';
11
+ window['sap-ushell-config'] = {
12
+ defaultRenderer: 'fiori2',
13
+ renderers: {
14
+ fiori2: {
15
+ componentData: {
16
+ config: {
17
+ enableSearch: false,
18
+ enableRecentActivity: true,
19
+ rootIntent: 'Shell-home'
22
20
  }
23
21
  }
22
+ }
23
+ },
24
+ ushell: {
25
+ customPreload: {
26
+ enabled: false
24
27
  },
25
- ushell: {
26
- customPreload: {
27
- enabled: false
28
- },
29
- spaces: {
30
- enabled: true,
31
- myHome: {
32
- enabled: true
33
- }
34
- },
35
- homeApp: {
36
- component: {
37
- name: 'open.ux.preview.client.flp.homepage',
38
- url: '/preview/client/flp/homepage'
39
- }
28
+ spaces: {
29
+ enabled: true,
30
+ myHome: {
31
+ enabled: true
40
32
  }
41
33
  },
42
- services: {
43
- Container: {
44
- adapter: {
45
- config: {
46
- userProfile: {
47
- metadata: {
48
- editablePropterties: ['accessibility', 'contentDensity', 'theme']
49
- },
50
- defaults: {
51
- email: 'john.doe@sap.com',
52
- firstName: 'John',
53
- lastName: 'Doe',
54
- fullName: 'John Doe',
55
- id: 'DOEJ'
56
- }
34
+ homeApp: {
35
+ component: {
36
+ name: 'open.ux.preview.client.flp.homepage',
37
+ url: `${basePath}/preview/client/flp/homepage`
38
+ }
39
+ }
40
+ },
41
+ services: {
42
+ Container: {
43
+ adapter: {
44
+ config: {
45
+ userProfile: {
46
+ metadata: {
47
+ editablePropterties: ['accessibility', 'contentDensity', 'theme']
48
+ },
49
+ defaults: {
50
+ email: 'john.doe@sap.com',
51
+ firstName: 'John',
52
+ lastName: 'Doe',
53
+ fullName: 'John Doe',
54
+ id: 'DOEJ'
57
55
  }
58
56
  }
59
57
  }
60
- },
61
- CommonDataModel: {
62
- adapter: {
63
- config: {
64
- ignoreSiteDataPersonalization: true,
65
- siteDataUrl: '/cdm.json'
66
- }
67
- }
68
- },
69
- Personalization: {
70
- adapter: {
71
- module: 'sap.ushell.adapters.local.PersonalizationAdapter',
72
- config: {
73
- storageType: 'MEMORY'
74
- }
75
- }
76
- },
77
- PersonalizationV2: {
78
- adapter: {
79
- module: 'sap.ushell.adapters.local.PersonalizationAdapter',
80
- config: {
81
- storageType: 'MEMORY'
82
- }
58
+ }
59
+ },
60
+ CommonDataModel: {
61
+ adapter: {
62
+ config: {
63
+ ignoreSiteDataPersonalization: true,
64
+ siteDataUrl: `${basePath}/cdm.json`
83
65
  }
84
- },
85
- AppState: {
86
- adapter: {
87
- module: 'sap.ushell.adapters.local.AppStateAdapter'
88
- },
66
+ }
67
+ },
68
+ Personalization: {
69
+ adapter: {
70
+ module: 'sap.ushell.adapters.local.PersonalizationAdapter',
89
71
  config: {
90
- transient: true
72
+ storageType: 'MEMORY'
91
73
  }
92
- },
93
- NavTargetResolutionInternal: {
74
+ }
75
+ },
76
+ PersonalizationV2: {
77
+ adapter: {
78
+ module: 'sap.ushell.adapters.local.PersonalizationAdapter',
94
79
  config: {
95
- allowTestUrlComponentConfig: false,
96
- enableClientSideTargetResolution: true
97
- },
98
- adapter: {
99
- module: 'sap.ushell.adapters.local.NavTargetResolutionInternalAdapter'
80
+ storageType: 'MEMORY'
100
81
  }
82
+ }
83
+ },
84
+ AppState: {
85
+ adapter: {
86
+ module: 'sap.ushell.adapters.local.AppStateAdapter'
101
87
  },
102
- UserInfo: {
103
- adapter: {
104
- module: 'sap.ushell.adapters.local.UserInfoAdapter'
105
- }
88
+ config: {
89
+ transient: true
90
+ }
91
+ },
92
+ NavTargetResolutionInternal: {
93
+ config: {
94
+ allowTestUrlComponentConfig: false,
95
+ enableClientSideTargetResolution: true
106
96
  },
107
- FlpLaunchPage: {
108
- adapter: {
109
- module: 'sap.ushell.adapters.cdm.v3.FlpLaunchPageAdapter'
110
- }
97
+ adapter: {
98
+ module: 'sap.ushell.adapters.local.NavTargetResolutionInternalAdapter'
99
+ }
100
+ },
101
+ UserInfo: {
102
+ adapter: {
103
+ module: 'sap.ushell.adapters.local.UserInfoAdapter'
104
+ }
105
+ },
106
+ FlpLaunchPage: {
107
+ adapter: {
108
+ module: 'sap.ushell.adapters.cdm.v3.FlpLaunchPageAdapter'
111
109
  }
112
110
  }
113
- };
114
- }
115
- return initCdm;
116
- });
111
+ }
112
+ };
113
+ })();
117
114
  //# sourceMappingURL=initCdm.js.map
@@ -5,7 +5,10 @@ import type { Window } from 'types/global';
5
5
  *
6
6
  * @returns {void}
7
7
  */
8
- export default function initCdm(): void {
8
+ ((): void => {
9
+ const initScript = document.getElementById('init-cdm');
10
+ const basePath = initScript?.dataset.basePath ?? '';
11
+
9
12
  (window as unknown as Window)['sap-ushell-config'] = {
10
13
  defaultRenderer: 'fiori2',
11
14
  renderers: {
@@ -32,7 +35,7 @@ export default function initCdm(): void {
32
35
  homeApp: {
33
36
  component: {
34
37
  name: 'open.ux.preview.client.flp.homepage',
35
- url: '/preview/client/flp/homepage'
38
+ url: `${basePath}/preview/client/flp/homepage`
36
39
  }
37
40
  }
38
41
  },
@@ -59,7 +62,7 @@ export default function initCdm(): void {
59
62
  adapter: {
60
63
  config: {
61
64
  ignoreSiteDataPersonalization: true,
62
- siteDataUrl: '/cdm.json'
65
+ siteDataUrl: `${basePath}/cdm.json`
63
66
  }
64
67
  }
65
68
  },
@@ -108,4 +111,4 @@ export default function initCdm(): void {
108
111
  }
109
112
  }
110
113
  };
111
- }
114
+ })();
@@ -248,6 +248,19 @@ export interface I18nEntry {
248
248
  annotation?: string;
249
249
  }
250
250
  export interface CardManifest {
251
+ 'sap.card'?: {
252
+ type?: string;
253
+ header?: Record<string, unknown>;
254
+ data?: {
255
+ request?: {
256
+ url: string;
257
+ };
258
+ };
259
+ configuration?: {
260
+ parameters?: Record<string, Record<string, unknown>>;
261
+ };
262
+ [key: string]: unknown;
263
+ };
251
264
  'sap.insights': {
252
265
  versions?: {
253
266
  dtpMiddleware?: string;
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.9",
12
+ "version": "0.25.12",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,17 +27,17 @@
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.106",
30
+ "@sap-ux/adp-tooling": "0.18.107",
31
31
  "@sap-ux/btp-utils": "1.1.12",
32
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.22",
33
- "@sap-ux/feature-toggle": "0.3.7",
34
- "@sap-ux/logger": "0.8.3",
32
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.23",
33
+ "@sap-ux/feature-toggle": "0.3.8",
34
+ "@sap-ux/logger": "0.8.4",
35
35
  "@sap-ux/project-access": "1.35.17",
36
- "@sap-ux/system-access": "0.7.3",
36
+ "@sap-ux/system-access": "0.7.4",
37
37
  "@sap-ux/i18n": "0.3.10"
38
38
  },
39
39
  "devDependencies": {
40
- "@sap-ux-private/playwright": "0.2.13",
40
+ "@sap-ux-private/playwright": "0.2.14",
41
41
  "@types/connect": "^3.4.38",
42
42
  "@types/qrcode": "1.5.6",
43
43
  "@types/ejs": "3.1.5",
@@ -53,10 +53,10 @@
53
53
  "nock": "14.0.11",
54
54
  "npm-run-all2": "8.0.4",
55
55
  "supertest": "7.2.2",
56
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.19.1",
57
- "@sap-ux/axios-extension": "1.25.27",
58
- "@sap-ux/store": "1.5.11",
59
- "@sap-ux/ui5-info": "0.13.16"
56
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.25.12",
57
+ "@sap-ux/axios-extension": "1.25.28",
58
+ "@sap-ux/store": "1.5.12",
59
+ "@sap-ux/ui5-info": "0.13.17"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "express": "4"
@@ -24,6 +24,9 @@
24
24
  for productive scenarios.
25
25
  -->
26
26
 
27
+ <!-- Initialize CDM -->
28
+ <script src="<%- basePath %>/preview/client/flp/initCdm.js" id="init-cdm" data-base-path="<%- basePath %>"></script>
29
+
27
30
  <!-- Bootstrap the UI5 core library. 'data-sap-ui-frameOptions="allow"' is a NON-SECURE setting for test environments -->
28
31
  <script id="sap-ui-bootstrap"
29
32
  src="<%- basePath %>/resources/sap-ui-core.js"