Checkpoint: Page de connexion : arrivée directe sur connexion locale, logo Itinova en haut, logo Santinova + "powered by" en bas, renommage en "Gestion facturation"

This commit is contained in:
Manus
2026-03-22 13:06:48 -04:00
parent ee49992530
commit 73edd0c757
4 changed files with 76 additions and 112 deletions

View File

@@ -6,7 +6,7 @@
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1" /> content="width=device-width, initial-scale=1.0, maximum-scale=1" />
<title>Invoice Analyzer - Dématérialisation de Facturation</title> <title>Gestion facturation - Itinova</title>
<!-- THIS IS THE START OF A COMMENT BLOCK, BLOCK TO BE DELETED: Google Fonts here, example: <!-- THIS IS THE START OF A COMMENT BLOCK, BLOCK TO BE DELETED: Google Fonts here, example:
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

View File

@@ -24,7 +24,7 @@ export default function Home() {
<div className="mx-auto mb-6 w-20 h-20 bg-blue-600 rounded-lg flex items-center justify-center"> <div className="mx-auto mb-6 w-20 h-20 bg-blue-600 rounded-lg flex items-center justify-center">
<FileText className="w-12 h-12 text-white" /> <FileText className="w-12 h-12 text-white" />
</div> </div>
<h1 className="text-3xl font-bold mb-2">Invoice Analyzer</h1> <h1 className="text-3xl font-bold mb-2">Gestion facturation</h1>
<p className="text-gray-600 mb-6">Dématérialisation de la facturation</p> <p className="text-gray-600 mb-6">Dématérialisation de la facturation</p>
<Loader2 className="w-8 h-8 animate-spin text-blue-600 mx-auto" /> <Loader2 className="w-8 h-8 animate-spin text-blue-600 mx-auto" />
</div> </div>

View File

@@ -1,19 +1,18 @@
import { useState } from "react"; import { useState } from "react";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Card, CardContent } from "@/components/ui/card";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Loader2, FileText } from "lucide-react"; import { Loader2 } from "lucide-react";
import { trpc } from "@/lib/trpc"; import { trpc } from "@/lib/trpc";
import { toast } from "sonner"; import { toast } from "sonner";
import { useLocation } from "wouter";
import { getLoginUrl } from "@/const"; const ITINOVA_LOGO = "https://d2xsxph8kpxj0f.cloudfront.net/310519663070627318/fo4DRyBgjsuiigFAgNLuWm/itinova-logo_2a2ba00a.jpg";
const SANTINOVA_LOGO = "https://d2xsxph8kpxj0f.cloudfront.net/310519663070627318/fo4DRyBgjsuiigFAgNLuWm/santinova-logo_5ae0d248.webp";
export default function Login() { export default function Login() {
const [, setLocation] = useLocation();
const [email, setEmail] = useState(""); const [email, setEmail] = useState("");
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const [showLocalLogin, setShowLocalLogin] = useState(false);
const loginMutation = trpc.auth.loginLocal.useMutation({ const loginMutation = trpc.auth.loginLocal.useMutation({
onSuccess: () => { onSuccess: () => {
@@ -25,123 +24,81 @@ export default function Login() {
}, },
}); });
const { data: azureAdAvailable } = trpc.auth.isAzureAdAvailable.useQuery();
const handleLocalLogin = (e: React.FormEvent) => { const handleLocalLogin = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
loginMutation.mutate({ email, password }); loginMutation.mutate({ email, password });
}; };
const handleManusLogin = () => { return (
window.location.href = getLoginUrl(); <div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-blue-50 p-4">
}; <div className="w-full max-w-sm flex flex-col items-center gap-6">
const handleAzureLogin = () => { {/* Logo Itinova en haut */}
// TODO: Implement Azure AD login flow <div className="w-full flex justify-center">
toast.info("Azure AD login coming soon"); <img
}; src={ITINOVA_LOGO}
alt="Itinova"
className="h-24 object-contain"
/>
</div>
if (!showLocalLogin) { {/* Carte de connexion */}
return ( <Card className="w-full shadow-lg border-0">
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 p-4"> <CardContent className="pt-6 pb-6">
<Card className="w-full max-w-md"> <div className="mb-6 text-center">
<CardHeader className="text-center"> <h1 className="text-2xl font-bold text-slate-800">Gestion facturation</h1>
<div className="mx-auto mb-4 w-16 h-16 bg-blue-600 rounded-lg flex items-center justify-center"> <p className="text-sm text-slate-500 mt-1">Connectez-vous pour accéder à l'application</p>
<FileText className="w-10 h-10 text-white" />
</div> </div>
<CardTitle className="text-2xl">Invoice Analyzer</CardTitle>
<CardDescription>Choisissez votre méthode de connexion</CardDescription> <form onSubmit={handleLocalLogin} className="space-y-4">
</CardHeader> <div className="space-y-2">
<CardContent className="space-y-3"> <Label htmlFor="email">Email</Label>
<Button <Input
onClick={() => setShowLocalLogin(true)} id="email"
className="w-full" type="email"
size="lg" placeholder="votre@email.com"
> value={email}
Connexion locale onChange={(e) => setEmail(e.target.value)}
</Button> required
autoFocus
{azureAdAvailable?.available && ( />
</div>
<div className="space-y-2">
<Label htmlFor="password">Mot de passe</Label>
<Input
id="password"
type="password"
placeholder="••••••••"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
/>
</div>
<Button <Button
onClick={handleAzureLogin} type="submit"
variant="outline" className="w-full bg-[#1e3a8a] hover:bg-[#1e40af] text-white mt-2"
className="w-full" disabled={loginMutation.isPending}
size="lg"
> >
Connexion Azure AD {loginMutation.isPending && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
Se connecter
</Button> </Button>
)} </form>
<Button
onClick={handleManusLogin}
variant="outline"
className="w-full"
size="lg"
>
Connexion Manus
</Button>
</CardContent> </CardContent>
</Card> </Card>
</div>
);
}
return ( {/* Logo Santinova en bas avec "powered by" */}
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 p-4"> <div className="flex flex-col items-center gap-1">
<Card className="w-full max-w-md"> <span className="text-xs text-slate-400 lowercase tracking-wide">powered by</span>
<CardHeader className="text-center"> <img
<div className="mx-auto mb-4 w-16 h-16 bg-blue-600 rounded-lg flex items-center justify-center"> src={SANTINOVA_LOGO}
<FileText className="w-10 h-10 text-white" /> alt="Santinova"
</div> className="h-10 object-contain"
<CardTitle className="text-2xl">Connexion locale</CardTitle> />
<CardDescription>Connectez-vous avec votre email et mot de passe</CardDescription> </div>
</CardHeader>
<CardContent> </div>
<form onSubmit={handleLocalLogin} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
placeholder="votre@email.com"
value={email}
onChange={(e) => setEmail(e.target.value)}
required
/>
</div>
<div className="space-y-2">
<Label htmlFor="password">Mot de passe</Label>
<Input
id="password"
type="password"
placeholder="••••••••"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
/>
</div>
<Button
type="submit"
className="w-full"
disabled={loginMutation.isPending}
>
{loginMutation.isPending && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
Se connecter
</Button>
<Button
type="button"
variant="ghost"
className="w-full"
onClick={() => setShowLocalLogin(false)}
>
Retour aux options de connexion
</Button>
</form>
</CardContent>
</Card>
</div> </div>
); );
} }

View File

@@ -540,4 +540,11 @@
- [x] Afficher la liste des services disponibles avec un sélecteur de signature pour chacun - [x] Afficher la liste des services disponibles avec un sélecteur de signature pour chacun
- [x] Modifier la route exportToPdf pour récupérer la signature associée au service de la facture - [x] Modifier la route exportToPdf pour récupérer la signature associée au service de la facture
- [x] Apposer la signature sur le PDF exporté (image en bas à droite + nom du signataire) - [x] Apposer la signature sur le PDF exporté (image en bas à droite + nom du signataire)
- [ ] Tester l'export PDF avec signature automatique - [x] Tester l'export PDF avec signature automatique
## Modification page de connexion
- [x] Arriver directement sur la connexion locale (supprimer l'écran de choix)
- [x] Afficher le logo Itinova au-dessus du formulaire de connexion
- [x] Afficher "powered by" + logo Santinova en dessous du formulaire
- [x] Renommer l'application "Invoice Analyzer" en "Gestion facturation"
- [x] Appliquer le même comportement en cas de déconnexion