From 71f9b8ed82a08d7c8ff4a169004f40e7e23a134e Mon Sep 17 00:00:00 2001 From: quasar Date: Mon, 26 May 2025 23:46:18 +0200 Subject: [PATCH] Correction du jobdetail --- frontend/src/components/JobDetail.tsx | 54 ++++++++++++++++----------- frontend/tsconfig.node.json | 1 - 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/JobDetail.tsx b/frontend/src/components/JobDetail.tsx index d5cddd1..83ec8c6 100644 --- a/frontend/src/components/JobDetail.tsx +++ b/frontend/src/components/JobDetail.tsx @@ -19,11 +19,11 @@ const JobDetail: React.FC = () => { const response = await axios.get(`${API_BASE_URL}/${id}`); setJob(response.data); } catch (err) { - console.error('Error fetching job detail:', err); + console.error('Erreur lors de la récupération des détails de l\'offre:', err); if (axios.isAxiosError(err) && err.response?.status === 404) { - setError('Job offer not found.'); + setError('Offre d\'emploi non trouvée.'); } else { - setError('Failed to load job offer details. Please try again.'); + setError('Impossible de charger les détails de l\'offre. Veuillez réessayer.'); } } finally { setLoading(false); @@ -36,25 +36,24 @@ const JobDetail: React.FC = () => { }, [id]); const handleApplyClick = () => { - // Logique pour trouver la meilleure URL de candidature const applyUrl = job?.urlOffre || job?.contact?.urlPostulation || job?.origineOffre?.urlOrigine; if (applyUrl) { - window.open(applyUrl, '_blank'); // Ouvre l'URL dans un nouvel onglet + window.open(applyUrl, '_blank', 'noopener,noreferrer'); } else { - alert("No application URL available for this job offer."); + alert("Aucune URL de candidature disponible pour cette offre."); } }; if (loading) { - return

Loading job details...

; + return

Chargement des détails de l'offre...

; } if (error) { return (
-

Error: {error}

- Back to Search +

Erreur : {error}

+ Retour à la recherche
); } @@ -62,8 +61,8 @@ const JobDetail: React.FC = () => { if (!job) { return (
-

No job details available.

- Back to Search +

Aucun détail d'offre disponible.

+ Retour à la recherche
); } @@ -71,24 +70,24 @@ const JobDetail: React.FC = () => { return (
- ← Back to Job Search + ← Retour à la recherche

{job.title}

- Company: {job.companyName || 'N/A'} + Entreprise : {job.companyName || 'Non spécifié'}

- Location: {job.locationLabel || job.cityName || 'N/A'} + Localisation : {job.locationLabel || job.cityName || 'Non spécifié'}

- Contract: {job.contractLabel || job.contractType || 'N/A'} + Type de contrat : {job.contractLabel || job.contractType || 'Non spécifié'}

- Published: {new Date(job.publicationDate).toLocaleDateString()} + Date de publication : {new Date(job.publicationDate).toLocaleDateString('fr-FR')}

- {job.romeLabel &&

ROME: {job.romeLabel}

} - {job.postalCode &&

Postal Code: {job.postalCode}

} - {job.departmentCode &&

Department Code: {job.departmentCode}

} + {job.romeLabel &&

Code ROME : {job.romeLabel}

} + {job.postalCode &&

Code postal : {job.postalCode}

} + {job.departmentCode &&

Département : {job.departmentCode}

}

Description

{job.description}

@@ -98,7 +97,7 @@ const JobDetail: React.FC = () => { )}
diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json index 9728af2..d9aa8a8 100644 --- a/frontend/tsconfig.node.json +++ b/frontend/tsconfig.node.json @@ -17,7 +17,6 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "erasableSyntaxOnly": true, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true },