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>
<body>
<div class="container-fluid">
<h1><%=padData.name%> – FacilMap</h1>
<h1><%=normalizePadName(padData.name)%> – FacilMap</h1>
<%
for(let type of Object.values(types)) {
-%>
@ -89,7 +89,7 @@
<%
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 { Router, type RequestHandler } from "express";
import { static as expressStatic } from "express";
import { normalizeLineName, normalizeMarkerName, normalizePadName } from "facilmap-utils";
export const isDevMode = !!process.env.FM_DEV;
@ -92,6 +93,9 @@ export async function renderTable(params: {
...injections,
paths,
utils,
normalizeMarkerName,
normalizeLineName,
normalizePadName,
...params
});
}