-
Notifications
You must be signed in to change notification settings - Fork 33
CUMULUS-4122: prefix vs infix searching in dashboard #1213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
… search and clear granules earch with infix and prefix logic
…en prefix and infix search
… search should be prefix by default. update integration test accordingly
…rio such as searching collection name
if (typeof infix === 'undefined') { | ||
dispatch(action(initialValueRef.current)); | ||
} else { | ||
dispatch(action({ search: initialValueRef.current, infix })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recognizing that: this does work, I've deployed and tested it and it appears to do what it's supposed to.
what's happening here? why is there not parity between infix and prefix searching here? how does infix become undefined? (I see that we're setting it to null below, although maybe I'm looking at the wrong source) and why does {value} vs {search: value} work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
what's happening here? how does infix become undefined? (I see that we're setting it to null below, although maybe I'm looking at the wrong source)
Search component is been used on multiple views, and since toggle is only on view with granule id search, I modify Search to check for infix property. On view where I don't have infix toggle such as Collection list, I expect the Search infix property to be undefined and dispatch action like how it was originally. -
why does {value} vs {search: value} work?
The search granule action originally looks like this
export const searchGranules = (infix) => ({ type: types.SEARCH_GRANULES, infix });
where the search value pass to searchGranule was expecting to be used in infix search. I have to modify the searchGranule to accept 2 parameters, one issearch
that holds the search value andinfix
becomes bool that holds the toggle value.
Other search method remain unchanged, that's why I had to differenitate withif (typeof infix === 'undefined')
so other search method will still receive infix as search value intead. -
why is there not parity between infix and prefix searching here?
I am actually not sure what you mean by this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I am looking at this again, maybe it's better to change search method like searchCollections from
export const searchCollections = (infix) => ({ type: types.SEARCH_COLLECTIONS, infix });
to
export const searchCollections = ({ search, infix }) => ({ type: types.SEARCH_COLLECTIONS, search, infix });
and always pass infix = true
on views without the actual toggle so Search doesn't have to check infix == undefined
?
I am not sure which way is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is there enot parity:
I would expect the base syntax to look the same
a = b({.......infix: infix})
vs
a = b({ ......prefix: prefix})
since what's arriving on the other end of the process to the api is a thing that unpacks prefix and/or infix and performs a search.
it's suspicious that there isn't a parallel between the two, and either prefix or infix is handled like it's an edge case.
now I do understand that elsewhere int eh dashboard we're using infix, and so the prefix is a special case, but it still feels suspicious
Summary: Summary of changes
Addresses CUMULUS-4122: prefix vs infix searching in dashboard
Changes
PR Checklist