featuer change for calendar
This commit is contained in:
@@ -13,15 +13,14 @@ import { useAuth } from '../contexts/AuthContext';
|
||||
import DashboardLayout from '../components/dashboard/DashboardLayout';
|
||||
import SkeletonCard from '../components/shared/SkeletonCard';
|
||||
import UserProfile from '../components/dashboard/UserProfile';
|
||||
import NextcloudCard from '../components/dashboard/NextcloudCard';
|
||||
import VikunjaCard from '../components/dashboard/VikunjaCard';
|
||||
import BookstackCard from '../components/dashboard/BookstackCard';
|
||||
import NextcloudTalkWidget from '../components/dashboard/NextcloudTalkWidget';
|
||||
import UpcomingEventsWidget from '../components/dashboard/UpcomingEventsWidget';
|
||||
import StatsCard from '../components/dashboard/StatsCard';
|
||||
import ActivityFeed from '../components/dashboard/ActivityFeed';
|
||||
import InspectionAlerts from '../components/vehicles/InspectionAlerts';
|
||||
import EquipmentAlerts from '../components/equipment/EquipmentAlerts';
|
||||
import AtemschutzDashboardCard from '../components/atemschutz/AtemschutzDashboardCard';
|
||||
import PersonalWarningsBanner from '../components/dashboard/PersonalWarningsBanner';
|
||||
import { vehiclesApi } from '../services/vehicles';
|
||||
import { equipmentApi } from '../services/equipment';
|
||||
import type { VehicleStats } from '../types/vehicle.types';
|
||||
@@ -89,6 +88,17 @@ function Dashboard() {
|
||||
</Grid>
|
||||
)}
|
||||
|
||||
{/* Personal Atemschutz Warnings — shown only when relevant */}
|
||||
{user && (
|
||||
<Grid item xs={12}>
|
||||
<Fade in={!dataLoading} timeout={600} style={{ transitionDelay: '150ms' }}>
|
||||
<Box>
|
||||
<PersonalWarningsBanner user={user} />
|
||||
</Box>
|
||||
</Fade>
|
||||
</Grid>
|
||||
)}
|
||||
|
||||
{/* Live vehicle KPI — einsatzbereit count from API */}
|
||||
<Grid item xs={12} sm={6} md={3}>
|
||||
{dataLoading ? (
|
||||
@@ -143,51 +153,13 @@ function Dashboard() {
|
||||
</Fade>
|
||||
</Grid>
|
||||
|
||||
{/* Service Integration Cards */}
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="h6" gutterBottom sx={{ mt: 2 }}>
|
||||
Dienste und Integrationen
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={4}>
|
||||
{dataLoading ? (
|
||||
<SkeletonCard variant="basic" />
|
||||
) : (
|
||||
<Fade in={true} timeout={600} style={{ transitionDelay: '400ms' }}>
|
||||
<Box>
|
||||
<NextcloudCard
|
||||
onClick={() => console.log('Nextcloud clicked')}
|
||||
/>
|
||||
</Box>
|
||||
</Fade>
|
||||
)}
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
{dataLoading ? (
|
||||
<SkeletonCard variant="basic" />
|
||||
) : (
|
||||
<Fade in={true} timeout={600} style={{ transitionDelay: '450ms' }}>
|
||||
<Box>
|
||||
<VikunjaCard
|
||||
onClick={() => console.log('Vikunja clicked')}
|
||||
/>
|
||||
</Box>
|
||||
</Fade>
|
||||
)}
|
||||
</Grid>
|
||||
<Grid item xs={12} md={4}>
|
||||
{dataLoading ? (
|
||||
<SkeletonCard variant="basic" />
|
||||
) : (
|
||||
<Fade in={true} timeout={600} style={{ transitionDelay: '500ms' }}>
|
||||
<Box>
|
||||
<BookstackCard
|
||||
onClick={() => console.log('Bookstack clicked')}
|
||||
/>
|
||||
</Box>
|
||||
</Fade>
|
||||
)}
|
||||
{/* Upcoming Events Widget */}
|
||||
<Grid item xs={12} md={6}>
|
||||
<Fade in={!dataLoading} timeout={600} style={{ transitionDelay: '440ms' }}>
|
||||
<Box>
|
||||
<UpcomingEventsWidget />
|
||||
</Box>
|
||||
</Fade>
|
||||
</Grid>
|
||||
|
||||
{/* Nextcloud Talk Widget */}
|
||||
|
||||
@@ -213,15 +213,53 @@ const VehicleCard: React.FC<VehicleCardProps> = ({ vehicle, onClick, warnings =
|
||||
)}
|
||||
|
||||
{warnings.length > 0 && (
|
||||
<Tooltip title={warnings.map(w => `${w.bezeichnung}: ${AusruestungStatusLabel[w.status]}`).join('\n')}>
|
||||
<Chip
|
||||
size="small"
|
||||
icon={<Warning />}
|
||||
label={`${warnings.length} Ausrüstung nicht bereit`}
|
||||
color={warnings.some(w => w.status === AusruestungStatus.Beschaedigt) ? 'error' : 'warning'}
|
||||
sx={{ mt: 0.5 }}
|
||||
/>
|
||||
</Tooltip>
|
||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5, mt: 0.5 }}>
|
||||
{warnings.slice(0, warnings.length > 3 ? 2 : 3).map((w) => {
|
||||
const isError =
|
||||
w.status === AusruestungStatus.Beschaedigt ||
|
||||
w.status === AusruestungStatus.AusserDienst;
|
||||
return (
|
||||
<Tooltip
|
||||
key={w.ausruestung_id}
|
||||
title={`${w.kategorie_name}: ${AusruestungStatusLabel[w.status]}`}
|
||||
>
|
||||
<Chip
|
||||
size="small"
|
||||
icon={<ReportProblem />}
|
||||
label={w.bezeichnung}
|
||||
color={isError ? 'error' : 'warning'}
|
||||
sx={{ fontSize: '0.7rem', maxWidth: 160 }}
|
||||
/>
|
||||
</Tooltip>
|
||||
);
|
||||
})}
|
||||
{warnings.length > 3 && (
|
||||
<Tooltip
|
||||
title={warnings
|
||||
.slice(2)
|
||||
.map((w) => `${w.bezeichnung}: ${AusruestungStatusLabel[w.status]}`)
|
||||
.join('\n')}
|
||||
>
|
||||
<Chip
|
||||
size="small"
|
||||
icon={<Warning />}
|
||||
label={`+${warnings.length - 2} weitere`}
|
||||
color={
|
||||
warnings
|
||||
.slice(2)
|
||||
.some(
|
||||
(w) =>
|
||||
w.status === AusruestungStatus.Beschaedigt ||
|
||||
w.status === AusruestungStatus.AusserDienst
|
||||
)
|
||||
? 'error'
|
||||
: 'warning'
|
||||
}
|
||||
sx={{ fontSize: '0.7rem' }}
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</CardContent>
|
||||
</CardActionArea>
|
||||
|
||||
Reference in New Issue
Block a user