mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-16 19:35:14 +00:00
parent
d815b20c54
commit
857db91634
2 changed files with 13 additions and 4 deletions
|
@ -140,14 +140,17 @@ defineEmits<{
|
|||
}>();
|
||||
|
||||
const pipeline = toRef(props, 'pipeline');
|
||||
const selectedStepId = toRef(props, 'selectedStepId');
|
||||
const { prettyRef } = usePipeline(pipeline);
|
||||
|
||||
const workflowsCollapsed = ref<Record<PipelineStep['id'], boolean>>(
|
||||
props.pipeline.workflows && props.pipeline.workflows.length > 1
|
||||
? (props.pipeline.workflows || []).reduce(
|
||||
pipeline.value.workflows && pipeline.value.workflows.length > 1
|
||||
? (pipeline.value.workflows || []).reduce(
|
||||
(collapsed, workflow) => ({
|
||||
...collapsed,
|
||||
[workflow.id]: ['success', 'skipped', 'blocked'].includes(workflow.state),
|
||||
[workflow.id]:
|
||||
['success', 'skipped', 'blocked'].includes(workflow.state) &&
|
||||
!workflow.children.some((child) => child.pid === selectedStepId.value),
|
||||
}),
|
||||
{},
|
||||
)
|
||||
|
|
|
@ -122,7 +122,13 @@ const selectedStepId = computed({
|
|||
get() {
|
||||
if (stepId.value !== '' && stepId.value !== null && stepId.value !== undefined) {
|
||||
const id = parseInt(stepId.value, 10);
|
||||
const step = pipeline.value?.workflows?.reduce(
|
||||
|
||||
let step = pipeline.value.workflows?.find((workflow) => workflow.pid === id)?.children[0];
|
||||
if (step) {
|
||||
return step.pid;
|
||||
}
|
||||
|
||||
step = pipeline.value?.workflows?.reduce(
|
||||
(prev, p) => prev || p.children?.find((c) => c.pid === id),
|
||||
undefined as PipelineStep | undefined,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue