Skip to content

Commit

Permalink
Add request prominence counts in admin UI
Browse files Browse the repository at this point in the history
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] #1005
  • Loading branch information
garethrees committed Oct 6, 2022
1 parent cef7ca4 commit 946fedf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/admin_public_body/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@

<h2>Requests</h2>

<%= render partial: 'admin_request/prominence_counts',
locals: { info_requests: @public_body.info_requests } %>

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @info_requests } %>

<hr>
Expand Down
12 changes: 12 additions & 0 deletions app/views/admin_request/_prominence_counts.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<ul class="thumbnails">
<% InfoRequest::Prominence::VALUES.each do |prominence| %>
<li class="span3">
<div class="thumbnail">
<%= prominence_icon(prominence) %>

<%= prominence %>:
<%= info_requests.where(prominence: prominence).size %>
</div>
</li>
<% end %>
</ul>
3 changes: 3 additions & 0 deletions app/views/admin_user/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@

<h2>Requests</h2>

<%= render partial: 'admin_request/prominence_counts',
locals: { info_requests: @admin_user.info_requests } %>

<%= render partial: 'admin_request/some_requests',
locals: { info_requests: @info_requests } %>

Expand Down
2 changes: 2 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 946fedf

Please sign in to comment.