Browse Source

refactor: cleanup and disable on 2022 and before logs

pull/1381/head
natdeanlewissoftwire 3 years ago
parent
commit
37b624343c
  1. 2
      app/components/check_answers_summary_list_card_component.rb
  2. 2
      app/helpers/check_answers_helper.rb
  3. 2
      app/helpers/question_view_helper.rb
  4. 4
      app/models/form/question.rb

2
app/components/check_answers_summary_list_card_component.rb

@ -18,7 +18,7 @@ class CheckAnswersSummaryListCardComponent < ViewComponent::Base
end
def get_question_label(question)
[question.question_number_string(false), question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ")
[question.question_number_string, question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ")
end
def check_answers_card_title(question)

2
app/helpers/check_answers_helper.rb

@ -47,6 +47,6 @@ private
end
def get_question_label(question)
[question.question_number_string(false), question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ")
[question.question_number_string, question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ")
end
end

2
app/helpers/question_view_helper.rb

@ -7,7 +7,7 @@ module QuestionViewHelper
def legend(question, page_header, conditional)
{
text: [question.question_number_string(conditional), question.header.html_safe].compact.join(" - "),
text: [question.question_number_string(conditional:), question.header.html_safe].compact.join(" - "),
size: label_size(page_header, conditional),
tag: label_tag(page_header, conditional),
}

4
app/models/form/question.rb

@ -259,8 +259,8 @@ class Form::Question
selected_answer_option_is_derived?(log) || has_inferred_check_answers_value?(log)
end
def question_number_string(conditional)
if @question_number && !conditional
def question_number_string(conditional: false)
if @question_number && !conditional && form.start_date.year >= 2023
"Q#{@question_number}"
end
end

Loading…
Cancel
Save