Quellcode durchsuchen

Name the calendar, messages and inspection pages in the breadcrumb (#544)

Bernt Christian Egeland vor 1 Tag
Ursprung
Commit
6fc289db5c

+ 5 - 1
messages/de/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "HU-Erinnerungen",
     "faultCodes": "Fehlercodes",
-    "faultCode": "Fehlercode"
+    "faultCode": "Fehlercode",
+    "calendar": "Kalender",
+    "messages": "Nachrichten",
+    "inspections": "Inspektionen",
+    "inspectionDetails": "Inspektionsdetails"
   },
   "search": "Suchen...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/en/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Inspection reminders",
     "faultCodes": "Fault codes",
-    "faultCode": "Fault code"
+    "faultCode": "Fault code",
+    "calendar": "Calendar",
+    "messages": "Messages",
+    "inspections": "Inspections",
+    "inspectionDetails": "Inspection Details"
   },
   "search": "Search...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/es/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Recordatorios de inspección",
     "faultCodes": "Códigos de avería",
-    "faultCode": "Código de avería"
+    "faultCode": "Código de avería",
+    "calendar": "Calendario",
+    "messages": "Mensajes",
+    "inspections": "Inspecciones",
+    "inspectionDetails": "Detalles de la inspección"
   },
   "search": "Buscar...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/fr/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Rappels de contrôle",
     "faultCodes": "Codes défaut",
-    "faultCode": "Code défaut"
+    "faultCode": "Code défaut",
+    "calendar": "Calendrier",
+    "messages": "Messages",
+    "inspections": "Inspections",
+    "inspectionDetails": "Détails de l’inspection"
   },
   "search": "Rechercher…",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/it/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Promemoria revisione",
     "faultCodes": "Codici di errore",
-    "faultCode": "Codice di errore"
+    "faultCode": "Codice di errore",
+    "calendar": "Calendario",
+    "messages": "Messaggi",
+    "inspections": "Ispezioni",
+    "inspectionDetails": "Dettagli ispezione"
   },
   "search": "Cerca...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/lt/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "„WhatsApp“",
     "inspectionReminders": "Apžiūros priminimai",
     "faultCodes": "Gedimų kodai",
-    "faultCode": "Gedimo kodas"
+    "faultCode": "Gedimo kodas",
+    "calendar": "Kalendorius",
+    "messages": "Žinutės",
+    "inspections": "Apžiūros",
+    "inspectionDetails": "Apžiūros informacija"
   },
   "search": "Ieškoti...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/nb/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "EU-kontroll-påminnelser",
     "faultCodes": "Feilkoder",
-    "faultCode": "Feilkode"
+    "faultCode": "Feilkode",
+    "calendar": "Kalender",
+    "messages": "Meldinger",
+    "inspections": "Inspeksjoner",
+    "inspectionDetails": "Inspeksjonsdetaljer"
   },
   "search": "Søk...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/nl/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Keuringsherinneringen",
     "faultCodes": "Foutcodes",
-    "faultCode": "Foutcode"
+    "faultCode": "Foutcode",
+    "calendar": "Kalender",
+    "messages": "Berichten",
+    "inspections": "Inspecties",
+    "inspectionDetails": "Inspectiegegevens"
   },
   "search": "Zoeken...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/pl/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Przypomnienia o przeglądzie",
     "faultCodes": "Kody usterek",
-    "faultCode": "Kod usterki"
+    "faultCode": "Kod usterki",
+    "calendar": "Kalendarz",
+    "messages": "Wiadomości",
+    "inspections": "Przeglądy",
+    "inspectionDetails": "Szczegóły przeglądu"
   },
   "search": "Szukaj...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/pt-BR/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Lembretes de inspeção",
     "faultCodes": "Códigos de falha",
-    "faultCode": "Código de falha"
+    "faultCode": "Código de falha",
+    "calendar": "Calendário",
+    "messages": "Mensagens",
+    "inspections": "Inspeções",
+    "inspectionDetails": "Detalhes da Inspeção"
   },
   "search": "Buscar...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/pt-PT/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Lembretes de inspeção",
     "faultCodes": "Códigos de avaria",
-    "faultCode": "Código de avaria"
+    "faultCode": "Código de avaria",
+    "calendar": "Calendário",
+    "messages": "Mensagens",
+    "inspections": "Inspeções",
+    "inspectionDetails": "Detalhes da inspeção"
   },
   "search": "Pesquisar...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/ru/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Напоминания о техосмотре",
     "faultCodes": "Коды неисправностей",
-    "faultCode": "Код неисправности"
+    "faultCode": "Код неисправности",
+    "calendar": "Календарь",
+    "messages": "Сообщения",
+    "inspections": "Осмотры",
+    "inspectionDetails": "Детали осмотра"
   },
   "search": "Поиск...",
   "shortcut": "Ctrl+K",

+ 5 - 1
messages/tr/navigation.json

@@ -67,7 +67,11 @@
     "whatsapp": "WhatsApp",
     "inspectionReminders": "Muayene hatırlatmaları",
     "faultCodes": "Arıza kodları",
-    "faultCode": "Arıza kodu"
+    "faultCode": "Arıza kodu",
+    "calendar": "Takvim",
+    "messages": "Mesajlar",
+    "inspections": "Muayeneler",
+    "inspectionDetails": "Muayene Detayları"
   },
   "search": "Ara...",
   "shortcut": "Ctrl+K",

+ 18 - 0
src/__tests__/components/page-header-breadcrumbs.test.tsx

@@ -96,3 +96,21 @@ describe('top-level breadcrumbs', () => {
     cleanup()
   })
 })
+
+/** Calendar, Messages, Inspections and four more fell through to "Home". */
+describe('pages outside settings', () => {
+  it.each([
+    ['/calendar', ['Calendar']],
+    ['/messages', ['Messages']],
+    ['/inspections', ['Inspections']],
+    ['/inspections/insp-1', ['Inspections', 'Inspection Details']],
+    ['/labor-presets', ['Labor Presets']],
+    ['/sales/rec-1', ['Work Orders', 'Service Details']],
+  ])('%s says where you are', (path, expected) => {
+    pathname = path
+    render(<PageHeader />)
+    expect(crumbs()).toEqual(expected)
+    expect(screen.queryByText('Home')).toBeNull()
+    cleanup()
+  })
+})

+ 14 - 0
src/components/page-header.tsx

@@ -144,6 +144,12 @@ const breadcrumbMap: Record<string, BreadcrumbSegment[]> = {
   '/inventory': [{ key: 'inventory', href: '/inventory' }, { key: 'allParts' }],
   '/reports': [{ key: 'reports' }],
   '/timesheets': [{ key: 'timesheets' }],
+  '/calendar': [{ key: 'calendar' }],
+  '/messages': [{ key: 'messages' }],
+  '/inspections': [{ key: 'inspections' }],
+  '/labor-presets': [{ key: 'laborPresets' }],
+  '/telegram': [{ key: 'telegram' }],
+  '/whatsapp': [{ key: 'whatsapp' }],
   '/reminders': [{ key: 'reminders', href: '/reminders' }, { key: 'allReminders' }],
   '/work-board': [{ key: 'workBoard' }],
   '/work-board/presenter': [{ key: 'workBoard', href: '/work-board' }, { key: 'presenter' }],
@@ -273,6 +279,14 @@ export function PageHeader() {
     else if (pathname.startsWith('/customers/')) {
       segments = [{ key: 'customers', href: '/customers' }, { key: 'customerDetails' }]
     }
+    // /inspections/[id]
+    else if (/^\/inspections\/[^/]+$/.test(pathname)) {
+      segments = [{ key: 'inspections', href: '/inspections' }, { key: 'inspectionDetails' }]
+    }
+    // /sales/[serviceId], a counter sale: a work order without a vehicle
+    else if (/^\/sales\/[^/]+$/.test(pathname)) {
+      segments = [{ key: 'workOrders', href: '/work-orders' }, { key: 'serviceDetails' }]
+    }
     // A settings page the map above does not list: named as the settings
     // menu names it, so a new page never reads "Home".
     else if (pathname.startsWith('/settings/')) {