mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
389 stars 196 forks source link

Button to revert status of requests marked for admin attention #8230

Open HelenWDTK opened 5 months ago

HelenWDTK commented 5 months ago

Replaces #1773, deleted in error:

On 14 September 2022 @garethrees wrote:

Context

After dealing with a reported request, to reset the state admins need to review the event history to find the previous status, remember it, then go to the edit page for the request to reset this state. It's pretty tedious and occasionally we revert to an incorrect status. We want a one-click way of reseting this state.

Scope

If a request is in a reported state (attention_requested , requires_admin, error_message), we'll add a new section in the "Actions" grouping on the request's admin page. In it we'll have a label, the button, and an indication of the previous state that the request is going to be put back into. 1

Technical Considerations

I think we'll probably need to store the previous state in the params_yaml of the report_request event. Alternatively, we may be able to use calculated_state. Note how below, the response event is described as successful but then calculated as attention_requested now that the report has been made. It may be that we can essentially do the reverse when reporting a request. 2 I'm a little less sure on the mechanics of all this, so it's worth exploring the code to see which approach makes more sense conceptually.

Out of Scope

A link in the email of reports was suggested, but that adds extra complexity to the controller handling these, in terms of handling different HTTP verbs, how we present the params in the URL, and giving an indication of what the request is being reset to. What happens to old links if they're clicked but the request is no longer reported? Too much hassle for the value at this stage.

We do want a Reportable in future (#6931), but extracting out all of the report mechanics from InfoRequest is going to be too difficult for the value in this context. If we can make any refactorings that help directly with this issue and also benefit a future Reportable though, we should.