Repository: kestra-io/kestra
Issue: Mass actions UI - various issues
Labels: bug

### Expected Behavior

The new mass actions UI elements should work just fine.

### Actual Behaviour

* The 'select all' button doesn't actually select the table rows.
* Hitting the alert's cancel button spits an error.
* The 'kill' error response spits an error.

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version:
- Operating System (OS / Docker / Kubernetes):
- Java Version (If not docker):


### Example flow

_No response_

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/ui/src/components/executions/Executions.vue b/ui/src/components/executions/Executions.vue
index 2ba58dd3f3..80acbca251 100644
--- a/ui/src/components/executions/Executions.vue
+++ b/ui/src/components/executions/Executions.vue
@@ -116,19 +116,19 @@
 
         <bottom-line v-if="executionsSelection.length !== 0 && (canUpdate || canDelete)">
             <ul>
-                <bottom-line-counter v-model="queryBulkAction" :selections="executionsSelection" :total="total" />
+                <bottom-line-counter v-model="queryBulkAction" :selections="executionsSelection" :total="total" @update:model-value="selectAll()" />
                 <li v-if="canUpdate">
-                    <el-button :icon="Restart" type="success" class="bulk-button" @click="this.restartExecutions()">
+                    <el-button :icon="Restart" type="success" class="bulk-button" @click="restartExecutions()">
                         {{ $t('restart') }}
                     </el-button>
                 </li>
                 <li v-if="canUpdate">
-                    <el-button :icon="StopCircleOutline" type="warning" class="bulk-button" @click="this.killExecutions()">
+                    <el-button :icon="StopCircleOutline" type="warning" class="bulk-button" @click="killExecutions()">
                         {{ $t('kill') }}
                     </el-button>
                 </li>
                 <li v-if="canDelete">
-                    <el-button :icon="Delete" type="danger" class="bulk-button" @click="this.deleteExecutions()">
+                    <el-button :icon="Delete" type="danger" class="bulk-button" @click="deleteExecutions()">
                         {{ $t('delete') }}
                     </el-button>
                 </li>
@@ -243,6 +243,9 @@
                 }
                 this.executionsSelection = val.map(x => x.id);
             },
+            selectAll() {
+                this.$refs.table.toggleAllSelection();
+            },
             isRunning(item){
                 return State.isRunning(item.state.current);
             },
@@ -312,7 +315,8 @@
                                     return {message: this.$t(exec.message, {executionId: exec.invalidValue})}
                                 }), this.$t(e.message)))
                         }
-                    }
+                    },
+                    () => {}
                 )
             },
             deleteExecutions() {
@@ -339,7 +343,8 @@
                                     return {message: this.$t(exec.message, {executionId: exec.invalidValue})}
                                 }), this.$t(e.message)))
                         }
-                    }
+                    },
+                    () => {}
                 )
             },
             killExecutions() {
@@ -366,7 +371,8 @@
                                     return {message: this.$t(exec.message, {executionId: exec.invalidValue})}
                                 }), this.$t(e.message)))
                         }
-                    }
+                    },
+                    () => {}
                 )
             },
         }
diff --git a/ui/src/utils/axios.js b/ui/src/utils/axios.js
index b7175e0e25..e1b933508f 100644
--- a/ui/src/utils/axios.js
+++ b/ui/src/utils/axios.js
@@ -112,8 +112,7 @@ export default (callback, store, router) => {
 
                 return Promise.reject(errorResponse);
             }
-            if (errorResponse.response.status === 422
-                && ["invalid bulk kill","invalid bulk delete","invalid bulk restart"].includes(errorResponse.response.data.message)){
+            if (errorResponse.response.status === 400){
                 return Promise.reject(errorResponse.response.data)
             }
 
diff --git a/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java b/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java
index 852f06280f..6eee14b0b1 100644
--- a/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java
+++ b/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java
@@ -306,7 +306,7 @@ public MutableHttpResponse<?> deleteByIds(
             }
         }
         if (invalids.size() > 0) {
-            return HttpResponse.unprocessableEntity()
+            return HttpResponse.badRequest()
                 .body(BulkErrorResponse
                     .builder()
                     .message("invalid bulk delete")
@@ -635,8 +635,7 @@ public MutableHttpResponse<?> restartByIds(
             }
         }
         if (invalids.size() > 0) {
-                return HttpResponse.unprocessableEntity()
-                    .body(BulkErrorResponse
+                return HttpResponse.badRequest(BulkErrorResponse
                         .builder()
                         .message("invalid bulk restart")
                         .invalids(invalids)
@@ -792,7 +791,7 @@ public MutableHttpResponse<?> killByIds(
             Optional<Execution> execution = executionRepository.findById(executionId);
             if (execution.isPresent() && execution.get().getState().isTerninated()) {
                 invalids.add(ManualConstraintViolation.of(
-                    "Execution already finished",
+                    "execution already finished",
                     executionId,
                     String.class,
                     "execution",
@@ -800,7 +799,7 @@ public MutableHttpResponse<?> killByIds(
                 ));
             } else if (execution.isEmpty()) {
                 invalids.add(ManualConstraintViolation.of(
-                    "Execution not found",
+                    "execution not found",
                     executionId,
                     String.class,
                     "execution",
@@ -812,10 +811,9 @@ public MutableHttpResponse<?> killByIds(
         }
 
         if (invalids.size() > 0) {
-            return HttpResponse.unprocessableEntity()
-                .body(BulkErrorResponse
+            return HttpResponse.badRequest(BulkErrorResponse
                     .builder()
-                    .message("Invalid bulk kill")
+                    .message("invalid bulk kill")
                     .invalids(invalids)
                     .build()
                 );


Test patch: