diff --git a/src/fragmentarium/domain/Fragment.test.ts b/src/fragmentarium/domain/Fragment.test.ts index 386675882..00d68da1e 100644 --- a/src/fragmentarium/domain/Fragment.test.ts +++ b/src/fragmentarium/domain/Fragment.test.ts @@ -127,6 +127,7 @@ const config: Parameters[0] = { nabuccoNumber: '123', metropolitanNumber: '123', louvreNumber: '123', + australianinstituteofarchaeologyNumber: '123', philadelphiaNumber: '123', }, projects: [], diff --git a/src/fragmentarium/domain/FragmentDtos.ts b/src/fragmentarium/domain/FragmentDtos.ts index 204512ea4..a5b069d94 100644 --- a/src/fragmentarium/domain/FragmentDtos.ts +++ b/src/fragmentarium/domain/FragmentDtos.ts @@ -68,6 +68,7 @@ export const ExternalNumberTypes = [ 'nabuccoNumber', 'metropolitanNumber', 'louvreNumber', + 'australianinstituteofarchaeologyNumber', 'philadelphiaNumber', 'yalePeabodyNumber', ] as const diff --git a/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap b/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap index 598153a0b..f868aa93e 100644 --- a/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap +++ b/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap @@ -27,18 +27,24 @@ exports[`Snapshot 1`] = ` (PElam) - -

- Accession no.: - kuljulom.1 -

-

- Excavation no.: - radjo.1 -

-
+
+ +

+ Accession no.: + kuljulom.1 +

+

+ Excavation no.: + noj.1 +

+

+ Provenance: + Ešnunna +

+
+
- rikeluco.2 + cowjofke.2 - (Ur3) + (JN) - -

- Accession no.: - jofkeku.2 -

-

- Excavation no.: - wu.2 -

-
+
+ +

+ Accession no.: + ed.2 +

+

+ Excavation no.: + pov.2 +

+

+ Provenance: + Anšan +

+
+
- White & Manca, 2071: 6525764484726784-1000123435843584 + Checcucci & Tomlinson, 2026: 4727451873705984-8024100712742912 [ - l. 3'., 2. + l. 3'., 1. ] - (T) + (C) @@ -5925,14 +5937,14 @@ exports[`Snapshot 1`] = ` - Martinez & Robin, 2113: 5946678584541184-5595938733162496 + Chirici & Borchi, 2109: 7541452181602304-6009873588289536 [ l. 3'., 4'.2. ] - (D) + (E) diff --git a/src/fragmentarium/ui/info/Details.test.tsx b/src/fragmentarium/ui/info/Details.test.tsx index 350219f61..8f8e6cabc 100644 --- a/src/fragmentarium/ui/info/Details.test.tsx +++ b/src/fragmentarium/ui/info/Details.test.tsx @@ -10,6 +10,7 @@ import { Fragment } from 'fragmentarium/domain/fragment' import Promise from 'bluebird' import { Genres } from 'fragmentarium/domain/Genres' import { + archaeologyFactory, externalNumbersFactory, fragmentFactory, measuresFactory, @@ -140,17 +141,34 @@ describe('All details', () => { it('Renders accession', () => { expect( - screen.getByText(`Accession: ${fragment.accession}`) + screen.getByText(`Accession no.: ${fragment.accession}`) + ).toBeInTheDocument() + }) + it('Renders excavation', () => { + expect( + screen.getByText( + `Excavation no.: ${fragment.archaeology?.excavationNumber}` + ) + ).toBeInTheDocument() + }) + it('Renders provenance', () => { + expect( + screen.getByText(`Provenance: ${fragment.archaeology?.site?.name}`) ).toBeInTheDocument() }) }) describe('Missing details', () => { beforeEach(async () => { + const archaeology = archaeologyFactory.build({ + excavationNumber: undefined, + site: undefined, + }) fragment = fragmentFactory.build( { collection: '', accession: '', + archaeology, }, { associations: { @@ -189,7 +207,13 @@ describe('Missing details', () => { }) it('Renders dash for accession', () => { - expect(screen.getByText('Accession: -')).toBeInTheDocument() + expect(screen.getByText('Accession no.: -')).toBeInTheDocument() + }) + it('Renders dash for excavation', () => { + expect(screen.getByText('Excavation no.: -')).toBeInTheDocument() + }) + it('Renders dash for provenance', () => { + expect(screen.getByText('Provenance: -')).toBeInTheDocument() }) }) diff --git a/src/fragmentarium/ui/info/Details.tsx b/src/fragmentarium/ui/info/Details.tsx index 9d62f6d94..7ce8d9674 100644 --- a/src/fragmentarium/ui/info/Details.tsx +++ b/src/fragmentarium/ui/info/Details.tsx @@ -82,7 +82,15 @@ function Measurements({ fragment: { measures } }: Props): JSX.Element { } function Accession({ fragment }: Props): JSX.Element { - return <>Accession: {fragment.accession || '-'} + return <>Accession no.: {fragment.accession || '-'} +} + +function Excavation({ fragment }: Props): JSX.Element { + return <>Excavation no.: {fragment.archaeology?.excavationNumber || '-'} +} + +function Provenance({ fragment }: Props): JSX.Element { + return <>Provenance: {fragment.archaeology?.site?.name || '-'} } interface DetailsProps { @@ -121,6 +129,12 @@ function Details({
  • +
  • + +
  • +
  • + +
  • ) } +export function australianinstituteofarchaeologyLink({ + number, +}: { + number: string +}): JSX.Element { + return ( + + ) +} export function PhiladelphiaLink({ number }: { number: string }): JSX.Element { return ( { nabuccoNumber, metropolitanNumber, louvreNumber, + australianinstituteofarchaeologyNumber, philadelphiaNumber, yalePeabodyNumber, }), @@ -87,6 +89,11 @@ describe('external resources', () => { metropolitanNumber, ], ['Louvre', 'https://collections.louvre.fr/ark:/53355/', louvreNumber], + [ + 'Australian Institute of Archaeology', + 'https://aiarch.pedestal3d.com/r/', + australianinstituteofarchaeologyNumber, + ], [ 'Penn Museum', 'https://www.penn.museum/collections/object/', @@ -131,6 +138,7 @@ describe('missing external resources', () => { 'NaBuCCo', 'The Metropolitan Museum of Art', 'Louvre', + 'Australian Institute of Archaeology', 'Penn Museum', 'Yale Babylonian Collection', ])('Mising %s number is not shown', async (label) => { diff --git a/src/fragmentarium/ui/info/ExternalResources.tsx b/src/fragmentarium/ui/info/ExternalResources.tsx index 1d9793fd0..60ca19280 100644 --- a/src/fragmentarium/ui/info/ExternalResources.tsx +++ b/src/fragmentarium/ui/info/ExternalResources.tsx @@ -12,6 +12,7 @@ import { NabuccoLink, MetropolitanLink, LouvreLink, + australianinstituteofarchaeologyLink, PhiladelphiaLink, BmIdLink, YalePeabodyLink, @@ -49,6 +50,10 @@ export default function ExternalResources({ [fragment.getExternalNumber('nabuccoNumber'), NabuccoLink], [fragment.getExternalNumber('metropolitanNumber'), MetropolitanLink], [fragment.getExternalNumber('louvreNumber'), LouvreLink], + [ + fragment.getExternalNumber('australianinstituteofarchaeologyNumber'), + australianinstituteofarchaeologyLink, + ], [fragment.getExternalNumber('philadelphiaNumber'), PhiladelphiaLink], [fragment.getExternalNumber('yalePeabodyNumber'), YalePeabodyLink], ] diff --git a/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap b/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap index 0e79b7712..0e135ef8d 100644 --- a/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap +++ b/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap @@ -137,6 +137,18 @@ exports[`external resources Snapshot 1`] = ` )
  • +
  • + Australian Institute of Archaeology ( + + L123 + + ) +
  • Penn Museum ( {script} - -

    - {fragment.accession && 'Accession no.: '} - {fragment.accession} -

    -

    - {fragment.archaeology?.excavationNumber && 'Excavation no.: '} - {fragment.archaeology?.excavationNumber} -

    -
    +
    + +

    + {fragment.accession && 'Accession no.: '} + {fragment.accession} +

    +

    + {fragment.archaeology?.excavationNumber && 'Excavation no.: '} + {fragment.archaeology?.excavationNumber} +

    +

    + {fragment.archaeology?.site?.name && 'Provenance: '} + {fragment.archaeology?.site?.name} +

    +
    +
    diff --git a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap index d598daf03..b74ec47af 100644 --- a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap +++ b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap @@ -706,24 +706,30 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="fragment-result__fragment-number" >
    - uc.9 + esojoku.9 (Hit) - -

    - Accession no.: - titeba.9 -

    -

    - Excavation no.: - omi.9 -

    -
    +
    + +

    + Accession no.: + newet.9 +

    +

    + Excavation no.: + dirrew.9 +

    +

    + Provenance: + Uruk +

    +
    +
  • - Giles & Alvarez, 2087: 5582194326110208-1406653725409280 + Cavicchi & Sani, 2077: 402849420804096-7346697910878208 [ - l. 1., 3'. + l. 2., 4'.2. ] - (C) + (T) @@ -792,14 +798,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli - Shaw & Robert, 2046: 6150545542742016-5917511180615680 + Pisani & Piazzini, 2053: 6838356841332736-6445201535008768 [ - l. 2., 1. + l. 4'.2., 1. ] - (P) + (D) @@ -6503,24 +6509,30 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="fragment-result__fragment-number" > - ronfow.10 + masijga.10 - (NA) + - -

    - Accession no.: - fig.10 -

    -

    - Excavation no.: - gorudzel.10 -

    -
    +
    + +

    + Accession no.: + sosiwbe.10 +

    +

    + Excavation no.: + zopiz.10 +

    +

    + Provenance: + Sippar +

    +
    +
    - Harrison & Palmieri, 2029: 5188341634957312-4059361584349184 + Verhoeven & Maruyama, 2074: 1797701492539392-2761403509243904 [ - l. 1., 2. + l. 4'.2., 2. ] - (T) + (C) @@ -6584,14 +6596,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli - Wise & Hudson, 2040: 1529496131862528-4383736143544320 + Wright & Acciai, 2059: 1648222065917952-6119525370036224 [ - l. 4'.2., 2. + l. 2., 4'.2. ] - (D) + (E) @@ -12360,7 +12372,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="justify-content-left fragment-result__match-info text-secondary col" > @@ -12370,10 +12382,10 @@ exports[`Searching fragments by transliteration Displays corpus results when cli  >  - Ibpoc ardi tacnezud cutzidhug degat nibhuuzi hooretul devdif jafodor zamhokbi fufpeper bo gece. + Dahehuk na hidu itikumam pez ukha pamfoje tadgib vejapuc geof wetvortaj het rot ni pabvewme hugic salkekvep. > - None Jato hi omcasa wo ma pa bodgudles upopi hasaf dizi gebuwe konrat fufedul maggili vafovej rus sus. + Uruk III-Jemdet Nasr La ci ve od bili lup fuchurohe fiedle runob henve le fenpun kisih ogi hus luj piza. @@ -12396,14 +12408,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli ( - Bisji jokgo luakwuf teosolu le cokrir maz mo do im up amu in wag cizef ed pefja pismen. + Heisowuw co faki gevbial gelewozo le bejab felufad fum eti cuki luno. ) @@ -12487,7 +12499,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli >
    - Suhwere femeimi tugive le fenpun kisih ogi hus luj piza vecke huk na. + Ihjiv tacoov zas mulire foluow le cu dektu jewu dahehner soc miw had vuhfofluk koosgo oppatdan nepa romlialo.
    @@ -12514,14 +12526,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli ( - Oh pakro dakpun hendup raereiw wuw top te dabeci laek ripe haknor jasuj pufoti pirri. + Lilmicri pafupifi roedipe ben momefuer ke jabip geuh mofona sapsis vi kiz me gemtigpa gufra pa. )
    @@ -12605,7 +12617,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli >
    - Osgobup fozdici pavir lialo telpah wihse nor udjo mut nugut dubter bovlub zeugihiz kibop. + Butakij cigbugij ha ehibun ri arzodu mewadu boldud boilwep hocewa zek russapi jebre pertagas vece tuc em.
    @@ -12635,7 +12647,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="justify-content-left fragment-result__match-info text-secondary col" >
    @@ -12645,10 +12657,10 @@ exports[`Searching fragments by transliteration Displays corpus results when cli  >  - Nu jir ab tobot wegpar ugeko hitigpa gufra pa amu kum nuzizij gackionu. + Hez te asi ci og egi kicepi elludot mer gopus wuokaeni palig ne comjualu. > - Sargonic Un kum wi tubma renzide elbud tufakiuta peva wokrov pur ke jabip. + Hittite Tor loamab bi zi koris hinot dubwos tizzacgow wugrik obozaoza uzlejoru wezvo bagaci rej ceb efaidauje gam zafev. @@ -12671,14 +12683,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli ( - Lafaw ov ro duvsoh geodofuk lof muskozoka timpalig ne comjualu nicju gopopkis wenzap vamusig evifobwu he sihe. + Bol wudzewig se fagmu durito soiji iku vel jak did ri odu ke pem go utmefup roagivaj ecoerekul. ) @@ -12762,7 +12774,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli >
    - Iki om tuk vuwoagi dakow ken vid ve huzop dep goaz iwumu gi riw tor. + Ufsucu arhoef didefi za bujaro pekurar rib rempoffi mape din togfejifu sumna.
    @@ -12789,14 +12801,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli ( - Ahi fup roagivaj ecoerekul bipdiweb zog nonalkot he adi ujoifeuva vaepgaz ewoli ivmo me rajuno ref tu jowa. + Vihi je rivaj cejbazo be fumubsa kazhog jontaj fi sa na jolhi nu jah ez cunnob titzihoz. )
    @@ -12880,7 +12892,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli >
    - Witma pibi ecsu zesjeifu sumna gapaha usenizi uba tu cucvizsa ec kamako lavo ci ontekseb. + Hop od holoro arajiploh po zat ninuziv uba johtid mun futu pigze luojipis.
    diff --git a/src/test-support/fragment-fixtures.ts b/src/test-support/fragment-fixtures.ts index 3c0f23d61..88e6898bd 100644 --- a/src/test-support/fragment-fixtures.ts +++ b/src/test-support/fragment-fixtures.ts @@ -163,6 +163,8 @@ export const externalNumbersFactory = Factory.define( achemenetNumber: associations.achemenetNumber ?? chance.string(), nabuccoNumber: associations.nabuccoNumber ?? chance.string(), louvreNumber: associations.louvreNumber ?? chance.string(), + australianinstituteofarchaeologyNumber: + associations.australianinstituteofarchaeologyNumber ?? chance.string(), philadelphiaNumber: associations.philadelphiaNumber ?? chance.string(), yalePeabodyNumber: associations.yalePeabodyNumber ?? chance.string(), } diff --git a/src/test-support/test-fragment.ts b/src/test-support/test-fragment.ts index abdb47288..bb7b49946 100644 --- a/src/test-support/test-fragment.ts +++ b/src/test-support/test-fragment.ts @@ -23,6 +23,7 @@ const externalNumbers = { nabuccoNumber: '5', metropolitanNumber: '123', louvreNumber: '123', + australianinstituteofarchaeologyNumber: '123', philadelphiaNumber: '123', }