aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-08-28 10:13:14 -0700
committerAnton Tananaev <anton@traccar.org>2022-08-28 10:13:14 -0700
commit8135f8a72d8fe4521e989356431f9a86c4139ed7 (patch)
tree2b9c9867e7c4c49297aa09229fe5c63146649529 /modern/src/reports
parentec740a9802939662ecce049f82b33896b0d3b3a6 (diff)
downloadtrackermap-web-8135f8a72d8fe4521e989356431f9a86c4139ed7.tar.gz
trackermap-web-8135f8a72d8fe4521e989356431f9a86c4139ed7.tar.bz2
trackermap-web-8135f8a72d8fe4521e989356431f9a86c4139ed7.zip
Sort devices by name (fix #1018)
Diffstat (limited to 'modern/src/reports')
-rw-r--r--modern/src/reports/components/ReportFilter.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/reports/components/ReportFilter.js b/modern/src/reports/components/ReportFilter.js
index d223b086..75c9d43d 100644
--- a/modern/src/reports/components/ReportFilter.js
+++ b/modern/src/reports/components/ReportFilter.js
@@ -80,7 +80,7 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev
onChange={(e) => (multiDevice ? setDeviceIds(e.target.value) : setDeviceId(e.target.value))}
multiple={multiDevice}
>
- {Object.values(devices).map((device) => (
+ {Object.values(devices).sort((a, b) => a.name.localeCompare(b.name)).map((device) => (
<MenuItem key={device.id} value={device.id}>{device.name}</MenuItem>
))}
</Select>
@@ -97,7 +97,7 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev
onChange={(e) => setGroupIds(e.target.value)}
multiple
>
- {Object.values(groups).map((group) => (
+ {Object.values(groups).sort((a, b) => a.name.localeCompare(b.name)).map((group) => (
<MenuItem key={group.id} value={group.id}>{group.name}</MenuItem>
))}
</Select>