aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-14 18:58:53 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-14 18:58:53 -0700
commit934900a67daa1c6a7782104cd27ed92b29d15fb5 (patch)
tree23df3043e7d23cc18b7ddeae7a212bcfdbc6ed8e /modern
parent82eb354605d10275f33436c89f18384f00463c5d (diff)
downloadtrackermap-web-934900a67daa1c6a7782104cd27ed92b29d15fb5.tar.gz
trackermap-web-934900a67daa1c6a7782104cd27ed92b29d15fb5.tar.bz2
trackermap-web-934900a67daa1c6a7782104cd27ed92b29d15fb5.zip
Event type selection logic
Diffstat (limited to 'modern')
-rw-r--r--modern/src/reports/EventReportPage.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js
index a0293978..92d04375 100644
--- a/modern/src/reports/EventReportPage.js
+++ b/modern/src/reports/EventReportPage.js
@@ -65,7 +65,15 @@ const Filter = ({ setItems }) => {
<InputLabel>{t('reportEventTypes')}</InputLabel>
<Select
value={eventTypes}
- onChange={(e) => setEventTypes(e.target.value)}
+ onChange={(event, child) => {
+ let values = event.target.value;
+ const clicked = child.props.value;
+ console.log(`${values} ${clicked}`)
+ if (values.includes('allEvents') && values.length > 1) {
+ values = [clicked];
+ }
+ setEventTypes(values);
+ }}
renderValue={(it) => (it.length > 1 ? it.length : it.length > 0 ? t(typesMap.get(it[0])) : it)}
multiple
>