@sap-ux/ui5-test-writer 1.9.1 → 1.9.2
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/utils/actionUtils.js +12 -5
- package/package.json +5 -5
|
@@ -99,10 +99,14 @@ export function buildActionButtonState(item, metadata) {
|
|
|
99
99
|
const actionString = item.Action || '';
|
|
100
100
|
const actionMethod = extractActionMethodName(actionString);
|
|
101
101
|
const operationAvailable = findOperationAvailableAnnotation(metadata, actionMethod);
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
// A single-instance-bound action operates on one selected row, so it is disabled by default
|
|
103
|
+
// until a row is selected. A collection-bound action operates on the whole collection and is
|
|
104
|
+
// enabled without a selection. Both are bound (`unbound: false`), but only the single-instance
|
|
105
|
+
// case requires a selection.
|
|
106
|
+
const actionTarget = item.ActionTarget;
|
|
107
|
+
const isBound = actionTarget?.isBound === true;
|
|
108
|
+
const requiresSelection = isBound && actionTarget?.parameters?.[0]?.isCollection !== true;
|
|
109
|
+
const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable, requiresSelection);
|
|
106
110
|
return {
|
|
107
111
|
label: item.Label || '',
|
|
108
112
|
action: actionMethod,
|
|
@@ -134,9 +138,12 @@ export function buildActionStateFromSpecModelKey(aggregationKey, label, converte
|
|
|
134
138
|
const actionFullName = keyParts[1]; // "namespace.Method"
|
|
135
139
|
const actionMethod = extractActionMethodName(actionFullName);
|
|
136
140
|
const actionDefinition = convertedMetadata.actions?.find((action) => action.name === actionMethod || action.fullyQualifiedName?.includes(`.${actionMethod}(`));
|
|
141
|
+
// Single-instance-bound actions require a row selection (disabled by default); collection-bound
|
|
142
|
+
// actions operate on the whole collection and are enabled without a selection. Both are bound.
|
|
137
143
|
const isBound = actionDefinition?.isBound === true;
|
|
144
|
+
const requiresSelection = isBound && actionDefinition?.parameters?.[0]?.isCollection !== true;
|
|
138
145
|
const operationAvailable = findOperationAvailableAnnotation(convertedMetadata, actionMethod);
|
|
139
|
-
const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable,
|
|
146
|
+
const { enabled, dynamicPath } = analyzeOperationAvailability(operationAvailable, requiresSelection);
|
|
140
147
|
return {
|
|
141
148
|
label: label ?? '',
|
|
142
149
|
action: actionMethod,
|
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": "1.9.
|
|
4
|
+
"version": "1.9.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"@sap/ux-specification": "1.144.5",
|
|
29
29
|
"@sap-ux/edmx-parser": "0.10.0",
|
|
30
30
|
"@sap-ux/annotation-converter": "0.10.22",
|
|
31
|
-
"@sap-ux/ui5-application-writer": "2.1.
|
|
31
|
+
"@sap-ux/ui5-application-writer": "2.1.5",
|
|
32
32
|
"@sap-ux/logger": "1.0.3",
|
|
33
|
-
"@sap-ux/
|
|
34
|
-
"@sap-ux/preview-middleware": "1.2.
|
|
35
|
-
"@sap-ux/
|
|
33
|
+
"@sap-ux/project-access": "2.1.13",
|
|
34
|
+
"@sap-ux/preview-middleware": "1.2.5",
|
|
35
|
+
"@sap-ux/fiori-generator-shared": "1.2.10"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@jest/globals": "30.4.1",
|