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

Add persistent DonationProcessAction history for processing pages #559

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

faultyserver
Copy link
Member

@faultyserver faultyserver commented Apr 30, 2023

Contributing to the Donation Tracker

First of all, thank you for taking the time to contribute!

Please fill out the template below and check the following boxes:

  • I've added tests or modified existing tests for the change.
  • I've humanly end-to-end tested the change by running an instance of the tracker.

Description of the Change

Especially at peak times, donation processors are quickly taking actions on many donations, and it's entirely possible for misclicks or unintended actions to occur. While it's possible to undo actions through the Admin dashboards, that's out of the way and not always intuitive to do, especially if the processor can't remember exactly what they did in the first place.

To address that, the initial version of the new Process Donations page included a naive "Action History" section in the sidebar that held a local list of actions that the processor had taken, and a basic "undo" button to reset the donation to a fully pending state. This worked, but wasn't really helpful because it disappeared whenever you reloaded the page, always reset to "UNPROCESSED" (even in the confirm mode, where it should be reset to "FLAGGED"), and only worked with actions taken on the local page (two pages open would have different histories).

This PR introduces a backend-persisted model for donation processing actions that tracks who performed an action, the source and target states, and also tracks undos using an originating_action. These actions are sent as part of the broadcast_processing_action socket updates, and are also queryable and undoable through their own API endpoints.

On the frontend, the action history has now moved to a distinct modal to better handle longer histories and provide more information to reference when deciding to undo an action.
image

Verification Process

Added tests. Ensured that performing actions in all of the states on the frontend logged an appropriate action, and that undoing actions put donations back into the appropriate states (and generates a new Undo action record as well).

The action history should be visible across page reloads, and on both the Processing and Read donations pages.

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

Successfully merging this pull request may close these issues.

1 participant