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

Release/2024 02 #530

Merged
merged 5 commits into from
Feb 24, 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
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"reset-css": "^5.0.2",
"sass": "^1.70.0",
"scandinavian-dictionary-crosslinker": "^0.5.0",
"sass": "^1.71.1",
"scandinavian-dictionary-crosslinker": "^0.6.0",
"sitemap": "^7.1.1",
"slugify": "^1.6.6",
"teljari": "^1.1.1",
"younger-futhark": "^1.2.5"
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "^20.11.7",
"@types/react": "^18.2.48",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"cypress": "^13.6.3",
"eslint": "^8.56.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.20",
"@types/react": "^18.2.58",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"cypress": "^13.6.6",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "^14.1.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
7 changes: 6 additions & 1 deletion src/components/Crosslinks/Crosslinks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ describe('Crosslinks component', () => {
url: 'https://old-norwegian-dictionary.vercel.app/word/fadir',
source: DictionarySource.OldNorwegian,
},
{
url: 'https://old-danish-dictionary.vercel.app/word/fader',
source: DictionarySource.OldDanish,
},
]

test('Matches the snapshot', () => {
Expand All @@ -31,7 +35,7 @@ describe('Crosslinks component', () => {
const tree = renderer.create(<Crosslinks crosslinks={crosslinks} />)
const { root } = tree

expect(root.findAllByProps({ className: styles.listItem }).length).toEqual(3)
expect(root.findAllByProps({ className: styles.listItem }).length).toEqual(4)
})

test('Has expected crosslink content', () => {
Expand All @@ -40,5 +44,6 @@ describe('Crosslinks component', () => {
expect(JSON.stringify(tree)).toContain('Old Swedish - K.F Söderwall\'s Dictionary')
expect(JSON.stringify(tree)).toContain('Old Norwegian - Johan Fritzner\'s Dictionary')
expect(JSON.stringify(tree)).toContain('Old Icelandic - Geir Zoëga\'s Dictionary')
expect(JSON.stringify(tree)).toContain('Old Danish - Otto Kalkar\'s Dictionary')
})
})
11 changes: 11 additions & 0 deletions src/components/Crosslinks/__snapshots__/Crosslinks.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ exports[`Crosslinks component Matches the snapshot 1`] = `
Old Norwegian - Johan Fritzner's Dictionary
</a>
</li>
<li
className="listItem"
>
<a
href="https://old-danish-dictionary.vercel.app/word/fader"
rel="noopener noreferrer"
target="_blank"
>
Old Danish - Otto Kalkar's Dictionary
</a>
</li>
</ul>,
]
`;
4 changes: 4 additions & 0 deletions src/components/Crosslinks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default function Crosslinks({ crosslinks }: CrossLinkProps) {
return 'Old Icelandic - Geir Zoëga\'s Dictionary'
}

if (source === 'old-danish') {
return 'Old Danish - Otto Kalkar\'s Dictionary'
}

return ''
}

Expand Down
11 changes: 0 additions & 11 deletions src/components/ExternalLink/index.js

This file was deleted.

16 changes: 16 additions & 0 deletions src/components/ExternalLink/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
interface ExternalLinkProps{
href: string,
title: string,
}

export default function ExternalLink({ href, title }: ExternalLinkProps) {
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
>
{title}
</a>
)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import ExternalLink from 'components/ExternalLink'
import LetterLink from 'components/LetterLink'
import ContentArea from 'components/ContentArea'
import { AlphabetLetter } from 'lib/services/dictionary'
import styles from './Footer.module.scss'

export default function Footer({ letters }) {
interface FooterProps{
letters: AlphabetLetter[]
}

export default function Footer({ letters }: FooterProps) {
return (
<footer className={styles.section}>
<div className="container">
Expand Down Expand Up @@ -81,8 +86,8 @@ export default function Footer({ letters }) {
</li>
<li>
<ExternalLink
title="Old Norse Alphabet"
href="https://github.com/stscoundrel/old-norse-alphabet"
title="Otto Kalkar's Old Danish Dictionary"
href="https://old-danish-dictionary.vercel.app/"
/>
</li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Layout/__snapshots__/Layout.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,11 @@ exports[`Layout component Letter layout Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down Expand Up @@ -1741,11 +1741,11 @@ exports[`Layout component Word layout Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/lib/services/crosslinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ describe('Crosslinks service tests', () => {

test('Returns crosslinks when slugs match', () => {
const expected = [
{
url: 'https://old-norwegian-dictionary.vercel.app/word/fadir',
source: 'old-norwegian',
},
{
url: 'https://old-icelandic.vercel.app/word/fadir',
source: 'old-icelandic',
},
{
url: 'https://old-norwegian-dictionary.vercel.app/word/fadir',
source: 'old-norwegian',
},
{
url: 'https://old-swedish-dictionary.vercel.app/word/fadhir',
source: 'old-swedish',
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/__snapshots__/404.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,11 @@ exports[`404 page page Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -635267,11 +635267,11 @@ exports[`Index page Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/__snapshots__/letter.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16196,11 +16196,11 @@ exports[`Letter page: render Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/__snapshots__/search.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,11 @@ exports[`Search page: render Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/__snapshots__/sources.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5094,11 +5094,11 @@ exports[`Sources page Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/__snapshots__/word.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,11 @@ exports[`Word page: render & usage Matches snapshot 1`] = `
</li>
<li>
<a
href="https://github.com/stscoundrel/old-norse-alphabet"
href="https://old-danish-dictionary.vercel.app/"
rel="noopener noreferrer"
target="_blank"
>
Old Norse Alphabet
Otto Kalkar's Old Danish Dictionary
</a>
</li>
</ul>
Expand Down
Loading
Loading