bug fix for atemschutz
This commit is contained in:
@@ -13,6 +13,7 @@ import EinsatzDetail from './pages/EinsatzDetail';
|
||||
import Fahrzeuge from './pages/Fahrzeuge';
|
||||
import FahrzeugDetail from './pages/FahrzeugDetail';
|
||||
import FahrzeugForm from './pages/FahrzeugForm';
|
||||
import FahrzeugBuchungen from './pages/FahrzeugBuchungen';
|
||||
import Ausruestung from './pages/Ausruestung';
|
||||
import AusruestungForm from './pages/AusruestungForm';
|
||||
import AusruestungDetail from './pages/AusruestungDetail';
|
||||
@@ -21,6 +22,8 @@ import Mitglieder from './pages/Mitglieder';
|
||||
import MitgliedDetail from './pages/MitgliedDetail';
|
||||
import Kalender from './pages/Kalender';
|
||||
import UebungDetail from './pages/UebungDetail';
|
||||
import Veranstaltungen from './pages/Veranstaltungen';
|
||||
import VeranstaltungKategorien from './pages/VeranstaltungKategorien';
|
||||
import NotFound from './pages/NotFound';
|
||||
|
||||
function App() {
|
||||
@@ -176,6 +179,30 @@ function App() {
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/veranstaltungen"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<Veranstaltungen />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/veranstaltungen/kategorien"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<VeranstaltungKategorien />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/fahrzeugbuchungen"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<FahrzeugBuchungen />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
</AuthProvider>
|
||||
|
||||
@@ -14,6 +14,9 @@ import {
|
||||
Build,
|
||||
People,
|
||||
Air,
|
||||
Event,
|
||||
BookOnline,
|
||||
CalendarMonth,
|
||||
} from '@mui/icons-material';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
|
||||
@@ -31,11 +34,26 @@ const navigationItems: NavigationItem[] = [
|
||||
icon: <DashboardIcon />,
|
||||
path: '/dashboard',
|
||||
},
|
||||
{
|
||||
text: 'Kalender',
|
||||
icon: <CalendarMonth />,
|
||||
path: '/kalender',
|
||||
},
|
||||
{
|
||||
text: 'Veranstaltungen',
|
||||
icon: <Event />,
|
||||
path: '/veranstaltungen',
|
||||
},
|
||||
{
|
||||
text: 'Fahrzeuge',
|
||||
icon: <DirectionsCar />,
|
||||
path: '/fahrzeuge',
|
||||
},
|
||||
{
|
||||
text: 'Fahrzeugbuchungen',
|
||||
icon: <BookOnline />,
|
||||
path: '/fahrzeugbuchungen',
|
||||
},
|
||||
{
|
||||
text: 'Ausrüstung',
|
||||
icon: <Build />,
|
||||
|
||||
@@ -44,6 +44,7 @@ import DashboardLayout from '../components/dashboard/DashboardLayout';
|
||||
import { atemschutzApi } from '../services/atemschutz';
|
||||
import { membersService } from '../services/members';
|
||||
import { useNotification } from '../contexts/NotificationContext';
|
||||
import { useAuth } from '../contexts/AuthContext';
|
||||
import type {
|
||||
AtemschutzUebersicht,
|
||||
AtemschutzStats,
|
||||
@@ -150,6 +151,8 @@ const StatCard: React.FC<StatCardProps> = ({ label, value, color, bgcolor }) =>
|
||||
|
||||
function Atemschutz() {
|
||||
const notification = useNotification();
|
||||
const { user } = useAuth();
|
||||
const canWrite = user?.groups?.some(g => ['dashboard_admin', 'dashboard_atemschutz'].includes(g)) ?? false;
|
||||
|
||||
// Data state
|
||||
const [traeger, setTraeger] = useState<AtemschutzUebersicht[]>([]);
|
||||
@@ -543,6 +546,7 @@ function Atemschutz() {
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
{canWrite && (
|
||||
<Tooltip title="Bearbeiten">
|
||||
<Button
|
||||
size="small"
|
||||
@@ -552,6 +556,8 @@ function Atemschutz() {
|
||||
<Edit fontSize="small" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
{canWrite && (
|
||||
<Tooltip title="Löschen">
|
||||
<Button
|
||||
size="small"
|
||||
@@ -562,6 +568,7 @@ function Atemschutz() {
|
||||
<Delete fontSize="small" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
@@ -572,6 +579,7 @@ function Atemschutz() {
|
||||
)}
|
||||
|
||||
{/* FAB to create */}
|
||||
{canWrite && (
|
||||
<Fab
|
||||
color="primary"
|
||||
aria-label="Atemschutzträger hinzufügen"
|
||||
@@ -580,6 +588,7 @@ function Atemschutz() {
|
||||
>
|
||||
<Add />
|
||||
</Fab>
|
||||
)}
|
||||
|
||||
{/* ── Add / Edit Dialog ───────────────────────────────────────────── */}
|
||||
<Dialog
|
||||
|
||||
Reference in New Issue
Block a user