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

Update rendered HTML to JSON endpoints #750

Open
russbiggs opened this issue Oct 31, 2019 · 4 comments
Open

Update rendered HTML to JSON endpoints #750

russbiggs opened this issue Oct 31, 2019 · 4 comments

Comments

@russbiggs
Copy link
Contributor

contents.html, map.html and errors.html are currently rendered and stored on s3 then fetched during templating. This has cause some issue while making improvements so let's seek to render these client side with JS where it makes sense with JSON data endpoints.

@russbiggs
Copy link
Contributor Author

marking this as discussion because some thoguht should go into what should be server rendered and what is better sent as JSON then client rendered

@russbiggs russbiggs added this to In progress in Redesign Oct 31, 2019
@Eleonore9
Copy link
Collaborator

OK, I had a look on S3 and I think I get it.

The frontend would have templates for content.html, map.html, errors.html which would get data passed in from the backend for a specific campaign the user is trying to view by

  1. either reaching the routes /campaigns/<campaing-uuid>/feature_completeness.json, /campaigns/<campaing-uuid>/geojson_x.json, /campaigns/<campaing-uuid>/errors_x.json, /campaigns/<campaing-uuid>/count_feature.json,
  2. or reaching one route like /campaigns/<campaing-uuid>/render_campaign.json.
    Where render_campaign.json would contain data from the S3 files feature_completeness.json, geojson_x.json, errors_x.json, count_feature.json.

It looks like any of those would mean modifying the lambda function [prod/staging]_render_feature on the backend at least.

@Eleonore9
Copy link
Collaborator

Eleonore9 commented Nov 5, 2019

OK, views.py also need modifying and the campaign_detail.html would import a JS script where the Ajax calls would be made.

@russbiggs
Copy link
Contributor Author

@Eleonore9 Jorge has updated map.html for his work in creating gpx, its now a flask template in his feature branch

@russbiggs russbiggs moved this from In progress to Review in Redesign Nov 28, 2019
@russbiggs russbiggs moved this from Review to Done in Redesign Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants