-
Notifications
You must be signed in to change notification settings - Fork 184
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
Parse URL query parameters to prepopulate subparser and script parameters #395
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #395 +/- ##
==========================================
+ Coverage 77.33% 77.63% +0.29%
==========================================
Files 143 143
Lines 5022 5070 +48
Branches 666 668 +2
==========================================
+ Hits 3884 3936 +52
+ Misses 989 988 -1
+ Partials 149 146 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@Chris7 should we also update the docs on how this works? |
This is awesome. Docs would be great. I generally build them locally in |
var $initial_parser = $("a[data-parser-pk=" + $wooey_parser.val() + "]"); | ||
// Set initial subparser if present in url params. | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const subparser = urlParams.get('__subparser'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason the param has __?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because it is somewhat of an internal keyword that specifically controls the subparser to use, not to be confused with other URL parameters that are treated as positional or keyword arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional documentation, it's great! There's a little caveat in how data is being passed that could cause confusion and i don't love users having to know some internals vs. what they see on the command line (e.g. a_slug vs a-slug)
Support prepopulating script parameters by parsing URL query parameters. This is useful in generating Wooey URLs for user-facing scripts to minimize user error in filling out info that the component generating the URL may already know about.