diff --git a/app/controllers/support/cases/tasklists_controller.rb b/app/controllers/support/cases/tasklists_controller.rb new file mode 100644 index 000000000..29ef5b756 --- /dev/null +++ b/app/controllers/support/cases/tasklists_controller.rb @@ -0,0 +1,11 @@ +module Support + module Cases + class TasklistsController < Cases::ApplicationController + private + + def current_case + @current_case ||= CasePresenter.new(super) + end + end + end +end diff --git a/app/views/support/cases/show.html.erb b/app/views/support/cases/show.html.erb index 8a83be11a..220bc6ec5 100644 --- a/app/views/support/cases/show.html.erb +++ b/app/views/support/cases/show.html.erb @@ -1,15 +1,17 @@ -<%= render "support/cases/show/tabs" do %> - <%= render "support/cases/show/school_details", current_case: @current_case %> - <%= render "support/cases/show/case_details", current_case: @current_case %> - <%= render "support/cases/show/request_details", current_case: @current_case %> + <%= render "support/cases/show/tabs" do %> + <%= render "support/cases/show/tasklist", current_case: @current_case %> + <%= render "support/cases/show/school_details", current_case: @current_case %> + <%= render "support/cases/show/case_details", current_case: @current_case %> + <%= render "support/cases/show/request_details", current_case: @current_case %> -
- <%= turbo_frame_tag "messages-frame", src: params[:messages_tab_url].presence || support_case_message_threads_path(@current_case) do %> -

Loading...

- <% end %> -
+
+ <%= turbo_frame_tag "messages-frame", src: params[:messages_tab_url].presence || support_case_message_threads_path(@current_case) do %> +

Loading...

+ <% end %> +
- <%= render "support/cases/show/case_history", interactions: @current_case.case_history_interactions, current_case: @current_case %> - <%= render "support/cases/show/case_attachments", current_case: @current_case %> - <%= render "support/cases/show/case_files", current_case: @current_case %> -<% end %> + <%= render "support/cases/show/case_history", interactions: @current_case.case_history_interactions, current_case: @current_case %> + <%= render "support/cases/show/case_attachments", current_case: @current_case %> + <%= render "support/cases/show/case_files", current_case: @current_case %> + <% end %> + \ No newline at end of file diff --git a/app/views/support/cases/show/_tabs.html.erb b/app/views/support/cases/show/_tabs.html.erb index 7fb47d9b0..ceaaf6799 100644 --- a/app/views/support/cases/show/_tabs.html.erb +++ b/app/views/support/cases/show/_tabs.html.erb @@ -25,6 +25,13 @@
<%= render "support/cases/show/case_actions" %> - diff --git a/app/views/support/cases/show/_tasklist.html.erb b/app/views/support/cases/show/_tasklist.html.erb new file mode 100644 index 000000000..c0058c74f --- /dev/null +++ b/app/views/support/cases/show/_tasklist.html.erb @@ -0,0 +1,23 @@ +
+

+ <%= I18n.t("support.case.header.procurement_task_list") %> +

+
+
+

+ <%= I18n.t("support.case.label.tasklist.complete_evaluation") %> +

+ <%= govuk_task_list(id_prefix: "complete-evaluation") do |task_list| + task_list.with_item(title: I18n.t("support.case.label.tasklist.item.add_evaluators"), href: '#', status: govuk_tag(text: I18n.t("support.case.label.tasklist.status.to_do"))) + task_list.with_item(title: I18n.t("support.case.label.tasklist.item.set_due_date"), href: '#', status: govuk_tag(text: I18n.t("support.case.label.tasklist.status.to_do"))) + task_list.with_item(title: I18n.t("support.case.label.tasklist.item.upload_documents"), href: '#', status: govuk_tag(text: I18n.t("support.case.label.tasklist.status.to_do"))) + task_list.with_item(title: I18n.t("support.case.label.tasklist.item.email_evaluators")) do | item | + item.with_status(text: I18n.t("support.case.label.tasklist.status.cannot_start"), cannot_start_yet: true) + end + task_list.with_item(title: I18n.t("support.case.label.tasklist.item.review_evaluations")) do | item | + item.with_status(text: I18n.t("support.case.label.tasklist.status.cannot_start"), cannot_start_yet: true) + end + end %> +
+
+
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 0f49dc10d..5c8df361b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -918,6 +918,8 @@ en: request: Request request_details: Request details school_detail: School details + tasklist: Tasklist + procurement_task_list: Procurement task list label: actions: transfer_to_framework_evaluation: Transfer to framework evaluation @@ -1205,6 +1207,19 @@ en: L5: 5 - DfE buying by getting quotes or bids header: Case level unspecified: Not specified + tasklist: + complete_evaluation: Complete evaluation + item: + add_evaluators: Add evaluators + set_due_date: Set due date + upload_documents: Upload documents + email_evaluators: Email evaluators + review_evaluations: Review evaluations + status: + to_do: To do + in_progress: In progress + complete: Complete + cannot_start: Cannot start transfer_to_framework_evaluation: title: Buy for your school | Case %{reference} | Transfer to framework evaluation header: Do you want to transfer Case %{reference} to a framework evaluation case? diff --git a/config/routes.rb b/config/routes.rb index 184acf1bb..b604fc383 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -275,6 +275,7 @@ resource :participating_schools, only: %i[show] end end + resource :tasklist, only: %i[show] get :transfer_to_framework_evaluation, to: "transfer_to_framework_evaluation#index" post :transfer_to_framework_evaluation, to: "transfer_to_framework_evaluation#create" get "move_emails/", to: "move_emails#index", as: "move_emails" diff --git a/spec/features/support/case_tabs_spec.rb b/spec/features/support/case_tabs_spec.rb index a4b31cf54..538b56670 100644 --- a/spec/features/support/case_tabs_spec.rb +++ b/spec/features/support/case_tabs_spec.rb @@ -99,4 +99,32 @@ end end end + + context "when the case is level 4" do + let(:support_case) { create(:support_case, support_level: "L4") } + + it "has 8 visible tabs" do + expect(all(".govuk-tabs__list-item", visible: true).count).to eq(8) + end + + it "has the tasklist tab" do + expect(page).to have_css(".govuk-tabs__list-item", text: "Tasklist") + end + end + + context "when the case is level 5" do + let(:support_case) { create(:support_case, support_level: "L5") } + + it "has the tasklist tab" do + expect(page).to have_css(".govuk-tabs__list-item", text: "Tasklist") + end + end + + context "when the case is level 1" do + let(:support_case) { create(:support_case, support_level: "L1") } + + it "does not have the tasklist tab" do + expect(page).not_to have_css(".govuk-tabs__list-item", text: "Tasklist") + end + end end diff --git a/spec/features/support/case_tasklist_spec.rb b/spec/features/support/case_tasklist_spec.rb new file mode 100644 index 000000000..a97716e98 --- /dev/null +++ b/spec/features/support/case_tasklist_spec.rb @@ -0,0 +1,19 @@ +describe "Case tasklist", :js do + include_context "with an agent" + + before do + visit "/support/cases/#{support_case.id}#tasklist" + end + + context "when a case is level 4 (or 5)" do + let(:support_case) { create(:support_case, support_level: "L4") } + + it "has a tasklist tab with a tasklist and items" do + within "#tasklist" do + expect(page).to have_text("Procurement task list") + expect(page).to have_text("Complete evaluation") + expect(page).to have_css(".govuk-task-list") + end + end + end +end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index bba85fd2b..dc7b4f23b 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -79,6 +79,7 @@ config.before do Bullet.enable = false Flipper.enable(:customer_satisfaction_survey) + Flipper.enable(:sc_tasklist_tab) end config.after do