From 7892df25cec9987e59b945ab39dbc93873977316 Mon Sep 17 00:00:00 2001 From: Paul Adamsen <117673433+pauladamseniii@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:09:07 -0400 Subject: [PATCH] CEC-4533 - Add DLT level to TREX config message (#434) * CEC-4533 - Add DLT level to TREX config message * Improved log level selection --- src/components/Cars/Status/Details/index.jsx | 34 ++++- .../Status/__snapshots__/index.test.jsx.snap | 10 +- .../Update/__snapshots__/index.test.jsx.snap | 126 +++++++++--------- src/components/Cars/Update/index.jsx | 63 +++++++-- 4 files changed, 155 insertions(+), 78 deletions(-) diff --git a/src/components/Cars/Status/Details/index.jsx b/src/components/Cars/Status/Details/index.jsx index a62e88d..b359a6f 100644 --- a/src/components/Cars/Status/Details/index.jsx +++ b/src/components/Cars/Status/Details/index.jsx @@ -76,6 +76,29 @@ const MainForm = ({ vin }) => { } } + const findDLTLevelStr = (dltLevelNum) => { + switch (dltLevelNum) { + case 0: + return "Off" + case 1: + return "Fatal" + case 2: + return "Error" + case 3: + return "Warn" + case 4: + return "Info" + case 5: + return "Debug" + case 6: + return "Verbose" + case 255: + return "Delete" + default: + return "Default" + } + } + if (redirect && redirect.length > 0) { return ; } @@ -144,11 +167,16 @@ const MainForm = ({ vin }) => {

DTC Enabled: {(vehicle.canbus.dtc_enabled || false).toString()}

-

- DLT Logging Enabled: {(vehicle.dlt_enabled || false).toString()} -

)} +

+ DLT Logging Enabled: {(vehicle.dlt_enabled || false).toString()} +

+ {vehicle.dlt_enabled && ( +

+ DLT Level: {findDLTLevelStr(vehicle.dlt_level) ?? "Default"} +

+ )} {showDebugMask && ( diff --git a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap index cfb8cf3..7ada9d4 100644 --- a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap @@ -318,7 +318,15 @@ exports[`CarStatus Render 1`] = `
+ > +

+ + DLT Logging Enabled + + : + false +

+
diff --git a/src/components/Cars/Update/__snapshots__/index.test.jsx.snap b/src/components/Cars/Update/__snapshots__/index.test.jsx.snap index 6101f51..e0d7314 100644 --- a/src/components/Cars/Update/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Update/__snapshots__/index.test.jsx.snap @@ -968,81 +968,85 @@ exports[`VehicleUpdate Render 1`] = `
-