CEC-1050 New manifest format (#117)

* CEC-1050 Manifest changes

* Fix delete bug

* Add approve update button

* Code smell

* Remove update approval
This commit is contained in:
John Wu
2022-03-01 16:56:25 -08:00
committed by GitHub
parent a858b842c6
commit 3b9252097a
17 changed files with 155 additions and 346 deletions

View File

@@ -24,30 +24,14 @@ const tableColumns = [
id: "sw_version",
label: "SW Version",
},
{
id: "boot_loader_version",
label: "BL Version",
},
{
id: "hw_version",
label: "HW Version",
},
{
id: "vendor",
label: "Vendor",
},
{
id: "config",
label: "Config",
},
{
id: "fingerprint",
label: "Fingerprint",
},
{
id: "serial_number",
label: "Serial",
},
{
id: "created_at",
label: "Created",
@@ -128,16 +112,12 @@ const CarECUsTable = ({ vin, token, classes }) => {
onSortRequest={handleSort}
/>
<TableBody>
{ecus.map((row) => (
<TableRow key={row.ecu}>
{ecus.map((row, i) => (
<TableRow key={row.ecu + i}>
<TableCell align="center">{row.ecu}</TableCell>
<TableCell align="center">{row.sw_version}</TableCell>
<TableCell align="center">{row.boot_loader_version}</TableCell>
<TableCell align="center">{row.hw_version}</TableCell>
<TableCell align="center">{row.vendor}</TableCell>
<TableCell align="center">{row.config}</TableCell>
<TableCell align="center">{row.fingerprint}</TableCell>
<TableCell align="center">{row.serial_number}</TableCell>
<TableCell align="center">
{LocalDateTimeString(row.created)}
</TableCell>

View File

@@ -153,6 +153,28 @@ exports[`CarUpdateStatusTable Render 1`] = `
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
/>
</tr>
<tr
class="MuiTableRow-root"
>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
>
8/23/2021 5:06:38 PM
</td>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
>
install_approval_await
</td>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
>
TEST
</td>
<td
class="MuiTableCell-root MuiTableCell-body MuiTableCell-alignCenter"
/>
</tr>
</tbody>
<tfoot
class="MuiTableFooter-root"
@@ -223,7 +245,7 @@ exports[`CarUpdateStatusTable Render 1`] = `
<p
class="MuiTypography-root MuiTablePagination-caption MuiTypography-body2 MuiTypography-colorInherit"
>
1-2 of 2
1-3 of 3
</p>
<div
class="MuiTablePagination-actions"

View File

@@ -0,0 +1,34 @@
import React from "react";
import { Select } from "@material-ui/core";
const ManifestECUFlashModes = (props) => {
const changeHandler = (e) => {
if (!props.changeHandler) return;
props.changeHandler(e);
};
return (
<Select
id={props.id}
native
variant="outlined"
value={props.value}
onChange={changeHandler}
>
{FlashModeTypes.map((item, index) => (
<option key={index} value={item[0]}>
{item[1]}
</option>
))}
</Select>
);
};
export default ManifestECUFlashModes;
const FlashModeTypes = [
["A", "Mode A"],
["D", "Mode D"],
["SELF", "Self"],
];

View File

@@ -31,22 +31,10 @@ const options = [
field: "version",
required: true,
},
{
label: "Part Number",
field: "part_number",
},
{
label: "Serial",
field: "serial_number",
},
{
label: "Hardware",
field: "hw_version",
},
{
label: "Vendor",
field: "vendor",
},
{
label: "",
delete: true,
@@ -74,7 +62,7 @@ const ManifestECUList = () => {
</TableBody>
<TableFooter>
<TableRow>
<TableCell colSpan={8} align="center">
<TableCell colSpan={5} align="center">
<Button onClick={addECU}>Add ECU</Button>
</TableCell>
</TableRow>