Compare commits
7 Commits
a74bc1c76f
...
feature/d7
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d7333b714 | |||
| 62b07597f5 | |||
| 5ce35af813 | |||
| 7f6855be62 | |||
| c1b215d06f | |||
| 7525970ffc | |||
| bfc90f8581 |
@@ -108,7 +108,6 @@ function gerbil(
|
|||||||
notes: null,
|
notes: null,
|
||||||
// BESTAND-FILTER: default = eigener Bestand; einzelne externe Ahnen unten gesetzt.
|
// BESTAND-FILTER: default = eigener Bestand; einzelne externe Ahnen unten gesetzt.
|
||||||
isResident: true,
|
isResident: true,
|
||||||
profilePhotoUrl: null,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +120,7 @@ export function seedDb(): MockDb {
|
|||||||
originContactId: 'con-meier',
|
originContactId: 'con-meier',
|
||||||
originBreeder: 'Clan-Kleine-Chaoten',
|
originBreeder: 'Clan-Kleine-Chaoten',
|
||||||
},
|
},
|
||||||
{ ...gerbil('fridolin', 'Fridolin', 'male', '2023-05-01', 'w-fridolin', 'cv-schwarz', 'aa CC DD EE GG PP spsp rere'), enclosureId: 'enc-gross', originBreeder: 'Zoohandlung Meier', profilePhotoUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==' },
|
{ ...gerbil('fridolin', 'Fridolin', 'male', '2023-05-01', 'w-fridolin', 'cv-schwarz', 'aa CC DD EE GG PP spsp rere'), enclosureId: 'enc-gross', originBreeder: 'Zoohandlung Meier' },
|
||||||
gerbil('luna', 'Luna', 'female', '2023-08-15', 'w-luna', 'cv-gold', 'AA CC DD EE GG pp spsp rere'),
|
gerbil('luna', 'Luna', 'female', '2023-08-15', 'w-luna', 'cv-gold', 'AA CC DD EE GG pp spsp rere'),
|
||||||
gerbil('balu', 'Balu', 'male', '2021-04-20', 'w-balu', 'cv-agouti'),
|
gerbil('balu', 'Balu', 'male', '2021-04-20', 'w-balu', 'cv-agouti'),
|
||||||
gerbil('maja', 'Maja', 'female', '2021-06-11', null, 'cv-schwarz-schecke', 'aa CC DD EE GG PP Spsp rere'),
|
gerbil('maja', 'Maja', 'female', '2021-06-11', null, 'cv-schwarz-schecke', 'aa CC DD EE GG PP Spsp rere'),
|
||||||
|
|||||||
@@ -138,19 +138,19 @@ test('Kein Würfe-Panel wenn Wurzeltier keine Würfe hat (STAMMBAUM-LITTERS)', a
|
|||||||
await expect(page.locator('.stammbaum-litters-panel')).not.toBeVisible()
|
await expect(page.locator('.stammbaum-litters-panel')).not.toBeVisible()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Tier mit Foto zeigt Avatar-Bild, Tier ohne Foto zeigt Rennmaus-Icon (STAMMBAUM-AVATAR)', async ({ page }) => {
|
test('Knoten-Karte zeigt volles Geburtsdatum (STAMMBAUM-FULLDATE)', async ({ page }) => {
|
||||||
skipUnlessMock()
|
skipUnlessMock()
|
||||||
// Fridolin hat profilePhotoUrl (data URI) → <img.pedigree-card__avatar> sichtbar
|
// Krümel: dateOfBirth '2025-03-12' → formatDate → '12.03.2025'
|
||||||
// Krümel hat profilePhotoUrl=null → kein img, SVG-Icon sichtbar
|
|
||||||
await page.goto('/rennmaeuse/kruemel/stammbaum')
|
await page.goto('/rennmaeuse/kruemel/stammbaum')
|
||||||
await expect(page.locator('.pedigree-card').first()).toBeVisible()
|
await expect(page.locator('.pedigree-card').first()).toBeVisible()
|
||||||
|
await expect(page.locator('.pedigree-card__year').first()).toContainText('12.03.2025')
|
||||||
// Fridolin ist Vater von Krümel → seine Karte enthält ein <img>
|
})
|
||||||
const fridolinCard = page.locator('.pedigree-card').filter({ hasText: 'Fridolin' })
|
|
||||||
await expect(fridolinCard.locator('img.pedigree-card__avatar')).toBeVisible()
|
test('Gencode-Chip zeigt Genotyp statt Farbname (STAMMBAUM-GENCODE)', async ({ page }) => {
|
||||||
|
skipUnlessMock()
|
||||||
// Krümel (root) hat kein Foto → SVG-Icon im Foto-Slot
|
// Fridolin ist Vater von Krümel — genotype 'aa CC DD EE GG PP spsp rere'
|
||||||
const rootCard = page.locator('.pedigree-card.pedigree-card--root')
|
await page.goto('/rennmaeuse/kruemel/stammbaum')
|
||||||
await expect(rootCard.locator('img.pedigree-card__avatar')).not.toBeAttached()
|
await expect(page.locator('.pedigree-card').first()).toBeVisible()
|
||||||
await expect(rootCard.locator('svg[role="img"]')).toBeVisible()
|
const fridolinCard = page.locator('.pedigree-card').filter({ hasText: 'Fridolin' })
|
||||||
|
await expect(fridolinCard.locator('.pedigree-chip')).toContainText('aa CC')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ export interface Gerbil {
|
|||||||
isResident?: boolean
|
isResident?: boolean
|
||||||
/** FORM-FIELDS-1: true=gehörlos, false=hörend, null=unbekannt. */
|
/** FORM-FIELDS-1: true=gehörlos, false=hörend, null=unbekannt. */
|
||||||
isDeaf?: boolean | null
|
isDeaf?: boolean | null
|
||||||
/** STAMMBAUM-AVATAR: URL des Profilfotos (erstes Foto nach sortOrder); null = kein Foto. API-relativ oder absolut. */
|
|
||||||
profilePhotoUrl?: string | null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Payload for POST /gerbils. */
|
/** Payload for POST /gerbils. */
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
import type { ReactNode } from 'react'
|
||||||
import { NavLink, Outlet } from 'react-router-dom'
|
import { NavLink, Outlet } from 'react-router-dom'
|
||||||
import { de } from '../strings/de'
|
import { de } from '../strings/de'
|
||||||
|
import GerbilIcon from './GerbilIcon'
|
||||||
import './appShell.css'
|
import './appShell.css'
|
||||||
|
|
||||||
interface NavItem {
|
interface NavItem {
|
||||||
to: string
|
to: string
|
||||||
label: string
|
label: string
|
||||||
icon: string
|
icon: ReactNode
|
||||||
end?: boolean
|
end?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
// Primary items are always visible in the phone bottom bar; secondary items
|
// Primary items are always visible in the phone bottom bar; secondary items
|
||||||
// move into the "Mehr" sheet on phones and appear inline in the desktop sidebar.
|
// move into the "Mehr" sheet on phones and appear inline in the desktop sidebar.
|
||||||
const PRIMARY: NavItem[] = [
|
const PRIMARY: NavItem[] = [
|
||||||
{ to: '/rennmaeuse', label: de.nav.gerbils, icon: '🐭' },
|
{ to: '/rennmaeuse', label: de.nav.gerbils, icon: <GerbilIcon size="1.25em" /> },
|
||||||
{ to: '/wuerfe', label: de.nav.litters, icon: '🍼' },
|
{ to: '/wuerfe', label: de.nav.litters, icon: '🍼' },
|
||||||
{ to: '/genetik', label: de.nav.genetics, icon: '🧬' },
|
{ to: '/genetik', label: de.nav.genetics, icon: '🧬' },
|
||||||
]
|
]
|
||||||
@@ -46,7 +48,7 @@ export default function AppShell() {
|
|||||||
return (
|
return (
|
||||||
<div className="app-shell">
|
<div className="app-shell">
|
||||||
<header className="app-header">
|
<header className="app-header">
|
||||||
<span className="app-logo" aria-hidden="true">🐭</span>
|
<span className="app-logo" aria-hidden="true"><GerbilIcon size="1.5rem" /></span>
|
||||||
<h1 className="app-title">{de.app.title}</h1>
|
<h1 className="app-title">{de.app.title}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { Link, useNavigate, useParams } from 'react-router-dom'
|
|||||||
import Tree from 'react-d3-tree'
|
import Tree from 'react-d3-tree'
|
||||||
import type { CustomNodeElementProps, Point, RawNodeDatum } from 'react-d3-tree'
|
import type { CustomNodeElementProps, Point, RawNodeDatum } from 'react-d3-tree'
|
||||||
import { de } from '../strings/de'
|
import { de } from '../strings/de'
|
||||||
import { API_BASE_URL, ApiError } from '../api/client'
|
import { ApiError } from '../api/client'
|
||||||
import { listLitters } from '../api/litters'
|
import { listLitters } from '../api/litters'
|
||||||
import { listColorVarieties } from '../api/lookups'
|
import { listColorVarieties } from '../api/lookups'
|
||||||
import { getInbreedingCoefficient } from '../api/pedigree'
|
import { getInbreedingCoefficient } from '../api/pedigree'
|
||||||
@@ -380,15 +380,7 @@ function PedigreeCard({
|
|||||||
const t = de.pages.stammbaum
|
const t = de.pages.stammbaum
|
||||||
const g = node.gerbil
|
const g = node.gerbil
|
||||||
const chip = farbschlag ? chipColorFor(farbschlag) : null
|
const chip = farbschlag ? chipColorFor(farbschlag) : null
|
||||||
const year = g.dateOfBirth ? g.dateOfBirth.slice(0, 4) : null
|
const dob = g.dateOfBirth ? formatDate(g.dateOfBirth) : null
|
||||||
const [imgError, setImgError] = useState(false)
|
|
||||||
useEffect(() => setImgError(false), [g.id])
|
|
||||||
const photoUrl =
|
|
||||||
!imgError && g.profilePhotoUrl
|
|
||||||
? /^(https?:|data:|\/\/)/.test(g.profilePhotoUrl)
|
|
||||||
? g.profilePhotoUrl
|
|
||||||
: `${API_BASE_URL}${g.profilePhotoUrl}`
|
|
||||||
: null
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={isRoot ? 'pedigree-card pedigree-card--root' : 'pedigree-card'}
|
className={isRoot ? 'pedigree-card pedigree-card--root' : 'pedigree-card'}
|
||||||
@@ -396,17 +388,9 @@ function PedigreeCard({
|
|||||||
role={isRoot ? undefined : 'button'}
|
role={isRoot ? undefined : 'button'}
|
||||||
title={isRoot ? undefined : t.tapHint}
|
title={isRoot ? undefined : t.tapHint}
|
||||||
>
|
>
|
||||||
<div className="pedigree-card__photo" aria-hidden={!photoUrl || undefined}>
|
{/* Foto-Platzhalter — echte Fotos kommen mit FEAT-6. */}
|
||||||
{photoUrl ? (
|
<div className="pedigree-card__photo" aria-hidden="true">
|
||||||
<img
|
<GerbilIcon size="1.6rem" />
|
||||||
src={photoUrl}
|
|
||||||
alt={g.name || ''}
|
|
||||||
className="pedigree-card__avatar"
|
|
||||||
onError={() => setImgError(true)}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<GerbilIcon size="1.6rem" aria-hidden="true" />
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="pedigree-card__body">
|
<div className="pedigree-card__body">
|
||||||
<div className="pedigree-card__name">
|
<div className="pedigree-card__name">
|
||||||
@@ -423,11 +407,12 @@ function PedigreeCard({
|
|||||||
<span
|
<span
|
||||||
className="pedigree-chip"
|
className="pedigree-chip"
|
||||||
style={chip ? { background: chip.bg, color: chip.fg } : undefined}
|
style={chip ? { background: chip.bg, color: chip.fg } : undefined}
|
||||||
|
title={farbschlag}
|
||||||
>
|
>
|
||||||
{farbschlag}
|
{g.genotype || farbschlag}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{year && <span className="pedigree-card__year">* {year}</span>}
|
{dob && <span className="pedigree-card__year">* {dob}</span>}
|
||||||
</div>
|
</div>
|
||||||
{node.expandable && (
|
{node.expandable && (
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -236,7 +236,6 @@
|
|||||||
width: 42px;
|
width: 42px;
|
||||||
height: 42px;
|
height: 42px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
overflow: hidden;
|
|
||||||
background: var(--color-accent-soft);
|
background: var(--color-accent-soft);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -244,13 +243,6 @@
|
|||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pedigree-card__avatar {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pedigree-card__body {
|
.pedigree-card__body {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -293,14 +285,15 @@
|
|||||||
.pedigree-chip {
|
.pedigree-chip {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
font-size: 0.68rem;
|
font-size: 0.62rem;
|
||||||
padding: 0.1rem 0.45rem;
|
padding: 0.1rem 0.45rem;
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
background: var(--color-accent-soft);
|
background: var(--color-accent-soft);
|
||||||
color: var(--color-accent);
|
color: var(--color-accent);
|
||||||
white-space: nowrap;
|
white-space: normal;
|
||||||
|
word-break: break-word;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
line-height: 1.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pedigree-card__year {
|
.pedigree-card__year {
|
||||||
|
|||||||
@@ -102,9 +102,9 @@
|
|||||||
{
|
{
|
||||||
"name": "Skarlett von den Kleinen Chaoten",
|
"name": "Skarlett von den Kleinen Chaoten",
|
||||||
"dob": "14.07.2013",
|
"dob": "14.07.2013",
|
||||||
"decision": "death date = 17.04.2016 (the '2018' variant was wrong — it had leaked as '/ +2018' into the genotype field; parse-leak already fixed in IMPORT-POLISH)",
|
"decision": "birth 2013 + 4 years = death year 2017, no exact date → year-only convention (01.01.2017). Previous entry (17.04.2016) was wrong.",
|
||||||
"dateOfDeath": "17.04.2016",
|
"dateOfDeath": "01.01.2017",
|
||||||
"source": "Julian 2026-06-07 — HUMANQUESTION D6"
|
"source": "Julian 2026-06-07 — HUMANQUESTION D7 (final Skarlett resolution)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Kazu von den Kleinen Chaoten",
|
"name": "Kazu von den Kleinen Chaoten",
|
||||||
@@ -162,6 +162,57 @@
|
|||||||
"decision": "Sterbedatum = 18.12.2020 (die 01.10.2020-Variante war falsch); Gencode war einig, taub-Flag bleibt via 'Vorhandensein gewinnt'",
|
"decision": "Sterbedatum = 18.12.2020 (die 01.10.2020-Variante war falsch); Gencode war einig, taub-Flag bleibt via 'Vorhandensein gewinnt'",
|
||||||
"dateOfDeath": "18.12.2020",
|
"dateOfDeath": "18.12.2020",
|
||||||
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7"
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Max von Privat",
|
||||||
|
"dob": "01.02.2013",
|
||||||
|
"decision": "Genotyp von der Züchterin bestätigt (D-=D-, P=PP); Todesjahr 2014 (kein genaues Datum → Jahr-only-Konvention 01.01.2014). Reject 4 on-file-Varianten: 04.02.2016 / 04.03.2016 / 2014-raw / 30.12.2015.",
|
||||||
|
"genotype": "aa c[chm]c[chm] D- EE GG PP spsp",
|
||||||
|
"dateOfDeath": "01.01.2014",
|
||||||
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7 (resolved)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Isa of Golden Lights",
|
||||||
|
"dob": "24.12.2014",
|
||||||
|
"decision": "Sterbedatum von der Züchterin (DOB-key war im extract teils leer; diese Zeile matcht die konfliktbehaftete Zeile mit dob=24.12.2014)",
|
||||||
|
"dateOfDeath": "21.07.2018",
|
||||||
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jack II von den Kleinen Chaoten",
|
||||||
|
"dob": "14.02.2016",
|
||||||
|
"decision": "Sterbedatum von der Züchterin",
|
||||||
|
"dateOfDeath": "06.10.2019",
|
||||||
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Milon von den Kleinen Chaoten",
|
||||||
|
"dob": "27.11.2014",
|
||||||
|
"decision": "A-Locus = Aa (Quellen: Aa // aa — einziger strittiger Locus, Züchterin löst auf Aa); alle anderen Loci waren einig",
|
||||||
|
"genotype": "Aa Cc[chm] D- ee[f] gg Pp spsp",
|
||||||
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sunny von PZ Karl",
|
||||||
|
"dob": "10.04.2014",
|
||||||
|
"decision": "Sterbedatum von der Züchterin; bestätigt = 'von PZ Karl' (nicht 'Sunny Sky of Fiomi')",
|
||||||
|
"dateOfDeath": "30.04.2018",
|
||||||
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7 (Nachtrag)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Dakota of sweet little mouse",
|
||||||
|
"dob": "30.01.2015",
|
||||||
|
"decision": "Genotyp von Julian/Züchterin: A-Locus=Aa, P-Locus=pp, Sp-Locus=Spsp (offene Loci); übrige bestätigt.",
|
||||||
|
"genotype": "Aa CC Dd Ee Gg pp Spsp",
|
||||||
|
"source": "Julian/Züchterin 2026-06-07 — HUMANQUESTION D7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Banjo of Fiomi",
|
||||||
|
"dob": "06.07.2015",
|
||||||
|
"decision": "E-Locus Korrektur: Julian — 'Goldfuchs Starkschecke, nicht Gold Starkschecke' → E-Locus muss ee sein, nicht E-. Extract hatte AA CC DD E- Gg pp Spsp [WP]; korrigiert zu ee (Goldfuchs-Definition). Sohn von Dakota of sweet little mouse.",
|
||||||
|
"genotype": "AA CC DD ee Gg pp Spsp",
|
||||||
|
"farbschlag": "Goldfuchs Starkschecke",
|
||||||
|
"source": "Julian 2026-06-07 — HUMANQUESTION D7 (Sohn-Korrektur, nicht ursprüngliche D7-Liste)"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user