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"
>
+
+
+ ARCHIVE ➝ Administrative ➝ Lists
+
+
Other ➝ Fake ➝ Certain
@@ -5897,7 +5902,17 @@ exports[`Snapshot 1`] = `
-
- No record
+ Romolini
+ (
+ Transliteration
+ ,
+
+
+ )
@@ -5942,9 +5957,9 @@ exports[`Snapshot 1`] = `
- Checcucci & Tomlinson, 2026: 4727451873705984-8024100712742912
+ Garrido & Tinti, 2055: 5928983864541184-7552106621829120
[
- l. 3'., 1.
+ l. 4'.2., 1.
]
- Chirici & Borchi, 2066: 1964069523292160-4777479967342592
+ Dong & Ducci, 2026: 3794580308754432-4010327748378624
[
- l. 4'.2., 2.
+ l. 3'., 4'.2.
]
)
}
+function SealLink({ number }: { number: string }): JSX.Element {
+ const baseUrl = 'https://seal.huji.ac.il/node/'
+ return (
+
+ )
+}
export function OraccLinks({
projects,
@@ -217,3 +226,22 @@ export function OraccLinks({
>
)
}
+
+export function SealLinks({
+ projects,
+}: {
+ projects: readonly string[]
+}): JSX.Element {
+ return (
+ <>
+ {'SEAL ('}
+ {projects.map((project, index) => (
+
+ {index !== 0 && ', '}
+
+
+ ))}
+ {')'}
+ >
+ )
+}
diff --git a/src/fragmentarium/ui/info/ExternalResources.test.tsx b/src/fragmentarium/ui/info/ExternalResources.test.tsx
index 36867dbd0..cc45c79c3 100644
--- a/src/fragmentarium/ui/info/ExternalResources.test.tsx
+++ b/src/fragmentarium/ui/info/ExternalResources.test.tsx
@@ -23,7 +23,6 @@ const alalahHpmNumber = 'L123'
const australianinstituteofarchaeologyNumber = 'L123'
const philadelphiaNumber = 'P123'
const yalePeabodyNumber = 'y123'
-const sealNumber = 'L123'
let fragment: Fragment
let container: HTMLElement
@@ -49,7 +48,6 @@ describe('external resources', () => {
australianinstituteofarchaeologyNumber,
philadelphiaNumber,
yalePeabodyNumber,
- sealNumber,
}),
},
}
@@ -113,7 +111,6 @@ 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',
diff --git a/src/fragmentarium/ui/info/ExternalResources.tsx b/src/fragmentarium/ui/info/ExternalResources.tsx
index 82f874a2b..6d7b5bbe8 100644
--- a/src/fragmentarium/ui/info/ExternalResources.tsx
+++ b/src/fragmentarium/ui/info/ExternalResources.tsx
@@ -18,7 +18,7 @@ import {
BmIdLink,
YalePeabodyLink,
OraccLinks,
- sealLink,
+ SealLinks,
} from './ExternalNumberLink'
import _ from 'lodash'
@@ -59,7 +59,6 @@ export default function ExternalResources({
],
[fragment.getExternalNumber('philadelphiaNumber'), PhiladelphiaLink],
[fragment.getExternalNumber('yalePeabodyNumber'), YalePeabodyLink],
- [fragment.getExternalNumber('sealNumber'), sealLink],
]
return (
@@ -79,6 +78,11 @@ export default function ExternalResources({
/>
)}
+ {!_.isEmpty(fragment.sealNumbers) && (
+ -
+
+
+ )}
)
}
diff --git a/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap b/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap
index fba4ab588..dca76c7ab 100644
--- a/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap
+++ b/src/fragmentarium/ui/info/__snapshots__/ExternalResources.test.tsx.snap
@@ -185,18 +185,6 @@ exports[`external resources Snapshot 1`] = `
)
- -
- SEAL Number (
-
- L123
-
- )
-
`;
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"
>
+
+
+ ARCHIVE ➝ Administrative ➝ Lists
+
+
Other ➝ Fake ➝ Certain
@@ -868,14 +873,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
- Duran & Boon, 2075: 1233275364311040-5892501091123200
+ Giles & Alvarez, 2087: 5582194326110208-1406653725409280
[
- l. 4'.2., 1.
+ l. 1., 3'.
]
- (E)
+ (C)
@@ -887,14 +892,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
- Hansen & van Ommen, 2050: 522493473325056-5682457787498496
+ Shaw & Robert, 2046: 6150545542742016-5917511180615680
[
- l. 4'.2., 1.
+ l. 2., 1.
]
- (D)
+ (P)
@@ -6598,9 +6603,9 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
class="fragment-result__fragment-number"
>
- lezajo.10
+ mi.10
(Uruk4)
@@ -6610,7 +6615,7 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
Accession no.:
- siti.10
+ kuvina.10
Excavation no.:
@@ -6678,14 +6683,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
- Biliotti & van Rijn, 2036: 1960181967618048-447775313494016
+ Sanna & Vivoli, 2086: 6039983651553280-8222076427042816
[
l. 4'.2., 2.
]
- (P)
+ (C)
@@ -6693,14 +6698,14 @@ exports[`Searching fragments by transliteration Displays corpus results when cli
- Duval & Burrows, 2077: 6062190752694272-6966757507989504
+ Waters & Faure, 2073: 3028366718402560-7932536841830400
[
l. 3'., 4'.2.
]
- (P)
+ (C)
diff --git a/src/test-support/fragment-fixtures.ts b/src/test-support/fragment-fixtures.ts
index 4f3e652b0..530f9315c 100644
--- a/src/test-support/fragment-fixtures.ts
+++ b/src/test-support/fragment-fixtures.ts
@@ -169,7 +169,6 @@ export const externalNumbersFactory = Factory.define(
associations.australianinstituteofarchaeologyNumber ?? chance.string(),
philadelphiaNumber: associations.philadelphiaNumber ?? chance.string(),
yalePeabodyNumber: associations.yalePeabodyNumber ?? chance.string(),
- sealNumber: associations.sealNumber ?? chance.string(),
}
}
)
diff --git a/src/test-support/test-fragment.ts b/src/test-support/test-fragment.ts
index 5a8c0c4b3..78cd57bf6 100644
--- a/src/test-support/test-fragment.ts
+++ b/src/test-support/test-fragment.ts
@@ -26,7 +26,6 @@ const externalNumbers = {
alalahHpmNumber: '123',
australianinstituteofarchaeologyNumber: '123',
philadelphiaNumber: '123',
- sealNumber: '123',
}
export const lines: readonly TextLineDto[] = [