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

As a user, I need pixieapp can handle query parameters in the url at the initial pageload #14

Open
sihong-ma opened this issue Dec 19, 2017 · 1 comment
Assignees

Comments

@sihong-ma
Copy link

Feature requirements:

In the initial page load, Pixieapp can take the query parameters from the url and apply them into the pre-defined fields and functions can be also trigged at the page load.

@DTAIEB DTAIEB self-assigned this Jan 24, 2018
DTAIEB pushed a commit that referenced this issue Jan 28, 2018
@DTAIEB
Copy link
Member

DTAIEB commented Jan 28, 2018

This feature has been implemented in PR #24 in the following way:
-url parameters can automatically activate a route.
-routes can automatically add parameters to the url by using a special argument: persist_args="true".
For example:

    @route(query="*", persist_args='true')
    def do_search(self, query):
       ....

In this case, when the do_search route is activated, it will automatically add query= as url argument. When running in a notebook, the parameter will be added to the cell metadata such that the next time you run the PixieApp, the route will automatically be involved.

One thing to be cautious about when using persist_args="true" is the fact that the default route is not invoked. Therefore, the page will only show the fragment returned by the do_search route. Depending on your requirements, you might want to make sure that the user has a way to go back to the welcome page. Note that the user can simply remove the parameters in the url or in the cell metadata to restore the default behavior.

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

No branches or pull requests

2 participants