Closed johnclary closed 10 months ago
Going to start by figuring out the reason for the uuids. My first thought is that it is a way to keep filters on the same column from merging in the gql abstract code. We build the project list view query differently now so hopefully we can avoid that dependency.
Some inspiration
I'm focusing on the the filters
state defined in useAdvancedSearch
first, and I've whittled down the data that needs to be set in the URL params to 3 fields:
project_team_members
(this lets us access config set in PROJECT_LIST_VIEW_FILTERS_CONFIG
for each column)chris
string_contains_case_insensitive
(FiltersCommonOperators
is composed of k/v pairs where the key is this operator value and the values are the pieces needed to build the GraphQL query)I've been able to build the needed query from these three details, and, now, I need to update the logic to set and get the URL params to only rely on the same three. My goal is to demo this in the next dev sync.
I'll keep down this path, and I think a second PR could take on paring down the internal state the Filter
component which is called filterParameters
. We could follow the same pattern of only storing what is needed to piece together the rest for the UI updates.
sounds good @mddilley! happy to pair / rubber duck anytime it would be helpful.
@johnclary I walked through each field and operator to make sure nothing broke, and I tripped over some quirks. I'm dropping notes here for now, but I can help make some issues too if you feel like any of these need attention soon.
“”
(double quote characters) for a string type like Name breaks the UI (WSOD)null
from the database created before the fixes.
specialNullValue
keys in FilterCommonOperators.js
On the project list, we currently base64-encode advanced search params into the browser URL. We should switch to using decoded search params, because:
Notes on current implementation:
useMakeFilterState
is helpful to see the filter state as it is updated. There is data stored in each filter that comes fromPROJECT_LIST_VIEW_FILTERS_CONFIG
andFiltersCommonOperators
handleFilterFieldMenuClick
in theFilters
componentPROJECT_LIST_VIEW_FILTERS_CONFIG[fields]
array to be an object might make it easier to access some of these values byname
orlabel
generateEmptyFilter
Example of current config that is encoded and stored in
filter
query string: