From 71892bfca5c4c7fe6d691aaf84baaae54c335939 Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Sat, 31 Oct 2020 16:32:54 +0530 Subject: Changed code style from double quotes to single quotes --- modern/src/reports/EventReportPage.js | 32 +++++++------- modern/src/reports/ReportFilter.js | 78 +++++++++++++++++------------------ 2 files changed, 55 insertions(+), 55 deletions(-) (limited to 'modern/src/reports') diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index acd6f637..0a451c13 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -1,5 +1,5 @@ -import React, { useState } from "react"; -import MainToolbar from "../MainToolbar"; +import React, { useState } from 'react'; +import MainToolbar from '../MainToolbar'; import { Grid, TableContainer, @@ -10,20 +10,20 @@ import { TableBody, Paper, makeStyles, -} from "@material-ui/core"; -import t from "../common/localization"; -import { formatPosition } from "../common/formatter"; -import ReportFilter from "./ReportFilter"; +} from '@material-ui/core'; +import t from '../common/localization'; +import { formatPosition } from '../common/formatter'; +import ReportFilter from './ReportFilter'; const useStyles = makeStyles((theme) => ({ root: { - height: "100%", - display: "flex", - flexDirection: "column", + height: '100%', + display: 'flex', + flexDirection: 'column', }, content: { flex: 1, - overflow: "auto", + overflow: 'auto', padding: theme.spacing(2), }, form: { @@ -42,7 +42,7 @@ const EventReportPage = () => { to: to.toISOString(), }); fetch(`/api/reports/events?${query.toString()}`, { - headers: { Accept: "application/json" }, + headers: { Accept: 'application/json' }, }).then((response) => { if (response.ok) { response.json().then(setData); @@ -65,17 +65,17 @@ const EventReportPage = () => { - {t("positionFixTime")} - {t("sharedType")} - {t("sharedGeofence")} - {t("sharedMaintenance")} + {t('positionFixTime')} + {t('sharedType')} + {t('sharedGeofence')} + {t('sharedMaintenance')} {data.map((item) => ( - {formatPosition(item, "serverTime")} + {formatPosition(item, 'serverTime')} {item.type} {} diff --git a/modern/src/reports/ReportFilter.js b/modern/src/reports/ReportFilter.js index 91fc9fa0..55f73e36 100644 --- a/modern/src/reports/ReportFilter.js +++ b/modern/src/reports/ReportFilter.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useState } from 'react'; import { FormControl, InputLabel, @@ -6,44 +6,44 @@ import { MenuItem, Button, TextField, -} from "@material-ui/core"; -import t from "../common/localization"; -import { useSelector } from "react-redux"; -import moment from "moment"; +} from '@material-ui/core'; +import t from '../common/localization'; +import { useSelector } from 'react-redux'; +import moment from 'moment'; const ReportFilter = (props) => { const devices = useSelector((state) => Object.values(state.devices.items)); const [deviceId, setDeviceId] = useState(); - const [period, setPeriod] = useState("today"); - const [from, setFrom] = useState(moment().subtract(1, "hour")); + const [period, setPeriod] = useState('today'); + const [from, setFrom] = useState(moment().subtract(1, 'hour')); const [to, setTo] = useState(moment()); const handleShow = () => { let selectedFrom; let selectedTo; switch (period) { - case "today": - selectedFrom = moment().startOf("day"); - selectedTo = moment().endOf("day"); + case 'today': + selectedFrom = moment().startOf('day'); + selectedTo = moment().endOf('day'); break; - case "yesterday": - selectedFrom = moment().subtract(1, "day").startOf("day"); - selectedTo = moment().subtract(1, "day").endOf("day"); + case 'yesterday': + selectedFrom = moment().subtract(1, 'day').startOf('day'); + selectedTo = moment().subtract(1, 'day').endOf('day'); break; - case "thisWeek": - selectedFrom = moment().startOf("week"); - selectedTo = moment().endOf("week"); + case 'thisWeek': + selectedFrom = moment().startOf('week'); + selectedTo = moment().endOf('week'); break; - case "previousWeek": - selectedFrom = moment().subtract(1, "week").startOf("week"); - selectedTo = moment().subtract(1, "week").endOf("week"); + case 'previousWeek': + selectedFrom = moment().subtract(1, 'week').startOf('week'); + selectedTo = moment().subtract(1, 'week').endOf('week'); break; - case "thisMonth": - selectedFrom = moment().startOf("month"); - selectedTo = moment().endOf("month"); + case 'thisMonth': + selectedFrom = moment().startOf('month'); + selectedTo = moment().endOf('month'); break; - case "previousMonth": - selectedFrom = moment().subtract(1, "month").startOf("month"); - selectedTo = moment().subtract(1, "month").endOf("month"); + case 'previousMonth': + selectedFrom = moment().subtract(1, 'month').startOf('month'); + selectedTo = moment().subtract(1, 'month').endOf('month'); break; default: selectedFrom = from; @@ -56,7 +56,7 @@ const ReportFilter = (props) => { return ( <> - {t("reportDevice")} + {t('reportDevice')} - {t("reportPeriod")} + {t('reportPeriod')} - {period === "custom" && ( + {period === 'custom' && ( @@ -88,11 +88,11 @@ const ReportFilter = (props) => { fullWidth /> )} - {period === "custom" && ( + {period === 'custom' && ( @@ -109,7 +109,7 @@ const ReportFilter = (props) => { disabled={!deviceId} onClick={handleShow} > - {t("reportShow")} + {t('reportShow')} -- cgit v1.2.3