Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubmissionsController: provide helpful redirects when invalid URLs are accessed #575

Merged

Conversation

lizheym
Copy link
Contributor

@lizheym lizheym commented May 8, 2024

What does this PR do?

This PR updates the SubmissionsController to add an index action and update the new action.

  • In the case of the index action, we redirect to the proposals #index route and display a notice flash message.
  • In the case of the new action, if there is no proposal provided, we redirect to the proposals #index route and display a notice flash message.
Why was this work done? Is there a related Issue?

This work was done in response to Issue Number 48, which notes that if someone happens to alter the URL (likely with knowledge of rails routes) to try to view the submissions index/new pages, an unhelpful error page is shown. The flash message should help contextualize the role of a submission, articulating why these pages do not exist (or need to exist).

Are there any manual testing steps?

  • Navigate to http://localhost:3000/submissions/new
  • Navigate to http://localhost:3000/submissions

Caveat about styling

This related CR by Hilary styles the flash messages, so they will look much better than shown below!!


Screenshots

http://localhost:3000/submissions/new
Screenshot 2024-05-08 at 3 35 16 PM
http://localhost:3000/submissions
Screenshot 2024-05-08 at 3 35 03 PM

@nodunayo nodunayo merged commit c67c20f into nodunayo:master May 21, 2024
1 check passed
@nodunayo
Copy link
Owner

Great stuff! I'm going to change the wording of the flash messages slightly, but other than that: awesome! Thank you!

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.

None yet

2 participants