aboutsummaryrefslogtreecommitdiff
path: root/modern/src
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
parent1a8ce85b311b3e80aba5df573259e119ae18fa0c (diff)
downloadetbsa-traccar-web-fac4b2c8679f459a184c41eeee18f81edbd1ee77.tar.gz
etbsa-traccar-web-fac4b2c8679f459a184c41eeee18f81edbd1ee77.tar.bz2
etbsa-traccar-web-fac4b2c8679f459a184c41eeee18f81edbd1ee77.zip
removing hardcoded width value
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/common/style.js1
-rw-r--r--modern/src/reports/RouteReportPage.js21
2 files changed, 12 insertions, 10 deletions
diff --git a/modern/src/common/style.js b/modern/src/common/style.js
deleted file mode 100644
index fa2e41e..0000000
--- a/modern/src/common/style.js
+++ /dev/null
@@ -1 +0,0 @@
-export const columnWidthNormal = 100; \ No newline at end of file
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js
index 3b9e15c..48a1373 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>
);
};