seed icon indicating copy to clipboard operation
seed copied to clipboard

Fix error filtering doubles as strings

Open nllong opened this issue 2 years ago • 1 comments

If there is an existing filter on a field that has a unit (e.g., site_eui) and the user is filtering in the Legacy property list, then when moving to the new property list, it breaks.

Image

The user is unable to delete the filter and reset the state. Current workaround seems to be clearing the local cache or going to the Property (Legacy) list and deleting the filters, then going back to the new Property list.

nllong avatar Jul 17 '22 19:07 nllong

A few notes as this does not seem to be an easy fix

The source of the issue is the legacy page uses the HTML table to apply filters while the new inventory list uses hand-rolled functions in the backend to apply sorting and filtering

The backend filter functions had no way to handle a is not null query (PropertyView.objects.filter(state__site_eui__isnull=False). I have since added a conditional to allow is not null queries for default columns. I have been unable to apply the same fix for extra data as they are a nested dictionary and the same style of query returns all property views regardless of the extra data value (PropertyView.objects.filter(state__extra_data__data_1__isnull=False)

Below is an example of the nested nature of the extra data in property states

PropertyState: {
...
site_eui: 123,
extra_data: {
   data_1: 123,
   data_2: 'test'
}
...
}

Filtering for derived columns is also not functional and will require further debugging.

perryr16 avatar Jul 21 '22 14:07 perryr16