Module: check_mk
Branch: master
Commit: 9d3f19bbf63064b7eeb4f8e088a453ca1fb279a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d3f19bbf63064…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 2 15:03:00 2016 +0100
#3041 FIX Fixed deselecting view checkbox options like "Always show checkboxes"
in dashboard embedded views
---
.werks/3041 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/dashboard.py | 2 ++
web/htdocs/views.py | 8 ++++++++
4 files changed, 20 insertions(+)
diff --git a/.werks/3041 b/.werks/3041
new file mode 100644
index 0000000..c6f7fb5
--- /dev/null
+++ b/.werks/3041
@@ -0,0 +1,9 @@
+Title: Fixed deselecting view checkbox options like "Always show checkboxes" in
dashboard embedded views
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1454421727
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 73f57d7..a3adce9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -290,6 +290,7 @@
* 2970 FIX: Users now allowed to modify the sidebar (e.g. guests) can now not fold
snapins anymore
* 3035 FIX: Fixed broken graph preview when hovering graph icon in Check_MK Raw
Edition
* 3040 FIX: Removed all summary_hosts related filters from shipped views...
+ * 3041 FIX: Fixed deselecting view checkbox options like "Always show
checkboxes" in dashboard embedded views
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 9f1a31f..caed08f 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -1074,6 +1074,8 @@ def page_edit_dashlet():
dashlet.update(type_properties)
elif handle_input_func:
+ # The returned dashlet must be equal to the parameter! It is not
replaced/re-added
+ # to the dashboard object. FIXME TODO: Clean this up!
dashlet = handle_input_func(ident, dashlet)
if context_specs:
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 5f054c0..d1db483 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -642,9 +642,17 @@ def transform_valuespec_value_to_view(view):
# at the moment.
if ident == 'view':
if "options" in attrs:
+ # First set all options to false
+ for option in dict(view_editor_options()).keys():
+ view[option] = False
+
+ # Then set the selected single options
for option in attrs['options']:
view[option] = True
+
+ # And cleanup
del attrs['options']
+
view.update(attrs)
del view["view"]