diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index 04f7423..ebdfb75 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -11643,6 +11643,24 @@ exports[`App Route /vehicle-status authenticated 1`] = ` class="MuiTouchRipple-root" /> + + diff --git a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap index e09f5ac..17a22f2 100644 --- a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap @@ -213,6 +213,24 @@ exports[`CarStatus Render 1`] = ` class="MuiTouchRipple-root" /> + + diff --git a/src/components/Cars/Status/index.jsx b/src/components/Cars/Status/index.jsx index de180d4..b8f3a7b 100644 --- a/src/components/Cars/Status/index.jsx +++ b/src/components/Cars/Status/index.jsx @@ -20,6 +20,7 @@ import FleetsTab from "./FleetsTab"; import RemoteCommandsTab from "./RemoteCommandsTab"; import RemoteDiagnosticCommandsTab from "./RemoteDiagnosticCommands"; import TRexLogsTab from "./TRexLogsTab"; +import DTCTimeline from "../../DTCTimeline/DTCTimeline"; const tabHashes = ["details", "updates", "filters"]; @@ -79,13 +80,13 @@ const TabViews = [ component: SelfServeTab, rolesPerProvider: Permissions.FiskerRead, }, - /* + { label: "DTC Timeline", component: DTCTimeline, rolesPerProvider: Permissions.FiskerMagnaRead, } - */ + ]; const filterTabs = (data, groups, providers) => { diff --git a/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap b/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap index 156a9b6..0fee44a 100644 --- a/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap +++ b/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap @@ -462,52 +462,6 @@ exports[`Render Render 1`] = ` - - - Id - - - - - - VIN - - - Error Text + + Speed + + + Milage + + + Voltage + - Date + ECU Time @@ -612,6 +584,29 @@ exports[`Render Render 1`] = ` + + + Cloud Time + + + { const { setMessage } = useStatusContext(); const tableColumns = [ - { - id: "id", - label: "Id", - }, - { - id: "vin", - label: "VIN", - }, { id: "ecu", label: "ECU", @@ -54,9 +46,28 @@ const MainForm = ({ vin }) => { label: "Error Text", no_sort: true, }, + { + id: "speed", + label: "Speed", + no_sort: true, + }, + { + id: "milage", + label: "Milage", + no_sort: true, + }, + { + id: "voltage", + label: "Voltage", + no_sort: true, + }, { id: "epoch_usec", - label: "Date", + label: "ECU Time", + }, + { + id: "created_at", + label: "Cloud Time", }, ]; @@ -111,9 +122,8 @@ const MainForm = ({ vin }) => { setLoading(false); }; - function formatDate(microseconds) { - const date = new Date(microseconds / 1000); - return date.toLocaleString(); + function formatDate(date) { + return date.replace(/[TZ]/g, ' ') } const handleDateChange = (value, dateType) => { @@ -285,15 +295,15 @@ const MainForm = ({ vin }) => { {(dtcData || []).map((dtc, index) => ( - - {dtc.id} - - {dtc.vin} {dtc.ecu_name} {dtc.trouble_code} {dtc.status_byte} {dtc.trouble_code_information?.ErrorText?.Text} + {(dtc.speed || dtc.speed === 0) && {dtc.speed + " km/h"}} + {(dtc.mileage || dtc.mileage === 0) && {dtc.mileage + " km"}} + {(dtc.voltage || dtc.voltage === 0) && {dtc.voltage + " V"}} {formatDate(dtc.epoch_usec)} + {formatDate(dtc.created_at)} ))} @@ -328,4 +338,4 @@ const DTCTimeline = (props) => ( ); -export default DTCTimeline; \ No newline at end of file +export default DTCTimeline;