Skip to content

Commit

Permalink
Add SEAL Links
Browse files Browse the repository at this point in the history
  • Loading branch information
ejimsan committed Mar 5, 2024
1 parent f69ca6f commit 2f7ae99
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 52 deletions.
1 change: 1 addition & 0 deletions src/fragmentarium/domain/Fragment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const config: Parameters<typeof Fragment['create']>[0] = {
alalahHpmNumber: '123',
australianinstituteofarchaeologyNumber: '123',
philadelphiaNumber: '123',
sealNumber: '123',
},
projects: [],
}
Expand Down
1 change: 1 addition & 0 deletions src/fragmentarium/domain/FragmentDtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const ExternalNumberTypes = [
'australianinstituteofarchaeologyNumber',
'philadelphiaNumber',
'yalePeabodyNumber',
'sealNumber',
] as const
export type ExternalNumber = typeof ExternalNumberTypes[number]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ exports[`Snapshot 1`] = `
</p>
<p>
Excavation no.:
ucotes.1
ed.1
</p>
<p>
Provenance:
Adab
Alalakh
</p>
</small>
</div>
Expand Down Expand Up @@ -5852,27 +5852,27 @@ exports[`Snapshot 1`] = `
class="fragment-result__fragment-number"
>
<a
href="/fragmentarium/ke.2"
href="/fragmentarium/etkoclo.2"
>
ke.2
etkoclo.2
</a>
(Ur3)
(JN)
</h4>
<div
class="fragment-result__archaeology-info"
>
<small>
<p>
Accession no.:
wugutkoc.2
baj.2
</p>
<p>
Excavation no.:
jozi.2
jil.2
</p>
<p>
Provenance:
Mari
Maškan-šāpir
</p>
</small>
</div>
Expand All @@ -5881,11 +5881,6 @@ exports[`Snapshot 1`] = `
class="text-secondary fragment-result__genre col-sm-4 col-12"
>
<ul>
<ul>
<small>
ARCHIVE ➝ Administrative ➝ Lists
</small>
</ul>
<ul>
<small>
Other ➝ Fake ➝ Certain
Expand All @@ -5902,17 +5897,7 @@ exports[`Snapshot 1`] = `
<li
class="Record__entry"
>
Romolini
(
Transliteration
,
<time
datetime="2108-01-21"
>
21/1/2108
</time>
)
No record
</li>
</ol>
</div>
Expand Down Expand Up @@ -5957,9 +5942,9 @@ exports[`Snapshot 1`] = `
<span
class="reference-popover__citation"
>
Garrido & Tinti, 2055: 5928983864541184-7552106621829120
Checcucci & Tomlinson, 2026: 4727451873705984-8024100712742912
[
l. 4'.2., 1.
l. 3'., 1.
]
<span
class="type-abbreviation"
Expand All @@ -5976,9 +5961,9 @@ exports[`Snapshot 1`] = `
<span
class="reference-popover__citation"
>
Dong & Ducci, 2026: 3794580308754432-4010327748378624
Chirici & Borchi, 2066: 1964069523292160-4777479967342592
[
l. 3'., 4'.2.
l. 4'.2., 2.
]
<span
class="type-abbreviation"
Expand Down
9 changes: 9 additions & 0 deletions src/fragmentarium/ui/info/ExternalNumberLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ export function alalahHpmLink({ number }: { number: string }): JSX.Element {
/>
)
}
export function sealLink({ number }: { number: string }): JSX.Element {
return (
<ExternalNumberLink
number={number}
baseUrl={'https://seal.huji.ac.il/node/'}
label={'SEAL Number'}
/>
)
}
export function australianinstituteofarchaeologyLink({
number,
}: {
Expand Down
3 changes: 3 additions & 0 deletions src/fragmentarium/ui/info/ExternalResources.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const alalahHpmNumber = 'L123'
const australianinstituteofarchaeologyNumber = 'L123'
const philadelphiaNumber = 'P123'
const yalePeabodyNumber = 'y123'
const sealNumber = 'L123'
let fragment: Fragment
let container: HTMLElement

Expand All @@ -48,6 +49,7 @@ describe('external resources', () => {
australianinstituteofarchaeologyNumber,
philadelphiaNumber,
yalePeabodyNumber,
sealNumber,
}),
},
}
Expand Down Expand Up @@ -111,6 +113,7 @@ describe('external resources', () => {
'https://collections.peabody.yale.edu/search/Record/YPM-',
yalePeabodyNumber,
],
['SEAL Number', 'https://seal.huji.ac.il/node/', sealNumber],
])('%s number is shown', async (label, link, number) => {
expect(screen.getByLabelText(`${label} text ${number}`)).toHaveAttribute(
'href',
Expand Down
2 changes: 2 additions & 0 deletions src/fragmentarium/ui/info/ExternalResources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
BmIdLink,
YalePeabodyLink,
OraccLinks,
sealLink,
} from './ExternalNumberLink'
import _ from 'lodash'

Expand Down Expand Up @@ -58,6 +59,7 @@ export default function ExternalResources({
],
[fragment.getExternalNumber('philadelphiaNumber'), PhiladelphiaLink],
[fragment.getExternalNumber('yalePeabodyNumber'), YalePeabodyLink],
[fragment.getExternalNumber('sealNumber'), sealLink],
]

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ exports[`external resources Snapshot 1`] = `
</a>
)
</li>
<li>
SEAL Number (
<a
aria-label="SEAL Number text L123"
href="https://seal.huji.ac.il/node/L123"
rel="noopener noreferrer"
target="_blank"
>
L123
</a>
)
</li>
</ul>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -788,27 +788,27 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
class="fragment-result__fragment-number"
>
<a
href="/fragmentarium/uc.9"
href="/fragmentarium/hohoru.9"
>
uc.9
hohoru.9
</a>
(Hit)
(Par)
</h4>
<div
class="fragment-result__archaeology-info"
>
<small>
<p>
Accession no.:
titeba.9
id.9
</p>
<p>
Excavation no.:
jora.9
ovhun.9
</p>
<p>
Provenance:
Lagaš
Kiš
</p>
</small>
</div>
Expand All @@ -817,11 +817,6 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
class="text-secondary fragment-result__genre col-sm-4 col-12"
>
<ul>
<ul>
<small>
ARCHIVE ➝ Administrative ➝ Lists
</small>
</ul>
<ul>
<small>
Other ➝ Fake ➝ Certain
Expand Down Expand Up @@ -873,14 +868,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
<span
class="reference-popover__citation"
>
Giles & Alvarez, 2087: 5582194326110208-1406653725409280
Duran & Boon, 2075: 1233275364311040-5892501091123200
[
l. 1., 3'.
l. 4'.2., 1.
]
<span
class="type-abbreviation"
>
(C)
(E)
</span>
</span>
</li>
Expand All @@ -892,14 +887,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
<span
class="reference-popover__citation"
>
Shaw & Robert, 2046: 6150545542742016-5917511180615680
Hansen & van Ommen, 2050: 522493473325056-5682457787498496
[
l. 2., 1.
l. 4'.2., 1.
]
<span
class="type-abbreviation"
>
(P)
(D)
</span>
</span>
</li>
Expand Down Expand Up @@ -6603,9 +6598,9 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
class="fragment-result__fragment-number"
>
<a
href="/fragmentarium/mi.10"
href="/fragmentarium/lezajo.10"
>
mi.10
lezajo.10
</a>
(Uruk4)
</h4>
Expand All @@ -6615,7 +6610,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
<small>
<p>
Accession no.:
kuvina.10
siti.10
</p>
<p>
Excavation no.:
Expand Down Expand Up @@ -6683,29 +6678,29 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
<span
class="reference-popover__citation"
>
Sanna & Vivoli, 2086: 6039983651553280-8222076427042816
Biliotti & van Rijn, 2036: 1960181967618048-447775313494016
[
l. 4'.2., 2.
]
<span
class="type-abbreviation"
>
(C)
(P)
</span>
</span>
</li>
<li>
<span
class="reference-popover__citation"
>
Waters & Faure, 2073: 3028366718402560-7932536841830400
Duval & Burrows, 2077: 6062190752694272-6966757507989504
[
l. 3'., 4'.2.
]
<span
class="type-abbreviation"
>
(C)
(P)
</span>
</span>
</li>
Expand Down
1 change: 1 addition & 0 deletions src/test-support/fragment-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const externalNumbersFactory = Factory.define<ExternalNumbers>(
associations.australianinstituteofarchaeologyNumber ?? chance.string(),
philadelphiaNumber: associations.philadelphiaNumber ?? chance.string(),
yalePeabodyNumber: associations.yalePeabodyNumber ?? chance.string(),
sealNumber: associations.sealNumber ?? chance.string(),
}
}
)
Expand Down
1 change: 1 addition & 0 deletions src/test-support/test-fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const externalNumbers = {
alalahHpmNumber: '123',
australianinstituteofarchaeologyNumber: '123',
philadelphiaNumber: '123',
sealNumber: '123',
}

export const lines: readonly TextLineDto[] = [
Expand Down

0 comments on commit 2f7ae99

Please sign in to comment.