diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-03-16 15:45:54 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-03-16 15:45:54 +0530 |
commit | 1a8ce85b311b3e80aba5df573259e119ae18fa0c (patch) | |
tree | 23f8842bc76a596fdad3146ede5a1034a47266a7 /modern/src | |
parent | 8de3b938369ea1e9437b4345d83a50e974f8a606 (diff) | |
download | trackermap-web-1a8ce85b311b3e80aba5df573259e119ae18fa0c.tar.gz trackermap-web-1a8ce85b311b3e80aba5df573259e119ae18fa0c.tar.bz2 trackermap-web-1a8ce85b311b3e80aba5df573259e119ae18fa0c.zip |
Minor code improvements
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/common/style.js | 1 | ||||
-rw-r--r-- | modern/src/reports/RouteReportPage.js | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/modern/src/common/style.js b/modern/src/common/style.js new file mode 100644 index 00000000..fa2e41ef --- /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 ff4a0033..3b9e15cc 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 ( <ReportLayoutPage filter={<Filter setItems={setItems} />}> - <DataGrid rows={items} columns={columns} pageSize={25}/> + <DataGrid rows={items} columns={columns} hideFooter/> </ReportLayoutPage> ); }; |