8 changed files with 75 additions and 41 deletions
@ -0,0 +1,36 @@
|
||||
class Form::Sales::Pages::StaircaseOwnedValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, joint_purchase:) |
||||
super(id, hsh, subsection) |
||||
@joint_purchase = joint_purchase |
||||
@depends_on = [ |
||||
{ |
||||
"staircase_owned_out_of_soft_range?" => true, |
||||
"joint_purchase?" => joint_purchase, |
||||
}, |
||||
] |
||||
@title_text = { |
||||
"translation" => joint_purchase ? "soft_validations.staircase_owned.title_text.two" : "soft_validations.staircase_owned.title_text.one", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "stairowned", |
||||
"label" => true, |
||||
"i18n_template" => "stairowned", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.staircase_owned.hint_text", |
||||
"arguments" => [], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::StaircaseOwnedValueCheck.new(nil, nil, self), |
||||
] |
||||
end |
||||
|
||||
def interruption_screen_question_ids |
||||
%w[type stairowned] |
||||
end |
||||
end |
||||
@ -0,0 +1,23 @@
|
||||
class Form::Sales::Questions::StaircaseOwnedValueCheck < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "stairowned_value_check" |
||||
@check_answer_label = "Percentage owned confirmation" |
||||
@header = "Are you sure?" |
||||
@type = "interruption_screen" |
||||
@answer_options = { |
||||
"0" => { "value" => "Yes" }, |
||||
"1" => { "value" => "No" }, |
||||
} |
||||
@hidden_in_check_answers = { |
||||
"depends_on" => [ |
||||
{ |
||||
"stairowned_value_check" => 0, |
||||
}, |
||||
{ |
||||
"stairowned_value_check" => 1, |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
end |
||||
Loading…
Reference in new issue