Browse Source

Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) (#28365)

Backport #28359 by @lunny

The left menu will only display the default branch's workflows but the
right side will display the runs triggered by all branches' workflows.
So we cannot hide right side if default branch has no workflows.

Fix #28332 
Replace #28333

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
tags/v1.21.2
Giteabot 6 months ago
parent
commit
b7e3adc66c
No account linked to committer's email address
2 changed files with 2 additions and 1 deletions
  1. 1
    0
      routers/web/repo/actions/actions.go
  2. 1
    1
      templates/repo/actions/list.tmpl

+ 1
- 0
routers/web/repo/actions/actions.go View File

pager.AddParamString("actor", fmt.Sprint(actorID)) pager.AddParamString("actor", fmt.Sprint(actorID))
pager.AddParamString("status", fmt.Sprint(status)) pager.AddParamString("status", fmt.Sprint(status))
ctx.Data["Page"] = pager ctx.Data["Page"] = pager
ctx.Data["HasWorkflowsOrRuns"] = len(workflows) > 0 || len(runs) > 0


ctx.HTML(http.StatusOK, tplListActions) ctx.HTML(http.StatusOK, tplListActions)
} }

+ 1
- 1
templates/repo/actions/list.tmpl View File

<div class="ui container"> <div class="ui container">
{{template "base/alert" .}} {{template "base/alert" .}}


{{if .workflows}}
{{if .HasWorkflowsOrRuns}}
<div class="ui stackable grid"> <div class="ui stackable grid">
<div class="four wide column"> <div class="four wide column">
<div class="ui fluid vertical menu"> <div class="ui fluid vertical menu">

Loading…
Cancel
Save