| Date |
- Time |
+ Heure |
Service |
Contact |
- Status |
+ Statut |
|
@@ -81,29 +87,29 @@ function AdminBookings() {
{booking.contact_email}
{booking.contact_notes && {booking.contact_notes}
}
- {booking.status} |
+ {STATUS_LABELS[booking.status]} |
{booking.status === 'confirmed' && (
<>
>
)}
diff --git a/src/pages/admin/AdminInquiries.test.tsx b/src/pages/admin/AdminInquiries.test.tsx
index 547eade..5a386b8 100644
--- a/src/pages/admin/AdminInquiries.test.tsx
+++ b/src/pages/admin/AdminInquiries.test.tsx
@@ -43,7 +43,7 @@ describe('AdminInquiries', () => {
render()
await screen.findByText('Nadia')
- await userEvent.click(screen.getByRole('button', { name: /mark as read/i }))
+ await userEvent.click(screen.getByRole('button', { name: /marquer comme lue/i }))
await waitFor(() => expect(updateMock).toHaveBeenCalledWith({ status: 'read' }))
expect(eqUpdateMock).toHaveBeenCalledWith('id', 'inquiry-1')
diff --git a/src/pages/admin/AdminInquiries.tsx b/src/pages/admin/AdminInquiries.tsx
index 8d8b229..4aaeaad 100644
--- a/src/pages/admin/AdminInquiries.tsx
+++ b/src/pages/admin/AdminInquiries.tsx
@@ -11,6 +11,11 @@ interface AdminInquiry {
products: { name: string } | null
}
+const STATUS_LABELS: Record = {
+ new: 'Nouvelle',
+ read: 'Lue',
+}
+
function AdminInquiries() {
const [inquiries, setInquiries] = useState([])
const [error, setError] = useState('')
@@ -53,15 +58,15 @@ function AdminInquiries() {
return (
- Inquiries
+ Demandes
{error && {error} }
- | Product |
+ Produit |
Contact |
Notes |
- Status |
+ Statut |
|
@@ -74,10 +79,10 @@ function AdminInquiries() {
{inquiry.contact_email}
{inquiry.contact_notes} |
- {inquiry.status} |
+ {STATUS_LABELS[inquiry.status]} |
{inquiry.status === 'new' && (
-
+
)}
|
diff --git a/src/pages/admin/AdminLayout.test.tsx b/src/pages/admin/AdminLayout.test.tsx
index 9847691..5aa4d9b 100644
--- a/src/pages/admin/AdminLayout.test.tsx
+++ b/src/pages/admin/AdminLayout.test.tsx
@@ -37,17 +37,17 @@ describe('AdminLayout', () => {
it('renders nav links for every admin section and the outlet content', () => {
renderLayout()
- expect(screen.getByRole('link', { name: /products/i })).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: /produits/i })).toBeInTheDocument()
expect(screen.getByRole('link', { name: /services/i })).toBeInTheDocument()
- expect(screen.getByRole('link', { name: /schedule/i })).toBeInTheDocument()
- expect(screen.getByRole('link', { name: /bookings/i })).toBeInTheDocument()
- expect(screen.getByRole('link', { name: /inquiries/i })).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: /horaire/i })).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: /réservations/i })).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: /demandes/i })).toBeInTheDocument()
expect(screen.getByText('Products content')).toBeInTheDocument()
})
it('signs out and navigates to the login page', async () => {
renderLayout()
- await userEvent.click(screen.getByRole('button', { name: /sign out/i }))
+ await userEvent.click(screen.getByRole('button', { name: /déconnexion/i }))
expect(signOutMock).toHaveBeenCalled()
expect(navigateMock).toHaveBeenCalledWith('/admin/login')
})
@@ -55,7 +55,7 @@ describe('AdminLayout', () => {
it('does not navigate if sign out fails', async () => {
signOutMock.mockResolvedValue({ error: new Error('Sign out failed') })
renderLayout()
- await userEvent.click(screen.getByRole('button', { name: /sign out/i }))
+ await userEvent.click(screen.getByRole('button', { name: /déconnexion/i }))
expect(signOutMock).toHaveBeenCalled()
expect(navigateMock).not.toHaveBeenCalled()
})
diff --git a/src/pages/admin/AdminLayout.tsx b/src/pages/admin/AdminLayout.tsx
index ab60049..8006c74 100644
--- a/src/pages/admin/AdminLayout.tsx
+++ b/src/pages/admin/AdminLayout.tsx
@@ -3,11 +3,11 @@ import { supabase } from '../../lib/supabase'
import styles from './AdminLayout.module.css'
const NAV_ITEMS = [
- { to: '/admin/products', label: 'Products' },
+ { to: '/admin/products', label: 'Produits' },
{ to: '/admin/services', label: 'Services' },
- { to: '/admin/schedule', label: 'Schedule' },
- { to: '/admin/bookings', label: 'Bookings' },
- { to: '/admin/inquiries', label: 'Inquiries' },
+ { to: '/admin/schedule', label: 'Horaire' },
+ { to: '/admin/bookings', label: 'Réservations' },
+ { to: '/admin/inquiries', label: 'Demandes' },
]
function AdminLayout() {
@@ -34,7 +34,7 @@ function AdminLayout() {
))}
diff --git a/src/pages/admin/AdminLogin.test.tsx b/src/pages/admin/AdminLogin.test.tsx
index 8a2b558..89d4ee6 100644
--- a/src/pages/admin/AdminLogin.test.tsx
+++ b/src/pages/admin/AdminLogin.test.tsx
@@ -27,9 +27,9 @@ describe('AdminLogin', () => {
signInMock.mockResolvedValue({ error: null })
render()
- await userEvent.type(screen.getByLabelText(/email/i), 'mira@example.com')
- await userEvent.type(screen.getByLabelText(/password/i), 'correct-password')
- await userEvent.click(screen.getByRole('button', { name: /sign in/i }))
+ await userEvent.type(screen.getByLabelText(/e-mail/i), 'mira@example.com')
+ await userEvent.type(screen.getByLabelText(/mot de passe/i), 'correct-password')
+ await userEvent.click(screen.getByRole('button', { name: /se connecter/i }))
expect(signInMock).toHaveBeenCalledWith({ email: 'mira@example.com', password: 'correct-password' })
expect(navigateMock).toHaveBeenCalledWith('/admin/products')
@@ -39,11 +39,11 @@ describe('AdminLogin', () => {
signInMock.mockResolvedValue({ error: { message: 'Invalid login credentials' } })
render()
- await userEvent.type(screen.getByLabelText(/email/i), 'mira@example.com')
- await userEvent.type(screen.getByLabelText(/password/i), 'wrong-password')
- await userEvent.click(screen.getByRole('button', { name: /sign in/i }))
+ await userEvent.type(screen.getByLabelText(/e-mail/i), 'mira@example.com')
+ await userEvent.type(screen.getByLabelText(/mot de passe/i), 'wrong-password')
+ await userEvent.click(screen.getByRole('button', { name: /se connecter/i }))
- expect(await screen.findByText(/incorrect email or password/i)).toBeInTheDocument()
+ expect(await screen.findByText(/adresse e-mail ou mot de passe incorrect/i)).toBeInTheDocument()
expect(navigateMock).not.toHaveBeenCalled()
})
})
diff --git a/src/pages/admin/AdminLogin.tsx b/src/pages/admin/AdminLogin.tsx
index 1861b16..5b0f815 100644
--- a/src/pages/admin/AdminLogin.tsx
+++ b/src/pages/admin/AdminLogin.tsx
@@ -17,7 +17,7 @@ function AdminLogin() {
const { error: signInError } = await supabase.auth.signInWithPassword({ email, password })
setSubmitting(false)
if (signInError) {
- setError('Incorrect email or password.')
+ setError('Adresse e-mail ou mot de passe incorrect.')
return
}
navigate('/admin/products')
@@ -26,9 +26,9 @@ function AdminLogin() {
return (
|