Team List: keep filter param and page in URL #101
Description
We have ability to filter teams on the team list page by some word and we are showing several pages.
If after that we open some of the teams and we would go back, we would not see the same list of teams that we had before. The filter would be clean and the page would be reset to 1
.
See demo video https://monosnap.com/file/baTlUc2gZj2QSUYBwx5RR3QvE4ny6t
To solve this issue we have to do the next:
-
when entering something into the search/filter field, we have to update the current URL and add query param
search=<search/filter input>
. If we are searching by an empty string, then remove query param. -
when we choose any page, we have to update URL and add query param
page=<page number>
. If page=1 then remove query param. -
if we open URL like http://localhost:8080/taas/myteams?search=max&page=2 then we should automatically apply a search filter and choose the page from URL
-
All of the above should lead to the next behaviour: if we search by some word and choose some page, after go inside a team and click "Back" in the browser, we have to come to the same page we were before with search and page applied
-
We also have to update how the arrow inside Team page work. When we click it, it should go to the Team List page with search and page applied
- I think we cannot implement it same like browser "back" button, because in such case if we come to this page from some page not a team list, then we would come back there, but we expect to come back to the team list
- so I guess we also have to store
serach
andpage
values from the team list in Redux. So if come to the team list page we could check if Redux store has some values - then apply them.