From 153c64502e7320b56d43c6bfd8dcc79e6bc84208 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 24 Feb 2023 16:31:13 +0100 Subject: dashboard: improve the bug subsystem page Hide children with 0 bugs and show parent subsystems. --- dashboard/app/main.go | 12 +++++++++++- dashboard/app/subsystem_page.html | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'dashboard') diff --git a/dashboard/app/main.go b/dashboard/app/main.go index 4bf69e94b..e6d064c81 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -151,6 +151,7 @@ type uiSubsystemPage struct { Header *uiHeader Info *uiSubsystem Children []*uiSubsystem + Parents []*uiSubsystem Groups []*uiBugGroup } @@ -482,13 +483,22 @@ func handleSubsystemPage(c context.Context, w http.ResponseWriter, r *http.Reque } children := []*uiSubsystem{} for _, item := range service.Children(subsystem) { - children = append(children, createUISubsystem(hdr.Namespace, item, cached)) + uiChild := createUISubsystem(hdr.Namespace, item, cached) + if uiChild.Open.Count+uiChild.Fixed.Count == 0 { + continue + } + children = append(children, uiChild) + } + parents := []*uiSubsystem{} + for _, item := range subsystem.Parents { + parents = append(parents, createUISubsystem(hdr.Namespace, item, cached)) } sort.Slice(children, func(i, j int) bool { return children[i].Name < children[j].Name }) return serveTemplate(w, "subsystem_page.html", &uiSubsystemPage{ Header: hdr, Info: createUISubsystem(hdr.Namespace, subsystem, cached), Children: children, + Parents: parents, Groups: groups, }) } diff --git a/dashboard/app/subsystem_page.html b/dashboard/app/subsystem_page.html index d965f1d99..45ada7b45 100644 --- a/dashboard/app/subsystem_page.html +++ b/dashboard/app/subsystem_page.html @@ -21,6 +21,13 @@ The list of polled trees. Maintainer(s): {{.Info.Maintainers}}
{{end}} Fixed bugs: {{link .Info.Fixed.Link (printf "%d" .Info.Fixed.Count)}}
+ {{if .Parents}} + Parent subsystem(s): + {{range .Parents}} + {{link .Open.Link .Name}} ({{.Open.Count}}) + {{end}} +
+ {{end}} {{if .Children}} Child subsystems: {{range .Children}} -- cgit mrf-deployment