Skip to content

Commit

Permalink
Support for delete/abort when experiment is stuck in Queued state (#4856
Browse files Browse the repository at this point in the history
)

* Support for delete/abort when experiment is stuck in Queued state

Signed-off-by: Baalekshan <baalekshan@gmail.com>

* Support for delete/abort when experiment is stuck in Queued state

Signed-off-by: Baalekshan <69910615+Baalekshan@users.noreply.github.com>

---------

Signed-off-by: Baalekshan <baalekshan@gmail.com>
Signed-off-by: Baalekshan <69910615+Baalekshan@users.noreply.github.com>
  • Loading branch information
Baalekshan authored Oct 8, 2024
1 parent 29e7130 commit c8e145c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ const ExperimentDashboardV2Table = ({
);
case ExperimentRunStatus.QUEUED:
return (
<RunExperimentButton
buttonProps={{ disabled: true }}
<StopExperimentButton
experimentID={data.experimentID}
refetchExperiments={refetchExperiments}
infrastructureType={InfrastructureType.KUBERNETES}
/>
);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

// <!-- confirmation dialog boxes -->
const confirmationDialogProps = {
Expand Down Expand Up @@ -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}
/>
</Menu>
Expand Down

0 comments on commit c8e145c

Please sign in to comment.