Module: check_mk
Branch: master
Commit: dedfc3da2401a6bef1f67ed148e697ad45f58be8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dedfc3da2401a6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 19 07:58:26 2018 +0100
5736 FIX Show even empty custom graphs in sidebar view snapin
Change-Id: Ia3b140fbadf80ad0cfca4aa130f1ffcfef30b1a7
---
.bugs/2845 | 6 ++++--
.werks/5736 | 10 ++++++++++
web/htdocs/pagetypes.py | 7 ++++++-
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.bugs/2845 b/.bugs/2845
index f91ab28..81da7e1 100644
--- a/.bugs/2845
+++ b/.bugs/2845
@@ -1,10 +1,12 @@
Title: Empty custom graphs should be shown in sidebar nevertheless
Component: metrics
-State: open
+Class: nastiness
+State: done
Date: 2017-02-21 10:46:23
Targetversion: 1.2.8
-Class: nastiness
It seems to be a "feature" that empty custom graphs are never shown in the
sidebar - regardless of the checkbox "do not show in sidebar". This is
confusing to users. Better treat empty graphs like nonempty-graphs.
+
+2018-02-19 07:57:29: changed state open -> done
diff --git a/.werks/5736 b/.werks/5736
new file mode 100644
index 0000000..8fe151f
--- /dev/null
+++ b/.werks/5736
@@ -0,0 +1,10 @@
+Title: Show even empty custom graphs in sidebar view snapin
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1519023460
+Class: fix
+
+
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index fd0b7a0..de0bc4f 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -189,6 +189,11 @@ class Base(object):
def is_empty(self):
return False
+
+ def _show_in_sidebar(self):
+ return not self.is_empty() and not self.is_hidden()
+
+
# Default values for the creation dialog can be overridden by the
# sub class.
@classmethod
@@ -375,7 +380,7 @@ class PageRenderer(Base):
@classmethod
def sidebar_links(cls):
for page in cls.pages():
- if not page.is_empty() and not page.is_hidden():
+ if page._show_in_sidebar():
yield page.topic(), page.title(), page.page_url()