diff --git a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap index c1dc644..d487b3c 100644 --- a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap @@ -55,6 +55,13 @@ exports[`DigitalTwinTab Render 1`] = ` : unknown

+

+ + Max Range + + : + 577 +

- Updated at + Updated At : 7/26/2022 12:26:38 AM @@ -206,7 +213,7 @@ exports[`DigitalTwinTab Render 1`] = ` >

- DBC version + DBC Version : d439abd3662dd20099f49dd8f43f7b145202e961caa2b5aba2c6154c8096348b diff --git a/src/components/Cars/Status/index.jsx b/src/components/Cars/Status/index.jsx index ffe3802..98f223a 100644 --- a/src/components/Cars/Status/index.jsx +++ b/src/components/Cars/Status/index.jsx @@ -26,10 +26,12 @@ const TabViews = [ { label: "Details", component: CarDetailsTab, + rolesPerProvider: Permissions.FiskerMagnaRead, }, { label: "Car Updates", component: CarUpdatesTab, + rolesPerProvider: Permissions.FiskerMagnaRead, }, { label: "CAN Filters", @@ -39,22 +41,27 @@ const TabViews = [ { label: "Digital Twin", component: DigitalTwinTab, + rolesPerProvider: Permissions.FiskerMagnaRead, }, { label: "CAN Signals", component: CANSignalsTab, + rolesPerProvider: Permissions.FiskerMagnaRead, }, { label: "T.Rex logs", component: TRexLogsTab, + rolesPerProvider: Permissions.FiskerMagnaRead, }, { label: "ECUs", component: ECUsTab, + rolesPerProvider: Permissions.FiskerMagnaRead, }, { label: "Remote Commands", component: RemoteCommandsTab, + rolesPerProvider: Permissions.FiskerMagnaCreate, }, { label: "Fleets", @@ -63,7 +70,8 @@ const TabViews = [ }, { label: "CAN Signal Export", - component: SelfServeTab + component: SelfServeTab, + rolesPerProvider: Permissions.FiskerRead, } ]; diff --git a/src/components/DigitalTwin/index.js b/src/components/DigitalTwin/index.js index e1c70f0..c359dc7 100644 --- a/src/components/DigitalTwin/index.js +++ b/src/components/DigitalTwin/index.js @@ -27,18 +27,19 @@ const windowState = (value) => { const DigitalTwin = (props) => { const classes = useStyles(); - const { battery, doors, location, trex_version, ip, updated, windows, misc_windows, sunroof, dbc_version, door_locks, vcu0x260, charging_metrics } = props; + const { battery, doors, location, trex_version, ip, updated, windows, misc_windows, sunroof, dbc_version, door_locks, vcu0x260, charging_metrics, max_range } = props; return (

{!battery && !doors && !location && !windows && !vcu0x260 && !charging_metrics && (

No vehicle data to display.

)} - {battery && ( + {(battery || max_range) && (

Battery

- {keyValueTemplate("Percentage", `${battery.percent || 0}%`)} - {keyValueTemplate("Total Mileage", `${battery.total_mileage_odometer || UNKNOWN}`)} + {keyValueTemplate("Percentage", `${battery?.percent || 0}%`)} + {keyValueTemplate("Total Mileage", battery?.total_mileage_odometer || UNKNOWN)} + {keyValueTemplate("Max Range", max_range?.max_miles || UNKNOWN)}
)} {(vcu0x260 || charging_metrics) && ( @@ -113,12 +114,12 @@ const DigitalTwin = (props) => { )} {updated != null && (
- {keyValueTemplate("Updated at", LocalDateTimeString(updated))} + {keyValueTemplate("Updated At", LocalDateTimeString(updated))}
)} {dbc_version != null && (
- {keyValueTemplate("DBC version", dbc_version)} + {keyValueTemplate("DBC Version", dbc_version)}
)}