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:
@@ -6,7 +6,7 @@
|
||||
<meta
|
||||
name="viewport"
|
||||
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:
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
|
||||
@@ -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">
|
||||
<FileText className="w-12 h-12 text-white" />
|
||||
</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>
|
||||
<Loader2 className="w-8 h-8 animate-spin text-blue-600 mx-auto" />
|
||||
</div>
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { useState } from "react";
|
||||
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 { Label } from "@/components/ui/label";
|
||||
import { Loader2, FileText } from "lucide-react";
|
||||
import { Loader2 } from "lucide-react";
|
||||
import { trpc } from "@/lib/trpc";
|
||||
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() {
|
||||
const [, setLocation] = useLocation();
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [showLocalLogin, setShowLocalLogin] = useState(false);
|
||||
|
||||
const loginMutation = trpc.auth.loginLocal.useMutation({
|
||||
onSuccess: () => {
|
||||
@@ -25,78 +24,32 @@ export default function Login() {
|
||||
},
|
||||
});
|
||||
|
||||
const { data: azureAdAvailable } = trpc.auth.isAzureAdAvailable.useQuery();
|
||||
|
||||
const handleLocalLogin = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
loginMutation.mutate({ email, password });
|
||||
};
|
||||
|
||||
const handleManusLogin = () => {
|
||||
window.location.href = getLoginUrl();
|
||||
};
|
||||
|
||||
const handleAzureLogin = () => {
|
||||
// TODO: Implement Azure AD login flow
|
||||
toast.info("Azure AD login coming soon");
|
||||
};
|
||||
|
||||
if (!showLocalLogin) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 p-4">
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="text-center">
|
||||
<div className="mx-auto mb-4 w-16 h-16 bg-blue-600 rounded-lg flex items-center justify-center">
|
||||
<FileText className="w-10 h-10 text-white" />
|
||||
</div>
|
||||
<CardTitle className="text-2xl">Invoice Analyzer</CardTitle>
|
||||
<CardDescription>Choisissez votre méthode de connexion</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
<Button
|
||||
onClick={() => setShowLocalLogin(true)}
|
||||
className="w-full"
|
||||
size="lg"
|
||||
>
|
||||
Connexion locale
|
||||
</Button>
|
||||
<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">
|
||||
|
||||
{azureAdAvailable?.available && (
|
||||
<Button
|
||||
onClick={handleAzureLogin}
|
||||
variant="outline"
|
||||
className="w-full"
|
||||
size="lg"
|
||||
>
|
||||
Connexion Azure AD
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Button
|
||||
onClick={handleManusLogin}
|
||||
variant="outline"
|
||||
className="w-full"
|
||||
size="lg"
|
||||
>
|
||||
Connexion Manus
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
{/* Logo Itinova en haut */}
|
||||
<div className="w-full flex justify-center">
|
||||
<img
|
||||
src={ITINOVA_LOGO}
|
||||
alt="Itinova"
|
||||
className="h-24 object-contain"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 p-4">
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="text-center">
|
||||
<div className="mx-auto mb-4 w-16 h-16 bg-blue-600 rounded-lg flex items-center justify-center">
|
||||
<FileText className="w-10 h-10 text-white" />
|
||||
{/* Carte de connexion */}
|
||||
<Card className="w-full shadow-lg border-0">
|
||||
<CardContent className="pt-6 pb-6">
|
||||
<div className="mb-6 text-center">
|
||||
<h1 className="text-2xl font-bold text-slate-800">Gestion facturation</h1>
|
||||
<p className="text-sm text-slate-500 mt-1">Connectez-vous pour accéder à l'application</p>
|
||||
</div>
|
||||
<CardTitle className="text-2xl">Connexion locale</CardTitle>
|
||||
<CardDescription>Connectez-vous avec votre email et mot de passe</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
<form onSubmit={handleLocalLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="email">Email</Label>
|
||||
@@ -107,6 +60,7 @@ export default function Login() {
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
required
|
||||
autoFocus
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -124,24 +78,27 @@ export default function Login() {
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-full"
|
||||
className="w-full bg-[#1e3a8a] hover:bg-[#1e40af] text-white mt-2"
|
||||
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>
|
||||
|
||||
{/* Logo Santinova en bas avec "powered by" */}
|
||||
<div className="flex flex-col items-center gap-1">
|
||||
<span className="text-xs text-slate-400 lowercase tracking-wide">powered by</span>
|
||||
<img
|
||||
src={SANTINOVA_LOGO}
|
||||
alt="Santinova"
|
||||
className="h-10 object-contain"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
9
todo.md
9
todo.md
@@ -540,4 +540,11 @@
|
||||
- [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] 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
|
||||
|
||||
Reference in New Issue
Block a user