@sap-ux/preview-middleware 0.16.124 → 0.16.125

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/ui/core/Fragment", "sap/ui/fl/Utils", "./controllers/AddFragment.controller", "./controllers/ControllerExtension.controller", "./controllers/ExtensionPoint.controller", "../cpe/utils", "../i18n", "./controllers/AddTableColumnFragments.controller"], function (Fragment, FlUtils, __AddFragment, __ControllerExtension, __ExtensionPoint, ___cpe_utils, ___i18n, __AddTableColumnFragments) {
3
+ sap.ui.define(["sap/ui/core/Fragment", "sap/ui/rta/util/hasStableId", "sap/ui/fl/Utils", "./controllers/AddFragment.controller", "./controllers/ControllerExtension.controller", "./controllers/ExtensionPoint.controller", "../cpe/utils", "../i18n", "./controllers/AddTableColumnFragments.controller"], function (Fragment, hasStableId, FlUtils, __AddFragment, __ControllerExtension, __ExtensionPoint, ___cpe_utils, ___i18n, __AddTableColumnFragments) {
4
4
  "use strict";
5
5
 
6
6
  function _interopRequireDefault(obj) {
@@ -62,16 +62,7 @@ sap.ui.define(["sap/ui/core/Fragment", "sap/ui/fl/Utils", "./controllers/AddFrag
62
62
  return false;
63
63
  }
64
64
  const control = overlays[0].getElement();
65
- return hasStableId(control) && !isReuseComponent(control.getId(), ui5VersionInfo);
66
- };
67
-
68
- /**
69
- * Determines whether control has stable id
70
- * @param {ManagedObject} control - ManagedObject object representing the UI control.
71
- * @returns {boolean} True if control has stable Id, false otherwise
72
- */
73
- const hasStableId = control => {
74
- return FlUtils.checkControlId(control);
65
+ return hasStableId(overlays[0]) && !isReuseComponent(control.getId(), ui5VersionInfo);
75
66
  };
76
67
 
77
68
  /**
@@ -81,8 +72,7 @@ sap.ui.define(["sap/ui/core/Fragment", "sap/ui/fl/Utils", "./controllers/AddFrag
81
72
  * @returns {string} The text of the Add Fragment context menu item.
82
73
  */
83
74
  const getAddFragmentItemText = overlay => {
84
- const control = overlay.getElement();
85
- if (control && !hasStableId(control)) {
75
+ if (!hasStableId(overlay)) {
86
76
  return 'Add: Fragment (Unavailable due to unstable ID of the control or its parent control)';
87
77
  }
88
78
  return 'Add: Fragment';
@@ -7,6 +7,7 @@ import UI5Element from 'sap/ui/core/Element';
7
7
 
8
8
  /** sap.ui.rta */
9
9
  import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
10
+ import hasStableId from 'sap/ui/rta/util/hasStableId';
10
11
 
11
12
  /** sap.ui.fl */
12
13
  import FlUtils from 'sap/ui/fl/Utils';
@@ -87,16 +88,7 @@ export const isFragmentCommandEnabled = (overlays: ElementOverlay[], ui5VersionI
87
88
 
88
89
  const control = overlays[0].getElement();
89
90
 
90
- return hasStableId(control) && !isReuseComponent(control.getId(), ui5VersionInfo);
91
- };
92
-
93
- /**
94
- * Determines whether control has stable id
95
- * @param {ManagedObject} control - ManagedObject object representing the UI control.
96
- * @returns {boolean} True if control has stable Id, false otherwise
97
- */
98
- const hasStableId = (control: ManagedObject): boolean => {
99
- return FlUtils.checkControlId(control);
91
+ return hasStableId(overlays[0]) && !isReuseComponent(control.getId(), ui5VersionInfo);
100
92
  };
101
93
 
102
94
  /**
@@ -106,8 +98,7 @@ const hasStableId = (control: ManagedObject): boolean => {
106
98
  * @returns {string} The text of the Add Fragment context menu item.
107
99
  */
108
100
  export const getAddFragmentItemText = (overlay: ElementOverlay) => {
109
- const control = overlay.getElement();
110
- if (control && !hasStableId(control)) {
101
+ if (!hasStableId(overlay)) {
111
102
  return 'Add: Fragment (Unavailable due to unstable ID of the control or its parent control)';
112
103
  }
113
104
 
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.16.124",
12
+ "version": "0.16.125",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,9 +27,9 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "@sap-ux/logger": "0.6.0",
29
29
  "@sap-ux/feature-toggle": "0.2.2",
30
+ "@sap-ux/adp-tooling": "0.12.81",
30
31
  "@sap-ux/btp-utils": "0.17.0",
31
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.26",
32
- "@sap-ux/adp-tooling": "0.12.81",
33
33
  "@sap-ux/project-access": "1.28.7"
34
34
  },
35
35
  "devDependencies": {
@@ -46,11 +46,11 @@
46
46
  "supertest": "6.3.3",
47
47
  "@sap-ux-private/playwright": "0.1.0",
48
48
  "dotenv": "16.3.1",
49
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.33",
49
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.34",
50
50
  "@sap-ux/axios-extension": "1.17.4",
51
51
  "@sap-ux/ui5-info": "0.8.3",
52
- "@sap-ux/i18n": "0.2.0",
53
- "@sap-ux/store": "0.9.3"
52
+ "@sap-ux/store": "0.9.3",
53
+ "@sap-ux/i18n": "0.2.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "express": "4"