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 51389833aa3..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,10 +110,7 @@ export const MenuCell = ({ icon="main-trash" text={getString('deleteExperiment')} onClick={openDeleteDialog} - disabled={ - lastExperimentRunStatus === ExperimentRunStatus.RUNNING || - lastExperimentRunStatus === ExperimentRunStatus.QUEUED - } + disabled={isDeleteButtonEnabled == false} permission={PermissionGroup.OWNER} />