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
[bug] Volunteer view in Supervisor/Admin dashboard should not default to search results from previous sessions. #451
Comments
Is there guidance on how to reproduce this? I have tried logging in as a supervisor, changing the filters, logging out and then back in. When I log back in, the filters I had set in the previous session are no longer there. They have been reset so that the logged-in supervisor sees only that supervisor's volunteers and sees all of them. I've also tried filtering, closing a browser window without logging out, then opening a new window. In that scenario, the filters that I had set before are no longer there. As with the other scenario, they have been reset so that the logged-in supervisor sees only that supervisor's volunteers and sees all of them. |
NVM. I see now. It's the "search" box over on the right that affects the behavior. I didn't see that when experimenting earlier. |
This occurs because the search is cached in the browser's local storage. From what I can tell, this capability is driven by the jquery-datatables-rails gem. I have looked through the README for that project, but I don't see information there on how to control this behavior. Does anyone have any guidance on this? Neither looking through that project's issues nor Googling has yielded anything for me. I also took a look at an alternative gem, jquery-datatables, and the manual for the underlying jquery library, but I haven't found anything there that might help. Here is a screenshot showing a cached search for "Lucinda". Note that the user has logged out but the search cache has remained in browser's local storage. The cache also affects any other user who might log in from the same browser on the same computer. I don't know how often this scenario occurs. |
Hmm, thanks for digging into this! I think a good solution for this would be to delete the DataTables part of localstorage on logout. |
What are the options for adding a JavaScript function on logout? Here is how the link is created: |
I think that if we wanted to run js on logout, we might attach it to the click event of the logout link/button. |
Can I propose an alternative: What if we cleared all localStorage on login? This has a couple of advantages:
|
I'm unlikely to work on this in the near term, so anyone else interested should please feel free to pick it up. |
I gave this a go in #483. Feedback welcomed: JavaScript is not my primary language. |
Part of epic #105
What type of user is this for? [admin/supervisor/volunteer/all]
supervisors and admins
Where does/should this occur?
Volunteer view in supervisor and admin dashboard.
Current behavior
The volunteer view in supervisor/admin dashboard defaults to display only search results from the last session.
Intended behavior
The volunteer view in supervisor/admin dashboard should default to display all volunteers assigned to supervisor – in alphabetical order – first, followed by other volunteers.
For admins, it should display all active volunteers in alphabetical order, followed by all inactive volunteers in alphabetical order.
Screenshots
The volunteer view should not look like this at login.
The text was updated successfully, but these errors were encountered: