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

fix(app): Show 404 pages on more invalid route paths (root and error pages) #3061

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions packages/openneuro-app/src/scripts/errors/errorRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
import OrcidEmail from "./orcid/email.jsx"
import OrcidGiven from "./orcid/given.jsx"
import OrcidFamily from "./orcid/family.jsx"
import FourOFourPage from "./404page"

Check warning on line 10 in packages/openneuro-app/src/scripts/errors/errorRoute.jsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-app/src/scripts/errors/errorRoute.jsx#L10

Added line #L10 was not covered by tests

class ErrorRoute extends React.Component {
render() {
return (
<div className="container errors">
<div className="panel">
<Routes>
<Route path="orcid" element={<OrcidGeneral />} />
<Route path="orcid/email" element={<OrcidEmail />} />
<Route path="orcid/given" element={<OrcidGiven />} />
<Route path="orcid/family" element={<OrcidFamily />} />
</Routes>
</div>
function ErrorRoute() {
return (
<div className="container errors">
<div className="panel">
<Routes>
<Route path="orcid" element={<OrcidGeneral />} />
<Route path="orcid/email" element={<OrcidEmail />} />
<Route path="orcid/given" element={<OrcidGiven />} />
<Route path="orcid/family" element={<OrcidFamily />} />
<Route path="*" element={<FourOFourPage />} />
</Routes>

Check warning on line 22 in packages/openneuro-app/src/scripts/errors/errorRoute.jsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-app/src/scripts/errors/errorRoute.jsx#L12-L22

Added lines #L12 - L22 were not covered by tests
</div>
)
}
</div>
)

Check warning on line 25 in packages/openneuro-app/src/scripts/errors/errorRoute.jsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-app/src/scripts/errors/errorRoute.jsx#L24-L25

Added lines #L24 - L25 were not covered by tests
}

export default ErrorRoute
2 changes: 1 addition & 1 deletion packages/openneuro-app/src/scripts/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
path="/dashboard"
element={<Navigate to="/search?mydatasets" replace />}
/>
<Route element={<FourOFourPage />} />
<Route path="/*" element={<FourOFourPage />} />

Check warning on line 42 in packages/openneuro-app/src/scripts/routes.tsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-app/src/scripts/routes.tsx#L42

Added line #L42 was not covered by tests
</Routes>
)

Expand Down
Loading