Browse Source

Update correct_validation_action_href

pull/2483/head
Kat 2 years ago
parent
commit
fea6f10256
  1. 2
      app/components/check_answers_summary_list_card_component.html.erb
  2. 4
      app/components/check_answers_summary_list_card_component.rb

2
app/components/check_answers_summary_list_card_component.html.erb

@ -36,7 +36,7 @@
<% if @log.collection_period_open_for_editing? %> <% if @log.collection_period_open_for_editing? %>
<% row.with_action( <% row.with_action(
text: question.action_text(log, correcting_hard_validation: @correcting_hard_validation), text: question.action_text(log, correcting_hard_validation: @correcting_hard_validation),
href: @correcting_hard_validation ? correct_validation_action_href(question, log, applicable_questions.map(&:id)) : action_href(question, log), href: correct_validation_action_href(question, log, applicable_questions.map(&:id), @correcting_hard_validation),
visually_hidden_text: question.check_answer_label.to_s.downcase, visually_hidden_text: question.check_answer_label.to_s.downcase,
) %> ) %>
<% end %> <% end %>

4
app/components/check_answers_summary_list_card_component.rb

@ -34,7 +34,9 @@ class CheckAnswersSummaryListCardComponent < ViewComponent::Base
send("#{log.model_name.param_key}_#{question.page.id}_path", log, referrer:) send("#{log.model_name.param_key}_#{question.page.id}_path", log, referrer:)
end end
def correct_validation_action_href(question, log, _related_question_ids) def correct_validation_action_href(question, log, _related_question_ids, correcting_hard_validation)
return action_href(question, log) unless correcting_hard_validation
if question.displayed_as_answered?(log) if question.displayed_as_answered?(log)
send("#{log.model_name.param_key}_confirm_clear_answer_path", log, question_id: question.id) send("#{log.model_name.param_key}_confirm_clear_answer_path", log, question_id: question.id)
else else

Loading…
Cancel
Save