feat: implement Weather Workshop feature with models, UI components, and session management for enhanced team visibility and personal well-being tracking
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m16s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m16s
This commit is contained in:
@@ -5,6 +5,7 @@ import { getSessionsByUserId } from '@/services/sessions';
|
||||
import { getMotivatorSessionsByUserId } from '@/services/moving-motivators';
|
||||
import { getYearReviewSessionsByUserId } from '@/services/year-review';
|
||||
import { getWeeklyCheckInSessionsByUserId } from '@/services/weekly-checkin';
|
||||
import { getWeatherSessionsByUserId } from '@/services/weather';
|
||||
import { Card, Button } from '@/components/ui';
|
||||
import { WorkshopTabs } from './WorkshopTabs';
|
||||
|
||||
@@ -34,13 +35,14 @@ export default async function SessionsPage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fetch SWOT, Moving Motivators, Year Review, and Weekly Check-in sessions
|
||||
const [swotSessions, motivatorSessions, yearReviewSessions, weeklyCheckInSessions] =
|
||||
// Fetch SWOT, Moving Motivators, Year Review, Weekly Check-in, and Weather sessions
|
||||
const [swotSessions, motivatorSessions, yearReviewSessions, weeklyCheckInSessions, weatherSessions] =
|
||||
await Promise.all([
|
||||
getSessionsByUserId(session.user.id),
|
||||
getMotivatorSessionsByUserId(session.user.id),
|
||||
getYearReviewSessionsByUserId(session.user.id),
|
||||
getWeeklyCheckInSessionsByUserId(session.user.id),
|
||||
getWeatherSessionsByUserId(session.user.id),
|
||||
]);
|
||||
|
||||
// Add type to each session for unified display
|
||||
@@ -64,12 +66,18 @@ export default async function SessionsPage() {
|
||||
workshopType: 'weekly-checkin' as const,
|
||||
}));
|
||||
|
||||
const allWeatherSessions = weatherSessions.map((s) => ({
|
||||
...s,
|
||||
workshopType: 'weather' as const,
|
||||
}));
|
||||
|
||||
// Combine and sort by updatedAt
|
||||
const allSessions = [
|
||||
...allSwotSessions,
|
||||
...allMotivatorSessions,
|
||||
...allYearReviewSessions,
|
||||
...allWeeklyCheckInSessions,
|
||||
...allWeatherSessions,
|
||||
].sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
||||
|
||||
const hasNoSessions = allSessions.length === 0;
|
||||
@@ -102,11 +110,17 @@ export default async function SessionsPage() {
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/weekly-checkin/new">
|
||||
<Button>
|
||||
<Button variant="outline">
|
||||
<span>📝</span>
|
||||
Nouveau Check-in
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/weather/new">
|
||||
<Button>
|
||||
<span>🌤️</span>
|
||||
Nouvelle Météo
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -142,11 +156,17 @@ export default async function SessionsPage() {
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/weekly-checkin/new">
|
||||
<Button>
|
||||
<Button variant="outline">
|
||||
<span>📝</span>
|
||||
Créer un Check-in
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/weather/new">
|
||||
<Button>
|
||||
<span>🌤️</span>
|
||||
Créer une Météo
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</Card>
|
||||
) : (
|
||||
@@ -156,6 +176,7 @@ export default async function SessionsPage() {
|
||||
motivatorSessions={allMotivatorSessions}
|
||||
yearReviewSessions={allYearReviewSessions}
|
||||
weeklyCheckInSessions={allWeeklyCheckInSessions}
|
||||
weatherSessions={allWeatherSessions}
|
||||
/>
|
||||
</Suspense>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user