Projektlogo: quadratisches Logo hochladen & anzeigen
Logo kann bei der Projekterstellung und nachträglich im Projekt-Header hochgeladen werden. Client-seitiger Center-Crop auf 256px WebP, gespeichert als Data-URL in neuer Spalte project.logo_url (Migration 0016). Anzeige in der Bereichs-Projektliste (Card) und im Detail-Header, mit Initialen- Platzhalter wenn kein Logo gesetzt ist. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
45a87711fb
commit
1206dc5e0f
9 files changed
+3652
-119
No files matched your search
@@ -3,10 +3,19 @@ import { z } from 'zod';
|
||||
const ampelSchema = z.enum(['green', 'amber', 'red']);
|
||||
const trendSchema = z.enum(['besser', 'gleich', 'schlechter']);
|
||||
|
||||
// Quadratisches Logo als Data-URL (client verkleinert auf 256px ≈ <100 KB).
|
||||
const logoUrlSchema = z
|
||||
.string()
|
||||
.max(500_000)
|
||||
.refine((s) => s.startsWith('data:image/') || /^https?:\/\//.test(s), {
|
||||
message: 'Logo muss ein Bild (Data-URL) oder eine http(s)-URL sein.',
|
||||
});
|
||||
|
||||
export const createProjectInput = z.object({
|
||||
areaId: z.string().uuid(),
|
||||
name: z.string().min(1).max(200),
|
||||
description: z.string().max(2000).optional(),
|
||||
logoUrl: logoUrlSchema.optional(),
|
||||
kind: z.enum(['kundenprojekt', 'internes_projekt']),
|
||||
verantwortlicheUserId: z.string().uuid().optional(),
|
||||
arbeitsmodus: z.enum(['cycle', 'kanban']).optional(),
|
||||
@@ -104,6 +113,7 @@ export const updateProjectInput = z.object({
|
||||
nichtZiele: z.string().max(2000).nullable().optional(),
|
||||
liefergegenstaende: z.string().max(2000).nullable().optional(),
|
||||
zieldreieckFlex: zieldreieckFlexSchema.nullable().optional(),
|
||||
logoUrl: logoUrlSchema.nullable().optional(),
|
||||
outlineSteckbriefUrl: z.string().url().nullable().optional(),
|
||||
planeProjectUrl: z.string().url().nullable().optional(),
|
||||
risikolisteUrl: z.string().url().nullable().optional(),
|
||||
|
||||
Reference in new issue
Block a user