mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-22 16:36:30 +00:00
make pending pipelines cancable (#2013)
in some edgecases we get pipelines that we can not cancle via WebUI. fix https://codeberg.org/Codeberg-CI/feedback/issues/126
This commit is contained in:
parent
a890a0d4d4
commit
572449b845
1 changed files with 3 additions and 10 deletions
|
@ -140,18 +140,11 @@ const { doSubmit: cancelPipeline, isLoading: isCancelingPipeline } = useAsyncAct
|
||||||
throw new Error('Unexpected: Repo is undefined');
|
throw new Error('Unexpected: Repo is undefined');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pipeline.value?.workflows) {
|
if (!pipeline.value?.number) {
|
||||||
throw new Error('Unexpected: Pipeline steps not loaded');
|
throw new Error('Unexpected: Pipeline number not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: is selectedStepId right?
|
await apiClient.cancelPipeline(repo.value.id, pipeline.value.number);
|
||||||
// const step = findStep(pipeline.value.steps, selectedStepId.value || 2);
|
|
||||||
|
|
||||||
// if (!step) {
|
|
||||||
// throw new Error('Unexpected: Step not found');
|
|
||||||
// }
|
|
||||||
|
|
||||||
await apiClient.cancelPipeline(repo.value.id, parseInt(pipelineId.value, 10));
|
|
||||||
notifications.notify({ title: i18n.t('repo.pipeline.actions.cancel_success'), type: 'success' });
|
notifications.notify({ title: i18n.t('repo.pipeline.actions.cancel_success'), type: 'success' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue