Sprint 8: minimale Admin-Seite (Standort/Objekt-Anlage) im Frontend
Frontend deckte bisher nur den Mitarbeiter-Kontrollflow ab, Stammdaten mussten per API/Skript angelegt werden (Test-Deployment-Lücke). /admin zeigt Standort- und Objekt-Anlage (aus aktiver Vorlage), nur für Rolle administration sichtbar (/auth/me liefert Rollen an AuthContext). Bewusst kein Bereich/Kategorie/Material-CRUD - kommt aus Excel-Import. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L85hmKbvX7Cqkq47KnQhFt
This commit is contained in:
@@ -3,6 +3,7 @@ import { Link } from "react-router-dom";
|
||||
|
||||
import { apiRequest } from "../api/client";
|
||||
import type { Objekt } from "../api/types";
|
||||
import { useAuth } from "../auth/AuthContext";
|
||||
|
||||
// Prompt 11 Screen 1: Standort/Objekt wählen. QR-/Barcode-Scan (Karte 10) ist
|
||||
// Roadmap - dieser Screen bietet bewusst schon die Code-Suche als Textfeld an,
|
||||
@@ -11,6 +12,7 @@ export function ObjektListPage() {
|
||||
const [objekte, setObjekte] = useState<Objekt[]>([]);
|
||||
const [suche, setSuche] = useState("");
|
||||
const [ladefehler, setLadefehler] = useState<string | null>(null);
|
||||
const { istAdmin } = useAuth();
|
||||
|
||||
useEffect(() => {
|
||||
apiRequest<Objekt[]>("/objekte")
|
||||
@@ -27,6 +29,11 @@ export function ObjektListPage() {
|
||||
return (
|
||||
<main style={{ maxWidth: 480, margin: "0 auto", padding: "1rem" }}>
|
||||
<h1>Objekte</h1>
|
||||
{istAdmin && (
|
||||
<Link to="/admin" style={{ display: "inline-block", marginBottom: "1rem" }}>
|
||||
Administration →
|
||||
</Link>
|
||||
)}
|
||||
<input
|
||||
placeholder="Suche oder Code scannen…"
|
||||
value={suche}
|
||||
|
||||
Reference in New Issue
Block a user