From 1a8ce85b311b3e80aba5df573259e119ae18fa0c Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Tue, 16 Mar 2021 15:45:54 +0530 Subject: Minor code improvements --- modern/src/common/style.js | 1 + modern/src/reports/RouteReportPage.js | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 modern/src/common/style.js diff --git a/modern/src/common/style.js b/modern/src/common/style.js new file mode 100644 index 0000000..fa2e41e --- /dev/null +++ b/modern/src/common/style.js @@ -0,0 +1 @@ +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 ff4a003..3b9e15c 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -5,6 +5,7 @@ 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 }) => { @@ -33,44 +34,44 @@ const RouteReportPage = () => { { headerName: t('positionFixTime'), field: 'fixTime', - width: 200, + width: columnWidthNormal * 2, valueFormatter: params => formatPosition(params.value, 'fixTime'), }, { headerName: t('positionLatitude'), field: 'latitude', - width: 130, + width: columnWidthNormal, valueFormatter: params => formatPosition(params.value, 'latitude'), }, { headerName: t('positionLongitude'), field: 'longitude', - width: 130, + width: columnWidthNormal, valueFormatter: params => formatPosition(params.value, 'longitude'), }, { headerName: t('positionSpeed'), field: 'speed', - width: 130, + width: columnWidthNormal, valueFormatter: params => formatPosition(params.value, 'speed'), }, { headerName: t('positionAddress'), field: 'address', - width: 130, + width: columnWidthNormal, valueFormatter: params => formatPosition(params.value, 'address'), }, { headerName: t('positionIgnition'), field: 'ignition', - width: 130, + width: columnWidthNormal, valueFormatter: params => params.getValue('attributes').ignition ? 'Yes' : 'No', }, { headerName: t('deviceTotalDistance'), hide: true, field: 'totalDistance', - width: 160, + width: columnWidthNormal, valueFormatter: params => formatDistance(params.getValue('attributes').totalDistance, distanceUnit), }, ] @@ -79,7 +80,7 @@ const RouteReportPage = () => { return ( }> - + ); }; -- cgit v1.2.3