From 26916a282757f1bc59d3b135925d386ddf7219b5 Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Wed, 15 Jan 2025 12:41:33 +0000 Subject: [PATCH] Add paused applications to CCMS queue for clarity --- .../admin/ccms_queues_controller.rb | 1 + app/views/admin/ccms_queues/index.html.erb | 39 ++++++++++++++++++- config/locales/en/admin.yml | 7 ++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/ccms_queues_controller.rb b/app/controllers/admin/ccms_queues_controller.rb index 164ebde9e5..1a4d8674d6 100644 --- a/app/controllers/admin/ccms_queues_controller.rb +++ b/app/controllers/admin/ccms_queues_controller.rb @@ -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 diff --git a/app/views/admin/ccms_queues/index.html.erb b/app/views/admin/ccms_queues/index.html.erb index 23fa14cfbc..798b25d297 100644 --- a/app/views/admin/ccms_queues/index.html.erb +++ b/app/views/admin/ccms_queues/index.html.erb @@ -3,8 +3,9 @@ back_link: :none, ) %> +

<%= t(".progress_queue.heading") %>

<% if @in_progress.empty? %> -

Queue is empty

+

<%= t(".progress_queue.empty") %>

<% else %>
@@ -40,3 +41,39 @@
<% end %> + +

<%= t(".paused_submission.heading") %>

+<% if @paused.empty? %> +

<%= t(".paused_submission.empty") %>

+<% else %> +
+
+ + <%= 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 %> + +
+
+ +<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 93be70387e..40aa37dc18 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -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: