feat(web): show recording_date on search rows; flag estimated count as approximate (#61)
This commit is contained in:
@@ -28,8 +28,8 @@
|
||||
"loadError": "Search is unavailable",
|
||||
"unavailable": "Search is not available on this server",
|
||||
"loadMore": "Load more",
|
||||
"resultCount_one": "{{count}} result",
|
||||
"resultCount_other": "{{count}} results",
|
||||
"resultCount_one": "~{{count}} result",
|
||||
"resultCount_other": "~{{count}} results",
|
||||
"selectPrompt": "Select a result to see the full record"
|
||||
},
|
||||
"fields": {
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
"loadError": "Sök är inte tillgängligt",
|
||||
"unavailable": "Sök är inte tillgängligt på den här servern",
|
||||
"loadMore": "Visa fler",
|
||||
"resultCount_one": "{{count}} träff",
|
||||
"resultCount_other": "{{count}} träffar",
|
||||
"resultCount_one": "~{{count}} träff",
|
||||
"resultCount_other": "~{{count}} träffar",
|
||||
"selectPrompt": "Välj en träff för att se hela posten"
|
||||
},
|
||||
"fields": {
|
||||
|
||||
@@ -18,6 +18,7 @@ export function SearchResultRow({ hit }: { hit: SearchHitView }) {
|
||||
<div className="text-sm font-semibold">{hit.object_name}</div>
|
||||
<div className="mt-0.5 flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<span>{hit.object_number}</span>
|
||||
{hit.recording_date && <span>· {hit.recording_date}</span>}
|
||||
<VisibilityBadge visibility={hit.visibility} />
|
||||
</div>
|
||||
{hit.snippet && (
|
||||
|
||||
@@ -60,7 +60,8 @@ test("typing searches and renders highlighted rich rows", async () => {
|
||||
expect(await screen.findByText("Bronze figurine")).toBeInTheDocument();
|
||||
const mark = await screen.findByText("bronze");
|
||||
expect(mark.tagName).toBe("MARK");
|
||||
expect(screen.getByText(/25 results/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/~\s*25 results/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/1962-04-03/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("Load more appends the next page", async () => {
|
||||
|
||||
@@ -73,6 +73,7 @@ export const searchHits: SearchHitView[] = [
|
||||
object_number: "2019.4.12",
|
||||
object_name: "Bronze figurine",
|
||||
brief_description: "A small cast figure.",
|
||||
recording_date: "1962-04-03",
|
||||
visibility: "public",
|
||||
snippet: "cast bronze with green patina",
|
||||
},
|
||||
@@ -81,6 +82,7 @@ export const searchHits: SearchHitView[] = [
|
||||
object_number: `N-${i + 2}`,
|
||||
object_name: `Object ${i + 2}`,
|
||||
brief_description: null,
|
||||
recording_date: null,
|
||||
visibility: "internal" as const,
|
||||
snippet: null,
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user