feat: Aufgaben einzeln zum Spiegeln freigeben

Der Schalter erscheint nur, wo auch gespiegelt wird.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Florian Wilde
2026-09-11 23:58:46 +02:00
co-authored by Claude Opus 5
parent 4da2f3d9c6
commit 3befcc19a3
4 changed files with 10 additions and 0 deletions
+4
View File
@@ -14,6 +14,7 @@ import {
type AufgabenFilter,
} from '@/server/abfragen/aufgaben'
import { verlangeAnmeldung } from '@/server/berechtigung'
import { umgebung } from '@/server/umgebung'
export const metadata: Metadata = { title: 'Aufgaben' }
@@ -67,6 +68,7 @@ export default async function AufgabenSeite({
searchParams: Promise<Record<string, string | string[] | undefined>>
}) {
await verlangeAnmeldung('/aufgaben')
const spiegelt = umgebung().spiegelSendenAktiv
const parameter = await searchParams
const [aufgaben, bereiche, projekte] = await Promise.all([
@@ -101,11 +103,13 @@ export default async function AufgabenSeite({
</CardInhalt>
</Card>
{/* Nur wo auch gespiegelt wird, hat der Schalter einen Sinn. */}
<AufgabenListe
aufgaben={aufgaben}
bereiche={bereiche}
projekte={projekte}
leerText="Keine Aufgabe passt zu diesen Filtern."
mitSpiegeln={spiegelt}
/>
</div>
)
+1
View File
@@ -16,6 +16,7 @@ function roh(teil: Partial<AufgabeRoh> = {}): AufgabeRoh {
faelligAm: null,
quelle: 'MANUELL',
quelleUrl: null,
spiegeln: false,
bereich: null,
projekt: null,
...teil,
+4
View File
@@ -26,6 +26,7 @@ export type AufgabeRoh = {
faelligAm: Date | null
quelle: Quelle
quelleUrl: string | null
spiegeln: boolean
bereich: { id: string; name: string; farbe: string } | null
projekt: { id: string; name: string } | null
}
@@ -48,6 +49,8 @@ export type AufgabeAnzeige = {
ueberfaellig: boolean
quelle: Quelle
quelleUrl: string | null
/** Ausdruecklich zum Spiegeln freigegeben. */
spiegeln: boolean
bereich: { id: string; name: string; farbe: string } | null
projekt: { id: string; name: string } | null
}
@@ -79,6 +82,7 @@ export function fuerAnzeige(aufgabe: AufgabeRoh, jetzt: Date): AufgabeAnzeige {
ueberfaellig: istUeberfaellig(aufgabe.faelligAm, aufgabe.status, jetzt),
quelle: aufgabe.quelle,
quelleUrl: aufgabe.quelleUrl,
spiegeln: aufgabe.spiegeln,
bereich: aufgabe.bereich,
projekt: aufgabe.projekt,
}
+1
View File
@@ -25,6 +25,7 @@ const AUSWAHL = {
faelligAm: true,
quelle: true,
quelleUrl: true,
spiegeln: true,
bereich: { select: { id: true, name: true, farbe: true } },
projekt: { select: { id: true, name: true } },
} satisfies Prisma.AufgabeSelect