diff --git a/frontend/src/pages/CasesPage.tsx b/frontend/src/pages/CasesPage.tsx index 2f86fe2..98d9647 100644 --- a/frontend/src/pages/CasesPage.tsx +++ b/frontend/src/pages/CasesPage.tsx @@ -354,10 +354,12 @@ function CaseDetail({ caseData }: { caseData: Case }) {

Änderungen gespeichert.

)} - {/* Status badges */} -
- -
+ {/* Status badges (admin only) */} + {isAdmin && ( +
+ +
+ )} {/* Disclosure status / request */} {!isAdmin && caseData.disclosure_granted && caseData.disclosure_expires_at && ( @@ -381,6 +383,7 @@ function CaseDetail({ caseData }: { caseData: Case }) { {/* Editable sections from config */} {CASE_SECTIONS.map((section) => { + if (section.visibleTo === 'admin' && !isAdmin) return null const visibleFields = section.fields.filter((field) => { if (field.visibleTo === 'admin' && !isAdmin && !caseData.disclosure_granted) return false return true @@ -434,8 +437,8 @@ function CaseDetail({ caseData }: { caseData: Case }) { )} - {/* Coding info (read-only, managed via coding endpoint) */} - {(caseData.gutachten_typ || caseData.therapieaenderung) && ( + {/* Coding info (read-only, admin only) */} + {isAdmin && (caseData.gutachten_typ || caseData.therapieaenderung) && (

Coding

diff --git a/frontend/src/pages/cases/fieldConfig.ts b/frontend/src/pages/cases/fieldConfig.ts index 72c83d5..81644e7 100644 --- a/frontend/src/pages/cases/fieldConfig.ts +++ b/frontend/src/pages/cases/fieldConfig.ts @@ -16,6 +16,7 @@ export interface FieldConfig { export interface SectionConfig { title: string fields: FieldConfig[] + visibleTo?: 'admin' | 'all' } const ANREDE_OPTIONS = [ @@ -50,7 +51,7 @@ export const CASE_SECTIONS: SectionConfig[] = [ ], }, { - title: 'Falldetails', + title: 'Falldetails', visibleTo: 'admin', fields: [ { key: 'kurzbeschreibung', label: 'Kurzbeschreibung', type: 'textarea', editableBy: 'admin', colSpan: 2 }, { key: 'fragestellung', label: 'Fragestellung', type: 'textarea', editableBy: 'admin', colSpan: 2 }, @@ -59,7 +60,7 @@ export const CASE_SECTIONS: SectionConfig[] = [ ], }, { - title: 'Unterlagen', + title: 'Unterlagen', visibleTo: 'admin', fields: [ { key: 'unterlagen', label: 'Unterlagen vorhanden', type: 'boolean', editableBy: 'admin' }, { key: 'erhalten', label: 'Erhalten', type: 'boolean', editableBy: 'admin' }, @@ -69,7 +70,7 @@ export const CASE_SECTIONS: SectionConfig[] = [ ], }, { - title: 'Gutachten', + title: 'Gutachten', visibleTo: 'admin', fields: [ { key: 'gutachten', label: 'Gutachten vorhanden', type: 'boolean', editableBy: 'admin' }, { key: 'gutachter', label: 'Gutachter', type: 'text', editableBy: 'admin', placeholder: 'Name des Gutachters' }, @@ -79,7 +80,7 @@ export const CASE_SECTIONS: SectionConfig[] = [ ], }, { - title: 'Status', + title: 'Status', visibleTo: 'admin', fields: [ { key: 'ablehnung', label: 'Ablehnung', type: 'boolean', editableBy: 'admin' }, { key: 'abbruch', label: 'Abbruch', type: 'boolean', editableBy: 'admin' }, @@ -87,7 +88,7 @@ export const CASE_SECTIONS: SectionConfig[] = [ ], }, { - title: 'Abrechnung', + title: 'Abrechnung', visibleTo: 'admin', fields: [ { key: 'abgerechnet', label: 'Abgerechnet', type: 'boolean', editableBy: 'admin' }, { key: 'abrechnung_datum', label: 'Abrechnungsdatum', type: 'date', editableBy: 'admin' },