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

Redirect to 404 page if css_id in URL is invalid #14172

Merged
merged 3 commits into from
May 4, 2020

Conversation

yoomlam
Copy link
Contributor

@yoomlam yoomlam commented May 4, 2020

Resolves #13911

Description

Change to use user-friendly error page.

Acceptance Criteria

  • Code compiles correctly

Testing Plan

  1. Go to http://localhost:3000/queue/BVAAAAAAAABSHIRE/assign or http://localhost:3000/queue/BVAAAbBSHIRE

User Facing Changes

  • Screenshots of UI changes added to PR & Original Issue
BEFORE AFTER
Screen Shot 2020-04-07 at 12 03 01 PM image

@yoomlam yoomlam added Product: caseflow-queue Team: Echo 🐬 Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. labels May 4, 2020
@yoomlam yoomlam self-assigned this May 4, 2020
@codeclimate
Copy link

codeclimate bot commented May 4, 2020

Code Climate has analyzed commit f58f290 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@ajspotts ajspotts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 🚀

@@ -126,7 +126,7 @@ def update
private

def validate_user_id
fail(Caseflow::Error::InvalidUserId, user_id: params[:user_id]) unless user
fail(ActiveRecord::RecordNotFound, user_id: params[:user_id]) unless user
Copy link
Contributor Author

@yoomlam yoomlam May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled by

rescue_from ActiveRecord::RecordNotFound, with: :not_found

and
def not_found
respond_to do |format|
format.html do
render "errors/404", layout: "application", status: :not_found
end

which loads https://github.com/department-of-veterans-affairs/caseflow/blob/7168968e0529c4957f04128cef19be0d32d66161/app/views/errors/404.html.erb
and causes the frontend to display

<StatusMessage title="Page not found">
Oops! We can't find the correct page. If you need assistance,
please visit the <Link to="/help">Caseflow Help Page</Link>.
<p>If you continue to see this page, please contact
the <a href={this.props.feedbackUrl}>Caseflow Help Desk</a>.</p>
</StatusMessage>

More here.

@yoomlam yoomlam added the Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master label May 4, 2020
@yoomlam yoomlam merged commit ff59e90 into master May 4, 2020
@yoomlam yoomlam deleted the yoom/13911-handle_bad_cssid branch May 4, 2020 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Product: caseflow-queue Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master Team: Echo 🐬
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle bad css_id when navigating to a judge assign queue
2 participants