From 946fedfb21bed5e15e9ec9ecc81b2658ee9cf78c Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 6 Oct 2022 13:08:26 +0100 Subject: [PATCH] Add request prominence counts in admin UI Make it easy to quickly see the distribution of prominence states for requests on body and user admin pages. The use case for this was wanting to know if a request hidden due to a data breach was the first for the authority in question or yet another in a long history of breaches. We do try to minimise reduced prominence to specific messages or even attachments after #1005 [1], so only showing request prominence counts doesn't tell the whole story, but it's a start. [1] https://github.com/mysociety/alaveteli/issues/1005 --- app/views/admin_public_body/show.html.erb | 3 +++ app/views/admin_request/_prominence_counts.html.erb | 12 ++++++++++++ app/views/admin_user/show.html.erb | 3 +++ doc/CHANGES.md | 2 ++ 4 files changed, 20 insertions(+) create mode 100644 app/views/admin_request/_prominence_counts.html.erb diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index 8907830344..a577a679d9 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -120,6 +120,9 @@

Requests

+<%= render partial: 'admin_request/prominence_counts', + locals: { info_requests: @public_body.info_requests } %> + <%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @info_requests } %>
diff --git a/app/views/admin_request/_prominence_counts.html.erb b/app/views/admin_request/_prominence_counts.html.erb new file mode 100644 index 0000000000..706a0d4f1c --- /dev/null +++ b/app/views/admin_request/_prominence_counts.html.erb @@ -0,0 +1,12 @@ + diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb index 77809390d8..737cdc3c05 100644 --- a/app/views/admin_user/show.html.erb +++ b/app/views/admin_user/show.html.erb @@ -125,6 +125,9 @@

Requests

+<%= render partial: 'admin_request/prominence_counts', + locals: { info_requests: @admin_user.info_requests } %> + <%= render partial: 'admin_request/some_requests', locals: { info_requests: @info_requests } %> diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 043734a0ca..be0f9439bb 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,8 @@ ## Highlighted Features +* Add count of requests in each prominence state to body and user admin pages + (Gareth Rees) * Improved notes feature, allowing multiple notes to be associated with bodies and requests. Association can either be direct or via a tag. Tagged notes are useful for displaying one note to a subset of bodies or requests which are all