calendar and vehicle booking rework

This commit is contained in:
Matthias Hochmeister
2026-03-25 16:09:16 +01:00
parent 7cc4facc11
commit 7dab359448
7 changed files with 25 additions and 24 deletions

View File

@@ -27,6 +27,7 @@ import {
ExpandLess,
LocalShipping,
BugReport,
BookOnline,
} from '@mui/icons-material';
import { useNavigate, useLocation } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
@@ -49,11 +50,6 @@ interface NavigationItem {
permission?: string;
}
const kalenderSubItems: SubItem[] = [
{ text: 'Veranstaltungen', path: '/kalender' },
{ text: 'Fahrzeugbuchungen', path: '/fahrzeugbuchungen' },
];
const adminSubItems: SubItem[] = [
{ text: 'Services', path: '/admin?tab=0' },
{ text: 'System', path: '/admin?tab=1' },
@@ -77,9 +73,14 @@ const baseNavigationItems: NavigationItem[] = [
text: 'Kalender',
icon: <CalendarMonth />,
path: '/kalender',
subItems: kalenderSubItems,
permission: 'kalender:view',
},
{
text: 'Fahrzeugbuchungen',
icon: <BookOnline />,
path: '/fahrzeugbuchungen',
permission: 'fahrzeugbuchungen:view',
},
{
text: 'Fahrzeuge',
icon: <DirectionsCar />,

View File

@@ -170,7 +170,7 @@ function Dashboard() {
</Fade>
)}
{hasPermission('kalender:view_bookings') && widgetVisible('vehicleBookingList') && (
{hasPermission('fahrzeugbuchungen:view') && widgetVisible('vehicleBookingList') && (
<Fade in={!dataLoading} timeout={600} style={{ transitionDelay: '520ms' }}>
<Box>
<VehicleBookingListWidget />
@@ -178,7 +178,7 @@ function Dashboard() {
</Fade>
)}
{hasPermission('kalender:manage_bookings') && widgetVisible('vehicleBooking') && (
{hasPermission('fahrzeugbuchungen:manage') && widgetVisible('vehicleBooking') && (
<Fade in={!dataLoading} timeout={600} style={{ transitionDelay: '560ms' }}>
<Box>
<VehicleBookingQuickAddWidget />

View File

@@ -98,8 +98,8 @@ function FahrzeugBuchungen() {
const navigate = useNavigate();
const queryClient = useQueryClient();
const canCreate = hasPermission('kalender:create');
const canManage = hasPermission('kalender:manage_bookings');
const canCreate = hasPermission('fahrzeugbuchungen:create');
const canManage = hasPermission('fahrzeugbuchungen:manage');
const [tabIndex, setTabIndex] = useState(0);