CEC-371 Update car ECUs display (#78)

* Clean up className styles
Update car status page to show update and ECUs

* Add update ecu version button
Show all ECUs on car status page
Only show car ecus for search
This commit is contained in:
John Wu
2021-08-18 09:14:13 -07:00
committed by GitHub
parent 3e66959521
commit d1815e2ff9
20 changed files with 1169 additions and 299 deletions

View File

@@ -2,16 +2,17 @@ import React from "react";
import PropTypes from "prop-types";
import { Chip } from "@material-ui/core";
const ECUList = ({ list, delimiter, search }) => {
const ECUList = ({ list, delimiter, search, searchedOnly }) => {
if (!list) return null;
if (!delimiter) delimiter = ",";
const items = list.split(delimiter);
return items.map((item, index) => {
const match = search
? item.toLowerCase().split(" ").indexOf(search.toLowerCase())
: -1;
if (searchedOnly && match === -1) return null;
return (
<Chip
key={index}
@@ -29,6 +30,7 @@ ECUList.propTypes = {
list: PropTypes.string,
delimiter: PropTypes.string,
search: PropTypes.string,
searchedOnly: PropTypes.bool,
};
export default ECUList;

View File

@@ -30,7 +30,7 @@ const SearchField = (props) => {
};
return (
<FormControl className={clsx(classes.margin, classes.textField)}>
<FormControl className={clsx(classes.margin, classes.fullWidth)}>
<InputLabel htmlFor="search">Search</InputLabel>
<Input
id="search"