opserver / Opserver

Stack Exchange's Monitoring System
https://opserver.github.io/Opserver/
MIT License
4.51k stars 827 forks source link

Fix for broken search dropdown in Active operations filter #211

Closed kshyju closed 8 years ago

kshyju commented 8 years ago

The code in Operations.Active.Fitlers.cshtml uses GetDescription extension method to return the description attribute value of the enum. It was missing and hence rendering the dropdown options with empty text. Fixed that. Also added the current active query count to the Active queries page.

active-filter-empty-dropdown

NickCraver commented 8 years ago

I see and agree this is an issue, but this isn't the proper fix unfortunately. The base issue is the .GetDescription<T>() behavior change after the UnconstrainedMelody inclusion, which doesn't fallback to .ToString(). I'll take a look at how to fix this globally, since this is only one of probably dozens of cases.

kshyju commented 8 years ago

Sure. I thought he did not want that ToString() fallback, seeing the specific test

[Test]
public void GetDescriptionWhenValueHasNoDescription()
{
      Assert.IsNull(Number.Two.GetDescription());
}
NickCraver commented 8 years ago

@kshyju that's correct - the library intentionally doesn't do this, but Opserver does want that behavior. I'll play with constraints tonight (we're packing up a house to move at the moment, so I'll be delayed on responses for a while).