@sap-ux/ui5-test-writer 0.7.93 → 0.7.95

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.
@@ -255,7 +255,11 @@ function extractAllActionStates(dataFieldForActions, metadata, entityTypeName) {
255
255
  function buildActionButtonState(item, metadata, entityTypeName) {
256
256
  const actionMethod = extractActionMethodName(item.Action || '');
257
257
  const operationAvailable = findOperationAvailableAnnotation(metadata, entityTypeName, actionMethod);
258
- const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable);
258
+ // Bound actions whose binding parameter is a single entity (not a collection) require
259
+ // row selection to be invoked, so they are disabled by default (no row selected).
260
+ // Collection-bound actions operate on the entity set and are always enabled.
261
+ const isEntityBound = item.ActionTarget?.isBound === true && item.ActionTarget?.parameters?.[0]?.isCollection !== true;
262
+ const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable, isEntityBound);
259
263
  return {
260
264
  label: item.Label || '',
261
265
  action: item.Action || '',
@@ -267,13 +271,15 @@ function buildActionButtonState(item, metadata, entityTypeName) {
267
271
  }
268
272
  /**
269
273
  * Analyzes Core.OperationAvailable annotation to determine action availability.
274
+ * Single-entity bound actions (requiring row selection) are disabled by default when no annotation is present.
270
275
  *
271
276
  * @param operationAvailable The OperationAvailable annotation value
277
+ * @param isEntityBound Whether the action is bound to a single entity (requires row selection to enable)
272
278
  * @returns Object containing enabled state and optional dynamic path
273
279
  */
274
- function analyzeOperationAvailability(operationAvailable) {
280
+ function analyzeOperationAvailability(operationAvailable, isEntityBound) {
275
281
  if (operationAvailable === undefined) {
276
- return { enabled: true };
282
+ return { enabled: !isEntityBound };
277
283
  }
278
284
  if (typeof operationAvailable === 'boolean') {
279
285
  return { enabled: operationAvailable };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-test-writer",
3
3
  "description": "SAP UI5 tests writer",
4
- "version": "0.7.93",
4
+ "version": "0.7.95",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -29,7 +29,7 @@
29
29
  "@sap-ux/annotation-converter": "0.10.21",
30
30
  "@sap-ux/ui5-application-writer": "1.8.2",
31
31
  "@sap-ux/logger": "0.8.3",
32
- "@sap-ux/project-access": "1.35.16"
32
+ "@sap-ux/project-access": "1.35.17"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/ejs": "3.1.5",