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
RSK: implement sorting on empty query string #149
Conversation
317b03b
to
98e8a26
Compare
src/lib/state/actions/query.js
Outdated
let queryState = getState().query; | ||
updateQueryStateSorting(queryState, appState, config); | ||
|
||
queryState = _cloneDeep(queryState); |
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.
Maybe better to return a cloned state from the updateQueryStateSorting
? Then, if someone uses it in another action, there wouldn't need to care about the mutation that is happening inside the function...
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.
I have changed, can you double check? I am not sure I fully understood your comment.
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.
I ran the branch locally and noticed that when you enter a query and then change the sorting and clear the query the last sorting is used in the empty query. Is this the desired behavior or everytime an empty query is entered the sorting should change to the defaultOnEmptyString
?
I would say that everytime the query string is empty the |
5db74df
to
7d3cc63
Compare
8a2e65d
to
d1834e0
Compare
7d3cc63
to
aeab05c
Compare
Good question @KonstantinaStoikou @zzacharo how I have implemented is:
The idea was that if the user selects a sorting, it means (s)he wants that. If I choose |
* introduces a new prop to define which sorting to use on empty query string * adds a new private app state to the store to keep track if the user has selected a new sorting and what was the initial sorting before change * adds tests * changes documentation * closes inveniosoftware#111
aeab05c
to
77c56e0
Compare
string
has selected a new sorting and what was the initial sorting before
change