diff --git a/src/components/Dialog/NewDeviceDialog.tsx b/src/components/Dialog/NewDeviceDialog.tsx index d178fc9b..dd73632a 100644 --- a/src/components/Dialog/NewDeviceDialog.tsx +++ b/src/components/Dialog/NewDeviceDialog.tsx @@ -135,7 +135,7 @@ export const NewDeviceDialog = ({ return ( - + Connect New Device diff --git a/src/components/Dialog/NodeDetailsDialog/NodeDetailsDialog.tsx b/src/components/Dialog/NodeDetailsDialog/NodeDetailsDialog.tsx index a185bdcf..33a45945 100644 --- a/src/components/Dialog/NodeDetailsDialog/NodeDetailsDialog.tsx +++ b/src/components/Dialog/NodeDetailsDialog/NodeDetailsDialog.tsx @@ -65,7 +65,7 @@ export const NodeDetailsDialog = ({ return ( - + @@ -128,7 +128,7 @@ export const NodeDetailsDialog = ({ {device.deviceMetrics && (
-

+

Device Metrics:

{deviceMetricsMap.map( diff --git a/src/components/Dialog/NodeOptionsDialog.tsx b/src/components/Dialog/NodeOptionsDialog.tsx index 4379e589..04809134 100644 --- a/src/components/Dialog/NodeOptionsDialog.tsx +++ b/src/components/Dialog/NodeOptionsDialog.tsx @@ -75,7 +75,7 @@ export const NodeOptionsDialog = ({ return ( - + {`${longName} (${shortName})`} diff --git a/src/components/Dialog/RefreshKeysDialog/RefreshKeysDialog.tsx b/src/components/Dialog/RefreshKeysDialog/RefreshKeysDialog.tsx index 2f0986af..95bc73aa 100644 --- a/src/components/Dialog/RefreshKeysDialog/RefreshKeysDialog.tsx +++ b/src/components/Dialog/RefreshKeysDialog/RefreshKeysDialog.tsx @@ -41,7 +41,10 @@ export const RefreshKeysDialog = ( }; return ( - + {text.title} @@ -77,7 +80,6 @@ export const RefreshKeysDialog = (
- {/* */}
); diff --git a/src/components/PageComponents/Messages/TraceRoute.tsx b/src/components/PageComponents/Messages/TraceRoute.tsx index 21cb4eba..e7578247 100644 --- a/src/components/PageComponents/Messages/TraceRoute.tsx +++ b/src/components/PageComponents/Messages/TraceRoute.tsx @@ -27,7 +27,7 @@ const RoutePath = ( return (

{title}

{startNode?.user?.longName}

diff --git a/src/components/generic/Table/index.test.tsx b/src/components/generic/Table/index.test.tsx index 61bd4063..727357f4 100644 --- a/src/components/generic/Table/index.test.tsx +++ b/src/components/generic/Table/index.test.tsx @@ -4,7 +4,6 @@ import { Table } from "@components/generic/Table/index.tsx"; import { TimeAgo } from "@components/generic/TimeAgo.tsx"; import { Mono } from "@components/generic/Mono.tsx"; // @ts-types="react" -import React from "react"; describe("Generic Table", () => { it("Can render an empty table.", () => { @@ -40,25 +39,46 @@ describe("Generic Table", () => { // A simplified version of the rows in pages/Nodes.tsx for testing purposes const mockDevicesWithShortNameAndConnection = [ - { user: { shortName: "TST1" }, hopsAway: 1, lastHeard: Date.now() + 1000 }, - { user: { shortName: "TST2" }, hopsAway: 0, lastHeard: Date.now() + 4000 }, - { user: { shortName: "TST3" }, hopsAway: 4, lastHeard: Date.now() }, - { user: { shortName: "TST4" }, hopsAway: 3, lastHeard: Date.now() + 2000 }, + { + user: { shortName: "TST1" }, + hopsAway: 1, + lastHeard: Date.now() + 1000, + viaMqtt: false, + }, + { + user: { shortName: "TST2" }, + hopsAway: 0, + lastHeard: Date.now() + 4000, + viaMqtt: true, + }, + { + user: { shortName: "TST3" }, + hopsAway: 4, + lastHeard: Date.now(), + viaMqtt: false, + }, + { + user: { shortName: "TST4" }, + hopsAway: 3, + lastHeard: Date.now() + 2000, + viaMqtt: true, + }, ]; const mockRows = mockDevicesWithShortNameAndConnection.map((node) => [

{node.user.shortName}

, - + - , + , {node.lastHeard !== 0 - ? node.hopsAway === 0 + ? node.viaMqtt === false && node.hopsAway === 0 ? "Direct" : `${node.hopsAway?.toString()} ${ - node.hopsAway > 1 ? "hops" : "hop" + node.hopsAway ?? 0 > 1 ? "hops" : "hop" } away` : "-"} + {node.viaMqtt === true ? ", via MQTT" : ""} , ]); diff --git a/src/components/generic/Table/index.tsx b/src/components/generic/Table/index.tsx index f3122ec9..124dd661 100755 --- a/src/components/generic/Table/index.tsx +++ b/src/components/generic/Table/index.tsx @@ -62,16 +62,16 @@ export const Table = ({ headings, rows }: TableProps) => { const elementB = getElement(b[columnIndex]); if (sortColumn === "Last Heard") { - const aTimestamp = elementA?.props?.timestamp ?? 0; - const bTimestamp = elementB?.props?.timestamp ?? 0; + const aTimestamp = elementA?.props?.children?.props?.timestamp ?? 0; + const bTimestamp = elementB?.props?.children?.props?.timestamp ?? 0; if (aTimestamp < bTimestamp) return sortOrder === "asc" ? -1 : 1; if (aTimestamp > bTimestamp) return sortOrder === "asc" ? 1 : -1; return 0; } if (sortColumn === "Connection") { - const aHopsStr = elementA?.props?.children; - const bHopsStr = elementB?.props?.children; + const aHopsStr = elementA?.props?.children[0]; + const bHopsStr = elementB?.props?.children[0]; const aNumHops = numericHops(aHopsStr); const bNumHops = numericHops(bHopsStr); if (aNumHops < bNumHops) return sortOrder === "asc" ? -1 : 1;