From 572449b845937bda3b479fead5b188a986cccd8f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 18 Jul 2023 06:12:17 +0200 Subject: [PATCH] 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 --- web/src/views/repo/pipeline/PipelineWrapper.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/web/src/views/repo/pipeline/PipelineWrapper.vue b/web/src/views/repo/pipeline/PipelineWrapper.vue index ee82ec9f9..45a08dfbd 100644 --- a/web/src/views/repo/pipeline/PipelineWrapper.vue +++ b/web/src/views/repo/pipeline/PipelineWrapper.vue @@ -140,18 +140,11 @@ const { doSubmit: cancelPipeline, isLoading: isCancelingPipeline } = useAsyncAct throw new Error('Unexpected: Repo is undefined'); } - if (!pipeline.value?.workflows) { - throw new Error('Unexpected: Pipeline steps not loaded'); + if (!pipeline.value?.number) { + throw new Error('Unexpected: Pipeline number not found'); } - // TODO: is selectedStepId right? - // 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)); + await apiClient.cancelPipeline(repo.value.id, pipeline.value.number); notifications.notify({ title: i18n.t('repo.pipeline.actions.cancel_success'), type: 'success' }); });