-
Notifications
You must be signed in to change notification settings - Fork 7
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 parameter for HTML request #242
Conversation
the CSS still needs to be integrated. Also the representation of the report results needs to be adjusted: the map as on the website does not work without javascript (maybe just a big traffic light like the small ones?) |
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.
Looks good so far. I have not finished looking at every change yet. But here are some minor comments for the parts I already looked at.
- Analogous to
remove_svg_from_properties
there should be a test forremove_html_from_properties
.
tests/unittests/test_api.py
def test_remove_svg_from_properties(self):
Update this branch to the latest commit in main.- Add jinja2 as dependency to
pyproject.toml
andpoetry.lock
usingpoetry add jinja2
Lets have a discussion about the CSS and reports once I finished the first review. Regarding the map on the website: It is not planned to include the map as part of the OQT API response. The response should only contain the description an plot for the results. |
I found this tool (https://github.com/rossant/smopy) to integrate OSM maps well with Python. The zoom is also adapted directly to the bounding box here. As far as I can see, there are no dependencies that we don't already have. So I would insert the map with it, if there is nothing against it from your side. |
I am not sure this is a good idea. The packages has not been updated since 2 years, is not available through pypi and has no tests :D. On the other hand the package is quite small and consists only 400 lines of code. |
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.
Just a few commets while skiming the changes.
I have not yet tested it or looked at the HTML construction.
The HTTP interactions introduced in #242 are containing binary data (OSM Map tiles as PNG). JSON can not handle those. `vcrpy` does recommend YAML in this case. Recreate all VCR cassettes.
The HTTP interactions introduced in #242 are containing binary data (OSM Map tiles as PNG). JSON can not handle those. `vcrpy` does recommend YAML in this case. Recreate all VCR cassettes.
The HTTP interactions introduced in #242 are containing binary data (OSM Map tiles as PNG). JSON can not handle those. `vcrpy` does recommend YAML in this case. Recreate all VCR cassettes.
The HTTP interactions introduced in #242 are containing binary data (OSM Map tiles as PNG). JSON can not handle those. `vcrpy` does recommend YAML in this case. Recreate all VCR cassettes.
The HTTP interactions introduced in #242 are containing binary data (OSM Map tiles as PNG). JSON can not handle those. `vcrpy` does recommend YAML in this case. Recreate all VCR cassettes.
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.
A first review, still to review:
- templates
- tests
- test website
CHANGELOG.md
Outdated
@@ -17,10 +17,12 @@ | |||
- Fix concurrent execution of CLI function `create_all_indicators` using async and semaphores ([#254]) | |||
- Support choosing a single indicator and/or single layer for CLI command `create_all_indicators` ([#254]) | |||
- Indicators based on GHS-POP use raster file stored on disk instead of raster in the database ([#276]) | |||
- Add new parameter `includeHtml` to the API endpoints to allow the request of a HTML snippet of the report result ([#242]) |
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 not only for reports, but indicators as well, isn't it?
4b51a41
to
985a303
Compare
0d12506
to
936d081
Compare
Use HTML templates to create HTML snippets containing the results of an Indicator or Report.
('/indicator' and '/report'). If this parameter is set to True the response will contain an HTML snippet with the Indicator or Report results. The default is not HTML snippet will be included in the response.
Report and embed the HTML snippet of the API response in the website.
c36c88c
to
16dfb45
Compare
@matthiasschaub replaced this review
Description
Add a parameter to the API endpoints to allow the request of a HTML snippet.
Corresponding issue
Closes #235
New or changed dependencies
Checklist
main
(e.g. throughgit rebase main
)