@sap-ux/preview-middleware 1.0.21 → 1.0.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.
@@ -157,9 +157,10 @@ export declare function remapResourcesForPath(config: TemplateConfig, newPagePat
157
157
  * @param config FLP configuration
158
158
  * @param manifest application manifest
159
159
  * @param resources additional resources
160
+ * @param isAdp whether this is an adaptation project
160
161
  * @returns configuration object for the sandbox.html template
161
162
  */
162
- export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Partial<Manifest>, resources?: Record<string, string>): TemplateConfig;
163
+ export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Partial<Manifest>, resources?: Record<string, string>, isAdp?: boolean): TemplateConfig;
163
164
  /**
164
165
  * Creates the configuration object for the test template.
165
166
  *
@@ -164,12 +164,13 @@ export function sanitizeRtaConfig(deprecatedRtaConfig, logger) {
164
164
  /**
165
165
  * Retrieves the configuration settings for UI5 flexibility services.
166
166
  *
167
+ * @param isAdp whether this is an adaptation project - LocalStorageConnector is omitted for ADP
167
168
  * @returns An array of flexibility service configurations, each specifying a connector
168
169
  * and its options, such as the layers it applies to and its service URL, if applicable.
169
170
  */
170
- function getFlexSettings() {
171
+ function getFlexSettings(isAdp = false) {
171
172
  const localConnectorPath = 'open/ux/preview/client/flp/WorkspaceConnector';
172
- return [
173
+ const connectors = [
173
174
  { connector: 'LrepConnector', layers: [], url: '/sap/bc/lrep' },
174
175
  {
175
176
  applyConnector: localConnectorPath,
@@ -177,6 +178,10 @@ function getFlexSettings() {
177
178
  custom: true
178
179
  }
179
180
  ];
181
+ if (!isAdp) {
182
+ connectors.push({ connector: 'LocalStorageConnector', layers: ['CUSTOMER', 'USER'] });
183
+ }
184
+ return connectors;
180
185
  }
181
186
  /**
182
187
  * Add an application to the local FLP preview.
@@ -278,10 +283,11 @@ export function remapResourcesForPath(config, newPagePath, appId) {
278
283
  * @param config FLP configuration
279
284
  * @param manifest application manifest
280
285
  * @param resources additional resources
286
+ * @param isAdp whether this is an adaptation project
281
287
  * @returns configuration object for the sandbox.html template
282
288
  */
283
- export function createFlpTemplateConfig(config, manifest, resources = {}) {
284
- const flex = getFlexSettings();
289
+ export function createFlpTemplateConfig(config, manifest, resources = {}, isAdp = false) {
290
+ const flex = getFlexSettings(isAdp);
285
291
  const supportedThemes = manifest['sap.ui5']?.supportedThemes ?? [DEFAULT_THEME];
286
292
  const ui5Theme = config.theme ?? (supportedThemes.includes(DEFAULT_THEME) ? DEFAULT_THEME : supportedThemes[0]);
287
293
  const id = manifest['sap.app']?.id ?? '';
package/dist/base/flp.js CHANGED
@@ -80,7 +80,7 @@ export class FlpSandbox {
80
80
  this.createFlexHandler();
81
81
  this.flpConfig.libs ??= await this.hasLocateReuseLibsScript();
82
82
  const id = manifest['sap.app']?.id ?? '';
83
- this.templateConfig = createFlpTemplateConfig(this.flpConfig, manifest, resources);
83
+ this.templateConfig = createFlpTemplateConfig(this.flpConfig, manifest, resources, adp !== undefined);
84
84
  this.adp = adp;
85
85
  this.manifest = manifest;
86
86
  await addApp(this.templateConfig, manifest, {
@@ -226,7 +226,7 @@ export class FlpSandbox {
226
226
  * @returns Promise that resolves when the application dependencies are set
227
227
  */
228
228
  async setApplicationDependencies() {
229
- if (this.adp) {
229
+ if (this.adp && !this.adp.isCloudFoundry) {
230
230
  await this.adp.sync();
231
231
  const appName = getAppName(this.manifest, this.flpConfig.intent);
232
232
  this.templateConfig.apps[appName].applicationDependencies = this.adp.descriptor;
@@ -954,7 +954,7 @@ export class FlpSandbox {
954
954
  if ('cfBuildPath' in config) {
955
955
  const manifest = this.setupCfBuildMode(config.cfBuildPath);
956
956
  configureRta(this.rta, layer, variant.id, false, true);
957
- await this.init(manifest, variant.reference);
957
+ await this.init(manifest, variant.reference, {}, adp);
958
958
  await this.setupAdpCommonHandlers(adp);
959
959
  return;
960
960
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
12
12
  },
13
- "version": "1.0.21",
13
+ "version": "1.0.22",
14
14
  "license": "Apache-2.0",
15
15
  "author": "@SAP/ux-tools-team",
16
16
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "mem-fs-editor": "9.4.0",
29
29
  "qrcode": "1.5.4",
30
30
  "@sap/bas-sdk": "3.13.7",
31
- "@sap-ux/adp-tooling": "1.0.15",
31
+ "@sap-ux/adp-tooling": "1.0.16",
32
32
  "@sap-ux/btp-utils": "2.0.2",
33
33
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@1.0.5",
34
34
  "@sap-ux/feature-toggle": "1.0.2",
@@ -54,7 +54,7 @@
54
54
  "nock": "14.0.11",
55
55
  "npm-run-all2": "8.0.4",
56
56
  "supertest": "7.2.2",
57
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.21",
57
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.22",
58
58
  "@sap-ux-private/playwright": "1.0.2",
59
59
  "@sap-ux/axios-extension": "2.0.3",
60
60
  "@sap-ux/store": "2.0.1",