aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/RouteReportPage.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-03-17 14:41:21 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-03-17 14:41:21 +0530
commitfac4b2c8679f459a184c41eeee18f81edbd1ee77 (patch)
tree29c6b4e5d5983d5b61d39df8e8e5b6f3f7432771 /modern/src/reports/RouteReportPage.js
parent1a8ce85b311b3e80aba5df573259e119ae18fa0c (diff)
downloadtrackermap-web-fac4b2c8679f459a184c41eeee18f81edbd1ee77.tar.gz
trackermap-web-fac4b2c8679f459a184c41eeee18f81edbd1ee77.tar.bz2
trackermap-web-fac4b2c8679f459a184c41eeee18f81edbd1ee77.zip
removing hardcoded width value
Diffstat (limited to 'modern/src/reports/RouteReportPage.js')
-rw-r--r--modern/src/reports/RouteReportPage.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js
index 3b9e15cc..48a13737 100644
--- a/modern/src/reports/RouteReportPage.js
+++ b/modern/src/reports/RouteReportPage.js
@@ -5,7 +5,6 @@ import { formatPosition, formatDistance } from '../common/formatter';
import ReportFilter from './ReportFilter';
import ReportLayoutPage from './ReportLayoutPage';
import { useAttributePreference } from '../common/preferences';
-import { columnWidthNormal } from '../common/style';
const Filter = ({ setItems }) => {
@@ -34,44 +33,44 @@ const RouteReportPage = () => {
{
headerName: t('positionFixTime'),
field: 'fixTime',
- width: columnWidthNormal * 2,
+ flex: 1,
valueFormatter: params => formatPosition(params.value, 'fixTime'),
},
{
headerName: t('positionLatitude'),
field: 'latitude',
- width: columnWidthNormal,
+ flex: 1,
valueFormatter: params => formatPosition(params.value, 'latitude'),
},
{
headerName: t('positionLongitude'),
field: 'longitude',
- width: columnWidthNormal,
+ flex: 1,
valueFormatter: params => formatPosition(params.value, 'longitude'),
},
{
headerName: t('positionSpeed'),
field: 'speed',
- width: columnWidthNormal,
+ flex: 1,
valueFormatter: params => formatPosition(params.value, 'speed'),
},
{
headerName: t('positionAddress'),
field: 'address',
- width: columnWidthNormal,
+ flex: 1,
valueFormatter: params => formatPosition(params.value, 'address'),
},
{
headerName: t('positionIgnition'),
field: 'ignition',
- width: columnWidthNormal,
+ flex: 1,
valueFormatter: params => params.getValue('attributes').ignition ? 'Yes' : 'No',
},
{
headerName: t('deviceTotalDistance'),
hide: true,
field: 'totalDistance',
- width: columnWidthNormal,
+ flex: 1,
valueFormatter: params => formatDistance(params.getValue('attributes').totalDistance, distanceUnit),
},
]
@@ -80,7 +79,11 @@ const RouteReportPage = () => {
return (
<ReportLayoutPage filter={<Filter setItems={setItems} />}>
- <DataGrid rows={items} columns={columns} hideFooter/>
+ <DataGrid
+ rows={items}
+ columns={columns}
+ hideFooter
+ autoHeight/>
</ReportLayoutPage>
);
};