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 use of Google Charts #658

Open
nworden opened this issue Apr 27, 2019 · 5 comments
Open

Update use of Google Charts #658

nworden opened this issue Apr 27, 2019 · 5 comments

Comments

@nworden
Copy link
Contributor

nworden commented Apr 27, 2019

The admin/dashboard page seems to rely on an old version of Google Charts, which uses Flash. We should update it to the current Charts tools, which is documented here.

@hmuhammadazeem
Copy link

I want to contribute to this. Where should I start?

@nworden
Copy link
Contributor Author

nworden commented Jun 28, 2019

Hi Muhammad!

So, Person Finder has a dashboard page for each repository that's supposed to show various statistics about its usage. If you have a local Person Finder running, you can find the dashboard at a path like /haiti/admin/dashboard. However, the code to generate the charts seems to depend on an old version of the Google visualization library, and parts of it use Flash, etc. Specifically, there were charts that used to show the number of records and notes as a timeline, and those charts are now broken (it appears they use a type of chart that's no longer supported).

The Django template for the dashboard page (including all the JS to generate the charts) is in app/resources/admin_dashboard.html.template, and the server-side code is in app/views/admin/dashboard.py (the server-side code probably doesn't need to change, at least not too much). The JS in the template needs to be updated to use a currently-supported chart time, probably a regular "Timeline" type a linechart. There might be other modifications that need to be made to handle other changes in the Charts library, but that's the main one I'm aware of so far.

There's also some changes that need to be made to get the dashboard page in line with the content security policy we added, but that shouldn't be a big deal. I pushed the main changes for that to a branch so you can take a look, they're here.

Let me know if you have any questions!

@nworden
Copy link
Contributor Author

nworden commented Jun 28, 2019

Actually, I didn't pay enough attention when I looked at the docs for the "Timeline" chart type, I think what we actually need is probably a linechart.

@hmuhammadazeem
Copy link

Alright, thank you for the information.

@hmuhammadazeem
Copy link

@nworden Hi Nick, I've been trying to setup the environment. But the errors related to the Python 2.7's end of support have been arising. Are there any plans to shift to Python 3. Either way, let me know if I'm missing something.

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