Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 34433b24bae54a8e427e594d82dfcc6aa01cccb2
https://github.com/tribe29/checkmk/commit/34433b24bae54a8e427e594d82dfcc6aa…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2022-11-14 (Mon, 14 Nov 2022)
Changed paths:
M cmk/gui/mobile.py
M cmk/gui/painters/v0/base.py
M cmk/gui/plugins/dashboard/view.py
M cmk/gui/type_defs.py
M cmk/gui/view.py
M cmk/gui/views/page_show_view.py
M tests/unit/cmk/gui/plugins/views/test_views_utils.py
Log Message:
-----------
Parameterized sorters: Move URL special case to URL parsing
When a user clicks on a column header to change the configured sorting,
the parameterized sorters (currently known as derived column sorters)
need to be handled in a special way. This is now moved to the other URL
parameter parsing code. It now happens earlier at a place you would
expect and reduces the variances during execution.
Change-Id: I6135db78dd0d073dda43220d9f6f2b5822a9131e
Commit: 892d8d2a3edbce1d8d3939c8c7e64bee6a3823a5
https://github.com/tribe29/checkmk/commit/892d8d2a3edbce1d8d3939c8c7e64bee6…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2022-11-14 (Mon, 14 Nov 2022)
Changed paths:
R cmk/gui/derived_columns_sorter.py
M cmk/gui/painters/v0/base.py
M cmk/gui/plugins/views/crash_reporting.py
M cmk/gui/plugins/views/perfometer.py
M cmk/gui/plugins/views/sorters.py
M cmk/gui/plugins/views/wato.py
M cmk/gui/sorter.py
M cmk/gui/view.py
M cmk/gui/views/__init__.py
M cmk/gui/views/page_edit_view.py
M cmk/gui/views/page_show_view.py
M tests/unit/cmk/gui/plugins/views/test_perfometer.py
Log Message:
-----------
Rework DerivedColumnsSorter to ParameterizedSorter
With this change the odd derived columns sorter which was not working
as intended in some cases has been cleaned cleaned up.
* The "Host custom attribute" could only be used as configured sorter in
the view. Sorting by clicking on a "Host custom attribute" column did
not work as intended.
* Vice versa for Metric history and forecast sorters. They could be
configured in the view editor as a dedicated sorter, but it was not
clear by which column they would sort. Actually they always selected
the first configured column of that type and sorted by that one.
Now it is an explicit parameter of that sorter to select one of the
previously configured columns. The relation is now configured
explicitly which makes it easier to understand.
In case such a referenced column is removed while the sorter is kept,
this is now also validated.
Interactive sorting by a column while displaying a view already worked
before.
* The name was related to the "derived columns" feature which is used
by the "Metric history" painter and "forecast sorters" while it is
a more generic feature: Enabling sorters to have parameters.
The feature has now been renamed to "Parameterized sorters". This
concept is similar to the parameters which painters can have. In case
of the "Metric history" and "Metric forecast" the painter and sorter
parameters are the same.
The parameters are only used by the cmp method of the Sorters and are
individual for each specific sorter. So the information is now handed
over to the cmp method instead of being stored as a member attribute
which makes the data flow easier to understand.
This change removes many explicit references to the concrete
svc_metrics_hist, svc_metrics_forecast and host_custom_variable sorters
in the generic code.
Along the way it decouples these sorters from the dependency on Cell,
which enables us to clean up the module hierarchy a bit better.
We could do more here to improve the situation even further:
* Cleanup the sorter attribute of SorterSpec to only contain the sorter
name and separate the parameters into a dedicated attribute
* Move computation of URL encoded sorter references from the generic
code to the ParameterizedSorter classes.
Change-Id: Id641b22e7539b0168981be795274cbb84fda06df
Commit: 0d575c3f573433efdc4ee3db016f41a9dfc25679
https://github.com/tribe29/checkmk/commit/0d575c3f573433efdc4ee3db016f41a9d…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2022-11-14 (Mon, 14 Nov 2022)
Changed paths:
M cmk/gui/painters/v0/base.py
M cmk/gui/plugins/views/mkeventd.py
M cmk/gui/plugins/views/sorters.py
M cmk/gui/sorter.py
M cmk/gui/view.py
M cmk/gui/views/__init__.py
M cmk/gui/views/inventory.py
M cmk/gui/views/layout/layouts.py
M cmk/gui/views/page_edit_view.py
A cmk/gui/views/sort_url.py
M tests/unit/cmk/gui/plugins/views/test_views_utils.py
M tests/unit/cmk/gui/views/test_views.py
Log Message:
-----------
Cleanup dependency between Cell and sorters
The sorters are only needed for rendering the sort URL to be used in the
header of a column. To have the computation in Cell required us to make
the view spec and sorter implementation available to Cell. Now the sort
URL is computed by the call sites which now simplifies the relation
between Cell and the sorters.
This also improves testability of Cell.
Change-Id: Ibbaf5ba5c533fcde99d191ef336243e1ad69d6dd
Commit: 31c139632a8d1236f4ed4faf177b025071cc3270
https://github.com/tribe29/checkmk/commit/31c139632a8d1236f4ed4faf177b02507…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2022-11-14 (Mon, 14 Nov 2022)
Changed paths:
M cmk/gui/availability.py
M cmk/gui/plugins/views/crash_reporting.py
M cmk/gui/plugins/views/mkeventd.py
M cmk/gui/plugins/views/perfometer.py
R cmk/gui/plugins/views/sorters.py
M cmk/gui/plugins/views/wato.py
M cmk/gui/raw/plugins/main_modules/registration.py
R cmk/gui/sorter.py
M cmk/gui/view.py
M cmk/gui/views/__init__.py
M cmk/gui/views/host_tag_plugins.py
M cmk/gui/views/inventory.py
M cmk/gui/views/page_edit_view.py
M cmk/gui/views/page_show_view.py
M cmk/gui/views/sort_url.py
A cmk/gui/views/sorter/__init__.py
A cmk/gui/views/sorter/base.py
A cmk/gui/views/sorter/helpers.py
A cmk/gui/views/sorter/registry.py
A cmk/gui/views/sorter/sorters.py
M tests/unit/cmk/gui/views/test_views.py
Log Message:
-----------
Consolidate view sorter code
* Move plugins to regular hierarchy
* Rework sorter registration to the scheme we want to use in the future
* Consolidate sorter code below views (it's view feature)
* Clarify external API of cmk.gui.views.sorter
Change-Id: I8be0f4a31baf18e4b20133d42c53e0ba706aa62e
Compare:
https://github.com/tribe29/checkmk/compare/8a37dac941b2...31c139632a8d