Browse Source

CLDC-4082: Allow for an unresolved log to redirect to the correct location page

previously would always go to location, causing issues for schemes with many locations
pull/3102/head
Samuel Young 2 weeks ago
parent
commit
8af721fbc2
  1. 6
      app/models/form.rb
  2. 2
      app/models/form/lettings/pages/scheme.rb

6
app/models/form.rb

@ -86,7 +86,11 @@ class Form
end end
def next_page_id(page, log, current_user, ignore_answered: false) def next_page_id(page, log, current_user, ignore_answered: false)
return page.next_unresolved_page_id || :check_answers if log.unresolved if log.unresolved
return log.scheme_has_large_number_of_locations? ? "location_search" : "location" if page.next_unresolved_page_id == :location_or_location_search
return page.next_unresolved_page_id || :check_answers
end
page_ids = page.subsection.pages.map(&:id) page_ids = page.subsection.pages.map(&:id)
page_index = page_ids.index(page.id) page_index = page_ids.index(page.id)

2
app/models/form/lettings/pages/scheme.rb

@ -6,7 +6,7 @@ class Form::Lettings::Pages::Scheme < ::Form::Page
"needstype" => 2, "needstype" => 2,
}, },
] ]
@next_unresolved_page_id = "location" @next_unresolved_page_id = :location_or_location_search
end end
def questions def questions

Loading…
Cancel
Save