Skip to content

Commit 0cd3b16

Browse files
committed
Fix a lot of warnings
* Unused import warnings * Missing useEffect dependency array warnings * Regex containing double space warning
1 parent 9da6393 commit 0cd3b16

File tree

8 files changed

+7
-12
lines changed

8 files changed

+7
-12
lines changed

src/client/src/pages/Admin/Admin.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ import {
99

1010
import _ from 'lodash';
1111
import {Alert} from "@material-ui/lab";
12-
import {makeStyles} from "@material-ui/styles";
1312
import UploadBox from './Components/UploadBox';
1413
import AnalysisBox from './Components/AnalysisBox';
1514
import Loading from './Components/Loading';
1615
import useAlert from '../../hooks/useAlert';
1716

18-
const useStyles = makeStyles({});
19-
2017
export default function Admin(props) {
2118
const [isLoading, setIsLoading] = React.useState(undefined);
2219
const [statistics, setStatistics] = React.useState(undefined);
@@ -82,7 +79,7 @@ export default function Admin(props) {
8279

8380
setAlert({
8481
type: "success",
85-
text: `${files.length == 1 ? "1 file" : files.length + " files"} uploaded successfully`,
82+
text: `${files.length === 1 ? "1 file" : files.length + " files"} uploaded successfully`,
8683
});
8784
} catch (error) {
8885
console.warn(error);

src/client/src/pages/Admin/Components/AnalysisBox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function AnalysisBox(props) {
1313
const { handleExecute, lastExecution, statistics } = props;
1414

1515
return (
16-
<Grid item direction="column" spacing={3} sm={6}>
16+
<Grid item sm={6}>
1717
<Paper>
1818
<CardContent>
1919
<Typography variant="h5" style={{ paddingBottom: 5 }}>

src/client/src/pages/Admin/Components/AnalysisTable.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Table,
88
Divider,
99
} from "@material-ui/core";
10-
import _ from "lodash";
1110
import { formatTimestamp } from "../../../utils/utils";
1211

1312
export default function AnalysisTable(props) {

src/client/src/pages/Admin/Components/UploadBox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function UploadBox(props) {
1313
const { filesInput, handleUpload, lastUploads } = props;
1414

1515
return (
16-
<Grid item direction="column" spacing={3} sm={6}>
16+
<Grid item sm={6}>
1717
<Paper>
1818
<CardContent>
1919
<Typography variant="h5">Upload Files</Typography>

src/client/src/pages/Admin/Components/UploadsTable.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import {
33
Grid,
44
TableRow,
5-
TableContainer,
65
TableCell,
76
TableBody,
87
Table,

src/client/src/pages/DataView360/Search/Search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const Search360 = (props) => {
6262
await setParticipantList(stateData.participantList)
6363
}
6464
})();
65-
}, []);
65+
}, [history]);
6666

6767
const onRowClick = (matching_id) => {
6868
const match = matchPath(`/360view/view/${matching_id}`, {

src/client/src/pages/UserManagement/UserManagement.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ export default function UserManagement(props) {
5656
setDialogOpen(true);
5757
}
5858

59-
const closeDialog = () => {
59+
const closeDialog = React.useCallback(() => {
6060
setDialogOpen(false);
6161
setDialogType(null);
6262
setSelectedUser(null);
63-
}
63+
}, [setDialogOpen, setDialogType, setSelectedUser])
6464

6565
React.useEffect(() => {
6666
const handleEscape = (event) => {

src/client/src/pages/UserManagement/Validations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const buildNameValidation = () => {
1313
.trim()
1414
.min(2, "Name must be at least 2 characters")
1515
.max(50, "Name cannot be more than 50 characters")
16-
.matches(/^(?!.* )[a-zA-Z ]+$/, "Name must only contain letters and non-consecutive internal spaces")
16+
.matches(/^(?!.* )[a-zA-Z ]+$/, "Name must only contain letters and non-consecutive internal spaces")
1717
.required("Name is required")
1818
}
1919

0 commit comments

Comments
 (0)