Skip to content

Conversation

@benbaumann95
Copy link
Member

@benbaumann95 benbaumann95 commented Jan 5, 2026

Description of change

This whole redirect thing is a mess but hopefully these changes make things a bit more consistent (and less worse)...

Refactor return_to parameter handling for report navigation

  • Remove ReturnToReport concern in favor of inline params[:return_to]
  • Update controllers to use params[:return_to].presence || default_path
  • Change nested form.hidden_field :return_to to hidden_field_tag
  • Add TaskPathHelper to generate preapps task paths from report
  • Add return_to_or_task_path helper in BopsPreapps for preserving
    return_to through internal task navigation
  • Update report edit links to use new task-based layout paths
  • Add comprehensive test coverage for report-to-task navigation

This allows users editing from the pre-application report page to
return directly to the report after saving, with proper anchor
support for deep-linking to specific sections

Story Link

https://trello.com/c/WkkkDqhI/1571-redirects-from-review-to-the-new-assessment-layout

@benbaumann95 benbaumann95 force-pushed the review-redirect-fixes branch 7 times, most recently from 9c78cd7 to 0800a75 Compare January 6, 2026 12:23
@benbaumann95 benbaumann95 marked this pull request as ready for review January 6, 2026 13:55
- Replace session-based approach with param-passing pattern
- Add return_to_path helper for consistent redirect logic
- Add return_to_param helper for forms to preserve value
- Remove store_return_to_report_path before_action calls
- Update views to use hidden return_to fields in forms
@benbaumann95 benbaumann95 force-pushed the review-redirect-fixes branch from 0800a75 to 4bae4f7 Compare January 7, 2026 12:30
@benbaumann95 benbaumann95 force-pushed the review-redirect-fixes branch 3 times, most recently from 97f50ea to a9b2645 Compare January 8, 2026 11:00
- Remove ReturnToReport concern in favor of inline params[:return_to]
- Update controllers to use params[:return_to].presence || default_path
- Change nested form.hidden_field :return_to to hidden_field_tag
- Add return_to_or_task_path helper in BopsPreapps for preserving
  return_to through internal task navigation
- Update report edit links to use new task-based layout paths
- Add comprehensive test coverage for report-to-task navigation

This allows users editing from the pre-application report page to
return directly to the report after saving, with proper anchor
support for deep-linking to specific sections
@benbaumann95 benbaumann95 force-pushed the review-redirect-fixes branch from a9b2645 to decd4aa Compare January 8, 2026 12:25
@benbaumann95 benbaumann95 merged commit 0e0bfa6 into main Jan 8, 2026
45 checks passed
@benbaumann95 benbaumann95 deleted the review-redirect-fixes branch January 8, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants