Skip to content

Commit

Permalink
Add display of sector (#515)
Browse files Browse the repository at this point in the history
* Add Sector to Display

* Update archaeology to show partial dates in findspot

* Correct duplicated sector
  • Loading branch information
ejimsan authored Dec 15, 2024
1 parent fa38ce7 commit ad66983
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/fragmentarium/domain/archaeology.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test.each([
primaryContext: true,
notes: 'General notes.',
},
'some sector > some area > a house (Residential), II (1200 BCE - 1150 BCE), ' +
'some sector > some area > a house (Residential), II (1200 BCE 1150 BCE), ' +
'Room 42, On the floor (primary context). General notes.',
'de-DE',
],
Expand All @@ -153,31 +153,31 @@ test.each([
[
'with area and notes',
{ area: 'some area', notes: 'General notes.' },
'some area > a house (Residential), II (1200 BCE - 1150 BCE). General notes.',
'some area > a house (Residential), II (1200 BCE 1150 BCE). General notes.',
'de-DE',
],
[
'without area or notes',
{ sector: '', area: '' },
'a house (Residential), II (1200 BCE - 1150 BCE).',
{ area: '' },
'a house (Residential), II (1200 BCE 1150 BCE).',
'en-US',
],
[
'without notes',
{ notes: '' },
'a house (Residential), II (1200 BCE - 1150 BCE).',
'a house (Residential), II (1200 BCE 1150 BCE).',
'en-US',
],
[
'without building',
{ building: '' },
'(Residential), II (1200 BCE - 1150 BCE).',
'(Residential), II (1200 BCE 1150 BCE).',
'de-DE',
],
[
'without buildingType',
{ buildingType: null },
'a house, II (1200 BCE - 1150 BCE).',
'a house, II (1200 BCE 1150 BCE).',
'en-US',
],
[
Expand All @@ -191,7 +191,7 @@ test.each([
{
date: { ...defaultParams.date, notes: 'date notes' },
},
'a house (Residential), II (1200 BCE - 1150 BCE, date notes).',
'a house (Residential), II (1200 BCE 1150 BCE, date notes).',
'en-US',
],
[
Expand Down
2 changes: 1 addition & 1 deletion src/fragmentarium/domain/archaeology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Findspot {
private dateString(): string {
const start = this.date?.start.toString()
const end = this.date?.end?.toString()
const range = join([start, end], ' - ')
const range = end ? `${start}${end}` : start

return join([range, this.date?.notes], ', ')
}
Expand Down
2 changes: 1 addition & 1 deletion src/fragmentarium/domain/archaeologyDtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function fromDateRangeDto(dto: DateRangeDto): DateRange {
return {
...dto,
start: createPartialDate(dto.start),
end: createPartialDate(dto.end),
end: dto.end ? createPartialDate(dto.end) : null,
}
}

Expand Down

0 comments on commit ad66983

Please sign in to comment.