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/App.js | 34 +++++----- modern/src/MainToolbar.js | 116 +++++++++++++++++----------------- modern/src/reports/EventReportPage.js | 32 +++++----- modern/src/reports/ReportFilter.js | 78 +++++++++++------------ 4 files changed, 130 insertions(+), 130 deletions(-) diff --git a/modern/src/App.js b/modern/src/App.js index a173a500..edfaa55b 100644 --- a/modern/src/App.js +++ b/modern/src/App.js @@ -1,20 +1,20 @@ -import React from "react"; -import { Switch, Route } from "react-router-dom"; -import CssBaseline from "@material-ui/core/CssBaseline"; -import MainPage from "./MainPage"; -import LoginPage from "./LoginPage"; -import RouteReportPage from "./reports/RouteReportPage"; -import EventReportPage from "./reports/EventReportPage"; -import ServerPage from "./admin/ServerPage"; -import UsersPage from "./admin/UsersPage"; -import DevicePage from "./DevicePage"; -import UserPage from "./UserPage"; -import SocketController from "./SocketController"; -import NotificationsPage from "./settings/NotificationsPage"; -import NotificationPage from "./settings/NotificationPage"; -import GroupsPage from "./settings/GroupsPage"; -import GroupPage from "./settings/GroupPage"; -import PositionPage from "./PositionPage"; +import React from 'react'; +import { Switch, Route } from 'react-router-dom'; +import CssBaseline from '@material-ui/core/CssBaseline'; +import MainPage from './MainPage'; +import LoginPage from './LoginPage'; +import RouteReportPage from './reports/RouteReportPage'; +import ServerPage from './admin/ServerPage'; +import UsersPage from './admin/UsersPage'; +import DevicePage from './DevicePage'; +import UserPage from './UserPage'; +import SocketController from './SocketController'; +import NotificationsPage from './settings/NotificationsPage'; +import NotificationPage from './settings/NotificationPage'; +import GroupsPage from './settings/GroupsPage'; +import GroupPage from './settings/GroupPage'; +import PositionPage from './PositionPage'; +import EventReportPage from './reports/EventReportPage'; const App = () => { return ( diff --git a/modern/src/MainToolbar.js b/modern/src/MainToolbar.js index 46d46496..7cca74ff 100644 --- a/modern/src/MainToolbar.js +++ b/modern/src/MainToolbar.js @@ -1,35 +1,35 @@ -import React, { useState } from "react"; -import { useHistory } from "react-router-dom"; -import { makeStyles } from "@material-ui/core/styles"; -import { useDispatch, useSelector } from "react-redux"; -import { sessionActions } from "./store"; -import AppBar from "@material-ui/core/AppBar"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; -import Button from "@material-ui/core/Button"; -import IconButton from "@material-ui/core/IconButton"; -import MenuIcon from "@material-ui/icons/Menu"; -import Drawer from "@material-ui/core/Drawer"; -import List from "@material-ui/core/List"; -import ListSubheader from "@material-ui/core/ListSubheader"; -import Divider from "@material-ui/core/Divider"; -import ListItem from "@material-ui/core/ListItem"; -import ListItemIcon from "@material-ui/core/ListItemIcon"; -import ListItemText from "@material-ui/core/ListItemText"; -import MapIcon from "@material-ui/icons/Map"; -import BarChartIcon from "@material-ui/icons/BarChart"; -import PeopleIcon from "@material-ui/icons/People"; -import StorageIcon from "@material-ui/icons/Storage"; -import PersonIcon from "@material-ui/icons/Person"; -import NotificationsIcon from "@material-ui/icons/Notifications"; -import TimelineIcon from "@material-ui/icons/Timeline"; -import PauseCircleFilledIcon from "@material-ui/icons/PauseCircleFilled"; -import PlayCircleFilledIcon from "@material-ui/icons/PlayCircleFilled"; -import NotificationsActiveIcon from "@material-ui/icons/NotificationsActive"; -import FormatListBulletedIcon from "@material-ui/icons/FormatListBulleted"; -import TrendingUpIcon from "@material-ui/icons/TrendingUp"; -import FolderIcon from "@material-ui/icons/Folder"; -import t from "./common/localization"; +import React, { useState } from 'react'; +import { useHistory } from 'react-router-dom'; +import { makeStyles } from '@material-ui/core/styles'; +import { useDispatch, useSelector } from 'react-redux'; +import { sessionActions } from './store'; +import AppBar from '@material-ui/core/AppBar'; +import Toolbar from '@material-ui/core/Toolbar'; +import Typography from '@material-ui/core/Typography'; +import Button from '@material-ui/core/Button'; +import IconButton from '@material-ui/core/IconButton'; +import MenuIcon from '@material-ui/icons/Menu'; +import Drawer from '@material-ui/core/Drawer'; +import List from '@material-ui/core/List'; +import ListSubheader from '@material-ui/core/ListSubheader'; +import Divider from '@material-ui/core/Divider'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemText from '@material-ui/core/ListItemText'; +import MapIcon from '@material-ui/icons/Map'; +import BarChartIcon from '@material-ui/icons/BarChart'; +import PeopleIcon from '@material-ui/icons/People'; +import StorageIcon from '@material-ui/icons/Storage'; +import PersonIcon from '@material-ui/icons/Person'; +import NotificationsIcon from '@material-ui/icons/Notifications'; +import TimelineIcon from '@material-ui/icons/Timeline'; +import PauseCircleFilledIcon from '@material-ui/icons/PauseCircleFilled'; +import PlayCircleFilledIcon from '@material-ui/icons/PlayCircleFilled'; +import NotificationsActiveIcon from '@material-ui/icons/NotificationsActive'; +import FormatListBulletedIcon from '@material-ui/icons/FormatListBulleted'; +import TrendingUpIcon from '@material-ui/icons/TrendingUp'; +import FolderIcon from '@material-ui/icons/Folder'; +import t from './common/localization'; const useStyles = makeStyles((theme) => ({ flex: { @@ -67,10 +67,10 @@ const MainToolbar = () => { }; const handleLogout = async () => { - const response = await fetch("/api/session", { method: "DELETE" }); + const response = await fetch('/api/session', { method: 'DELETE' }); if (response.ok) { dispatch(sessionActions.updateUser(null)); - history.push("/login"); + history.push('/login'); } }; @@ -89,7 +89,7 @@ const MainToolbar = () => { Traccar @@ -102,54 +102,54 @@ const MainToolbar = () => { onKeyDown={closeDrawer} > - history.push("/")}> + history.push('/')}> - + - {t("reportTitle")}}> - history.push("/reports/route")}> + {t('reportTitle')}}> + history.push('/reports/route')}> - + - history.push("/reports/event")}> + history.push('/reports/event')}> - + - + - + - + - + - {t("settingsTitle")}}> + {t('settingsTitle')}}> { - + history.push("/settings/notifications")} + onClick={() => history.push('/settings/notifications')} > - + - history.push("/settings/groups")}> + history.push('/settings/groups')}> - + {adminEnabled && ( <> - {t("userAdmin")}}> - history.push("/admin/server")}> + {t('userAdmin')}}> + history.push('/admin/server')}> - + - history.push("/admin/users")}> + history.push('/admin/users')}> - + - + 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