aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports
diff options
context:
space:
mode:
authorMatjaž Črnko <matjaz.crnko@gmail.com>2024-03-08 10:59:29 +0100
committerGitHub <noreply@github.com>2024-03-08 10:59:29 +0100
commitfe7b4800224352c628fb925c85a937684af58e6f (patch)
treed5a111f5cedbba4a10278695227447ee12113db0 /modern/src/reports
parentb87f2387ae597e57d9e2591ab01595e76b65d7c5 (diff)
parentc9da10062998a231c038cd3a519f72128fcea2bb (diff)
downloadtrackermap-web-fe7b4800224352c628fb925c85a937684af58e6f.tar.gz
trackermap-web-fe7b4800224352c628fb925c85a937684af58e6f.tar.bz2
trackermap-web-fe7b4800224352c628fb925c85a937684af58e6f.zip
Merge branch 'traccar:master' into autocomplete-instead-of-single-select
Diffstat (limited to 'modern/src/reports')
-rw-r--r--modern/src/reports/EventReportPage.jsx4
-rw-r--r--modern/src/reports/LogsPage.jsx4
-rw-r--r--modern/src/reports/StopReportPage.jsx6
-rw-r--r--modern/src/reports/SummaryReportPage.jsx4
-rw-r--r--modern/src/reports/TripReportPage.jsx4
5 files changed, 11 insertions, 11 deletions
diff --git a/modern/src/reports/EventReportPage.jsx b/modern/src/reports/EventReportPage.jsx
index 10b539ab..5ffc8ac3 100644
--- a/modern/src/reports/EventReportPage.jsx
+++ b/modern/src/reports/EventReportPage.jsx
@@ -204,7 +204,7 @@ const EventReportPage = () => {
{!loading ? items.map((item) => (
<TableRow key={item.id}>
<TableCell className={classes.columnAction} padding="none">
- {item.positionId ? selectedItem === item ? (
+ {(item.positionId && (selectedItem === item ? (
<IconButton size="small" onClick={() => setSelectedItem(null)}>
<GpsFixedIcon fontSize="small" />
</IconButton>
@@ -212,7 +212,7 @@ const EventReportPage = () => {
<IconButton size="small" onClick={() => setSelectedItem(item)}>
<LocationSearchingIcon fontSize="small" />
</IconButton>
- ) : ''}
+ ))) || ''}
</TableCell>
{columns.map((key) => (
<TableCell key={key}>
diff --git a/modern/src/reports/LogsPage.jsx b/modern/src/reports/LogsPage.jsx
index 4b689944..7bdbd309 100644
--- a/modern/src/reports/LogsPage.jsx
+++ b/modern/src/reports/LogsPage.jsx
@@ -41,7 +41,7 @@ const LogsPage = () => {
const registerDevice = (uniqueId) => {
const query = new URLSearchParams({ uniqueId });
navigate(`/settings/device?${query.toString()}`);
- }
+ };
return (
<PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'statisticsTitle']}>
@@ -55,7 +55,7 @@ const LogsPage = () => {
</TableRow>
</TableHead>
<TableBody>
- {items.map((item, index) => (
+ {items.map((item, index) => /* eslint-disable react/no-array-index-key */ (
<TableRow key={index}>
<TableCell className={classes.columnAction} padding="none">
{item.deviceId ? (
diff --git a/modern/src/reports/StopReportPage.jsx b/modern/src/reports/StopReportPage.jsx
index 3a6ee18d..066b29a4 100644
--- a/modern/src/reports/StopReportPage.jsx
+++ b/modern/src/reports/StopReportPage.jsx
@@ -7,7 +7,7 @@ import {
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
import LocationSearchingIcon from '@mui/icons-material/LocationSearching';
import {
- formatDistance, formatHours, formatVolume, formatTime,
+ formatDistance, formatVolume, formatTime, formatNumericHours,
} from '../common/util/formatter';
import ReportFilter from './components/ReportFilter';
import { useAttributePreference, usePreference } from '../common/util/preferences';
@@ -95,9 +95,9 @@ const StopReportPage = () => {
case 'startOdometer':
return formatDistance(item[key], distanceUnit, t);
case 'duration':
- return formatHours(item[key]);
+ return formatNumericHours(item[key], t);
case 'engineHours':
- return formatHours(item[key]);
+ return formatNumericHours(item[key], t);
case 'spentFuel':
return formatVolume(item[key], volumeUnit, t);
case 'address':
diff --git a/modern/src/reports/SummaryReportPage.jsx b/modern/src/reports/SummaryReportPage.jsx
index ec5395f1..ae7e043e 100644
--- a/modern/src/reports/SummaryReportPage.jsx
+++ b/modern/src/reports/SummaryReportPage.jsx
@@ -5,7 +5,7 @@ import {
FormControl, InputLabel, Select, MenuItem, Table, TableHead, TableRow, TableBody, TableCell,
} from '@mui/material';
import {
- formatDistance, formatHours, formatSpeed, formatVolume, formatTime,
+ formatDistance, formatSpeed, formatVolume, formatTime, formatNumericHours,
} from '../common/util/formatter';
import ReportFilter from './components/ReportFilter';
import { useAttributePreference, usePreference } from '../common/util/preferences';
@@ -101,7 +101,7 @@ const SummaryReportPage = () => {
case 'maxSpeed':
return formatSpeed(item[key], speedUnit, t);
case 'engineHours':
- return formatHours(item[key]);
+ return formatNumericHours(item[key], t);
case 'spentFuel':
return formatVolume(item[key], volumeUnit, t);
default:
diff --git a/modern/src/reports/TripReportPage.jsx b/modern/src/reports/TripReportPage.jsx
index f5b524ad..897ee506 100644
--- a/modern/src/reports/TripReportPage.jsx
+++ b/modern/src/reports/TripReportPage.jsx
@@ -6,7 +6,7 @@ import {
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
import LocationSearchingIcon from '@mui/icons-material/LocationSearching';
import {
- formatDistance, formatSpeed, formatHours, formatVolume, formatTime,
+ formatDistance, formatSpeed, formatVolume, formatTime, formatNumericHours,
} from '../common/util/formatter';
import ReportFilter from './components/ReportFilter';
import { useAttributePreference, usePreference } from '../common/util/preferences';
@@ -142,7 +142,7 @@ const TripReportPage = () => {
case 'maxSpeed':
return formatSpeed(item[key], speedUnit, t);
case 'duration':
- return formatHours(item[key]);
+ return formatNumericHours(item[key], t);
case 'spentFuel':
return formatVolume(item[key], volumeUnit, t);
case 'startAddress':