Fix handling of empty pad/marker/line names in table export

pull/256/head
Candid Dauth 2023-11-14 22:01:39 +01:00
rodzic 304b56d9c6
commit 997509cda0
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -36,7 +36,7 @@
</head> </head>
<body> <body>
<div class="container-fluid"> <div class="container-fluid">
<h1><%=padData.name%> – FacilMap</h1> <h1><%=normalizePadName(padData.name)%> – FacilMap</h1>
<% <%
for(let type of Object.values(types)) { for(let type of Object.values(types)) {
-%> -%>
@ -89,7 +89,7 @@
<% <%
if(!hide.includes("Name")) { if(!hide.includes("Name")) {
-%> -%>
<td><%=object.name%></td> <td><%=type.type === "marker" ? normalizeMarkerName(object.name) : normalizeLineName(object.name)%></td>
<% <%
} }

Wyświetl plik

@ -6,6 +6,7 @@ import * as ejs from "ejs";
import * as utils from "facilmap-utils"; import * as utils from "facilmap-utils";
import { Router, type RequestHandler } from "express"; import { Router, type RequestHandler } from "express";
import { static as expressStatic } from "express"; import { static as expressStatic } from "express";
import { normalizeLineName, normalizeMarkerName, normalizePadName } from "facilmap-utils";
export const isDevMode = !!process.env.FM_DEV; export const isDevMode = !!process.env.FM_DEV;
@ -92,6 +93,9 @@ export async function renderTable(params: {
...injections, ...injections,
paths, paths,
utils, utils,
normalizeMarkerName,
normalizeLineName,
normalizePadName,
...params ...params
}); });
} }