From 1cdfde01285e8813d897b6abcde2756cdaa8ab0d Mon Sep 17 00:00:00 2001 From: Matthias Hochmeister Date: Fri, 13 Mar 2026 14:31:58 +0100 Subject: [PATCH] update --- frontend/src/pages/Settings.tsx | 79 +++++++-------------------------- 1 file changed, 17 insertions(+), 62 deletions(-) diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index c6657d8..7c15424 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -15,10 +15,10 @@ import { CircularProgress, Button, Chip, - TextField, } from '@mui/material'; -import { Settings as SettingsIcon, Notifications, Palette, Language, SettingsBrightness, LightMode, DarkMode, Widgets, Cloud, LinkOff, Forum, Badge } from '@mui/icons-material'; +import { Settings as SettingsIcon, Notifications, Palette, Language, SettingsBrightness, LightMode, DarkMode, Widgets, Cloud, LinkOff, Forum, Person, OpenInNew } from '@mui/icons-material'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; +import { useNavigate } from 'react-router-dom'; import DashboardLayout from '../components/dashboard/DashboardLayout'; import { useThemeMode } from '../contexts/ThemeContext'; import { preferencesApi } from '../services/settings'; @@ -26,7 +26,6 @@ import { WIDGETS, WidgetKey } from '../constants/widgets'; import { nextcloudApi } from '../services/nextcloud'; import { useNotification } from '../contexts/NotificationContext'; import { useAuth } from '../contexts/AuthContext'; -import { membersService } from '../services/members'; const POLL_INTERVAL = 2000; const POLL_TIMEOUT = 5 * 60 * 1000; @@ -34,35 +33,9 @@ const POLL_TIMEOUT = 5 * 60 * 1000; function Settings() { const { themeMode, setThemeMode } = useThemeMode(); const queryClient = useQueryClient(); - const { showInfo, showSuccess, showError } = useNotification(); + const { showInfo } = useNotification(); const { user } = useAuth(); - - // FDISK Standesbuchnummer - const [standesNr, setStandesNr] = useState(''); - const [standesNrEdited, setStandesNrEdited] = useState(false); - - const { data: memberProfile, isLoading: profileLoading } = useQuery({ - queryKey: ['member', user?.id], - queryFn: () => membersService.getMember(user!.id), - enabled: !!user?.id, - }); - - useEffect(() => { - if (memberProfile?.profile?.fdisk_standesbuch_nr != null) { - setStandesNr(memberProfile.profile.fdisk_standesbuch_nr); - } - }, [memberProfile]); - - const standesNrMutation = useMutation({ - mutationFn: (value: string) => - membersService.updateMember(user!.id, { fdisk_standesbuch_nr: value || undefined }), - onSuccess: () => { - showSuccess('Standesbuchnummer gespeichert'); - setStandesNrEdited(false); - queryClient.invalidateQueries({ queryKey: ['member', user?.id] }); - }, - onError: () => showError('Speichern fehlgeschlagen'), - }); + const navigate = useNavigate(); const { data: preferences, isLoading: prefsLoading } = useQuery({ queryKey: ['user-preferences'], @@ -282,45 +255,27 @@ function Settings() { - {/* FDISK-Profil */} + {/* Mitgliedsprofil */} - - FDISK-Profil + + Mitgliedsprofil - Die Standesbuchnummer wird für die automatische FDISK-Synchronisation verwendet. + Persönliche Daten, Standesbuchnummer und weitere Profileinstellungen. - {profileLoading ? ( - - - - ) : ( - - { - setStandesNr(e.target.value); - setStandesNrEdited(true); - }} - placeholder="z.B. 123456" - sx={{ flex: 1 }} - /> - - - )} +