CEC-5182: add car update status to fleet (#466)
This commit is contained in:
@@ -150,6 +150,52 @@ exports[`FleetVehiclesTable Render 1`] = `
|
||||
</svg>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
|
||||
scope="col"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiTableSortLabel-root"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Car Update
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
|
||||
scope="col"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiTableSortLabel-root"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Car Update Status
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
|
||||
scope="col"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
Grid,
|
||||
LinearProgress,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
@@ -38,6 +39,14 @@ const tableColumns = [
|
||||
id: "trex_version",
|
||||
label: "T.REX Version",
|
||||
},
|
||||
{
|
||||
id: "car_update",
|
||||
label: "Car Update",
|
||||
},
|
||||
{
|
||||
id: "car_update_status",
|
||||
label: "Car Update Status",
|
||||
},
|
||||
{
|
||||
id: "",
|
||||
label: "Actions",
|
||||
@@ -58,6 +67,7 @@ const MainForm = ({ name }) => {
|
||||
const {
|
||||
fleetVehicles,
|
||||
totalFleetVehicles,
|
||||
watchFleetVehicles,
|
||||
getFleetVehicles,
|
||||
deleteFleetVehicle,
|
||||
} = useFleetContext();
|
||||
@@ -87,11 +97,15 @@ const MainForm = ({ name }) => {
|
||||
},
|
||||
token
|
||||
);
|
||||
watchFleetVehicles.start({ token });
|
||||
} catch (e) {
|
||||
setMessage(e.message);
|
||||
logger.warn(e.stack);
|
||||
}
|
||||
})();
|
||||
return () => {
|
||||
watchFleetVehicles.end();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [token, pageIndex, pageSize, orderBy, order, search]);
|
||||
|
||||
@@ -209,7 +223,20 @@ const MainForm = ({ name }) => {
|
||||
<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.vin} align="center">{Actions(car.vin)}</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.car_update_status}>
|
||||
{car.car_update_status}
|
||||
{car.car_update_progress > -1 && (
|
||||
<LinearProgress variant="determinate" value={car.car_update_progress} />
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell key={"cell5" + car.vin} align="center">{Actions(car.vin)}</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
))}
|
||||
|
||||
@@ -149,6 +149,52 @@ exports[`VehiclesTab Render 1`] = `
|
||||
</svg>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
|
||||
scope="col"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiTableSortLabel-root"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Car Update
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
|
||||
scope="col"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root MuiTableSortLabel-root"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Car Update Status
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root MuiTableSortLabel-icon MuiTableSortLabel-iconDirectionAsc"
|
||||
focusable="false"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
class="MuiTableCell-root MuiTableCell-head MuiTableCell-alignCenter"
|
||||
scope="col"
|
||||
|
||||
Reference in New Issue
Block a user