From cee3cd7b475effd2b164255ccd1fd532a48e8730 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Fri, 28 Nov 2025 15:09:01 +0100 Subject: [PATCH] chore: remove Motivators page and update links to Sessions across the application --- src/actions/profile.ts | 1 + src/app/motivators/[id]/page.tsx | 2 +- src/app/motivators/page.tsx | 137 ---------------------- src/app/page.tsx | 2 +- src/app/profile/PasswordForm.tsx | 1 + src/app/profile/ProfileForm.tsx | 1 + src/components/ui/Avatar.tsx | 1 + src/components/ui/CollaboratorDisplay.tsx | 1 + src/lib/gravatar.ts | 1 + 9 files changed, 8 insertions(+), 139 deletions(-) delete mode 100644 src/app/motivators/page.tsx diff --git a/src/actions/profile.ts b/src/actions/profile.ts index f4dc3c7..2d11b1c 100644 --- a/src/actions/profile.ts +++ b/src/actions/profile.ts @@ -56,3 +56,4 @@ export async function updatePasswordAction(data: { return result; } + diff --git a/src/app/motivators/[id]/page.tsx b/src/app/motivators/[id]/page.tsx index 1f828c1..6321117 100644 --- a/src/app/motivators/[id]/page.tsx +++ b/src/app/motivators/[id]/page.tsx @@ -29,7 +29,7 @@ export default async function MotivatorSessionPage({ params }: MotivatorSessionP {/* Header */}
- + Moving Motivators / diff --git a/src/app/motivators/page.tsx b/src/app/motivators/page.tsx deleted file mode 100644 index 686de42..0000000 --- a/src/app/motivators/page.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import Link from 'next/link'; -import { auth } from '@/lib/auth'; -import { getMotivatorSessionsByUserId } from '@/services/moving-motivators'; -import { Card, CardContent, Badge, Button, CollaboratorDisplay } from '@/components/ui'; - -export default async function MotivatorsPage() { - const session = await auth(); - - if (!session?.user?.id) { - return null; - } - - const sessions = await getMotivatorSessionsByUserId(session.user.id); - - // Separate owned vs shared sessions - const ownedSessions = sessions.filter((s) => s.isOwner); - const sharedSessions = sessions.filter((s) => !s.isOwner); - - return ( -
- {/* Header */} -
-
-

Moving Motivators

-

- Découvrez ce qui motive vraiment vos collaborateurs -

-
- - - -
- - {/* Sessions Grid */} - {sessions.length === 0 ? ( - -
🎯
-

- Aucune session pour le moment -

-

- Créez votre première session Moving Motivators pour explorer les motivations - intrinsèques de vos collaborateurs. -

- - - -
- ) : ( -
- {/* My Sessions */} - {ownedSessions.length > 0 && ( -
-

- 📁 Mes sessions ({ownedSessions.length}) -

-
- {ownedSessions.map((s) => ( - - ))} -
-
- )} - - {/* Shared Sessions */} - {sharedSessions.length > 0 && ( -
-

- 🤝 Sessions partagées avec moi ({sharedSessions.length}) -

-
- {sharedSessions.map((s) => ( - - ))} -
-
- )} -
- )} -
- ); -} - -type SessionWithMeta = Awaited>[number]; - -function SessionCard({ session: s }: { session: SessionWithMeta }) { - return ( - - -
-
-

- {s.title} -

-
- -
- {!s.isOwner && ( -

- Par {s.user.name || s.user.email} -

- )} -
-
- {!s.isOwner && ( - - {s.role === 'EDITOR' ? '✏️' : '👁️'} - - )} - 🎯 -
-
- - -
- - {s._count.cards} motivations - -
- -

- Mis à jour le{' '} - {new Date(s.updatedAt).toLocaleDateString('fr-FR', { - day: 'numeric', - month: 'long', - year: 'numeric', - })} -

-
-
- - ); -} - diff --git a/src/app/page.tsx b/src/app/page.tsx index 2f72de2..3750837 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -39,7 +39,7 @@ export default function Home() { {/* Moving Motivators Workshop Card */}