From a94b756cc4d60ce907f42a8240321259a9be88cc Mon Sep 17 00:00:00 2001 From: Divya Jain Date: Sat, 5 Nov 2022 06:48:16 +0530 Subject: [PATCH] Show workflow state in ui and collapse completed workflows (#1383) Fixes #1371 Co-authored-by: Anbraten --- .../repo/pipeline/PipelineStepList.vue | 18 +++++++++++++++++- web/src/views/repo/pipeline/Pipeline.vue | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/web/src/components/repo/pipeline/PipelineStepList.vue b/web/src/components/repo/pipeline/PipelineStepList.vue index 3723b4198..c1e1e013c 100644 --- a/web/src/components/repo/pipeline/PipelineStepList.vue +++ b/web/src/components/repo/pipeline/PipelineStepList.vue @@ -73,6 +73,15 @@ class="transition-transform duration-150 min-w-6 h-6" :class="{ 'transform rotate-90': !stepsCollapsed[step.id] }" /> +
{{ step.name }}
@@ -137,5 +146,12 @@ defineEmits<{ const pipeline = toRef(props, 'pipeline'); const { prettyRef } = usePipeline(pipeline); -const stepsCollapsed = ref>({}); +const stepsCollapsed = ref>( + props.pipeline.steps && props.pipeline.steps.length > 1 + ? (props.pipeline.steps || []).reduce( + (collapsed, step) => ({ ...collapsed, [step.id]: !['started', 'running', 'pending'].includes(step.state) }), + {}, + ) + : {}, +); diff --git a/web/src/views/repo/pipeline/Pipeline.vue b/web/src/views/repo/pipeline/Pipeline.vue index 7ad2aa166..0727fe8ef 100644 --- a/web/src/views/repo/pipeline/Pipeline.vue +++ b/web/src/views/repo/pipeline/Pipeline.vue @@ -2,6 +2,7 @@