chore(workspace): move the app to apps/app under a pnpm workspace (step 2)
144 files moved with git mv (pure renames). Root package.json delegates dev/typecheck/test:run/lint/build to the packages; Node 24 LTS and pnpm 10.13.1 pinned (.nvmrc, .node-version, engines, packageManager, root devDependency, engine-strict). Dockerfile builds @faunosteo/app on node:24-alpine and copies apps/app/dist; nginx and runtime config unchanged. CI workflow for Gitea Actions. packages/ reserved (README only). Docs synced: WORKSPACE.md, CLAUDE.md, README, DEPLOY, CHANGELOG, plan. 271/271 tests, typecheck, lint, build green from the root.
This commit is contained in:
1 parent
c8d48ab4cc
commit
8673475293
164 files changed
+348
-128
No files matched your search
@@ -0,0 +1,56 @@
|
||||
import type { Animal, Owner } from '@/domain/schema/animal'
|
||||
import Label from '@/components/ui/Label'
|
||||
import Input from '@/components/ui/Input'
|
||||
import Select from '@/components/ui/Select'
|
||||
import { getAllSpecies, speciesLabel } from '@/domain/species/registry'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
|
||||
export interface AnimalFormProps {
|
||||
animal: Animal
|
||||
owner: Owner
|
||||
onChangeAnimal: (next: Animal) => void
|
||||
onChangeOwner: (next: Owner) => void
|
||||
}
|
||||
|
||||
export default function AnimalForm({ animal, owner, onChangeAnimal, onChangeOwner }: AnimalFormProps) {
|
||||
const t = useT()
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
const species = getAllSpecies()
|
||||
const setA = (patch: Partial<Animal>) => onChangeAnimal({ ...animal, ...patch })
|
||||
return (
|
||||
<fieldset className="space-y-3">
|
||||
<legend className="font-serif text-xl mb-2 text-[var(--color-ink)]">
|
||||
{t('form.animal.legend')}
|
||||
</legend>
|
||||
<div>
|
||||
<Label htmlFor="an-species">{t('form.animal.species')}</Label>
|
||||
<Select
|
||||
id="an-species"
|
||||
value={animal.speciesId}
|
||||
onChange={(e) => setA({ speciesId: e.target.value })}
|
||||
>
|
||||
{species.map((s) => (
|
||||
<option key={s.id} value={s.id}>{speciesLabel(s, locale)}</option>
|
||||
))}
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="an-name">{t('form.animal.name')}</Label>
|
||||
<Input id="an-name" required value={animal.name} onChange={(e) => setA({ name: e.target.value })} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="an-breed">{t('form.animal.breed')}</Label>
|
||||
<Input id="an-breed" value={animal.breed ?? ''} onChange={(e) => setA({ breed: e.target.value || undefined })} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="an-age">{t('form.animal.age')}</Label>
|
||||
<Input id="an-age" value={animal.age ?? ''} onChange={(e) => setA({ age: e.target.value || undefined })} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="own-name">{t('form.owner.name')}</Label>
|
||||
<Input id="own-name" required value={owner.name} onChange={(e) => onChangeOwner({ name: e.target.value })} />
|
||||
</div>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { Report } from '@/domain/schema/report'
|
||||
import Label from '@/components/ui/Label'
|
||||
import Textarea from '@/components/ui/Textarea'
|
||||
import NextAppointmentPicker from './NextAppointmentPicker'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export interface ConclusionPanelProps {
|
||||
conclusion: string
|
||||
recommendations: string
|
||||
nextAppointment: Report['nextAppointment']
|
||||
onChangeConclusion: (s: string) => void
|
||||
onChangeRecommendations: (s: string) => void
|
||||
onChangeNextAppointment: (n: Report['nextAppointment']) => void
|
||||
}
|
||||
|
||||
export default function ConclusionPanel({
|
||||
conclusion,
|
||||
recommendations,
|
||||
nextAppointment,
|
||||
onChangeConclusion,
|
||||
onChangeRecommendations,
|
||||
onChangeNextAppointment,
|
||||
}: ConclusionPanelProps) {
|
||||
const t = useT()
|
||||
return (
|
||||
<section className="space-y-4">
|
||||
<h2 className="font-serif text-lg sm:text-xl text-[var(--color-ink)]">
|
||||
{t('conclusion.section_title')}
|
||||
</h2>
|
||||
<div>
|
||||
<Label htmlFor="conclusion">{t('conclusion.conclusion')}</Label>
|
||||
<Textarea id="conclusion" value={conclusion} onChange={(e) => onChangeConclusion(e.target.value)} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="recommendations">{t('conclusion.recommendations')}</Label>
|
||||
<Textarea id="recommendations" value={recommendations} onChange={(e) => onChangeRecommendations(e.target.value)} />
|
||||
</div>
|
||||
<NextAppointmentPicker value={nextAppointment} onChange={onChangeNextAppointment} />
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import type { Report } from '@/domain/schema/report'
|
||||
import Input from '@/components/ui/Input'
|
||||
import Label from '@/components/ui/Label'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export interface NextAppointmentPickerProps {
|
||||
value: Report['nextAppointment']
|
||||
onChange: (next: Report['nextAppointment']) => void
|
||||
}
|
||||
|
||||
export default function NextAppointmentPicker({
|
||||
value,
|
||||
onChange,
|
||||
}: NextAppointmentPickerProps) {
|
||||
const t = useT()
|
||||
const kind = value?.kind
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<Label>{t('conclusion.next_appointment')}</Label>
|
||||
<div className="flex gap-2 mb-2">
|
||||
<label className="text-sm flex items-center gap-1">
|
||||
<input
|
||||
type="radio"
|
||||
checked={kind === 'date'}
|
||||
onChange={() => onChange({ kind: 'date', date: '' })}
|
||||
/>
|
||||
{t('conclusion.next_kind_date')}
|
||||
</label>
|
||||
<label className="text-sm flex items-center gap-1">
|
||||
<input
|
||||
type="radio"
|
||||
checked={kind === 'period'}
|
||||
onChange={() => onChange({ kind: 'period', text: '' })}
|
||||
/>
|
||||
{t('conclusion.next_kind_period')}
|
||||
</label>
|
||||
<label className="text-sm flex items-center gap-1">
|
||||
<input
|
||||
type="radio"
|
||||
checked={value === undefined}
|
||||
onChange={() => onChange(undefined)}
|
||||
/>
|
||||
{t('conclusion.next_kind_none')}
|
||||
</label>
|
||||
</div>
|
||||
{value?.kind === 'date' && (
|
||||
<Input
|
||||
type="date"
|
||||
value={value.date}
|
||||
onChange={(e) => onChange({ kind: 'date', date: e.target.value })}
|
||||
/>
|
||||
)}
|
||||
{value?.kind === 'period' && (
|
||||
<Input
|
||||
value={value.text}
|
||||
placeholder={t('conclusion.next_period_placeholder')}
|
||||
onChange={(e) => onChange({ kind: 'period', text: e.target.value })}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import type { Practitioner } from '@/domain/schema/practitioner'
|
||||
import Label from '@/components/ui/Label'
|
||||
import Input from '@/components/ui/Input'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export interface PractitionerFormProps {
|
||||
value: Practitioner
|
||||
onChange: (next: Practitioner) => void
|
||||
}
|
||||
|
||||
export default function PractitionerForm({ value, onChange }: PractitionerFormProps) {
|
||||
const t = useT()
|
||||
const set = (patch: Partial<Practitioner>) => onChange({ ...value, ...patch })
|
||||
return (
|
||||
<fieldset className="space-y-3">
|
||||
<legend className="font-serif text-xl mb-2 text-[var(--color-ink)]">
|
||||
{t('form.practitioner.legend')}
|
||||
</legend>
|
||||
<div>
|
||||
<Label htmlFor="prac-name">{t('form.practitioner.name')}</Label>
|
||||
<Input id="prac-name" required value={value.name} onChange={(e) => set({ name: e.target.value })} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="prac-cabinet">{t('form.practitioner.cabinet')}</Label>
|
||||
<Input id="prac-cabinet" value={value.cabinet ?? ''} onChange={(e) => set({ cabinet: e.target.value || undefined })} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="prac-contact">{t('form.practitioner.contact')}</Label>
|
||||
<Input id="prac-contact" value={value.contact ?? ''} onChange={(e) => set({ contact: e.target.value || undefined })} />
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="prac-siret">{t('form.practitioner.siret')}</Label>
|
||||
<Input id="prac-siret" value={value.siret ?? ''} onChange={(e) => set({ siret: e.target.value || undefined })} />
|
||||
</div>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { Report } from '@/domain/schema/report'
|
||||
import AppHeader from '@/components/brand/AppHeader'
|
||||
import Button from '@/components/ui/Button'
|
||||
import { formatDate } from '@/lib/dates'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
|
||||
export interface ReportHeaderProps {
|
||||
report: Report
|
||||
onEditInfos?: () => void
|
||||
}
|
||||
|
||||
export default function ReportHeader({ report, onEditInfos }: ReportHeaderProps) {
|
||||
const t = useT()
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
return (
|
||||
<AppHeader>
|
||||
<div className="text-xs sm:text-sm text-right text-[var(--color-ink-muted)]">
|
||||
<div className="text-[var(--color-ink)] font-medium truncate max-w-[10rem] sm:max-w-none">
|
||||
{report.animal.name} · {report.owner.name}
|
||||
</div>
|
||||
<div className="hidden sm:block">{formatDate(report.date, locale)}</div>
|
||||
</div>
|
||||
{onEditInfos && (
|
||||
<Button variant="secondary" size="sm" onClick={onEditInfos}>
|
||||
{t('editor.edit_infos')}
|
||||
</Button>
|
||||
)}
|
||||
</AppHeader>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user