From f7d0ee73b6657637e25b09f8cc2c69a3f2793f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Jim=C3=A9nez?= Date: Tue, 30 Apr 2024 07:26:01 +0000 Subject: [PATCH] Update SEAL Links --- src/fragmentarium/domain/Fragment.test.ts | 1 - src/fragmentarium/domain/FragmentDtos.ts | 2 +- src/fragmentarium/domain/fragment.ts | 4 ++ .../LatestTransliterations.test.tsx.snap | 41 ++++++++++++------ .../ui/info/ExternalNumberLink.tsx | 28 ++++++++++++ .../ui/info/ExternalResources.test.tsx | 3 -- .../ui/info/ExternalResources.tsx | 8 +++- .../ExternalResources.test.tsx.snap | 12 ------ .../FragmentariumSearch.test.tsx.snap | 43 +++++++++++-------- src/test-support/fragment-fixtures.ts | 1 - src/test-support/test-fragment.ts | 1 - 11 files changed, 91 insertions(+), 53 deletions(-) diff --git a/src/fragmentarium/domain/Fragment.test.ts b/src/fragmentarium/domain/Fragment.test.ts index 3fa72e851..75836d057 100644 --- a/src/fragmentarium/domain/Fragment.test.ts +++ b/src/fragmentarium/domain/Fragment.test.ts @@ -131,7 +131,6 @@ const config: Parameters[0] = { alalahHpmNumber: '123', australianinstituteofarchaeologyNumber: '123', philadelphiaNumber: '123', - sealNumber: '123', }, projects: [], } diff --git a/src/fragmentarium/domain/FragmentDtos.ts b/src/fragmentarium/domain/FragmentDtos.ts index 4f7c6a144..020c66d60 100644 --- a/src/fragmentarium/domain/FragmentDtos.ts +++ b/src/fragmentarium/domain/FragmentDtos.ts @@ -76,7 +76,6 @@ export const ExternalNumberTypes = [ 'australianinstituteofarchaeologyNumber', 'philadelphiaNumber', 'yalePeabodyNumber', - 'sealNumber', ] as const export type ExternalNumber = typeof ExternalNumberTypes[number] @@ -84,6 +83,7 @@ export type ExternalNumbers = { [K in ExternalNumber]?: string } & { oraccNumbers?: readonly string[] + sealNumbers?: readonly string[] } export default interface FragmentDto { diff --git a/src/fragmentarium/domain/fragment.ts b/src/fragmentarium/domain/fragment.ts index 09c5a1435..0fbb8bfd1 100644 --- a/src/fragmentarium/domain/fragment.ts +++ b/src/fragmentarium/domain/fragment.ts @@ -232,9 +232,13 @@ export class Fragment { get oraccNumbers(): readonly string[] { return this.externalNumbers['oraccNumbers'] || [] } + get sealNumbers(): readonly string[] { + return this.externalNumbers['sealNumbers'] || [] + } get hasExternalResources(): boolean { return _.some([ ...this.oraccNumbers, + ...this.sealNumbers, ...ExternalNumberTypes.map((number) => this.getExternalNumber(number as ExternalNumber) ), 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 c6fd8d4a6..63bd9479f 100644 --- a/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap +++ b/src/fragmentarium/ui/front-page/__snapshots__/LatestTransliterations.test.tsx.snap @@ -37,11 +37,11 @@ exports[`Snapshot 1`] = `

Excavation no.: - ed.1 + ucotes.1

Provenance: - Alalakh + Adab

@@ -5852,11 +5852,11 @@ exports[`Snapshot 1`] = ` class="fragment-result__fragment-number" > - etkoclo.2 + ke.2 - (JN) + (Ur3)

Accession no.: - baj.2 + wugutkoc.2

Excavation no.: - jil.2 + jozi.2

Provenance: - Maškan-šāpir + Mari

@@ -5881,6 +5881,11 @@ exports[`Snapshot 1`] = ` class="text-secondary fragment-result__genre col-sm-4 col-12" > `; diff --git a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap index a786ab225..ee584969d 100644 --- a/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap +++ b/src/fragmentarium/ui/search/__snapshots__/FragmentariumSearch.test.tsx.snap @@ -788,11 +788,11 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="fragment-result__fragment-number" > - hohoru.9 + uc.9 - (Par) + (Hit)

Accession no.: - id.9 + titeba.9

Excavation no.: - ovhun.9 + jora.9

Provenance: - Kiš + Lagaš

@@ -817,6 +817,11 @@ exports[`Searching fragments by transliteration Displays corpus results when cli class="text-secondary fragment-result__genre col-sm-4 col-12" >