Skip to content

Commit

Permalink
Add paused applications to CCMS queue for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbruce committed Jan 15, 2025
1 parent 00fd77c commit 4019fa1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/admin/ccms_queues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Admin
class CCMSQueuesController < AdminBaseController
def index
@in_progress = CCMS::Submission.where.not(aasm_state: %w[completed abandoned]).order(created_at: :desc)
@paused = BaseStateMachine.where(aasm_state: :submission_paused).order(:created_at).map(&:legal_aid_application)
end

def show
Expand Down
37 changes: 36 additions & 1 deletion app/views/admin/ccms_queues/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% if @in_progress.empty? %>
<h2 class="govuk-heading-m">Queue is empty</h2>
<% else %>

<h2 class="govuk-heading-m">Processing Queue</h2>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">

Expand Down Expand Up @@ -40,3 +40,38 @@
</div>

<% end %>
<% if @paused.empty? %>
<h2 class="govuk-heading-m">No paused submissions</h2>
<% else %>
<h2 class="govuk-heading-m">Paused submissions</h2>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">

<%= govuk_table do |table|
table.with_caption(html_attributes: { class: "govuk-visually-hidden" }, text: t(".page_title"))

table.with_head do |head|
head.with_row do |row|
row.with_cell(text: t(".references"))
row.with_cell(text: t(".state"))
row.with_cell(text: t(".created_at"))
end
end

table.with_body do |body|
@paused.each do |application|
body.with_row do |row|
row.with_cell do
govuk_link_to(application.application_ref, admin_ccms_queue_path(application.id))
end
row.with_cell(text: application.state.humanize)
row.with_cell(text: l(application.created_at, format: :long_date_time))
end
end
end
end %>

</div>
</div>

<% end %>

0 comments on commit 4019fa1

Please sign in to comment.