From 997509cda0f27f4db73898df291126274ae861d8 Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Tue, 14 Nov 2023 22:01:39 +0100 Subject: [PATCH] Fix handling of empty pad/marker/line names in table export --- frontend/src/table/table.ejs | 4 ++-- server/src/frontend.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/table/table.ejs b/frontend/src/table/table.ejs index e714d22d..8e99542a 100644 --- a/frontend/src/table/table.ejs +++ b/frontend/src/table/table.ejs @@ -36,7 +36,7 @@
-

<%=padData.name%> – FacilMap

+

<%=normalizePadName(padData.name)%> – FacilMap

<% for(let type of Object.values(types)) { -%> @@ -89,7 +89,7 @@ <% if(!hide.includes("Name")) { -%> - <%=object.name%> + <%=type.type === "marker" ? normalizeMarkerName(object.name) : normalizeLineName(object.name)%> <% } diff --git a/server/src/frontend.ts b/server/src/frontend.ts index 11155914..1d51aa02 100644 --- a/server/src/frontend.ts +++ b/server/src/frontend.ts @@ -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 }); }