Skip to content

Commit

Permalink
Integrate AMPS and aluGeneva
Browse files Browse the repository at this point in the history
  • Loading branch information
zsomborfoldi committed Dec 13, 2024
1 parent cfd83a1 commit 64b9f0e
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/common/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export class SectionCrumb implements Crumb {
['About', '/about'],
['Projects', '/projects'],
['CAIC', '/projects/CAIC'],
['AMPS', '/projects/AMPS'],
['aluGeneva', '/projects/aluGeneva'],
])

readonly text: string
Expand Down
27 changes: 19 additions & 8 deletions src/fragmentarium/ui/info/ResearchProjects.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,37 @@ import { ProjectList } from './ResearchProjects'
import { ResearchProjects } from 'research-projects/researchProject'

let fragment: Fragment
const project = ResearchProjects.CAIC
const projects = [
ResearchProjects.CAIC,
ResearchProjects.AMPS,
ResearchProjects.aluGeneva,
]

beforeEach(async () => {
fragment = fragmentFactory.build(
{},
{
associations: {
projects: [project],
projects,
},
}
)
render(<ProjectList projects={fragment.projects} />)
})

it('Renders logo', () => {
expect(screen.getByAltText(project.name)).toHaveAttribute('src', project.logo)
it('Renders logos for all projects', () => {
projects.forEach((project) => {
expect(screen.getByAltText(project.name)).toHaveAttribute(
'src',
project.logo
)
})
})

it('Links to project website', () => {
expect(
screen.getByLabelText(`Link to ${project.name} project`)
).toHaveAttribute('href', project.url)
it('Links to all project websites', () => {
projects.forEach((project) => {
expect(
screen.getByLabelText(`Link to ${project.name} project`)
).toHaveAttribute('href', project.url)
})
})
10 changes: 10 additions & 0 deletions src/research-projects/ResearchProjectsOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ export default function ResearchProjectsOverview(): JSX.Element {
<ResearchProjectLink project={ResearchProjects.CAIC} />
</Container>
</section>
<section>
<Container>
<ResearchProjectLink project={ResearchProjects.aluGeneva} />
</Container>
</section>
<section>
<Container>
<ResearchProjectLink project={ResearchProjects.AMPS} />
</Container>
</section>
</AppContent>
)
}
8 changes: 8 additions & 0 deletions src/research-projects/researchProject.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'lodash'
import caicLogo from './logos/CAIC Briefkopf 2023.png'
import aluLogo from './logos/Alu.png'
import ampsLogo from './logos/AMPS.png'

export interface ResearchProject {
name: string
Expand All @@ -24,6 +25,13 @@ export const ResearchProjects = {
logo: aluLogo,
url: 'https://data.snf.ch/grants/grant/175970',
},
AMPS: {
name:
'Ancient Mesopotamian Priestly Scholasticism in the First Millennium BCE',
abbreviation: 'AMPS',
logo: ampsLogo,
url: 'https://amps.huji.ac.il/',
},
}

export const researchProjects = Object.values(ResearchProjects)
Expand Down
88 changes: 88 additions & 0 deletions src/router/researchProjectRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import FragmentService from 'fragmentarium/application/FragmentService'
import ResearchProjectsOverview from 'research-projects/ResearchProjectsOverview'
import CaicHome from 'research-projects/subpages/caic/Home'
import CaicSearch from 'research-projects/subpages/caic/Search'
import AmpsHome from 'research-projects/subpages/amps/Home'
import AmpsSearch from 'research-projects/subpages/amps/Search'
import AluGenevaHome from 'research-projects/subpages/aluGeneva/Home'
import AluGenevaSearch from 'research-projects/subpages/aluGeneva/Search'

export default function ResearchProjectRoutes({
sitemap,
Expand Down Expand Up @@ -68,6 +72,90 @@ export default function ResearchProjectRoutes({
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="amps-project"
exact
path={[
`/projects/${ResearchProjects.AMPS.abbreviation}`,
`/projects/${ResearchProjects.AMPS.abbreviation}/home`,
]}
render={(): ReactNode => (
<HeadTagsService
title={`${ResearchProjects.AMPS.abbreviation} in eBL`}
description={ResearchProjects.AMPS.name}
>
<AmpsHome
fragmentService={fragmentService}
fragmentSearchService={fragmentSearchService}
wordService={wordService}
bibliographyService={bibliographyService}
/>
</HeadTagsService>
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="amps-project-search"
exact
path={`/projects/${ResearchProjects.AMPS.abbreviation}/search`}
render={({ location }): ReactNode => (
<HeadTagsService
title={`${ResearchProjects.AMPS.abbreviation} in eBL`}
description={ResearchProjects.AMPS.name}
>
<AmpsSearch
fragmentService={fragmentService}
fragmentSearchService={fragmentSearchService}
wordService={wordService}
bibliographyService={bibliographyService}
fragmentQuery={{ ...parse(location.search), project: 'AMPS' }}
/>
</HeadTagsService>
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="alugeneva-project"
exact
path={[
`/projects/${ResearchProjects.aluGeneva.abbreviation}`,
`/projects/${ResearchProjects.aluGeneva.abbreviation}/home`,
]}
render={(): ReactNode => (
<HeadTagsService
title={`${ResearchProjects.aluGeneva.abbreviation} in eBL`}
description={ResearchProjects.aluGeneva.name}
>
<AluGenevaHome
fragmentService={fragmentService}
fragmentSearchService={fragmentSearchService}
wordService={wordService}
bibliographyService={bibliographyService}
/>
</HeadTagsService>
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="alugeneva-project-search"
exact
path={`/projects/${ResearchProjects.aluGeneva.abbreviation}/search`}
render={({ location }): ReactNode => (
<HeadTagsService
title={`${ResearchProjects.aluGeneva.abbreviation} in eBL`}
description={ResearchProjects.aluGeneva.name}
>
<AluGenevaSearch
fragmentService={fragmentService}
fragmentSearchService={fragmentSearchService}
wordService={wordService}
bibliographyService={bibliographyService}
fragmentQuery={{ ...parse(location.search), project: 'aluGeneva' }}
/>
</HeadTagsService>
)}
{...(sitemap && sitemapDefaults)}
/>,
<Route
key="projects"
exact
Expand Down

0 comments on commit 64b9f0e

Please sign in to comment.