fix: inline edit now displays correct asset location info on Enter

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.
This commit is contained in:
2026-05-25 21:21:06 -04:00
parent a243980c1b
commit 5488f579e7
+7 -2
View File
@@ -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 <strong>' + esc(val) + '</strong>';