From 85461684eb402d4df62c8b59e0a0f627bd3487c1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 23 May 2022 07:19:30 -0700 Subject: Initial migration to MUI 5 --- modern/src/reports/ChartReportPage.js | 5 +++-- modern/src/reports/EventReportPage.js | 2 +- modern/src/reports/RouteReportPage.js | 2 +- modern/src/reports/StatisticsPage.js | 2 +- modern/src/reports/StopReportPage.js | 2 +- modern/src/reports/SummaryReportPage.js | 2 +- modern/src/reports/TripReportPage.js | 2 +- modern/src/reports/components/ColumnSelect.js | 2 +- modern/src/reports/components/ReportFilter.js | 5 +++-- modern/src/reports/components/ReportsMenu.js | 16 ++++++++-------- 10 files changed, 21 insertions(+), 19 deletions(-) (limited to 'modern/src/reports') diff --git a/modern/src/reports/ChartReportPage.js b/modern/src/reports/ChartReportPage.js index bb71fa95..e6c971df 100644 --- a/modern/src/reports/ChartReportPage.js +++ b/modern/src/reports/ChartReportPage.js @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import { - FormControl, InputLabel, Select, MenuItem, makeStyles, -} from '@material-ui/core'; + FormControl, InputLabel, Select, MenuItem, +} from '@mui/material'; +import makeStyles from '@mui/styles/makeStyles'; import { CartesianGrid, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis, } from 'recharts'; diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index 8a3a070f..2c6aaea5 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { FormControl, InputLabel, Select, MenuItem, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, -} from '@material-ui/core'; +} from '@mui/material'; import { useSelector } from 'react-redux'; import { formatDate } from '../common/util/formatter'; import ReportFilter, { useFilterStyles } from './components/ReportFilter'; diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index b67833f9..3f89888f 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, -} from '@material-ui/core'; +} from '@mui/material'; import ReportFilter from './components/ReportFilter'; import { useTranslation } from '../common/components/LocalizationProvider'; import PageLayout from '../common/components/PageLayout'; diff --git a/modern/src/reports/StatisticsPage.js b/modern/src/reports/StatisticsPage.js index 9ed830eb..b9b14902 100644 --- a/modern/src/reports/StatisticsPage.js +++ b/modern/src/reports/StatisticsPage.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { TableContainer, Table, TableRow, TableCell, TableHead, TableBody, -} from '@material-ui/core'; +} from '@mui/material'; import { formatDate } from '../common/util/formatter'; import { useTranslation } from '../common/components/LocalizationProvider'; import PageLayout from '../common/components/PageLayout'; diff --git a/modern/src/reports/StopReportPage.js b/modern/src/reports/StopReportPage.js index 5e1c2a66..4cf29035 100644 --- a/modern/src/reports/StopReportPage.js +++ b/modern/src/reports/StopReportPage.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, -} from '@material-ui/core'; +} from '@mui/material'; import { formatDistance, formatHours, formatDate, formatVolume, } from '../common/util/formatter'; diff --git a/modern/src/reports/SummaryReportPage.js b/modern/src/reports/SummaryReportPage.js index 9de7e13c..1e905155 100644 --- a/modern/src/reports/SummaryReportPage.js +++ b/modern/src/reports/SummaryReportPage.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { FormControl, InputLabel, Select, MenuItem, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, -} from '@material-ui/core'; +} from '@mui/material'; import { formatDistance, formatHours, formatDate, formatSpeed, formatVolume, } from '../common/util/formatter'; diff --git a/modern/src/reports/TripReportPage.js b/modern/src/reports/TripReportPage.js index e6e13d56..4846afa6 100644 --- a/modern/src/reports/TripReportPage.js +++ b/modern/src/reports/TripReportPage.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, -} from '@material-ui/core'; +} from '@mui/material'; import { formatDistance, formatSpeed, formatHours, formatDate, formatVolume, } from '../common/util/formatter'; diff --git a/modern/src/reports/components/ColumnSelect.js b/modern/src/reports/components/ColumnSelect.js index d7306c58..04645cd5 100644 --- a/modern/src/reports/components/ColumnSelect.js +++ b/modern/src/reports/components/ColumnSelect.js @@ -1,7 +1,7 @@ import React from 'react'; import { FormControl, InputLabel, MenuItem, Select, -} from '@material-ui/core'; +} from '@mui/material'; import { useTranslation } from '../../common/components/LocalizationProvider'; import { useFilterStyles } from './ReportFilter'; diff --git a/modern/src/reports/components/ReportFilter.js b/modern/src/reports/components/ReportFilter.js index 350bbe6d..9938a4ad 100644 --- a/modern/src/reports/components/ReportFilter.js +++ b/modern/src/reports/components/ReportFilter.js @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import { - FormControl, InputLabel, Select, MenuItem, Button, TextField, Typography, makeStyles, -} from '@material-ui/core'; + FormControl, InputLabel, Select, MenuItem, Button, TextField, Typography, +} from '@mui/material'; +import makeStyles from '@mui/styles/makeStyles'; import { useSelector } from 'react-redux'; import moment from 'moment'; import { useTranslation } from '../../common/components/LocalizationProvider'; diff --git a/modern/src/reports/components/ReportsMenu.js b/modern/src/reports/components/ReportsMenu.js index 8e973562..afe9de79 100644 --- a/modern/src/reports/components/ReportsMenu.js +++ b/modern/src/reports/components/ReportsMenu.js @@ -1,14 +1,14 @@ import React from 'react'; import { Divider, List, ListItem, ListItemIcon, ListItemText, -} from '@material-ui/core'; -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 BarChartIcon from '@material-ui/icons/BarChart'; +} from '@mui/material'; +import TimelineIcon from '@mui/icons-material/Timeline'; +import PauseCircleFilledIcon from '@mui/icons-material/PauseCircleFilled'; +import PlayCircleFilledIcon from '@mui/icons-material/PlayCircleFilled'; +import NotificationsActiveIcon from '@mui/icons-material/NotificationsActive'; +import FormatListBulletedIcon from '@mui/icons-material/FormatListBulleted'; +import TrendingUpIcon from '@mui/icons-material/TrendingUp'; +import BarChartIcon from '@mui/icons-material/BarChart'; import { Link, useLocation } from 'react-router-dom'; import { useTranslation } from '../../common/components/LocalizationProvider'; import { useAdministrator } from '../../common/util/permissions'; -- cgit v1.2.3 From e7e8d1c9a52b9b82fdcbf2d4d6f3134698eb0cf0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 23 May 2022 07:30:04 -0700 Subject: Convert to outline inputs --- modern/src/common/components/ErrorHandler.js | 2 +- modern/src/common/theme/index.js | 2 +- modern/src/login/LoginPage.js | 6 +-- modern/src/login/RegisterPage.js | 6 +-- modern/src/login/ResetPasswordPage.js | 4 +- modern/src/main/MainPage.js | 2 +- modern/src/reports/ChartReportPage.js | 2 +- modern/src/reports/EventReportPage.js | 2 +- modern/src/reports/SummaryReportPage.js | 2 +- modern/src/reports/components/ColumnSelect.js | 2 +- modern/src/reports/components/ReportFilter.js | 8 +-- modern/src/settings/AccumulatorsPage.js | 4 +- modern/src/settings/CalendarPage.js | 2 +- modern/src/settings/CommandPage.js | 2 +- modern/src/settings/CommandSendPage.js | 2 +- modern/src/settings/ComputedAttributePage.js | 8 +-- modern/src/settings/DevicePage.js | 26 +++++----- modern/src/settings/DriverPage.js | 4 +- modern/src/settings/GeofencePage.js | 2 +- modern/src/settings/GroupPage.js | 16 +++--- modern/src/settings/MaintenancePage.js | 8 +-- modern/src/settings/NotificationPage.js | 6 +-- modern/src/settings/PreferencesPage.js | 4 +- modern/src/settings/ServerPage.js | 22 ++++---- modern/src/settings/UserPage.js | 58 +++++++++++----------- .../src/settings/components/AddAttributeDialog.js | 4 +- modern/src/settings/components/BaseCommandView.js | 4 +- .../src/settings/components/EditAttributesView.js | 6 +-- 28 files changed, 108 insertions(+), 108 deletions(-) (limited to 'modern/src/reports') diff --git a/modern/src/common/components/ErrorHandler.js b/modern/src/common/components/ErrorHandler.js index 08ba8e12..d6735885 100644 --- a/modern/src/common/components/ErrorHandler.js +++ b/modern/src/common/components/ErrorHandler.js @@ -14,7 +14,7 @@ const ErrorHandler = () => { dispatch(errorsActions.pop())} severity="error" > diff --git a/modern/src/common/theme/index.js b/modern/src/common/theme/index.js index 8e85150e..de0a7efd 100644 --- a/modern/src/common/theme/index.js +++ b/modern/src/common/theme/index.js @@ -5,7 +5,7 @@ import dimensions from './dimensions'; const theme = createTheme(adaptV4Theme({ palette, - overrides, + //overrides, dimensions, })); diff --git a/modern/src/login/LoginPage.js b/modern/src/login/LoginPage.js index 4478c866..e7a110de 100644 --- a/modern/src/login/LoginPage.js +++ b/modern/src/login/LoginPage.js @@ -118,7 +118,7 @@ const LoginPage = () => { onChange={(e) => setEmail(e.target.value)} onKeyUp={handleSpecialKey} helperText={failed && 'Invalid username or password'} - variant="filled" + /> @@ -134,7 +134,7 @@ const LoginPage = () => { autoFocus={!!email} onChange={(e) => setPassword(e.target.value)} onKeyUp={handleSpecialKey} - variant="filled" + /> @@ -156,7 +156,7 @@ const LoginPage = () => { - + {t('loginLanguage')} setType(e.target.value)}> {Object.keys(positionAttributes).filter((key) => positionAttributes[key].type === 'number').map((key) => ( diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index 2c6aaea5..352a4e13 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -99,7 +99,7 @@ const EventReportPage = () => { } breadcrumbs={['reportTitle', 'reportEvents']}>
- + {t('reportEventTypes')} setDaily(e.target.value)}> {t('reportSummary')} diff --git a/modern/src/reports/components/ColumnSelect.js b/modern/src/reports/components/ColumnSelect.js index 04645cd5..543aa7bf 100644 --- a/modern/src/reports/components/ColumnSelect.js +++ b/modern/src/reports/components/ColumnSelect.js @@ -13,7 +13,7 @@ const ColumnSelect = ({ return (
- + {t('sharedColumns')} setDeviceId(e.target.value)}> {Object.values(devices).map((device) => ( @@ -101,7 +101,7 @@ const ReportFilter = ({
)}
- + {t('reportPeriod')} { label={t('sharedExpression')} multiline rows={4} - variant="filled" + /> { value={item.name || ''} onChange={(event) => setItem({ ...item, name: event.target.value })} label={t('sharedName')} - variant="filled" + /> setItem({ ...item, uniqueId: event.target.value })} label={t('deviceIdentifier')} - variant="filled" + /> @@ -89,28 +89,28 @@ const DevicePage = () => { onChange={(event) => setItem({ ...item, groupId: Number(event.target.value) })} endpoint="/api/groups" label={t('groupParent')} - variant="filled" + /> setItem({ ...item, phone: event.target.value })} label={t('sharedPhone')} - variant="filled" + /> setItem({ ...item, model: event.target.value })} label={t('deviceModel')} - variant="filled" + /> setItem({ ...item, contact: event.target.value })} label={t('deviceContact')} - variant="filled" + /> { name: t(`category${category.replace(/^\w/, (c) => c.toUpperCase())}`), }))} label={t('deviceCategory')} - variant="filled" + /> {admin && ( { keyBase="deviceId" keyLink="geofenceId" label={t('sharedGeofences')} - variant="filled" + /> { keyLink="notificationId" titleGetter={(it) => t(prefixString('event', it.type))} label={t('sharedNotifications')} - variant="filled" + /> { keyBase="deviceId" keyLink="driverId" label={t('sharedDrivers')} - variant="filled" + /> { keyLink="attributeId" titleGetter={(it) => it.description} label={t('sharedComputedAttributes')} - variant="filled" + /> { keyLink="commandId" titleGetter={(it) => it.description} label={t('sharedSavedCommands')} - variant="filled" + /> { keyBase="deviceId" keyLink="maintenanceId" label={t('sharedMaintenance')} - variant="filled" + /> diff --git a/modern/src/settings/DriverPage.js b/modern/src/settings/DriverPage.js index f03682e3..c072c52b 100644 --- a/modern/src/settings/DriverPage.js +++ b/modern/src/settings/DriverPage.js @@ -47,14 +47,14 @@ const DriverPage = () => { value={item.name || ''} onChange={(event) => setItem({ ...item, name: event.target.value })} label={t('sharedName')} - variant="filled" + /> setItem({ ...item, uniqueId: event.target.value })} label={t('deviceIdentifier')} - variant="filled" + /> diff --git a/modern/src/settings/GeofencePage.js b/modern/src/settings/GeofencePage.js index 3b8ac2ed..7dd47527 100644 --- a/modern/src/settings/GeofencePage.js +++ b/modern/src/settings/GeofencePage.js @@ -51,7 +51,7 @@ const GeofencePage = () => { value={item.name || ''} onChange={(event) => setItem({ ...item, name: event.target.value })} label={t('sharedName')} - variant="filled" + /> diff --git a/modern/src/settings/GroupPage.js b/modern/src/settings/GroupPage.js index d4991c59..5cb0474d 100644 --- a/modern/src/settings/GroupPage.js +++ b/modern/src/settings/GroupPage.js @@ -56,7 +56,7 @@ const GroupPage = () => { value={item.name || ''} onChange={(event) => setItem({ ...item, name: event.target.value })} label={t('sharedName')} - variant="filled" + /> @@ -73,7 +73,7 @@ const GroupPage = () => { onChange={(event) => setItem({ ...item, groupId: Number(event.target.value) })} endpoint="/api/groups" label={t('groupParent')} - variant="filled" + /> @@ -107,7 +107,7 @@ const GroupPage = () => { keyBase="groupId" keyLink="geofenceId" label={t('sharedGeofences')} - variant="filled" + /> { keyLink="notificationId" titleGetter={(it) => t(prefixString('event', it.type))} label={t('sharedNotifications')} - variant="filled" + /> { keyBase="groupId" keyLink="driverId" label={t('sharedDrivers')} - variant="filled" + /> { keyLink="attributeId" titleGetter={(it) => it.description} label={t('sharedComputedAttributes')} - variant="filled" + /> { keyLink="commandId" titleGetter={(it) => it.description} label={t('sharedSavedCommands')} - variant="filled" + /> { keyBase="groupId" keyLink="maintenanceId" label={t('sharedMaintenance')} - variant="filled" + /> diff --git a/modern/src/settings/MaintenancePage.js b/modern/src/settings/MaintenancePage.js index 292e197e..599d600d 100644 --- a/modern/src/settings/MaintenancePage.js +++ b/modern/src/settings/MaintenancePage.js @@ -129,9 +129,9 @@ const MaintenancePage = () => { value={item.name || ''} onChange={(event) => setItem({ ...item, name: event.target.value })} label={t('sharedName')} - variant="filled" + /> - + {t('sharedType')} setLanguage(e.target.value)}> {languageList.map((it) => {it.name})} @@ -68,7 +68,7 @@ const PreferencesPage = () => { - + {t('sharedAttributes')} { {t('sharedDegreesMinutesSeconds')} - + {t('settingsSpeedUnit')} - + {t('settingsDistanceUnit')} - + {t('settingsVolumeUnit')} { {t('sharedDegreesMinutesSeconds')} - + {t('settingsSpeedUnit')} - + {t('settingsDistanceUnit')} - + {t('settingsVolumeUnit')} + {label} setLanguage(e.target.value)}> + diff --git a/modern/src/reports/ChartReportPage.js b/modern/src/reports/ChartReportPage.js index 461a6756..becdfb57 100644 --- a/modern/src/reports/ChartReportPage.js +++ b/modern/src/reports/ChartReportPage.js @@ -61,7 +61,7 @@ const ChartReportPage = () => {
{t('reportChartType')} - setType(e.target.value)}> {Object.keys(positionAttributes).filter((key) => positionAttributes[key].type === 'number').map((key) => ( {positionAttributes[key].name} ))} diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index 352a4e13..6a1fe309 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -102,6 +102,7 @@ const EventReportPage = () => { {t('reportEventTypes')} setDaily(e.target.value)}> + diff --git a/modern/src/reports/components/ColumnSelect.js b/modern/src/reports/components/ColumnSelect.js index 543aa7bf..8a79108e 100644 --- a/modern/src/reports/components/ColumnSelect.js +++ b/modern/src/reports/components/ColumnSelect.js @@ -16,6 +16,7 @@ const ColumnSelect = ({ {t('sharedColumns')} setDeviceId(e.target.value)}> + setPeriod(e.target.value)}> + @@ -100,6 +101,7 @@ const ComputedAttributePage = () => { > {t('sharedType')} diff --git a/modern/src/settings/PreferencesPage.js b/modern/src/settings/PreferencesPage.js index 7c0d4aee..93ded1f0 100644 --- a/modern/src/settings/PreferencesPage.js +++ b/modern/src/settings/PreferencesPage.js @@ -55,7 +55,11 @@ const PreferencesPage = () => { {t('loginLanguage')} - setLanguage(e.target.value)} + > {languageList.map((it) => {it.name})} @@ -71,6 +75,7 @@ const PreferencesPage = () => { {t('sharedAttributes')} setItem({ ...item, coordinateFormat: event.target.value })} > @@ -125,6 +126,7 @@ const ServerPage = () => { {t('settingsSpeedUnit')} setItem({ ...item, attributes: { ...item.attributes, distanceUnit: e.target.value } })} > @@ -147,6 +150,7 @@ const ServerPage = () => { {t('settingsVolumeUnit')} setItem({ ...item, coordinateFormat: event.target.value })} > @@ -150,6 +151,7 @@ const UserPage = () => { {t('settingsSpeedUnit')} setItem({ ...item, attributes: { ...item.attributes, distanceUnit: e.target.value } })} > @@ -172,6 +175,7 @@ const UserPage = () => { {t('settingsVolumeUnit')} setType(e.target.value)} > -- cgit v1.2.3