feat: add weather trend chart showing indicator averages over time
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m6s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m6s
Adds a collapsible SVG line graph on weather session pages displaying the evolution of all 4 indicators (Performance, Moral, Flux, Création de valeur) across sessions, with per-session average scores, hover tooltips, and a marker on the current session. Also fixes pre-existing lint errors: non-null assertion on optional chain in Header and eslint-disable for intentional hydration pattern in ThemeToggle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,13 +2,18 @@ import { notFound } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import { auth } from '@/lib/auth';
|
||||
import { getWorkshop, getSessionsTabUrl } from '@/lib/workshops';
|
||||
import { getWeatherSessionById, getPreviousWeatherEntriesForUsers } from '@/services/weather';
|
||||
import {
|
||||
getWeatherSessionById,
|
||||
getPreviousWeatherEntriesForUsers,
|
||||
getWeatherSessionsHistory,
|
||||
} from '@/services/weather';
|
||||
import { getUserTeams } from '@/services/teams';
|
||||
import {
|
||||
WeatherBoard,
|
||||
WeatherLiveWrapper,
|
||||
WeatherInfoPanel,
|
||||
WeatherAverageBar,
|
||||
WeatherTrendChart,
|
||||
} from '@/components/weather';
|
||||
import { Badge } from '@/components/ui';
|
||||
import { EditableWeatherTitle } from '@/components/ui/EditableWeatherTitle';
|
||||
@@ -33,9 +38,10 @@ export default async function WeatherSessionPage({ params }: WeatherSessionPageP
|
||||
|
||||
const allUserIds = [session.user.id, ...session.shares.map((s: { userId: string }) => s.userId)];
|
||||
|
||||
const [previousEntries, userTeams] = await Promise.all([
|
||||
const [previousEntries, userTeams, history] = await Promise.all([
|
||||
getPreviousWeatherEntriesForUsers(session.id, session.date, allUserIds),
|
||||
getUserTeams(authSession.user.id),
|
||||
getWeatherSessionsHistory(authSession.user.id),
|
||||
]);
|
||||
|
||||
return (
|
||||
@@ -79,6 +85,9 @@ export default async function WeatherSessionPage({ params }: WeatherSessionPageP
|
||||
{/* Info sur les catégories */}
|
||||
<WeatherInfoPanel />
|
||||
|
||||
{/* Évolution dans le temps */}
|
||||
<WeatherTrendChart data={history} currentSessionId={session.id} />
|
||||
|
||||
{/* Live Wrapper + Board */}
|
||||
<WeatherLiveWrapper
|
||||
sessionId={session.id}
|
||||
|
||||
Reference in New Issue
Block a user