Skip to content

Commit

Permalink
filter empty string fields from tooltips
Browse files Browse the repository at this point in the history
Signed-off-by: Sanjula Ganepola <[email protected]>
  • Loading branch information
SanjulaGanepola authored and chrjorgensen committed Jul 1, 2024
1 parent 80c99ea commit 0bc2b7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/Tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ export namespace Tools {
export function generateTooltipHtmlTable(header: string, rows: Record<string, any>) {
return `<table>`
.concat(`${header ? `<thead>${header}</thead>` : ``}`)
.concat(`${Object.entries(rows).filter(([key, value]) => value !== undefined).map(([key, value]) => `<tr><td>${t(key)}:</td><td>&nbsp;${value}</td></tr>`).join(``)}`)
.concat(`${Object.entries(rows)
.filter(([key, value]) => value !== undefined && value !== '')
.map(([key, value]) => `<tr><td>${t(key)}:</td><td>&nbsp;${value}</td></tr>`)
.join(``)}`
)
.concat(`</table>`);
}

Expand Down

0 comments on commit 0bc2b7d

Please sign in to comment.