-
Notifications
You must be signed in to change notification settings - Fork 54
Change pathogens to splat [#1133] #1136
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
Closed
genehack
wants to merge
21
commits into
remediate-already-ported-bits-1133
from
change-pathogens-to-splat-1133
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9ceadc8
Remediate comments in `static-site/app/blog` tree [#1133]
genehack c4da8f4
Remediate comment in `static-site/app/contact/page.tsx` [#1133]
genehack 7fcfab2
Remediate comments in base-level `static-site/app/` files [#1133]
genehack 5ba6c96
Add Metadata to `static-site/app/pathogens/page.tsx` [#1133]
genehack cf45081
Remediate comment in `static-site/app/team/page.tsx` [#1133]
genehack ab43ac0
Remediate comment in `static-site/app/whoami/page.tsx` [#1133]
genehack c4fd97e
Remediate comments in `static-site/components/error-message` [#1133]
genehack c469f84
Remediate comments in `static-site/components/expandable-tiles` [#1133]
genehack 9c75942
Remediate comments in `static-site/components/flex-center` [#1133]
genehack 1a546f2
Remediate comments in `static-site/components/focus-paragraph` [#1133]
genehack 6bc80e4
Remediate comments and whitespace in `static-site/components/footer` …
genehack 4b0b035
Remediate comment in `static-site/components/line` [#1133]
genehack 1a5640e
Remediate comments in `static-site/components/list-resources` tree [#…
genehack 449bb22
Remediate comments in `static-site/components/logos` [#1133]
genehack 6cf6a41
Remediate comments in `static-site/components/nav` tree [#1133]
genehack d5225b4
Remediate comments in `static-site/components/people/avatars.tsx` [#1…
genehack ab2bb17
Remediate comment in `static-site/components/plausible-analytics` [#1…
genehack 14c0f61
Remediate comments in `static-site/comments/spacers` [#1133]
genehack 495b694
Remediate comment in `static-site/components/user-data-wrapper` [#1133]
genehack 94aa4d5
Convert /pathogens over to using splat path to display error message.…
genehack c8cfb4e
Extract repeated <ErrorBanner> parts of staging and pathogens into co…
genehack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
static-site/app/pathogens/callback.tsx → ...p/pathogens/[[...pathogens]]/callback.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 25 additions & 9 deletions
34
static-site/app/pathogens/page.tsx → ...pp/pathogens/[[...pathogens]]/content.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import React from "react"; | ||
|
|
||
| import ErrorBanner from "../../../components/error-banner"; | ||
|
|
||
| import PathogensPageContent from "./content"; | ||
| import { metadata } from "./page"; | ||
|
|
||
| /** | ||
| * A React Server component that renders the usual `/staging` page | ||
| * content, with an error banner up-top explaining that the requested | ||
| * dataset doesn't actuall exist. | ||
| */ | ||
| export default function FourOhFour(): React.ReactElement { | ||
| return ( | ||
| <> | ||
| <ErrorBanner stub="pathogens"/> | ||
| <PathogensPageContent metadata={metadata} /> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import React from "react"; | ||
| import { Metadata } from "next"; | ||
|
|
||
| import PathogensPageContent from "./content"; | ||
| import ValidatePathogensUrl from "./validatePathogensUrl"; | ||
|
|
||
| const title = "Nextstrain-maintained pathogen analyses"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title, | ||
| }; | ||
|
|
||
| /** | ||
| * React Server Component for `/pathogens` | ||
| * | ||
| * See note in `static-site/app/staging/[[...staging]]/page.tsx` | ||
| * to understand how this works | ||
| */ | ||
| export default function Pathogens(): React.ReactElement { | ||
| return ( | ||
| <> | ||
| <ValidatePathogensUrl /> | ||
| <PathogensPageContent metadata={metadata} /> | ||
| </> | ||
| ); | ||
| } |
23 changes: 23 additions & 0 deletions
23
static-site/app/pathogens/[[...pathogens]]/validatePathogensUrl.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| "use client"; | ||
|
|
||
| import { notFound, useParams }from "next/navigation"; | ||
|
|
||
| /** | ||
| * A React Client Component to detect when an invalid `/pathogens/` URL | ||
| * is requested, which calls the `notFound()` method to redirect to | ||
| * the `not-found.tsx` component | ||
| * | ||
| * Note that any actually valid `/pathogens/<something>` URL will be | ||
| * redirected at the Express router level, before the Next.js router | ||
| * is engaged, so if we are trying to render a `/pathogens/<something>` | ||
| * URL, it _is_ an error | ||
| */ | ||
| export default function ValidateStagingUrl(): null { | ||
| const params = useParams(); | ||
|
|
||
| if (params && params["pathogens"]) { | ||
| notFound(); | ||
| } | ||
| else { return null; } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
See suggestion to use
pathogens/[[...slug]]: #1131 (comment)