Skip to content

Commit

Permalink
Fix handling of empty pad/marker/line names in table export
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Nov 14, 2023
1 parent 304b56d commit 997509c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/table/table.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
-%>
Expand Down Expand Up @@ -89,7 +89,7 @@
<%
if(!hide.includes("Name")) {
-%>
<td><%=object.name%></td>
<td><%=type.type === "marker" ? normalizeMarkerName(object.name) : normalizeLineName(object.name)%></td>
<%
}
Expand Down
4 changes: 4 additions & 0 deletions server/src/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -92,6 +93,9 @@ export async function renderTable(params: {
...injections,
paths,
utils,
normalizeMarkerName,
normalizeLineName,
normalizePadName,
...params
});
}
Expand Down

0 comments on commit 997509c

Please sign in to comment.