Skip to content

Commit c8e145c

Browse files
authored
Support for delete/abort when experiment is stuck in Queued state (#4856)
* Support for delete/abort when experiment is stuck in Queued state Signed-off-by: Baalekshan <[email protected]> * Support for delete/abort when experiment is stuck in Queued state Signed-off-by: Baalekshan <[email protected]> --------- Signed-off-by: Baalekshan <[email protected]> Signed-off-by: Baalekshan <[email protected]>
1 parent 29e7130 commit c8e145c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2Table.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ const ExperimentDashboardV2Table = ({
215215
);
216216
case ExperimentRunStatus.QUEUED:
217217
return (
218-
<RunExperimentButton
219-
buttonProps={{ disabled: true }}
218+
<StopExperimentButton
220219
experimentID={data.experimentID}
221220
refetchExperiments={refetchExperiments}
221+
infrastructureType={InfrastructureType.KUBERNETES}
222222
/>
223223
);
224224
default:

chaoscenter/web/src/views/ExperimentDashboardV2/ExperimentDashboardV2TableMenu.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export const MenuCell = ({
3333
onError: error => showError(error.message)
3434
});
3535

36-
const lastExperimentRunStatus = data.recentExecutions[0]?.experimentRunStatus;
36+
const isDeleteButtonEnabled = !data.recentExecutions.some(
37+
execution => execution?.experimentRunStatus === ExperimentRunStatus.RUNNING
38+
);
3739

3840
// <!-- confirmation dialog boxes -->
3941
const confirmationDialogProps = {
@@ -108,10 +110,7 @@ export const MenuCell = ({
108110
icon="main-trash"
109111
text={getString('deleteExperiment')}
110112
onClick={openDeleteDialog}
111-
disabled={
112-
lastExperimentRunStatus === ExperimentRunStatus.RUNNING ||
113-
lastExperimentRunStatus === ExperimentRunStatus.QUEUED
114-
}
113+
disabled={isDeleteButtonEnabled == false}
115114
permission={PermissionGroup.OWNER}
116115
/>
117116
</Menu>

0 commit comments

Comments
 (0)