-
Notifications
You must be signed in to change notification settings - Fork 29
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
Project: Add 404 responses for projects and workflows #1964
Conversation
07f4bb3
to
256de60
Compare
I think this PR will 404 if Panoptes is down. Do we want to do that? The project model might need a bit of work to distinguish between API errors and successful requests for resources that don't exist. |
bfc4c37
to
4a2dc85
Compare
The size of this PR jumped a lot today, but the increase is mostly tests. A lot of the SSR page props code has never had tests. |
559ca9a
to
1bd5732
Compare
1bd5732
to
e8191bf
Compare
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.
One minor style thing on the current generic 404 page:
We have an extra period in the message. This is a non-issue since I think implementing @beckyrother's designs would be the next iteration?
Nice set of new tests for this functionality with nock! Also, I since this partially implements what we discussed in #1997, it'd be nice to have the summary ADR of the decision written up to be able to reference while reviewing. Any chance you have time to write that up? Thanks!
Check the project model for a project ID after the project API call resolves. If there's no project ID, set a 404 status code and show the default Next error page.
Send back 404 if there's a workflow ID in the URL and it isn't an active workflow.
Perform all data fetching in getStaticPageProps (props that only depend on the page URL.) Return entry with a 404 to avoid extra API calls when we know there's nothing to fetch.
Add a couple of empty responses to the mocked API for getDefaultProps. Wrap the existing tests in describe blocks.
Essentially the same tests as for default page props, but with the HTTP request and response removed.
Rename NotFoundError to notFoundError and add tests.
0f7376c
to
6fce9c5
Compare
Remove a redundant existence check. Remove full stops from error messages (it seems the Next error page adds these in.)
6fce9c5
to
d0c4109
Compare
Check the project model for a project ID after the project API call resolves. If there's no project ID, set a 404 status code and show the default Next error page.
When there's a workflow ID in the URL, return 404 if it isn't listed in the project's active workflows.
Split data-fetching, and page props that only depend on the page URL, into a
getStaticPageProps
helper.Package:
app-project
Closes #1694.
Review Checklist
General
Components
Apps
yarn panic && yarn bootstrap
ordocker-compose up --build
and app works as expected?Publishing
Post-merging