Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying provenance of signs #449

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading