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

Fragment display update #457

Closed
wants to merge 8 commits into from
Closed
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
10 changes: 10 additions & 0 deletions src/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'

const NotFoundPage: React.FC = () => (
<div style={{ textAlign: 'center', marginTop: '50px' }}>
<h1>404 - Not Found</h1>
<p>The page you are looking for does not exist.</p>
</div>
)

export default NotFoundPage
2 changes: 2 additions & 0 deletions src/fragmentarium/ui/info/ResearchProjects.sass
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.ResultList
ul
padding: 0
margin: 0

li
list-style: none
padding-bottom: .5rem
8 changes: 4 additions & 4 deletions src/fragmentarium/ui/info/ResearchProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export function ProjectList({
projects: readonly ResearchProject[]
}): JSX.Element {
return (
<ul className={'ResultList'}>
<div className={'ResultList'}>
{projects.map((project, index) => (
<li key={index}>
<div key={index}>
<ExternalLink
href={project.url}
aria-label={`Link to ${project.name} project`}
Expand All @@ -23,8 +23,8 @@ export function ProjectList({
alt={project.name}
/>
</ExternalLink>
</li>
</div>
))}
</ul>
</div>
)
}
2 changes: 1 addition & 1 deletion src/fragmentarium/ui/info/ScriptSelection.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
&__button-wrapper
display: flex
align-items: flex-start
justify-content: space-between
justify-content: flex-end

button
margin-left: .5em
6 changes: 6 additions & 0 deletions src/router/aboutRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import About, { TabId, tabIds } from 'about/ui/about'
import { CachedMarkupService } from 'markup/application/MarkupService'
import { sitemapDefaults } from 'router/sitemap'
import { HeadTagsService } from 'router/head'
import NotFoundPage from 'NotFoundPage'
import { newsletters } from 'about/ui/news'

// ToDo:
Expand Down Expand Up @@ -44,6 +45,11 @@ export default function AboutRoutes({
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="AboutNotFound"
path="/about/*"
render={(): ReactNode => <NotFoundPage />}
/>,
<Redirect
from="/about"
to="/about/fragmentarium"
Expand Down
10 changes: 10 additions & 0 deletions src/router/bibliographyRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { BibliographySlugs, sitemapDefaults } from 'router/sitemap'
import { HeadTagsService } from 'router/head'
import AfoRegisterService from 'afo-register/application/AfoRegisterService'
import FragmentService from 'fragmentarium/application/FragmentService'
import NotFoundPage from 'NotFoundPage'

export default function BibliographyRoutes({
sitemap,
Expand All @@ -25,6 +26,7 @@ export default function BibliographyRoutes({
<Route
key="BibliographyEditorNew"
path="/bibliography/references/new-reference"
exact
render={(props): ReactNode => (
<BibliographyEditor
bibliographyService={bibliographyService}
Expand All @@ -36,6 +38,7 @@ export default function BibliographyRoutes({
<Route
key="BibliographyViewerAndEditor"
path="/bibliography/references/:id"
exact
render={(props): ReactNode => (
<HeadTagsService
title="Bibliography entry: eBL"
Expand All @@ -55,6 +58,7 @@ export default function BibliographyRoutes({
<Route
key="Bibliography references search"
path="/bibliography/references"
exact
render={(props): ReactNode => (
<HeadTagsService
title="Bibliography References: eBL"
Expand All @@ -74,6 +78,7 @@ export default function BibliographyRoutes({
<Route
key="Bibliography AfO-Register search"
path="/bibliography/afo-register"
exact
render={(props): ReactNode => (
<HeadTagsService
title="Bibliography AfO-Register: eBL"
Expand All @@ -90,6 +95,11 @@ export default function BibliographyRoutes({
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="BibliographyNotFound"
path="/bibliography/*"
render={(): ReactNode => <NotFoundPage />}
/>,
<Redirect
from="/bibliography"
to="/bibliography/afo-register"
Expand Down
7 changes: 6 additions & 1 deletion src/router/corpusRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Corpus, { genres } from 'corpus/ui/Corpus'
import { sitemapDefaults, ChapterSlugs, TextSlugs } from 'router/sitemap'
import MarkupService from 'markup/application/MarkupService'
import { HeadTagsService } from 'router/head'

import NotFoundPage from 'NotFoundPage'
function parseChapterId(params): ChapterId {
return {
textId: parseTextId(params),
Expand Down Expand Up @@ -149,5 +149,10 @@ export default function CorpusRoutes({
}),
})}
/>,
<Route
key="CorpusNotFound"
path="/corpus/*"
render={(): ReactNode => <NotFoundPage />}
/>,
]
}
9 changes: 9 additions & 0 deletions src/router/dictionaryRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Route } from 'react-router-dom'
import SignService from 'signs/application/SignService'
import { DictionarySlugs, sitemapDefaults } from 'router/sitemap'
import { HeadTagsService } from 'router/head'
import NotFoundPage from 'NotFoundPage'

export default function DictionaryRoutes({
sitemap,
Expand All @@ -29,6 +30,7 @@ export default function DictionaryRoutes({
<Route
key="WordEditor"
path="/dictionary/:id/edit"
exact
render={({ match }): ReactNode => (
<WordEditor
wordService={wordService}
Expand All @@ -39,6 +41,7 @@ export default function DictionaryRoutes({
<Route
key="WordDisplay"
path="/dictionary/:id"
exact
render={({ match }): ReactNode => (
<HeadTagsService
title="Dictionary entry: eBL"
Expand All @@ -61,6 +64,7 @@ export default function DictionaryRoutes({
<Route
key="Dictionary"
path="/dictionary"
exact
render={(props): ReactNode => (
<HeadTagsService
title="Search dictionary: eBL"
Expand All @@ -71,5 +75,10 @@ export default function DictionaryRoutes({
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="DictionaryNotFound"
path="/dictionary/*"
render={(): ReactNode => <NotFoundPage />}
/>,
]
}
12 changes: 11 additions & 1 deletion src/router/fragmentariumRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { HeadTagsService } from 'router/head'
import BibliographyService from 'bibliography/application/BibliographyService'
import { FindspotService } from 'fragmentarium/application/FindspotService'
import AfoRegisterService from 'afo-register/application/AfoRegisterService'

import NotFoundPage from 'NotFoundPage'
function parseStringParam(location: Location, param: string): string | null {
const value = parse(location.search)[param]
return _.isArray(value) ? value.join('') : value
Expand Down Expand Up @@ -78,6 +78,7 @@ export default function FragmentariumRoutes({
<Route
key="FragmentariumSearch"
path="/fragmentarium/search"
exact
render={({ location }): ReactNode => (
<HeadTagsService
title="Fragmentarium search: eBL"
Expand All @@ -99,6 +100,7 @@ export default function FragmentariumRoutes({
<Route
key="FragmentLineToVecRanking"
path="/fragmentarium/:id/match"
exact
render={({ match }): ReactNode => (
<HeadTagsService
title="Fragmentarium line to vector ranking: eBL"
Expand All @@ -118,6 +120,7 @@ export default function FragmentariumRoutes({
<Route
key="TagSignsView"
path="/fragmentarium/:id/annotate"
exact
render={({ match }): ReactNode => (
<TagSignsView
signService={signService}
Expand All @@ -129,6 +132,7 @@ export default function FragmentariumRoutes({
<Route
key="FragmentView"
path="/fragmentarium/:id"
exact
render={({ match, location }): ReactNode => (
<SessionContext.Consumer>
{(session) => (
Expand Down Expand Up @@ -157,6 +161,7 @@ export default function FragmentariumRoutes({
<Route
key="Fragmentarium"
path="/fragmentarium"
exact
render={(): ReactNode => (
<HeadTagsService
title="Fragmentarium: eBL"
Expand All @@ -176,5 +181,10 @@ export default function FragmentariumRoutes({
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="FragmentariumNotFound"
path="/Fragmentarium/*"
render={(): ReactNode => <NotFoundPage />}
/>,
]
}
Loading
Loading