CEC-4066 move date column (#314)
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
import DateFnsUtils from '@date-io/date-fns';
|
import DateFnsUtils from '@date-io/date-fns';
|
||||||
import { Button, CircularProgress, Grid, TableFooter, TablePagination, TableCell, Table, TableRow, TableBody} from "@material-ui/core";
|
import { Button, CircularProgress, Grid, Table, TableBody, TableCell, TableFooter, TablePagination, TableRow } from "@material-ui/core";
|
||||||
import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
|
import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
|
||||||
|
import clsx from "clsx";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { logger } from "../../../services/monitoring";
|
import { logger } from "../../../services/monitoring";
|
||||||
import { DTCTimelineProvider, useDTCTimelineContext } from '../../Contexts/DTCTimelineContext';
|
import { DTCTimelineProvider, useDTCTimelineContext } from '../../Contexts/DTCTimelineContext';
|
||||||
import { useStatusContext } from "../../Contexts/StatusContext";
|
import { useStatusContext } from "../../Contexts/StatusContext";
|
||||||
import { useUserContext } from "../../Contexts/UserContext";
|
import { useUserContext } from "../../Contexts/UserContext";
|
||||||
import { useLocalStorage } from "../../useLocalStorage";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import TableHeaderSortable from "../../Table/HeaderSortable";
|
|
||||||
import SearchField from '../../Controls/SearchField';
|
import SearchField from '../../Controls/SearchField';
|
||||||
|
import TableHeaderSortable from "../../Table/HeaderSortable";
|
||||||
|
import { useLocalStorage } from "../../useLocalStorage";
|
||||||
import useStyles from "../../useStyles";
|
import useStyles from "../../useStyles";
|
||||||
|
|
||||||
const MainForm = ({ vin }) => {
|
const MainForm = ({ vin }) => {
|
||||||
@@ -28,6 +28,10 @@ const MainForm = ({ vin }) => {
|
|||||||
const { setMessage } = useStatusContext();
|
const { setMessage } = useStatusContext();
|
||||||
|
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
|
{
|
||||||
|
id: "epoch_usec",
|
||||||
|
label: "Date",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "id",
|
id: "id",
|
||||||
label: "Id",
|
label: "Id",
|
||||||
@@ -48,10 +52,6 @@ const MainForm = ({ vin }) => {
|
|||||||
id: "status_byte",
|
id: "status_byte",
|
||||||
label: "Status Code",
|
label: "Status Code",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: "epoch_usec",
|
|
||||||
label: "Date",
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleSort = (_event, property) => {
|
const handleSort = (_event, property) => {
|
||||||
@@ -189,6 +189,7 @@ const MainForm = ({ vin }) => {
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{(dtcData || []).map((dtc, index) => (
|
{(dtcData || []).map((dtc, index) => (
|
||||||
<TableRow key={index}>
|
<TableRow key={index}>
|
||||||
|
<TableCell>{formatDate(dtc.epoch_usec)}</TableCell>
|
||||||
<TableCell component="th" scope="row">
|
<TableCell component="th" scope="row">
|
||||||
{dtc.id}
|
{dtc.id}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -196,7 +197,6 @@ const MainForm = ({ vin }) => {
|
|||||||
<TableCell>{dtc.ecu_name}</TableCell>
|
<TableCell>{dtc.ecu_name}</TableCell>
|
||||||
<TableCell>{dtc.trouble_code}</TableCell>
|
<TableCell>{dtc.trouble_code}</TableCell>
|
||||||
<TableCell>{dtc.status_byte}</TableCell>
|
<TableCell>{dtc.status_byte}</TableCell>
|
||||||
<TableCell>{formatDate(dtc.epoch_usec)}</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
|
|||||||
Reference in New Issue
Block a user