Instead of prompting the login modal, I'm hiding the download data button. This is a simpler implementation than trying to get the salsa auth plugin to fit this use case. I discussed with Hannah this implementation.
I've also added some logic in employer.js to check if that button exists before executing the related code, otherwise the data selector gets stuck in a loading state.
Testing
git pull origin authenticated-download
Not sure how to test with the salsa cookie, so you'll need to spoof it in the code. In line 109 of views.py, set context['authenticated'] to True and False to test.
Make sure the download data button does or doesn't show, depending on how you spoofed it in the view code.
Make sure the date selection dropdown loads correctly
Make sure the download data button uses the correct year
Overview
Closes #569.
Notes
Instead of prompting the login modal, I'm hiding the download data button. This is a simpler implementation than trying to get the salsa auth plugin to fit this use case. I discussed with Hannah this implementation.
I've also added some logic in
employer.js
to check if that button exists before executing the related code, otherwise the data selector gets stuck in a loading state.Testing
git pull origin authenticated-download
views.py
, setcontext['authenticated']
toTrue
andFalse
to test.