From b07bdafd85c7544575583134affd54e970896017 Mon Sep 17 00:00:00 2001 From: bonamin Date: Mon, 21 Sep 2026 18:33:55 +0300 Subject: [PATCH] fix(header): resolve breadcrumb labels for devices and melodies correctly - devices: breadcrumb now falls back through console_name -> device_name -> device_id, matching every other device display label in the console - melodies/archetypes: breadcrumb was reading a bare d.name field that doesn't exist on the melody schema (name lives at d.information.name.), so these breadcrumbs always showed blank. Now uses getLocalizedValue like the rest of the melodies UI. Co-Authored-By: Claude Sonnet 5 --- frontend/src/components/layout/Header.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/layout/Header.jsx b/frontend/src/components/layout/Header.jsx index 7573ce6..72b7ee3 100644 --- a/frontend/src/components/layout/Header.jsx +++ b/frontend/src/components/layout/Header.jsx @@ -9,6 +9,7 @@ import { Link, useLocation, useNavigate } from 'react-router-dom' import { useAuth } from '@/hooks/useAuth' import api from '@/lib/api' import HeaderSearch from '@/components/ui/HeaderSearch' +import { getLocalizedValue } from '@/lib/melodyUtils' // ─── Breadcrumb config ──────────────────────────────────────────────────────── @@ -52,10 +53,10 @@ const ENTITY_RESOLVERS = { customers: { path: (id) => `/crm/customers/${id}`, label: (d) => [d.name, d.surname].filter(Boolean).join(' ') || d.organization || null }, products: { path: (id) => `/crm/products/${id}`, label: (d) => d.name || null }, quotations: { path: (id) => `/crm/quotations/${id}`, label: (d) => d.quotation_number || null }, - devices: { path: (id) => `/devices/${id}`, label: (d) => d.name || d.device_id || null }, + devices: { path: (id) => `/devices/${id}`, label: (d) => d.console_name || d.device_name || d.device_id || null }, orders: { path: (id) => `/crm/orders/${id}`, label: (d) => d.order_number || null }, - melodies: { path: (id) => `/melodies/${id}`, label: (d) => d.name || null }, - archetypes: { path: (id) => `/builder/melodies/${id}`, label: (d) => d.name || null }, + melodies: { path: (id) => `/melodies/${id}`, label: (d) => getLocalizedValue(d.information?.name, 'en', '') || null }, + archetypes: { path: (id) => `/builder/melodies/${id}`, label: (d) => getLocalizedValue(d.information?.name, 'en', '') || null }, users: { path: (id) => `/users/${id}`, label: (d) => d.name || d.display_name || null }, notes: { path: (id) => `/equipment/notes/${id}`, label: (d) => d.title || d.subject || null }, staff: { path: (id) => `/staff/${id}`, label: (d) => d.name || null },