@sap-ux/preview-middleware 0.11.21 → 0.11.23

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.
package/dist/base/flp.js CHANGED
@@ -135,20 +135,22 @@ class FlpSandbox {
135
135
  },
136
136
  locateReuseLibsScript: (_e = this.config.libs) !== null && _e !== void 0 ? _e : (yield this.hasLocateReuseLibsScript())
137
137
  };
138
+ const id = manifest['sap.app'].id;
138
139
  this.addApp(manifest, {
139
140
  componentId,
140
- target: (_f = resources[componentId !== null && componentId !== void 0 ? componentId : manifest['sap.app'].id]) !== null && _f !== void 0 ? _f : this.templateConfig.basePath,
141
+ target: (_f = resources[componentId !== null && componentId !== void 0 ? componentId : id]) !== null && _f !== void 0 ? _f : this.templateConfig.basePath,
141
142
  local: '.',
142
143
  intent: this.config.intent
143
144
  });
144
145
  this.addStandardRoutes();
145
146
  if (this.rta) {
146
147
  (_g = (_h = this.rta).options) !== null && _g !== void 0 ? _g : (_h.options = {});
147
- this.rta.options.baseId = componentId !== null && componentId !== void 0 ? componentId : manifest['sap.app'].id;
148
+ this.rta.options.baseId = componentId !== null && componentId !== void 0 ? componentId : id;
149
+ this.rta.options.appName = id;
148
150
  this.addEditorRoutes(this.rta);
149
151
  }
150
152
  this.addRoutesForAdditionalApps();
151
- this.logger.info(`Initialized for app ${manifest['sap.app'].id}`);
153
+ this.logger.info(`Initialized for app ${id}`);
152
154
  this.logger.debug(`Configured apps: ${JSON.stringify(this.templateConfig.apps)}`);
153
155
  });
154
156
  }
@@ -192,15 +194,18 @@ class FlpSandbox {
192
194
  previewUrl = `${previewUrl}.inner.html`;
193
195
  (_a = editor.pluginScript) !== null && _a !== void 0 ? _a : (editor.pluginScript = 'open/ux/preview/client/cpe/init');
194
196
  this.router.get(editor.path, (_req, res) => {
195
- var _a, _b, _c;
197
+ var _a, _b, _c, _d;
198
+ const scenario = (_a = rta.options) === null || _a === void 0 ? void 0 : _a.scenario;
196
199
  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}`;
197
- if (((_a = rta.options) === null || _a === void 0 ? void 0 : _a.scenario) === 'ADAPTATION_PROJECT') {
200
+ if (scenario === 'ADAPTATION_PROJECT') {
198
201
  templatePreviewUrl = templatePreviewUrl.replace('?', `?sap-ui-layer=${rta.layer}&`);
199
202
  }
200
203
  const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../templates/flp/editor.html'), 'utf-8');
201
204
  const html = (0, ejs_1.render)(template, {
202
205
  previewUrl: templatePreviewUrl,
203
- telemetry: (_c = (_b = rta.options) === null || _b === void 0 ? void 0 : _b.telemetry) !== null && _c !== void 0 ? _c : false
206
+ telemetry: (_c = (_b = rta.options) === null || _b === void 0 ? void 0 : _b.telemetry) !== null && _c !== void 0 ? _c : false,
207
+ appName: (_d = rta.options) === null || _d === void 0 ? void 0 : _d.appName,
208
+ scenario
204
209
  });
205
210
  res.status(200).contentType('html').send(html);
206
211
  });
@@ -13,7 +13,6 @@ sap.ui.define([
13
13
  const startPostMessageCommunication = ___sap_ux_private_control_property_editor_common['startPostMessageCommunication'];
14
14
  const iconsLoaded = ___sap_ux_private_control_property_editor_common['iconsLoaded'];
15
15
  const enableTelemetry = ___sap_ux_private_control_property_editor_common['enableTelemetry'];
16
- const scenarioLoaded = ___sap_ux_private_control_property_editor_common['scenarioLoaded'];
17
16
  const initOutline = ___outline_index['initOutline'];
18
17
  const SelectionService = ___selection['SelectionService'];
19
18
  const ChangeService = ___changes_service['ChangeService'];
@@ -47,7 +46,6 @@ sap.ui.define([
47
46
  }
48
47
  }
49
48
  }, logger);
50
- sendAction(scenarioLoaded(flexSettings.scenario));
51
49
  for (const service of services) {
52
50
  service.init(sendAction, subscribe);
53
51
  }
@@ -2,8 +2,7 @@ import type { ExternalAction } from '@sap-ux-private/control-property-editor-com
2
2
  import {
3
3
  startPostMessageCommunication,
4
4
  iconsLoaded,
5
- enableTelemetry,
6
- scenarioLoaded
5
+ enableTelemetry
7
6
  } from '@sap-ux-private/control-property-editor-common';
8
7
  import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
9
8
 
@@ -54,8 +53,6 @@ export default function init(rta: RuntimeAuthoring): Promise<void> {
54
53
  logger
55
54
  );
56
55
 
57
- sendAction(scenarioLoaded(flexSettings.scenario));
58
-
59
56
  for (const service of services) {
60
57
  service.init(sendAction, subscribe);
61
58
  }
@@ -8,7 +8,7 @@ sap.ui.define((function () { 'use strict';
8
8
 
9
9
  (function (exports) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.scenarioLoaded = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.scenario = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
11
+ exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.scenario = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
12
12
  exports.BOOLEAN_VALUE_TYPE = 'boolean';
13
13
  exports.INTEGER_VALUE_TYPE = 'integer';
14
14
  exports.FLOAT_VALUE_TYPE = 'float';
@@ -62,7 +62,6 @@ sap.ui.define((function () { 'use strict';
62
62
  exports.EXTERNAL_ACTION_PREFIX = '[ext]';
63
63
  const createExternalAction = createActionFactory(exports.EXTERNAL_ACTION_PREFIX);
64
64
  exports.iconsLoaded = createExternalAction('icons-loaded');
65
- exports.scenarioLoaded = createExternalAction('scenario-loaded');
66
65
  exports.controlSelected = createExternalAction('control-selected');
67
66
  exports.selectControl = createExternalAction('select-control');
68
67
  exports.addExtensionPoint = createExternalAction('add-extension-point');
@@ -32,6 +32,7 @@ export interface RtaConfig {
32
32
  baseId?: string;
33
33
  projectId?: string;
34
34
  scenario?: string;
35
+ appName?: string;
35
36
  };
36
37
  editors: Editor[];
37
38
  }
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.21",
12
+ "version": "0.11.23",
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.9",
26
26
  "@sap-ux/logger": "0.4.0",
27
27
  "@sap-ux/adp-tooling": "0.7.2",
28
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.7"
28
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.9"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/ejs": "3.1.2",
@@ -34,11 +34,11 @@
34
34
  "@types/supertest": "2.0.12",
35
35
  "copyfiles": "2.4.1",
36
36
  "npm-run-all": "4.1.5",
37
- "nock": "13.2.1",
37
+ "nock": "13.4.0",
38
38
  "supertest": "6.3.3",
39
39
  "@sap-ux-private/playwright": "0.0.1",
40
40
  "dotenv": "16.3.1",
41
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.8.12",
41
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.8.13",
42
42
  "@sap-ux/project-access": "1.16.2",
43
43
  "@sap-ux/store": "0.4.0"
44
44
  },
@@ -5,9 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="theme-color" content="#000000" />
7
7
  <meta name="description" content="Web page for rendering SAP Fiori Tools Control Property Editor" />
8
- <link rel="shortcut icon" type="image/x-icon" href="./editor/favicon.ico" />
9
8
  <link rel="stylesheet" type="text/css" href="./editor/app.css" />
10
- <title>Control Property Editor</title>
9
+ <title>Editing <%- appName %></title>
11
10
  </head>
12
11
  <body>
13
12
  <noscript>You need to enable JavaScript to run this app.</noscript>
@@ -17,7 +16,8 @@
17
16
  start({
18
17
  previewUrl: '<%- previewUrl %>',
19
18
  telemetry: <%- telemetry %>,
20
- rootElementId: 'root'
19
+ rootElementId: 'root',
20
+ scenario: '<%- scenario %>'
21
21
  });
22
22
  </script>
23
23
  </body>