Skip to content

Commit

Permalink
Revert "Merge pull request #1249 from jcardus/speed-based-color"
Browse files Browse the repository at this point in the history
This reverts commit f18c48d, reversing
changes made to fe058f5.
  • Loading branch information
tananaev committed Jun 28, 2024
1 parent f18c48d commit 942723e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
20 changes: 1 addition & 19 deletions src/reports/ChartReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const ChartReportPage = () => {
const [items, setItems] = useState([]);
const [types, setTypes] = useState(['speed']);
const [type, setType] = useState('speed');
const [timeType, setTimeType] = useState('fixTime');

const values = items.map((it) => it[type]);
const minValue = Math.min(...values);
Expand All @@ -53,8 +52,6 @@ const ChartReportPage = () => {
const data = { ...position, ...position.attributes };
const formatted = {};
formatted.fixTime = dayjs(position.fixTime).valueOf();
formatted.deviceTime = dayjs(position.deviceTime).valueOf();
formatted.serverTime = dayjs(position.serverTime).valueOf();
Object.keys(data).filter((key) => !['id', 'deviceId'].includes(key)).forEach((key) => {
const value = data[key];
if (typeof value === 'number') {
Expand Down Expand Up @@ -115,21 +112,6 @@ const ChartReportPage = () => {
</Select>
</FormControl>
</div>
<div className={classes.filterItem}>
<FormControl fullWidth>
<InputLabel>{t('reportTimeType')}</InputLabel>
<Select
label={t('reportTimeType')}
value={timeType}
onChange={(e) => setTimeType(e.target.value)}
disabled={!items.length}
>
<MenuItem value="fixTime">{t('positionFixTime')}</MenuItem>
<MenuItem value="deviceTime">{t('positionDeviceTime')}</MenuItem>
<MenuItem value="serverTime">{t('positionServerTime')}</MenuItem>
</Select>
</FormControl>
</div>
</ReportFilter>
{items.length > 0 && (
<div className={classes.chart}>
Expand All @@ -141,7 +123,7 @@ const ChartReportPage = () => {
}}
>
<XAxis
dataKey={timeType}
dataKey="fixTime"
type="number"
tickFormatter={(value) => formatTime(value, 'time')}
domain={['dataMin', 'dataMax']}
Expand Down
4 changes: 1 addition & 3 deletions src/reports/components/ReportFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import SplitButton from '../../common/components/SplitButton';
import SelectField from '../../common/components/SelectField';
import { useRestriction } from '../../common/util/permissions';

const ReportFilter = ({
children, handleSubmit, handleSchedule, showOnly, ignoreDevice, multiDevice, includeGroups, loading,
}) => {
const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignoreDevice, multiDevice, includeGroups, loading }) => {

Check warning on line 14 in src/reports/components/ReportFilter.jsx

View workflow job for this annotation

GitHub Actions / build

Expected a line break after this opening brace

Check warning on line 14 in src/reports/components/ReportFilter.jsx

View workflow job for this annotation

GitHub Actions / build

Expected a line break before this closing brace
const classes = useReportStyles();
const dispatch = useDispatch();
const t = useTranslation();
Expand Down
1 change: 0 additions & 1 deletion src/resources/l10n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@
"reportSpentFuel": "Spent Fuel",
"reportStartOdometer": "Odometer Start",
"reportEndOdometer": "Odometer End",
"reportTimeType": "Time",
"statisticsTitle": "Statistics",
"statisticsCaptureTime": "Capture Time",
"statisticsActiveUsers": "Active Users",
Expand Down

0 comments on commit 942723e

Please sign in to comment.