Browse Source
			
			
			
			
				
		* fix rebase conflicts * fix rebase conflicts * fix rebase conflicts * implement soft validation of grant value * fix rebase conflicts * fix rebase conflicts * fix rebase conflicts * fix rebase conflicts * fix final test from added page * update test after rebasepull/1245/head
				 10 changed files with 81 additions and 4 deletions
			
			
		| @ -0,0 +1,18 @@ | |||||||
|  | class Form::Sales::Pages::GrantValueCheck < ::Form::Page | ||||||
|  |   def initialize(id, hsh, subsection) | ||||||
|  |     super | ||||||
|  |     @id = "grant_value_check" | ||||||
|  |     @depends_on = [ | ||||||
|  |       { | ||||||
|  |         "grant_outside_common_range?" => true, | ||||||
|  |       }, | ||||||
|  |     ] | ||||||
|  |     @informative_text = {} | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   def questions | ||||||
|  |     @questions ||= [ | ||||||
|  |       Form::Sales::Questions::GrantValueCheck.new(nil, nil, self), | ||||||
|  |     ] | ||||||
|  |   end | ||||||
|  | end | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | class Form::Sales::Questions::GrantValueCheck < ::Form::Question | ||||||
|  |   def initialize(id, hsh, page) | ||||||
|  |     super | ||||||
|  |     @id = "grant_value_check" | ||||||
|  |     @check_answer_label = "Grant value confirmation" | ||||||
|  |     @header = "Are you sure? Grants are usually £9,000 - £16,000" | ||||||
|  |     @type = "interruption_screen" | ||||||
|  |     @answer_options = { | ||||||
|  |       "0" => { "value" => "Yes" }, | ||||||
|  |       "1" => { "value" => "No" }, | ||||||
|  |     } | ||||||
|  |     @hidden_in_check_answers = { | ||||||
|  |       "depends_on" => [ | ||||||
|  |         { | ||||||
|  |           "grant_value_check" => 0, | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |           "grant_value_check" => 1, | ||||||
|  |         }, | ||||||
|  |       ], | ||||||
|  |     } | ||||||
|  |   end | ||||||
|  | end | ||||||
| @ -0,0 +1,5 @@ | |||||||
|  | class AddGrantValueCheckToSalesLog < ActiveRecord::Migration[7.0] | ||||||
|  |   def change | ||||||
|  |     add_column :sales_logs, :grant_value_check, :integer | ||||||
|  |   end | ||||||
|  | end | ||||||
					Loading…
					
					
				
		Reference in new issue