Browse Source

feat: remove question dynamic behaviour

pull/944/head
natdeanlewissoftwire 3 years ago
parent
commit
63aaa3b7e3
  1. 2
      app/helpers/question_view_helper.rb
  2. 3
      app/models/form/question.rb
  3. 3
      app/models/form/sales/questions/person2_known.rb

2
app/helpers/question_view_helper.rb

@ -7,7 +7,7 @@ module QuestionViewHelper
def legend(question, page_header, conditional) def legend(question, page_header, conditional)
{ {
text: question.header_partial.present? ? question.header_partial.html_safe : question.header.html_safe, text: question.header.html_safe,
size: label_size(page_header, conditional), size: label_size(page_header, conditional),
tag: label_tag(page_header, conditional), tag: label_tag(page_header, conditional),
} }

3
app/models/form/question.rb

@ -1,5 +1,5 @@
class Form::Question class Form::Question
attr_accessor :id, :header, :header_partial, :hint_text, :description, :questions, attr_accessor :id, :header, :hint_text, :description, :questions,
:type, :min, :max, :step, :width, :fields_to_add, :result_field, :type, :min, :max, :step, :width, :fields_to_add, :result_field,
:conditional_for, :readonly, :answer_options, :page, :check_answer_label, :conditional_for, :readonly, :answer_options, :page, :check_answer_label,
:inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value, :inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value,
@ -16,7 +16,6 @@ class Form::Question
if hsh if hsh
@check_answer_label = hsh["check_answer_label"] @check_answer_label = hsh["check_answer_label"]
@header = hsh["header"] @header = hsh["header"]
@header_partial = hsh["header_partial"]
@guidance_partial = hsh["guidance_partial"] @guidance_partial = hsh["guidance_partial"]
@guidance_position = GuidancePosition::TOP @guidance_position = GuidancePosition::TOP
@hint_text = hsh["hint_text"] @hint_text = hsh["hint_text"]

3
app/models/form/sales/questions/person2_known.rb

@ -3,8 +3,7 @@ class Form::Sales::Questions::Person2Known < ::Form::Question
super super
@id = "details_known_2" @id = "details_known_2"
@check_answer_label = "Details known for person 2" @check_answer_label = "Details known for person 2"
@header = "Do you know the details for person 2? @header = "Do you know the details for person 2?"
"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@page = page @page = page

Loading…
Cancel
Save