Module: check_mk
Branch: master
Commit: bce3d3d67d9eaaf7e18aa9f6c1656109826dfaf2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bce3d3d67d9eaa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 20 10:55:56 2015 +0100
#1872 FIX View editor hides filter selection for object types which have no filter to
choose
A small usability cleanup. Options where nothing can be choosen from are confusing.
---
.werks/1872 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/1872 b/.werks/1872
new file mode 100644
index 0000000..97283f4
--- /dev/null
+++ b/.werks/1872
@@ -0,0 +1,10 @@
+Title: View editor hides filter selection for object types which have no filter to
choose
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1421747701
+
+A small usability cleanup. Options where nothing can be choosen from are confusing.
diff --git a/ChangeLog b/ChangeLog
index 2a02c77..f530c49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -113,6 +113,7 @@
* 1843 FIX: Fixed crash in display of crash report for precompiled host checks
* 1870 FIX: Joined columns were empty in CSV, JSON or PYTHON exports of view...
* 1871 FIX: Site filter is only shown as host related filter now...
+ * 1872 FIX: View editor hides filter selection for object types which have no filter
to choose...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index afc8b32..88493e4 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -460,6 +460,10 @@ def get_context_specs(visual, info_handler):
else:
filter_list = VisualFilterList([info_key], title=info['title'])
filter_names = filter_list.filter_names()
+
+ if not filter_names:
+ continue # Skip infos which have no filters available
+
params = [
('filters', filter_list),
]
@@ -1016,8 +1020,7 @@ class VisualFilterList(ListOfMultiple):
self._filters[fname] = fspecs[fname]._filter
# Convert to list and sort them!
- fspecs = fspecs.items()
- fspecs.sort(key = lambda x: (x[1]._filter.sort_index, x[1].title()))
+ fspecs = sorted(fspecs.items(), key=lambda x: (x[1]._filter.sort_index,
x[1].title()))
kwargs.setdefault('title', _('Filters'))
kwargs.setdefault('add_label', _('Add filter'))