feat(devices): add console-only display name (console_name)

Lets staff set a friendly name for a device independent of whatever
name the end user gave it in the app. console_name is never shown to
app users and never synced from/to device_name; every display label
across search, equipment/helpdesk name resolution, device search, and
the Manage tab's issue linker now falls back through console_name ->
device_name -> serial rather than device_name alone.

Also includes an incidental one-line fix in devices/service.py: the
nested-struct deep-merge in update_device() was missing the newly
added device_health_settings key.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-21 18:31:10 +03:00
co-authored by Claude Sonnet 5
parent 8ec13947cb
commit 6e0a291228
8 changed files with 16 additions and 12 deletions
+2 -1
View File
@@ -48,7 +48,8 @@ def _resolve_names(db, device_id: str | None, user_id: str | None) -> tuple[str,
if device_id and isinstance(device_id, str) and device_id.strip():
device_doc = db.collection("devices").document(device_id.strip()).get()
if device_doc.exists:
device_name = device_doc.to_dict().get("device_name", "")
device_data = device_doc.to_dict()
device_name = device_data.get("console_name") or device_data.get("device_name", "")
if user_id and isinstance(user_id, str) and user_id.strip():
user_doc = db.collection("users").document(user_id.strip()).get()