aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/components
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-15 15:47:03 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-15 15:47:03 -0700
commit2a7d1a41dc897018a2bf17d3ca9f85cfb66bbb5f (patch)
tree664edf952e35084ec3f8f3be99011d2ac836d1fa /modern/src/reports/components
parent3d3b8096392f074baa7178d2a026525503657d50 (diff)
downloadtrackermap-web-2a7d1a41dc897018a2bf17d3ca9f85cfb66bbb5f.tar.gz
trackermap-web-2a7d1a41dc897018a2bf17d3ca9f85cfb66bbb5f.tar.bz2
trackermap-web-2a7d1a41dc897018a2bf17d3ca9f85cfb66bbb5f.zip
Add missing position values
Diffstat (limited to 'modern/src/reports/components')
-rw-r--r--modern/src/reports/components/ColumnSelect.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/modern/src/reports/components/ColumnSelect.js b/modern/src/reports/components/ColumnSelect.js
index 991f21e7..d7306c58 100644
--- a/modern/src/reports/components/ColumnSelect.js
+++ b/modern/src/reports/components/ColumnSelect.js
@@ -5,7 +5,9 @@ import {
import { useTranslation } from '../../common/components/LocalizationProvider';
import { useFilterStyles } from './ReportFilter';
-const ColumnSelect = ({ columns, setColumns, columnsArray }) => {
+const ColumnSelect = ({
+ columns, setColumns, columnsArray, columnsObject,
+}) => {
const classes = useFilterStyles();
const t = useTranslation();
@@ -19,9 +21,13 @@ const ColumnSelect = ({ columns, setColumns, columnsArray }) => {
renderValue={(it) => it.length}
multiple
>
- {columnsArray.map(([key, string]) => (
- <MenuItem value={key}>{t(string)}</MenuItem>
- ))}
+ {columnsArray
+ ? columnsArray.map(([key, string]) => (
+ <MenuItem key={key} value={key}>{t(string)}</MenuItem>
+ ))
+ : Object.keys(columnsObject).map((key) => (
+ <MenuItem key={key} value={key}>{columnsObject[key].name}</MenuItem>
+ ))}
</Select>
</FormControl>
</div>