calendar and vehicle booking rework
This commit is contained in:
@@ -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 />,
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user