Skip to content
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

feat(resources): link search text to route navigation #227

Closed
chrismclarke opened this issue Jan 30, 2024 · 0 comments · Fixed by #236
Closed

feat(resources): link search text to route navigation #227

chrismclarke opened this issue Jan 30, 2024 · 0 comments · Fixed by #236
Assignees

Comments

@chrismclarke
Copy link
Collaborator

chrismclarke commented Jan 30, 2024

Is your feature request related to a problem? Please describe.
Following the updates in #223, a new search page exists from where resources can be searched.
Links to resource collections can be followed, however when navigating back the list of search results has reset.

Describe the solution you'd like
Search input text to be stored as a url query parameter, and used to set the default search text.
By doing this it should also make it possible to navigate to the search page with a pre-built search term ready, e.g.

/resources/search?searchText=crops

Describe alternatives you've considered
Storing local variables or navigation state data, however this would not work if a user is trying to link directly to a pre-filled search page

Additional context
Examples or accessing queryParams can be found at: https://www.digitalocean.com/community/tutorials/angular-query-parameters

Another challenge will be to update the current route to capture the queryParams as the user types in the box. Angular does support same-route navigation, some examples on stackOverflow: https://stackoverflow.com/questions/43698032/angular-how-to-update-queryparams-without-changing-route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants