Merge branch 'main' into CEC-5542
This commit is contained in:
@@ -191,7 +191,7 @@ exports[`FleetVehiclesTable Render 1`] = `
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
VIN
|
||||
Vehicle
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
|
||||
|
||||
@@ -23,18 +23,19 @@ import {
|
||||
} from "../../../../Contexts/FleetContext";
|
||||
import { useStatusContext } from "../../../../Contexts/StatusContext";
|
||||
import { useUserContext } from "../../../../Contexts/UserContext";
|
||||
import { VehicleProvider } from "../../../../Contexts/VehicleContext";
|
||||
import SearchField from "../../../../Controls/SearchField";
|
||||
import TableHeaderSortable from "../../../../Table/HeaderSortable";
|
||||
import { useLocalStorage } from "../../../../useLocalStorage";
|
||||
import ConnectedIcon from "../../../../Controls/ConnectedIcon";
|
||||
import BulkActions from "../../../../BulkActions";
|
||||
import Battery from "../../../../Battery";
|
||||
import { VehicleTeaserController as VehicleTeaser } from "../../../../VehicleTeaser";
|
||||
import useStyles from "../../../../useStyles";
|
||||
|
||||
const tableColumns = [
|
||||
{
|
||||
id: "vin",
|
||||
label: "VIN",
|
||||
id: "vehicle",
|
||||
label: "Vehicle",
|
||||
},
|
||||
{
|
||||
id: "trex_version",
|
||||
@@ -213,54 +214,53 @@ const MainForm = ({ name }) => {
|
||||
selectCount={selected.length}
|
||||
rowCount={fleetVehicles.length}
|
||||
/>
|
||||
<TableBody>
|
||||
{fleetVehicles && fleetVehicles.map((car) => {
|
||||
const isSelected = selected.includes(car.vin);
|
||||
return (car.vin && <TableRow key={"row" + car.vin}>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
checked={isSelected}
|
||||
onChange={() => handleSelect(car.vin, !isSelected)}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell key={"cell" + car.vin} align="center">
|
||||
{(car.connected || car.connectedHMI) &&
|
||||
<ConnectedIcon
|
||||
key={"icon" + car.vin}
|
||||
connected={car.connected}
|
||||
connectedHMI={car.connectedHMI}
|
||||
style={{ marginRight: 3 }}
|
||||
<VehicleProvider>
|
||||
<TableBody>
|
||||
{fleetVehicles && fleetVehicles.map((car) => {
|
||||
const isSelected = selected.includes(car.vin);
|
||||
return (car.vin && <TableRow key={"row" + car.vin}>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
checked={isSelected}
|
||||
onChange={() => handleSelect(car.vin, !isSelected)}
|
||||
/>
|
||||
}
|
||||
<Link key={"link" + car.vin} to={`/vehicle-status/${car.vin}`}>{car.vin}</Link>
|
||||
</TableCell>
|
||||
<TableCell key={"cell2" + car.vin} align="center">{car.trex_version}</TableCell>
|
||||
<TableCell key={"cell3" + car.car_update_name}>
|
||||
<Tooltip key={"cell3tooltip"} title={`${car.car_update_id} / ${car.car_update_type}`}>
|
||||
<Link to={`/vehicle-status/${car.vin}/${car.car_update_id}`} className={classes.truncateCell}>
|
||||
{car.car_update_name}
|
||||
</Link>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell key={"cell4" + car.vin}>
|
||||
{car.car_update_status}
|
||||
{car.car_update_progress > -1 && (
|
||||
<LinearProgress variant="determinate" value={car.car_update_progress} />
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell key={"cell5" + car.vin} align="left">
|
||||
<Battery percent={car.charge} charge={car.charge_type} />
|
||||
</TableCell>
|
||||
<TableCell key={"cell6" + car.vin}>
|
||||
{car.voltage > 0 && `${car.voltage}V`}
|
||||
</TableCell>
|
||||
<TableCell key={"cell7" + car.vin}>
|
||||
{car.park ? "Yes" : "No"}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
})}
|
||||
</TableBody>
|
||||
</TableCell>
|
||||
<TableCell key={"cell" + car.vin} align="center">
|
||||
<VehicleTeaser
|
||||
vin={car.vin}
|
||||
icc={car.connectedHMI}
|
||||
trex={car.connected}
|
||||
token={token}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell key={"cell2" + car.vin} align="center">{car.trex_version}</TableCell>
|
||||
<TableCell key={"cell3" + car.car_update_name}>
|
||||
<Tooltip key={"cell3tooltip"} title={`${car.car_update_id} / ${car.car_update_type}`}>
|
||||
<Link to={`/vehicle-status/${car.vin}/${car.car_update_id}`} className={classes.truncateCell}>
|
||||
{car.car_update_name}
|
||||
</Link>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell key={"cell4" + car.vin}>
|
||||
{car.car_update_status}
|
||||
{car.car_update_progress > -1 && (
|
||||
<LinearProgress variant="determinate" value={car.car_update_progress} />
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell key={"cell5" + car.vin} align="left">
|
||||
<Battery percent={car.charge} charge={car.charge_type} />
|
||||
</TableCell>
|
||||
<TableCell key={"cell6" + car.vin}>
|
||||
{car.voltage > 0 && `${car.voltage}V`}
|
||||
</TableCell>
|
||||
<TableCell key={"cell7" + car.vin}>
|
||||
{car.park ? "Yes" : "No"}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
})}
|
||||
</TableBody>
|
||||
</VehicleProvider>
|
||||
<TableFooter>
|
||||
<TableRow>
|
||||
<TablePagination
|
||||
|
||||
@@ -190,7 +190,7 @@ exports[`VehiclesTab Render 1`] = `
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
VIN
|
||||
Vehicle
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
|
||||
|
||||
Reference in New Issue
Block a user