diff options
author | Boubrid Ihab <boubrid.ihab@gmail.com> | 2022-05-23 23:13:20 +0100 |
---|---|---|
committer | Boubrid Ihab <boubrid.ihab@gmail.com> | 2022-05-23 23:13:20 +0100 |
commit | 3f842a3691419c5d18504960408085b8e5a52bd7 (patch) | |
tree | 0b87afa3d415005f0088333f534a054626997be3 /modern/src/reports | |
parent | 979b2d999320ab918d02020980a1e244cb356b74 (diff) | |
download | trackermap-web-3f842a3691419c5d18504960408085b8e5a52bd7.tar.gz trackermap-web-3f842a3691419c5d18504960408085b8e5a52bd7.tar.bz2 trackermap-web-3f842a3691419c5d18504960408085b8e5a52bd7.zip |
fix: remove generateKey function and make it inline
Diffstat (limited to 'modern/src/reports')
-rw-r--r-- | modern/src/reports/SummaryReportPage.js | 4 | ||||
-rw-r--r-- | modern/src/reports/TripReportPage.js | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/modern/src/reports/SummaryReportPage.js b/modern/src/reports/SummaryReportPage.js index b428ecf0..49fc7bb1 100644 --- a/modern/src/reports/SummaryReportPage.js +++ b/modern/src/reports/SummaryReportPage.js @@ -77,8 +77,6 @@ const SummaryReportPage = () => { } }; - const generateKey = (item) => (`${item.deviceId}_${Date.parse(item.startTime)}`); - return ( <PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'reportSummary']}> <ReportFilter handleSubmit={handleSubmit}> @@ -102,7 +100,7 @@ const SummaryReportPage = () => { </TableHead> <TableBody> {items.map((item) => ( - <TableRow key={generateKey(item)}> + <TableRow key={(`${item.deviceId}_${Date.parse(item.startTime)}`)}> {columns.map((key) => ( <TableCell key={key}> {formatValue(item, key)} diff --git a/modern/src/reports/TripReportPage.js b/modern/src/reports/TripReportPage.js index 37ba2e96..773e7510 100644 --- a/modern/src/reports/TripReportPage.js +++ b/modern/src/reports/TripReportPage.js @@ -79,6 +79,7 @@ const TripReportPage = () => { return item[key]; } }; + return ( <PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'reportTrips']}> <ReportFilter handleSubmit={handleSubmit}> |