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

link search route #236

Merged
merged 4 commits into from
Feb 22, 2024
Merged

link search route #236

merged 4 commits into from
Feb 22, 2024

Conversation

Pamella014
Copy link
Collaborator

@Pamella014 Pamella014 commented Feb 20, 2024

Description

I was able to link the search text to the route navigation where its stored as query params

Screenshots / Videos

Screenshot from 2024-02-16 09-24-08

Picsa.Extension.webm

closes #227

@github-actions github-actions bot added the Tool: Resources Updates related to Resources tool label Feb 20, 2024
Copy link
Collaborator

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Pamella014 , the feature works really well! I tested typing into the input to see route param change, reloading page to see search reload success, and clearing input to see param removed.

I've added two small additions
5c5b7c8 - a very common issue when working with rxjs subscriptions is the fact that they should be manually unsubscribed when you no longer need them (can cause small performance issues if too many left open). There's lots of ways to manage this, you can see the code I've added in the linked commit or see more examples at:
https://blog.bitsrc.io/6-ways-to-unsubscribe-from-observables-in-angular-ab912819a78f

54b33d9 - a tiny amount of code tidying for the function that updates the route. It basically uses a small feature/hack that when setting a route param if you set as undefined, e.g. {searchText: undefined} the angular router is actually smart enough to just remove that. So I've implemented without need for the conditional statement and renamed the method name to be a little bit more specific

But overall I think the implementation is really nice and uses a few different angular techniques which is good to see you picking up. I'll go ahead and merge here and identify a good next issue to work on.

Oh, and I can see that the video you shared has a link but is not displayed inline. This is an annoying markdown issue, basically you need to leave an empty line before the video to get it to display in github preview. So feel free to update your PR note and add a new line before the video link and it should show correctly

@chrismclarke chrismclarke merged commit f7a9304 into main Feb 22, 2024
3 checks passed
@chrismclarke chrismclarke deleted the ft-link-search-text-to-route branch February 22, 2024 22:53
@Pamella014
Copy link
Collaborator Author

Thank you Chris.

@Pamella014
Copy link
Collaborator Author

I have updated the PR as requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tool: Resources Updates related to Resources tool
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

feat(resources): link search text to route navigation
2 participants