diff options
author | Matjaž Črnko <m.crnko@txt.si> | 2024-03-08 11:10:49 +0100 |
---|---|---|
committer | Matjaž Črnko <m.crnko@txt.si> | 2024-03-08 11:10:49 +0100 |
commit | 3229441f4b254eb13266486ff5b29e3dd952357b (patch) | |
tree | 4af16db91131f2c1e1b715b054bb58df12960943 /modern/src | |
parent | fe7b4800224352c628fb925c85a937684af58e6f (diff) | |
download | trackermap-web-3229441f4b254eb13266486ff5b29e3dd952357b.tar.gz trackermap-web-3229441f4b254eb13266486ff5b29e3dd952357b.tar.bz2 trackermap-web-3229441f4b254eb13266486ff5b29e3dd952357b.zip |
fix: Linting.
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/common/components/SelectField.jsx | 10 | ||||
-rw-r--r-- | modern/src/reports/components/ReportFilter.jsx | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/modern/src/common/components/SelectField.jsx b/modern/src/common/components/SelectField.jsx index c7efe75f..db8c30b0 100644 --- a/modern/src/common/components/SelectField.jsx +++ b/modern/src/common/components/SelectField.jsx @@ -1,5 +1,5 @@ import { - FormControl, InputLabel, MenuItem, Select, Autocomplete, TextField + FormControl, InputLabel, MenuItem, Select, Autocomplete, TextField, } from '@mui/material'; import React, { useState } from 'react'; import { useEffectAsync } from '../../reactHelper'; @@ -21,10 +21,10 @@ const SelectField = ({ const getOptionLabel = (option) => { if (typeof option !== 'object') { - option = items.find(obj => keyGetter(obj) === option); + option = items.find((obj) => keyGetter(obj) === option); } return option ? titleGetter(option) : emptyTitle; - } + }; useEffectAsync(async () => { if (endpoint) { @@ -62,9 +62,9 @@ const SelectField = ({ renderOption={(props, option) => ( <MenuItem {...props} key={keyGetter(option)} value={keyGetter(option)}>{titleGetter(option)}</MenuItem> )} - isOptionEqualToValue={(option, value) => keyGetter(option) == value} + isOptionEqualToValue={(option, value) => keyGetter(option) === value} value={value} - onChange={(_, value) => onChange({ target: { value: value ? keyGetter(value) : emptyValue }})} + onChange={(_, value) => onChange({ target: { value: value ? keyGetter(value) : emptyValue } })} renderInput={(params) => <TextField {...params} label={label} />} /> )} diff --git a/modern/src/reports/components/ReportFilter.jsx b/modern/src/reports/components/ReportFilter.jsx index 5b4c5786..e6e08f16 100644 --- a/modern/src/reports/components/ReportFilter.jsx +++ b/modern/src/reports/components/ReportFilter.jsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { - FormControl, InputLabel, Select, MenuItem, Button, TextField, Typography, Autocomplete + FormControl, InputLabel, Select, MenuItem, Button, TextField, Typography, } from '@mui/material'; import { useDispatch, useSelector } from 'react-redux'; import dayjs from 'dayjs'; @@ -92,7 +92,7 @@ const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignore <div className={classes.filter}> {!ignoreDevice && ( <div className={classes.filterItem}> - <SelectField + <SelectField label={t(multiDevice ? 'deviceTitle' : 'reportDevice')} data={Object.values(devices).sort((a, b) => a.name.localeCompare(b.name))} value={multiDevice ? deviceIds : deviceId} @@ -104,13 +104,13 @@ const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignore )} {includeGroups && ( <div className={classes.filterItem}> - <SelectField + <SelectField label={t('settingsGroups')} data={Object.values(groups).sort((a, b) => a.name.localeCompare(b.name))} value={groupIds} onChange={(e) => dispatch(reportsActions.updateGroupIds(e.target.value))} multiple - fullWidth + fullWidth /> </div> )} |