feat(260928-ujj): Dashboard-Hintergrund pro Benutzer in der Datenbank

- Spalte User.dashboardBackground (JSONB) samt Migration
- PATCH /users/me/dashboard-background, geprueft mit parseDashboardBackground aus @tessera/shared (Allowlist, UUID-Bildkennung)
- getMe liefert dashboardBackground normalisiert neben accentColor
- Web liest die Wahl aus dem Auth-Store, speichert ueber die Server-Aktion, alte localStorage-Wahl wird einmalig uebernommen
- Hinweistext: gilt auf jedem Geraet

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-28 22:13:49 +02:00
parent 76f6d87973
commit 0aaa15240d
16 changed files with 333 additions and 66 deletions
+6 -1
View File
@@ -8,6 +8,7 @@ import {
import { ConfigService } from '@nestjs/config';
import { JwtService } from '@nestjs/jwt';
import { Role } from '@prisma/client';
import { parseDashboardBackground } from '@tessera/shared';
import * as argon2 from 'argon2';
import { randomUUID } from 'node:crypto';
import { Response } from 'express';
@@ -331,6 +332,7 @@ export class AuthService {
ldapDn: true,
avatarPath: true,
accentColor: true,
dashboardBackground: true,
},
});
@@ -338,10 +340,13 @@ export class AuthService {
return null;
}
const { passwordHash, ldapDn, avatarPath, ...publicFields } = user;
const { passwordHash, ldapDn, avatarPath, dashboardBackground, ...publicFields } = user;
return {
...publicFields,
// quick-260928-ujj (T-ujj-01): auch beim Lesen durch die gemeinsame
// Pruefregel — NULL oder ein ungueltiger Inhalt ergibt null.
dashboardBackground: parseDashboardBackground(dashboardBackground),
isLocalUser: !!passwordHash && !ldapDn,
hasAvatar: !!avatarPath,
};