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 26916a2
Show file tree
Hide file tree
Showing 3 changed files with 46 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
39 changes: 38 additions & 1 deletion app/views/admin/ccms_queues/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
back_link: :none,
) %>

<h2 class="govuk-heading-m"><%= t(".progress_queue.heading") %></h2>
<% if @in_progress.empty? %>
<h2 class="govuk-heading-m">Queue is empty</h2>
<h3 class="govuk-heading-s"><%= t(".progress_queue.empty") %></h3>
<% else %>

<div class="govuk-grid-row">
Expand Down Expand Up @@ -40,3 +41,39 @@
</div>

<% end %>

<h2 class="govuk-heading-m"><%= t(".paused_submission.heading") %></h2>
<% if @paused.empty? %>
<h3 class="govuk-heading-s"><%= t(".paused_submission.empty") %></h3>
<% else %>
<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(".case_reference"))
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_legal_aid_applications_submission_path(application))
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 %>
7 changes: 7 additions & 0 deletions config/locales/en/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ en:
ccms_queues:
index:
page_title: Incomplete CCMS Submissions
progress_queue:
heading: Processing queue
empty: The sidekiq queue is empty
paused_submission:
heading: Paused submissions
empty: There are no paused submissions
applicant_name: Client's name
references: CCMS & case reference
case_reference: Case reference
created_at: Date started
state: State
sidekiq:
Expand Down

0 comments on commit 26916a2

Please sign in to comment.