CEC-4546: add ecu search (#391)
* CEC-4546: add ecu search * CEC-4546: add checkbox to filter current * add column * set initial state to true for unique
This commit is contained in:
@@ -58,11 +58,15 @@ const tableColumns = [
|
||||
id: "updated_at",
|
||||
label: "Updated",
|
||||
},
|
||||
{
|
||||
id: "epoch_usec",
|
||||
label: "Epoch",
|
||||
},
|
||||
];
|
||||
|
||||
const PAGE_SIZE = "CAR_ECUS_TABLE_PAGE_SIZE";
|
||||
|
||||
const CarECUsTable = ({ vin, token, classes }) => {
|
||||
const CarECUsTable = ({ vin, token, classes, search, unique }) => {
|
||||
const [ecus, setECUs] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [pageSize, setPageSize] = useLocalStorage(PAGE_SIZE, 10);
|
||||
@@ -79,6 +83,8 @@ const CarECUsTable = ({ vin, token, classes }) => {
|
||||
const result = await getECUs(
|
||||
{
|
||||
vin,
|
||||
search,
|
||||
unique,
|
||||
limit: pageSize,
|
||||
offset: pageSize * pageIndex,
|
||||
order: `${orderBy} ${order}`,
|
||||
@@ -93,7 +99,7 @@ const CarECUsTable = ({ vin, token, classes }) => {
|
||||
}
|
||||
})();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [vin, token, pageIndex, pageSize, orderBy, order]);
|
||||
}, [vin, token, pageIndex, pageSize, orderBy, order, search, unique]);
|
||||
|
||||
const handleChangePageIndex = (event, newIndex) => {
|
||||
setPageIndex(newIndex);
|
||||
|
||||
Reference in New Issue
Block a user