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

Enable adding query parameters to documentation page request #91

Closed
basvandenberg opened this issue Jan 27, 2021 · 1 comment
Closed
Assignees

Comments

@basvandenberg
Copy link
Contributor

Currently it is only possible to define a docId for showing a documentation page, in which case the page {docRoot}/{docId}.html is loaded and displayed.

let docId = 'my_doc_id';
DocViewer.create(docId);
// loads and displays: /your/root/my_doc_id.html

Sending along (optional) query parameters would enable displaying different variants of the same help content (for example for different view contexts).

let docId = 'my_doc_id';
let queryParams = {
    paramA: 'test1',
    paramB: 'test2'
}
DocViewer.create(docId, queryParams);
// loads and displays:  /your/root/my_doc_id.html?paramA=test1&paramB=test2

The queryParams should be optional, so if not defined/provided, it should be ignored.

basvandenberg pushed a commit that referenced this issue Jan 27, 2021
@basvandenberg basvandenberg self-assigned this Jan 27, 2021
basvandenberg pushed a commit that referenced this issue Jan 28, 2021
The queryParamsFunc parameter is a function that, if present, will be
used to fetch query parameters for the help request.
basvandenberg pushed a commit that referenced this issue Feb 3, 2021
…nction for fetching the query parameters (#91).
@basvandenberg
Copy link
Contributor Author

Instead of adding queryParams as parameter of the DocViewer.create() function, I enabled setting a function that will be used for fetching the query parameters.

// set root url of the help documents
DocViewer.setDocRoot('my/doc/root');
// set function for fetching query parameters
DocViewer.setQueryParamsFunc(myQueryParamsFunc);

If this function is set, it will be used to fetch query parameters, and (if there are any) they will be send to the server as part of the help document request.

basvandenberg pushed a commit that referenced this issue Feb 3, 2021
basvandenberg pushed a commit that referenced this issue Feb 10, 2021
basvandenberg pushed a commit that referenced this issue Feb 10, 2021
Feature #91 Enable setting query parameters for help document requests
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

1 participant