From 95ad561aec5ec360448267b09d8d2238c98012e0 Mon Sep 17 00:00:00 2001 From: Simon Behar Date: Tue, 15 Jun 2021 14:39:03 -0700 Subject: [PATCH] feat(ui): Add checkbox to check all workflows in list. Fixes #6069 (#6158) --- .../workflows-list/workflows-list.tsx | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ui/src/app/workflows/components/workflows-list/workflows-list.tsx b/ui/src/app/workflows/components/workflows-list/workflows-list.tsx index b1f6f6c206e1..355a3a3b168f 100644 --- a/ui/src/app/workflows/components/workflows-list/workflows-list.tsx +++ b/ui/src/app/workflows/components/workflows-list/workflows-list.tsx @@ -267,7 +267,31 @@ export class WorkflowsList extends BasePage, State> { )}
-
+
+ { + e.stopPropagation(); + }} + onChange={e => { + if (this.state.workflows.length === this.state.selectedWorkflows.size) { + // All workflows are selected, deselect them all + this.updateCurrentlySelectedAndBatchActions(new Map()); + } else { + // Not all workflows are selected, select them all + const currentlySelected: Map = this.state.selectedWorkflows; + this.state.workflows.forEach(wf => { + if (!currentlySelected.has(wf.metadata.uid)) { + currentlySelected.set(wf.metadata.uid, wf); + } + }); + this.updateCurrentlySelectedAndBatchActions(currentlySelected); + } + }} + /> +
NAME
NAMESPACE