Dashboard corrections

This commit is contained in:
2026-08-11 16:27:14 -04:00
parent 2d19bcdf60
commit 568dfbb91c
7 changed files with 85 additions and 13 deletions

View File

@@ -118,10 +118,23 @@ export function mapTitleTip(card, item) {
return key ? (item[key] || '') : ''
}
// Floor-plan preview on hover, for rows that carry coordinates. Returns null
// when the card declares none or the row has not been placed on the map - an
// unplaced printer still belongs on the card, it just has nothing to preview.
export function mapHover(card, item) {
const spec = card.map && card.map.maphover
if (!spec) return null
const x = item[spec.x]
const y = item[spec.y]
if (x === null || x === undefined || y === null || y === undefined) return null
return { x, y, label: spec.label ? (item[spec.label] || '') : '' }
}
export function cardRows(card) {
return rows(card).map((item) => ({
title: mapTitle(card, item),
titletip: mapTitleTip(card, item),
maphover: mapHover(card, item),
detail: mapDetail(card, item),
detailtip: mapDetailTip(card, item),
meta: mapMeta(card, item),