diff --git a/ApiCore-Frontend/src/app/(app)/settings/automation/calendar-sync-tab.tsx b/ApiCore-Frontend/src/app/(app)/settings/automation/calendar-sync-tab.tsx index c2f2353..b3f2e6e 100644 --- a/ApiCore-Frontend/src/app/(app)/settings/automation/calendar-sync-tab.tsx +++ b/ApiCore-Frontend/src/app/(app)/settings/automation/calendar-sync-tab.tsx @@ -87,13 +87,18 @@ function SettingsForm({ settings }: { settings: CalendarSyncSettings }) {
- + setGroupId(event.target.value)} placeholder="z. B. 3fa85f64-5717-4562-b3fc-2c963f66afa6" + aria-describedby="sync-group-id-hint" /> +

+ Steht im Microsoft-Entra-Admin-Center unter Gruppen → gewünschte Gruppe → + „Objekt-ID“. Bei Unklarheit die IT fragen. +

Welche Einträge übertragen werden

@@ -148,9 +153,9 @@ function StatusSection() {

Lädt…

) : !status?.configured ? (

- Nicht konfiguriert - die SSO-Umgebungsvariablen (OIDC_ISSUER_URL/OIDC_CLIENT_ID/ - OIDC_CLIENT_SECRET) fehlen, oder die App-Registrierung hat noch keine - Application-Berechtigung „Calendars.ReadWrite“. + Noch nicht eingerichtet. Das erledigt die Person, die den Server betreut: Microsoft- + Anmeldung (SSO) einrichten und der App die Berechtigung „Calendars.ReadWrite“ geben + (Details in der Betriebsanleitung, ARCHITECTURE.md Abschnitt 6.9).

) : !canRunNow ? (

diff --git a/ApiCore-Frontend/src/app/(app)/settings/automation/webhooks-tab.tsx b/ApiCore-Frontend/src/app/(app)/settings/automation/webhooks-tab.tsx index e497916..11db482 100644 --- a/ApiCore-Frontend/src/app/(app)/settings/automation/webhooks-tab.tsx +++ b/ApiCore-Frontend/src/app/(app)/settings/automation/webhooks-tab.tsx @@ -1,24 +1,22 @@ "use client"; +import { CircleCheck, CircleSlash, Webhook } from "lucide-react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { toast } from "sonner"; import { deleteWebhook, fetchWebhooks } from "@/lib/webhooks/api"; +import { WEBHOOK_EVENT_LABELS } from "@/lib/webhooks/labels"; +import { errorMessage } from "@/lib/forms/error-message"; import { Badge } from "@/components/ui/badge"; import { ConfirmDialog } from "@/components/confirm-dialog"; -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "@/components/ui/table"; +import { EmptyState } from "@/components/empty-state"; +import { QueryState } from "@/components/query-state"; import { CreateWebhookDialog } from "./create-webhook-dialog"; import { EditWebhookDialog } from "./edit-webhook-dialog"; +/** One card per connection - events in words, not technical keys. */ export function WebhooksTab() { const queryClient = useQueryClient(); - const { data: webhooks, isLoading, isError } = useQuery({ + const webhooksQuery = useQuery({ queryKey: ["webhooks"], queryFn: fetchWebhooks, }); @@ -29,76 +27,72 @@ export function WebhooksTab() { void queryClient.invalidateQueries({ queryKey: ["webhooks"] }); toast.success("Webhook gelöscht"); }, - onError: () => toast.error("Webhook konnte nicht gelöscht werden"), + onError: (error) => toast.error(errorMessage(error, "Webhook konnte nicht gelöscht werden")), }); return (

+

+ Ein Webhook meldet einem anderen System sofort, wenn hier etwas passiert – zum Beispiel + eine neue Ernte. Nur nötig, wenn ein anderes Programm darauf wartet. +

- {isLoading ?

Lädt…

: null} - {isError ? ( -

- Webhooks konnten nicht geladen werden. -

- ) : null} - - {webhooks && webhooks.length === 0 ? ( -

Noch keine Webhooks angelegt.

- ) : null} - - {webhooks && webhooks.length > 0 ? ( -
- - - - URL - Ereignisse - Status - Aktion - - - - {webhooks.map((webhook) => ( - - {webhook.url} - -
- {webhook.events.map((event) => ( - - {event} - - ))} -
-
- - - {webhook.active ? "Aktiv" : "Inaktiv"} - - - -
- - deleteMutation.mutate(webhook.id)} - /> -
-
-
- ))} -
-
-
- ) : null} + } + > + {(webhooks) => ( +
    + {webhooks.map((webhook) => ( +
  • +
    + {webhook.url} + + {webhook.active ? ( + + ) : ( + + )} + {webhook.active ? "Aktiv" : "Pausiert"} + +
    + {webhook.events.map((event) => ( + + {WEBHOOK_EVENT_LABELS[event] ?? event} + + ))} +
    +
    +
    + + deleteMutation.mutate(webhook.id)} + /> +
    +
  • + ))} +
+ )} +
); }