resolve issues with new features

This commit is contained in:
Matthias Hochmeister
2026-03-12 17:51:57 +01:00
parent 34ca007f9b
commit 67b7d5ccd2
10 changed files with 138 additions and 68 deletions

View File

@@ -44,6 +44,7 @@ import {
} from '@mui/icons-material';
import { Link as RouterLink, useNavigate, useParams } from 'react-router-dom';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import { equipmentApi } from '../services/equipment';
import { fromGermanDate } from '../utils/dateInput';
import {
@@ -351,6 +352,7 @@ interface WartungTabProps {
}
const WartungTab: React.FC<WartungTabProps> = ({ equipmentId, wartungslog, onAdded, canWrite }) => {
const { chatPanelOpen } = useLayout();
const [dialogOpen, setDialogOpen] = useState(false);
const [saving, setSaving] = useState(false);
const [saveError, setSaveError] = useState<string | null>(null);
@@ -446,7 +448,7 @@ const WartungTab: React.FC<WartungTabProps> = ({ equipmentId, wartungslog, onAdd
color="primary"
size="small"
aria-label="Wartung eintragen"
sx={{ position: 'fixed', bottom: 32, right: 32 }}
sx={{ position: 'fixed', bottom: 32, right: chatPanelOpen ? 376 : 80, transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)' }}
onClick={() => { setForm(emptyForm); setSaveError(null); setDialogOpen(true); }}
>
<Add />

View File

@@ -55,6 +55,7 @@ import {
} from '@mui/icons-material';
import { useNavigate, useParams } from 'react-router-dom';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import { vehiclesApi } from '../services/vehicles';
import { fromGermanDate } from '../utils/dateInput';
import { equipmentApi } from '../services/equipment';
@@ -322,6 +323,7 @@ const WARTUNG_ART_ICONS: Record<string, React.ReactElement> = {
};
const WartungTab: React.FC<WartungTabProps> = ({ fahrzeugId, wartungslog, onAdded, canWrite }) => {
const { chatPanelOpen } = useLayout();
const [dialogOpen, setDialogOpen] = useState(false);
const [saving, setSaving] = useState(false);
const [saveError, setSaveError] = useState<string | null>(null);
@@ -398,7 +400,7 @@ const WartungTab: React.FC<WartungTabProps> = ({ fahrzeugId, wartungslog, onAdde
color="primary"
size="small"
aria-label="Wartung eintragen"
sx={{ position: 'fixed', bottom: 32, right: 32 }}
sx={{ position: 'fixed', bottom: 32, right: chatPanelOpen ? 376 : 80, transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)' }}
onClick={() => { setForm(emptyForm); setDialogOpen(true); }}
>
<Add />

View File

@@ -29,6 +29,7 @@ import {
} from '@mui/icons-material';
import { useNavigate } from 'react-router-dom';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import { vehiclesApi } from '../services/vehicles';
import { equipmentApi } from '../services/equipment';
import type { VehicleEquipmentWarning } from '../types/equipment.types';
@@ -271,6 +272,7 @@ const VehicleCard: React.FC<VehicleCardProps> = ({ vehicle, onClick, warnings =
function Fahrzeuge() {
const navigate = useNavigate();
const { isAdmin } = usePermissions();
const { chatPanelOpen } = useLayout();
const [vehicles, setVehicles] = useState<FahrzeugListItem[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
@@ -415,7 +417,7 @@ function Fahrzeuge() {
<Fab
color="primary"
aria-label="Fahrzeug hinzufügen"
sx={{ position: 'fixed', bottom: 32, right: 32 }}
sx={{ position: 'fixed', bottom: 32, right: chatPanelOpen ? 376 : 80, transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)' }}
onClick={() => navigate('/fahrzeuge/neu')}
>
<Add />

View File

@@ -70,6 +70,7 @@ import {
} from '@mui/icons-material';
import { useNavigate, useSearchParams } from 'react-router-dom';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import { toGermanDate, toGermanDateTime, fromGermanDate, fromGermanDateTime, isValidGermanDate, isValidGermanDateTime } from '../utils/dateInput';
import { useAuth } from '../contexts/AuthContext';
import { useNotification } from '../contexts/NotificationContext';
@@ -1681,6 +1682,7 @@ export default function Kalender() {
const [searchParams] = useSearchParams();
const { user } = useAuth();
const notification = useNotification();
const { chatPanelOpen } = useLayout();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
@@ -2218,34 +2220,6 @@ export default function Kalender() {
</Tooltip>
</ButtonGroup>
{/* Category filter */}
{kategorien.length > 0 && (
<Box sx={{ display: 'flex', gap: 0.5, flexWrap: 'wrap' }}>
<Chip
label="Alle"
onClick={() => setSelectedKategorie('all')}
color={selectedKategorie === 'all' ? 'primary' : 'default'}
variant={selectedKategorie === 'all' ? 'filled' : 'outlined'}
size="small"
/>
{kategorien.map((k) => (
<Chip
key={k.id}
label={k.name}
onClick={() =>
setSelectedKategorie(selectedKategorie === k.id ? 'all' : k.id)
}
size="small"
sx={{
bgcolor: selectedKategorie === k.id ? k.farbe : undefined,
color: selectedKategorie === k.id ? 'white' : undefined,
}}
variant={selectedKategorie === k.id ? 'filled' : 'outlined'}
/>
))}
</Box>
)}
{/* Kategorien verwalten */}
{canWriteEvents && (
<Tooltip title="Kategorien verwalten">
@@ -2296,6 +2270,34 @@ export default function Kalender() {
</Button>
</Box>
{/* Category filter — between controls and navigation */}
{kategorien.length > 0 && (
<Box sx={{ display: 'flex', gap: 0.5, flexWrap: 'wrap', mb: 1 }}>
<Chip
label="Alle"
onClick={() => setSelectedKategorie('all')}
color={selectedKategorie === 'all' ? 'primary' : 'default'}
variant={selectedKategorie === 'all' ? 'filled' : 'outlined'}
size="small"
/>
{kategorien.map((k) => (
<Chip
key={k.id}
label={k.name}
onClick={() =>
setSelectedKategorie(selectedKategorie === k.id ? 'all' : k.id)
}
size="small"
sx={{
bgcolor: selectedKategorie === k.id ? k.farbe : undefined,
color: selectedKategorie === k.id ? 'white' : undefined,
}}
variant={selectedKategorie === k.id ? 'filled' : 'outlined'}
/>
))}
</Box>
)}
{/* Navigation */}
<Box sx={{ display: 'flex', alignItems: 'center', mb: 2, gap: 1 }}>
<IconButton onClick={handlePrev} size="small">
@@ -2554,7 +2556,7 @@ export default function Kalender() {
{canWriteEvents && (
<Fab
color="primary"
sx={{ position: 'fixed', bottom: 32, right: 32 }}
sx={{ position: 'fixed', bottom: 32, right: chatPanelOpen ? 376 : 80, transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)' }}
onClick={() => {
setVeranstEditing(null);
setVeranstFormOpen(true);
@@ -2562,7 +2564,6 @@ export default function Kalender() {
>
<Add />
</Fab>
)}
{/* Day Popover */}
<DayPopover
@@ -2927,7 +2928,7 @@ export default function Kalender() {
{canCreateBookings && (
<Fab
color="primary"
sx={{ position: 'fixed', bottom: 32, right: 32 }}
sx={{ position: 'fixed', bottom: 32, right: chatPanelOpen ? 376 : 80, transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)' }}
onClick={openBookingCreate}
>
<Add />

View File

@@ -33,6 +33,7 @@ import {
} from '@mui/icons-material';
import { useNavigate } from 'react-router-dom';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import { useAuth } from '../contexts/AuthContext';
import { membersService } from '../services/members';
import {
@@ -74,7 +75,7 @@ function useDebounce<T>(value: T, delay: number): T {
function Mitglieder() {
const navigate = useNavigate();
const { user } = useAuth();
const canWrite = useCanWrite();
const { chatPanelOpen } = useLayout(); const canWrite = useCanWrite();
// --- redirect non-admin/non-kommando users to their own profile ---
useEffect(() => {
@@ -434,7 +435,8 @@ function Mitglieder() {
sx={{
position: 'fixed',
bottom: 32,
right: 32,
right: chatPanelOpen ? 376 : 80,
transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)',
zIndex: (theme) => theme.zIndex.speedDial,
}}
>

View File

@@ -51,6 +51,7 @@ import {
Delete as DeleteIcon,
} from '@mui/icons-material';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import { toGermanDate, toGermanDateTime, fromGermanDate, fromGermanDateTime } from '../utils/dateInput';
import { useAuth } from '../contexts/AuthContext';
import { useNotification } from '../contexts/NotificationContext';
@@ -1004,6 +1005,7 @@ function EventListView({ events, canWrite, onEdit, onCancel, onDelete }: ListVie
export default function Veranstaltungen() {
const { user } = useAuth();
const { chatPanelOpen } = useLayout();
const notification = useNotification();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
@@ -1317,7 +1319,7 @@ export default function Veranstaltungen() {
<Fab
color="primary"
aria-label="Veranstaltung erstellen"
sx={{ position: 'fixed', bottom: 32, right: 32 }}
sx={{ position: 'fixed', bottom: 32, right: chatPanelOpen ? 376 : 80, transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)' }}
onClick={() => { setEditingEvent(null); setFormOpen(true); }}
>
<Add />