@sap-ux/preview-middleware 0.20.24 → 0.20.27

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.
@@ -24,8 +24,10 @@ sap.ui.define([
24
24
  if (addExtensionPoint.match(action)) {
25
25
  try {
26
26
  const {controlId, name} = action.payload;
27
+ const suffix = `--${ name }`;
28
+ const baseControlId = controlId.endsWith(suffix) ? controlId.slice(0, -suffix.length) : controlId;
27
29
  const service = await this.rta.getService('action');
28
- service.execute(controlId, this.actionId);
30
+ service.execute(baseControlId, this.actionId);
29
31
  this.selectedExtensionPointName = name;
30
32
  } catch (e) {
31
33
  throw new Error(`Failed to execute service with actionId: ${ this.actionId }`);
@@ -58,9 +58,11 @@ export default class ExtensionPointService {
58
58
  try {
59
59
  const { controlId, name } = action.payload;
60
60
 
61
+ const suffix = `--${name}`;
62
+ const baseControlId = controlId.endsWith(suffix) ? controlId.slice(0, -suffix.length) : controlId;
61
63
  const service = await this.rta.getService<ActionService>('action');
62
64
 
63
- service.execute(controlId, this.actionId);
65
+ service.execute(baseControlId, this.actionId);
64
66
  this.selectedExtensionPointName = name;
65
67
  } catch (e) {
66
68
  throw new Error(`Failed to execute service with actionId: ${this.actionId}`);
@@ -153,7 +153,7 @@ sap.ui.define(["sap/base/Log", "../../utils/core", "../../utils/error", "../util
153
153
  addChildToExtensionPoint(id, children, changeService);
154
154
  });
155
155
  const node = {
156
- controlId: current.id,
156
+ controlId: `${current.id}--${current.name ?? ''}`,
157
157
  controlType: current.technicalName,
158
158
  name: current.name ?? '',
159
159
  editable,
@@ -153,20 +153,8 @@ export async function transformNodes(
153
153
  const technicalName = current.technicalName.split('.').slice(-1)[0];
154
154
 
155
155
  const transformedChildren = isAdp
156
- ? await handleDuplicateNodes(
157
- children,
158
- scenario,
159
- controlIndex,
160
- changeService,
161
- propertyIdMap
162
- )
163
- : await transformNodes(
164
- children,
165
- scenario,
166
- controlIndex,
167
- changeService,
168
- propertyIdMap
169
- );
156
+ ? await handleDuplicateNodes(children, scenario, controlIndex, changeService, propertyIdMap)
157
+ : await transformNodes(children, scenario, controlIndex, changeService, propertyIdMap);
170
158
  const node: OutlineNode = {
171
159
  controlId: current.id,
172
160
  controlType: current.technicalName,
@@ -192,7 +180,7 @@ export async function transformNodes(
192
180
  });
193
181
 
194
182
  const node: OutlineNode = {
195
- controlId: current.id,
183
+ controlId: `${current.id}--${current.name ?? ''}`,
196
184
  controlType: current.technicalName,
197
185
  name: current.name ?? '',
198
186
  editable,
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.24",
12
+ "version": "0.20.27",
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.15",
28
+ "@sap-ux/adp-tooling": "0.14.17",
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.5",
52
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.14.6",
53
53
  "@sap-ux/axios-extension": "1.21.2",
54
54
  "@sap-ux/i18n": "0.3.0",
55
55
  "@sap-ux/store": "1.1.0",