From 5488f579e7d3bb59ce57c8cff7ecd4663ebbeda6 Mon Sep 17 00:00:00 2001 From: Shawn Date: Mon, 25 May 2026 21:21:06 -0400 Subject: [PATCH] fix: inline edit now displays correct asset location info on Enter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit saveMachineIdInline used wrong field names when rendering the location info div after a successful assignment: 'location_name', 'building', 'zone' โ€” none of which exist in the asset dict returned by lookup_machine_id(). Replaced with the correct fields matching lookupPrevAsset(): building_name, floor, room, address, make, model Now pressing Enter on an inline machine ID edit correctly shows the asset's building, floor, room, address, and make/model. --- static/index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 938dc73..af9008a 100644 --- a/static/index.html +++ b/static/index.html @@ -698,8 +698,13 @@ function saveMachineIdInline(input, photoId, cancel) { (a.status === 'active' ? ' ๐ŸŸข Active' : ''); } if (infoEl) { - const parts = [a.location_name, a.building, a.floor, a.zone].filter(Boolean); - infoEl.innerHTML = parts.join(' ยท ') || '(No location details)'; + let info = ''; + if (a.building_name) info += '๐Ÿข ' + esc(a.building_name) + ' '; + if (a.floor) info += '๐Ÿ“ถ Floor ' + esc(a.floor) + ' '; + if (a.room) info += '๐Ÿšช ' + esc(a.room) + ' '; + if (a.address) info += '๐Ÿ  ' + esc(a.address); + if (a.make || a.model) info += '๐Ÿ”ง ' + esc(a.make || '') + ' ' + esc(a.model || ''); + infoEl.innerHTML = info || '(No location details)'; } } else { if (assetEl) assetEl.innerHTML = 'โš ๏ธ No asset match for ' + esc(val) + '';