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

Add support for URL query parameters to represent application state #381

Open
smalers opened this issue Apr 27, 2021 · 3 comments
Open

Add support for URL query parameters to represent application state #381

smalers opened this issue Apr 27, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request M Size: 2-3 days medium Priority: normal maintenance and enhancements

Comments

@smalers
Copy link
Contributor

smalers commented Apr 27, 2021

This is lower priority but if figured out would be a big step forward.

It would be useful to represent the state of the application with URL query parameters. For example, see the image below, which shows how some layers have been turned off. The URL might look something like:

http://poudre.openwaterfoundation.org/latest#/map/entities-basins?huc12.enabled=false

where huc12 is the layer ID and .enabled is a property. We need to figure out the mechanics of doing such a thing and then spend time on the specification that would map URL to application state properties. The application would need to update the URL when selections are made and would need to be able to recreate a UI state based on URL with query parameters. It is important to understand the parts of the URL, including the main resource, the query parameters to modify state, and the hash fragment. As shown above the query parameter is in the fragment, which may not be correct. However, I tried some bogus query parameters in the hash fragment and the correct app page was displayed.

image

@smalers smalers added enhancement New feature or request medium Priority: normal maintenance and enhancements M Size: 2-3 days labels Apr 27, 2021
@smalers smalers self-assigned this Apr 27, 2021
@smalers
Copy link
Contributor Author

smalers commented May 4, 2021

Here is an example of URL fragment that causes specific state to be shown:

NRCS SNOTEL Map

@cnlane
Copy link
Collaborator

cnlane commented May 4, 2021

I have used some Angular url classes, namely: Location.path() (https://angular.io/api/common/Location), route.params (https://angular.io/api/router/ActivatedRoute) to respond to url information or create "back" paths. Maybe the Angular group has more information.

@smalers
Copy link
Contributor Author

smalers commented May 12, 2021

Catherine found the following article:

Mastering RouterLink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request M Size: 2-3 days medium Priority: normal maintenance and enhancements
Projects
None yet
Development

No branches or pull requests

2 participants