Skip to content

Commit

Permalink
Displaying provenance of signs (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vas9ka authored Feb 14, 2024
1 parent 203e35d commit 06f8a5e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/signs/domain/CroppedAnnotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type base64String = string
export interface CroppedAnnotation {
image: base64String
fragmentNumber: string
provenance?: string
script: string
label: string
date?: MesopotamianDate
Expand Down
4 changes: 4 additions & 0 deletions src/signs/ui/display/SignImages.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
color: black;
font-size: 90%;
}

.figure-caption .provenance {
color: black;
}
9 changes: 9 additions & 0 deletions src/signs/ui/display/SignImages.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const croppedAnnotations: CroppedAnnotation[] = [
fragmentNumber: 'K.6400',
image: imageString,
script: '',
provenance: 'ASSUR',
label: 'label-1',
},
{
Expand Down Expand Up @@ -48,6 +49,14 @@ describe('Sign Images', () => {
userEvent.click(screen.getByRole('button', { name: 'Unclassified' }))
expect(screen.getByText(croppedAnnotations[0].fragmentNumber)).toBeVisible()
})

it('Provenance is displayed', () => {
userEvent.click(screen.getByRole('button', { name: 'Unclassified' }))
const provenanceSpan = screen.getByText('ASSUR', {
selector: '.provenance',
})
expect(provenanceSpan).toBeInTheDocument()
})
})

describe('Sign Images Empty', () => {
Expand Down
3 changes: 3 additions & 0 deletions src/signs/ui/display/SignImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function SignImage({
{croppedAnnotation.date && (
<DateDisplay date={croppedAnnotation.date} />
)}
{croppedAnnotation.provenance && (
<span className="provenance">{`${croppedAnnotation.provenance}`}</span>
)}
</Figure.Caption>
</Figure>
</Col>
Expand Down

0 comments on commit 06f8a5e

Please sign in to comment.