@sap-ux/preview-middleware 0.11.6 → 0.11.7

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.
Files changed (2) hide show
  1. package/dist/base/flp.js +7 -3
  2. package/package.json +3 -3
package/dist/base/flp.js CHANGED
@@ -165,11 +165,15 @@ class FlpSandbox {
165
165
  previewUrl = `${previewUrl}.inner.html`;
166
166
  (_a = editor.pluginScript) !== null && _a !== void 0 ? _a : (editor.pluginScript = 'open/ux/preview/client/cpe/init');
167
167
  this.router.get(editor.path, (_req, res) => {
168
- var _a, _b;
168
+ var _a, _b, _c;
169
+ let templatePreviewUrl = `${previewUrl}?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=forAdaptation&sap-ui-rta-skip-flex-validation=true&sap-ui-xx-condense-changes=true#${this.config.intent.object}-${this.config.intent.action}`;
170
+ if (((_a = rta.options) === null || _a === void 0 ? void 0 : _a.scenario) === 'ADAPTATION_PROJECT') {
171
+ templatePreviewUrl = templatePreviewUrl.replace('?', `?sap-ui-layer=${rta.layer}&`);
172
+ }
169
173
  const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../templates/flp/editor.html'), 'utf-8');
170
174
  const html = (0, ejs_1.render)(template, {
171
- previewUrl: `${previewUrl}?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=forAdaptation&sap-ui-rta-skip-flex-validation=true&sap-ui-xx-condense-changes=true#${this.config.intent.object}-${this.config.intent.action}`,
172
- telemetry: (_b = (_a = rta.options) === null || _a === void 0 ? void 0 : _a.telemetry) !== null && _b !== void 0 ? _b : false
175
+ previewUrl: templatePreviewUrl,
176
+ telemetry: (_c = (_b = rta.options) === null || _b === void 0 ? void 0 : _b.telemetry) !== null && _c !== void 0 ? _c : false
173
177
  });
174
178
  res.status(200).contentType('html').send(html);
175
179
  });
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.11.6",
12
+ "version": "0.11.7",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "ejs": "3.1.9",
26
26
  "@sap-ux/logger": "0.4.0",
27
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.4",
28
- "@sap-ux/adp-tooling": "0.7.1"
27
+ "@sap-ux/adp-tooling": "0.7.1",
28
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.4"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/ejs": "3.1.2",