Module: check_mk
Branch: master
Commit: 73a569af7ac42d4dcace599ada97095a3f06cdfd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73a569af7ac42d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 13:05:49 2018 +0200
6725 FIX Fixed grouping of service descriptions when view rows are already grouped
When a view is grouped by the host name and it shows only services starting with
"Log" of
each host and there is a view grouping for all services starting with "Log"
configured,
this resulted in rendering issues. The foldable groups should only fold/unfold services of
a
single host (row group) but there were groups spanning over multiple hosts.
Change-Id: I543d93fa193925a50452685fc6c3cefa007cfab7
---
.werks/6725 | 14 ++++++++++++++
cmk/gui/plugins/views/layouts.py | 15 ++++++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/.werks/6725 b/.werks/6725
new file mode 100644
index 0000000..327983b
--- /dev/null
+++ b/.werks/6725
@@ -0,0 +1,14 @@
+Title: Fixed grouping of service descriptions when view rows are already grouped
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538046148
+
+When a view is grouped by the host name and it shows only services starting with
"Log" of
+each host and there is a view grouping for all services starting with "Log"
configured,
+this resulted in rendering issues. The foldable groups should only fold/unfold services
of a
+single host (row group) but there were groups spanning over multiple hosts.
diff --git a/cmk/gui/plugins/views/layouts.py b/cmk/gui/plugins/views/layouts.py
index 4bd9bed..abf94b6 100644
--- a/cmk/gui/plugins/views/layouts.py
+++ b/cmk/gui/plugins/views/layouts.py
@@ -218,7 +218,7 @@ def render_grouped_boxes(rows, view, group_cells, cells, num_columns,
show_check
if column_headers != "off":
show_header_line()
- groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids)
+ groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids,
row_group_cells=None)
visible_row_number = 0
group_hidden, num_grouped_rows = None, 0
@@ -312,7 +312,7 @@ def grouped_row_title(index, group_spec, num_rows, trclass,
num_cells):
# b) Row grouping (Displaying header painters for each row)
#
# This is confusing and needs to be cleaned up!
-def calculate_view_grouping_of_services(rows):
+def calculate_view_grouping_of_services(rows, row_group_cells):
if not config.service_view_grouping:
return {}, rows
@@ -321,12 +321,21 @@ def calculate_view_grouping_of_services(rows):
groups = {}
current_group = None
group_id = None
+ last_row_group = None
for index, (row_id, row) in enumerate(rows[:]):
group_spec = try_to_match_group(row)
if not group_spec:
current_group = None
continue
+ # New row groups need to separate the view groups. There is no folding allowed
+ # between row groups (e.g. services of different hosts when the host is a group
cell)
+ if row_group_cells:
+ this_row_group = group_value(row, row_group_cells)
+ if this_row_group != last_row_group:
+ group_id = row_id
+ last_row_group = this_row_group
+
if current_group == None:
group_id = row_id
@@ -581,7 +590,7 @@ def render_grouped_list(rows, view, group_cells, cells, num_columns,
show_checkb
show_header_line()
rows_with_ids = [ (row_id(view, row), row) for row in rows ]
- groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids)
+ groups, rows_with_ids = calculate_view_grouping_of_services(rows_with_ids,
row_group_cells=group_cells)
visible_row_number = 0
group_hidden, num_grouped_rows = None, 0