From 873d7385131f0ed3f242e0642d3e29b9cd00c50a Mon Sep 17 00:00:00 2001 From: baarkerlounger <5101747+baarkerlounger@users.noreply.github.com> Date: Thu, 13 Jan 2022 13:50:52 +0000 Subject: [PATCH] CLDC-836: Don't make subsection labels links if they're not enabled (#215) * Don't make subsection labels links if they're not enabled * PR accessibility comments --- app/helpers/tasklist_helper.rb | 12 ++++++------ app/views/case_logs/_tasklist.html.erb | 11 +++++++---- spec/helpers/tasklist_helper_spec.rb | 4 ++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/helpers/tasklist_helper.rb b/app/helpers/tasklist_helper.rb index a6935f620..148f2f1e7 100644 --- a/app/helpers/tasklist_helper.rb +++ b/app/helpers/tasklist_helper.rb @@ -35,11 +35,11 @@ module TasklistHelper end def subsection_link(subsection, case_log) - next_page_path = if subsection.status(case_log) != :cannot_start_yet - first_page_or_check_answers(subsection, case_log) - else - "#" - end - govuk_link_to(subsection.label, next_page_path.to_s.dasherize, class: "task-name") + if subsection.status(case_log) != :cannot_start_yet + next_page_path = first_page_or_check_answers(subsection, case_log).to_s + govuk_link_to(subsection.label, next_page_path.dasherize, aria: { describedby: subsection.id.dasherize }) + else + subsection.label + end end end diff --git a/app/views/case_logs/_tasklist.html.erb b/app/views/case_logs/_tasklist.html.erb index 6765d6f82..85a8d6349 100644 --- a/app/views/case_logs/_tasklist.html.erb +++ b/app/views/case_logs/_tasklist.html.erb @@ -8,10 +8,13 @@