generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
[Feature] Implement Client Routing #631
Merged
glenflorendo
merged 13 commits into
hackforla:main
from
christianjro:660/feature-client-routing
Mar 30, 2024
Merged
[Feature] Implement Client Routing #631
glenflorendo
merged 13 commits into
hackforla:main
from
christianjro:660/feature-client-routing
Mar 30, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ic handling of search parameters in the URL for single search mode
…Also correct date range logic.
…e search mode and ensure that visualization mode works.
…uch as console.log statements and unused imports).
…pm test. The 'stroke-width' property needs to be renamed to 'strokeWidth'.
✅ Deploy Preview for luckyparking ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
glenflorendo
previously approved these changes
Mar 27, 2024
glenflorendo
previously approved these changes
Mar 30, 2024
glenflorendo
approved these changes
Mar 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Problem:
As a developer, I want the route paths to be dynamic, so that URLs can be used to personalize or specific what to render in particular views.
Solution:
Used React Router to create dynamic routes for single mode and comparative mode use of the website. I also created a custom hook
useCitationSearchParams
to handle the logic of setting, retrieving, and deleting search query parameters.In single mode:
place_name
andplace_type
parameters are set in the URL. I decided to keep it this way because the citation data filters (data category and date preset) are still the default selections.single-search-visualization.tsx
component.citation-explorer.tsx
, theplace_name
is obtained from the URL and is passed down to theSingleSearch
component (as asavedQuery
) and ultimately to theGeocoder
component. I updated theGeocoder
component to behave in the following way: if it recognizes that it’s receiving a savedQuery, it will automatically select theGeocoder
result and pass it to thecitation-explorer
via a callback function. This way, we can use asavedQuery
string to obtain a Geocoder result with all the necessary properties.single-search-visualization.tsx
component.In comparative mode:
comparative_mode
parameter is added to the URL when a user enters comparative mode.citation-explorer.tsx
component.visualization_mode
parameter is added to the URL.category
parameter will be added to the URL.citation-explorer.tsx
, theisSingleSearchMode
state variable will be set based on whether or not it finds thecompare_mode
parameter in the URL.ComparativeSearch
component asregion1SavedQuery
andregion2SavedQuery
variables. To differentiate regions, I added the id property on the Geocoder component. This way when the onSelect callback function is called, the proper region is assigned.Related Issues
Resolves #620
Testing
Updated Testing Coverage
Checklist