aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/RouteReportPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-14 19:04:32 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-14 19:04:32 -0700
commit9027b70996d2c39e51dee1e3fc9b55336c480a60 (patch)
tree38643907d099ae88a32617c0995b1ee96908c435 /modern/src/reports/RouteReportPage.js
parent072a70f8b30f1e2839da58116133f1f629ab8209 (diff)
downloadtrackermap-web-9027b70996d2c39e51dee1e3fc9b55336c480a60.tar.gz
trackermap-web-9027b70996d2c39e51dee1e3fc9b55336c480a60.tar.bz2
trackermap-web-9027b70996d2c39e51dee1e3fc9b55336c480a60.zip
Extract column select component
Diffstat (limited to 'modern/src/reports/RouteReportPage.js')
-rw-r--r--modern/src/reports/RouteReportPage.js16
1 files changed, 3 insertions, 13 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js
index aefd0c6e..67eb4962 100644
--- a/modern/src/reports/RouteReportPage.js
+++ b/modern/src/reports/RouteReportPage.js
@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import {
- FormControl, InputLabel, MenuItem, Select, Table, TableBody, TableCell, TableContainer, TableHead, TableRow,
+ Table, TableBody, TableCell, TableContainer, TableHead, TableRow,
} from '@material-ui/core';
-import ReportFilter, { useFilterStyles } from './components/ReportFilter';
+import ReportFilter from './components/ReportFilter';
import { useTranslation } from '../common/components/LocalizationProvider';
import PageLayout from '../common/components/PageLayout';
import ReportsMenu from './components/ReportsMenu';
@@ -21,7 +21,6 @@ const columnsArray = [
const columnsMap = new Map(columnsArray);
const RouteReportPage = () => {
- const classes = useFilterStyles();
const t = useTranslation();
const [columns, setColumns] = usePersistedState('routeColumns', ['fixTime', 'latitude', 'longitude', 'speed', 'address']);
@@ -47,16 +46,7 @@ const RouteReportPage = () => {
return (
<PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'reportRoute']}>
<ReportFilter handleSubmit={handleSubmit}>
- <div className={classes.item}>
- <FormControl variant="filled" fullWidth>
- <InputLabel>{t('sharedColumns')}</InputLabel>
- <Select value={columns} onChange={(e) => setColumns(e.target.value)} renderValue={(it) => it.length} multiple>
- {columnsArray.map(([key, string]) => (
- <MenuItem value={key}>{t(string)}</MenuItem>
- ))}
- </Select>
- </FormControl>
- </div>
+ <ColumnSelect columns={columns} setColumns={setColumns} columnsArray={columnsArray} />
</ReportFilter>
<TableContainer>
<Table>