Icinga / icingaweb2-module-cube

Drill-down view for Icinga web 2 based on custom variables
GNU General Public License v2.0
45 stars 12 forks source link

Wrong state color of outer dimension #102

Closed sukhwinder33445 closed 1 year ago

sukhwinder33445 commented 1 year ago

Describe the bug

When implementing sort control, I noticed that the state class of the cube dimension wrapper (outer dimension) only based on the first inner dimension. So if the first inner dimension has the state class UP|OK, the wrapper also gets the state class UP|OK and vice versa, no matter if there are further DOWN|CRITICAL dimensions.

To Reproduce

  1. Use the sort control PR.
  2. Add two or more dimensions.
  3. Change sort order and notice the change.

Expected behavior

The outer dimension should have the correct state class.

Screenshots

The prod -> ps has berlin (DOWN) on the first place, so the outer dimension (prod) is marked as down (red).

Screenshot 2022-12-20 at 15 23 16

The prod -> ps has london (UP) on the first place, so the outer dimension (prod) is marked as UP (black).

Screenshot 2022-12-20 at 15 23 01