aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-07-22 19:32:35 +0200
committerTaras Madan <tarasmadan@google.com>2024-07-22 18:25:37 +0000
commit708c10c4c13e9c045b11491f72d92ff75f853d00 (patch)
tree1cf84fe79d0ebe1259269f91bafbbf032b756d6c
parent27981d31754e51f9084eec50f1f9bf31883d70e3 (diff)
dashboard/app: check subsystems coverage enabled
-rw-r--r--dashboard/app/main.go4
-rw-r--r--dashboard/app/templates/templates.html6
2 files changed, 7 insertions, 3 deletions
diff --git a/dashboard/app/main.go b/dashboard/app/main.go
index 21530c67c..c9d1e658d 100644
--- a/dashboard/app/main.go
+++ b/dashboard/app/main.go
@@ -67,7 +67,9 @@ func initHTTPHandlers() {
if nsConfig.Coverage != nil {
http.Handle("/"+ns+"/graph/coverage", handlerWrapper(handleCoverageGraph))
http.Handle("/"+ns+"/graph/coverage_heatmap", handlerWrapper(handleCoverageHeatmap))
- http.Handle("/"+ns+"/graph/coverage_subsystems_heatmap", handlerWrapper(handleSubsystemsCoverageHeatmap))
+ if nsConfig.Subsystems.Service != nil {
+ http.Handle("/"+ns+"/graph/coverage_subsystems_heatmap", handlerWrapper(handleSubsystemsCoverageHeatmap))
+ }
}
http.Handle("/"+ns+"/repos", handlerWrapper(handleRepos))
http.Handle("/"+ns+"/bug-summaries", handlerWrapper(handleBugSummaries))
diff --git a/dashboard/app/templates/templates.html b/dashboard/app/templates/templates.html
index 0fb915c83..37ea44d7a 100644
--- a/dashboard/app/templates/templates.html
+++ b/dashboard/app/templates/templates.html
@@ -111,8 +111,10 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the
href="/{{$.Namespace}}/graph/coverage">Total</a>
<a class="navigation_tab{{if eq .URLPath (printf "/%v/graph/coverage_heatmap" $.Namespace)}}_selected{{end}}"
href="/{{$.Namespace}}/graph/coverage_heatmap">Repo&nbsp;Heatmap</a>
- <a class="navigation_tab{{if eq .URLPath (printf "/%v/graph/coverage_subsystems_heatmap" $.Namespace)}}_selected{{end}}"
- href="/{{$.Namespace}}/graph/coverage_subsystems_heatmap">Subsystems&nbsp;Heatmap</a>
+ {{ if .ShowSubsystems }}
+ <a class="navigation_tab{{if eq .URLPath (printf "/%v/graph/coverage_subsystems_heatmap" $.Namespace)}}_selected{{end}}"
+ href="/{{$.Namespace}}/graph/coverage_subsystems_heatmap">Subsystems&nbsp;Heatmap</a>
+ {{ end }}
</div>
</div>
{{end}}