-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Task 2260] refactor search error page for maintainability #2434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome start at making things cleaner and easier to maintain.
99fe83d
to
3f5eb8c
Compare
status: number; | ||
type: string; | ||
} | ||
|
||
function isValidJSON(str: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably move to a util, but didn't want to cause unnecessary churn creating a new file for it today
} | ||
} | ||
|
||
function createBlankParsedError(): ParsedError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like there should be a better way but I think I'd need more context into our error throwing / handling patterns to take an informed approach. For now just tried to change as little as possible to keep this working
@@ -23,7 +22,6 @@ export default function SearchFilters({ | |||
category: Set<string>; | |||
opportunityStatus: Set<string>; | |||
}) { | |||
unstable_setRequestLocale("en"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that unstable_setRequestLocale
is only meant to be used on layout and page files https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#add-unstable_setrequestlocale-to-all-layouts-and-pages
Summary
Fixes #2260
Time to review: 20 mins
Changes proposed
The goal of this change is to update the search error page to:
To accomplish this, I:
Context for reviewers
Note that I considered other options for approaching this change:
A few other ancillary changes:
Test steps
simpler-grants-gov/frontend/src/app/api/SearchOpportunityAPI.ts
Line 22 in db47fec
Additional information
Existing issues uncovered but not addressed: