From 1fd1b5a2471f0a0c34df84c65e1595de155510f8 Mon Sep 17 00:00:00 2001 From: Baalekshan <69910615+Baalekshan@users.noreply.github.com> Date: Sat, 31 Aug 2024 12:46:46 +0000 Subject: [PATCH] Support for delete/abort when experiment is stuck in Queued state Signed-off-by: Baalekshan <69910615+Baalekshan@users.noreply.github.com> --- .../ExperimentDashboardV2/ExperimentDashboardV2Table.tsx | 4 ++-- .../ExperimentDashboardV2TableMenu.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2Table.tsx b/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2Table.tsx index 92eb81be5fb..3f0877d832f 100644 --- a/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2Table.tsx +++ b/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2Table.tsx @@ -215,10 +215,10 @@ const ExperimentDashboardV2Table = ({ ); case ExperimentRunStatus.QUEUED: return ( - ); default: diff --git a/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2TableMenu.tsx b/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2TableMenu.tsx index 4889b174316..48385401474 100644 --- a/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2TableMenu.tsx +++ b/chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2TableMenu.tsx @@ -33,7 +33,9 @@ export const MenuCell = ({ onError: error => showError(error.message) }); - const lastExperimentRunStatus = data.recentExecutions[0]?.experimentRunStatus; + const isDeleteButtonEnabled = !data.recentExecutions.some( + execution => execution?.experimentRunStatus === ExperimentRunStatus.RUNNING + ); // const confirmationDialogProps = { @@ -108,7 +110,7 @@ export const MenuCell = ({ icon="main-trash" text={getString('deleteExperiment')} onClick={openDeleteDialog} - disabled={lastExperimentRunStatus === ExperimentRunStatus.RUNNING} + disabled={isDeleteButtonEnabled == false} permission={PermissionGroup.OWNER} />