@@ -461,7 +460,7 @@ class VerifyIncidentsPage extends Component {
this.fetchData();
});
}}
- defaultValue={"{true, false }"}
+ defaultValue="{true, false }"
className={classes.selectEmpty}
>
From 8cbcc7000fa9f52db6c116c11cf45a1b861478e7 Mon Sep 17 00:00:00 2001
From: Luke <77371718+ldalton02@users.noreply.github.com>
Date: Mon, 6 Dec 2021 21:41:43 -0800
Subject: [PATCH 5/5] Eslint fixes
---
.../src/components/SimpleTable/SimpleTable.jsx | 16 +++++++---------
.../VerifyIncidentsPage/VerifyIncidentsPage.jsx | 4 ++--
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/client/src/components/SimpleTable/SimpleTable.jsx b/client/src/components/SimpleTable/SimpleTable.jsx
index 1791aab..8d15f4c 100644
--- a/client/src/components/SimpleTable/SimpleTable.jsx
+++ b/client/src/components/SimpleTable/SimpleTable.jsx
@@ -42,7 +42,7 @@ const styles = (theme) => ({
* idsChecked - array of ids (corresponding to the first element of every row array) to track checkbox status
* fetchData - function(int #rows, int page#) to update table data whenever pagination values are updated
* counts - max number of rows, for pagination purposes
- *
+ *
* */
const SimpleTable = (props) => {
@@ -58,18 +58,17 @@ const SimpleTable = (props) => {
onCheckAll,
} = props;
-
const handlePageChange = (e, newPage) => {
setPage(newPage);
};
-
- // changes handleRowChange to
+
+ // changes handleRowChange to
const handleRowChange = (e) => {
- let newRowsPerPage = e.target.value
- let currentStartingNumber = (rowsPerPage * page) + 1
- let startingPage = Math.floor(currentStartingNumber / newRowsPerPage)
+ const newRowsPerPage = e.target.value;
+ const currentStartingNumber = (rowsPerPage * page) + 1;
+ const startingPage = Math.floor(currentStartingNumber / newRowsPerPage);
setRowsPerPage(e.target.value);
- setPage(startingPage)
+ setPage(startingPage);
/* NOTE
The above function doesn't actually call fetchData itself - have a useEffect only triggered by page change to call fetchData
This is due to useState not updating fast enough before next line is called (state change stuff)
@@ -138,7 +137,6 @@ const SimpleTable = (props) => {
);
-
};
SimpleTable.propTypes = {
diff --git a/client/src/containers/VerifyIncidentsPage/VerifyIncidentsPage.jsx b/client/src/containers/VerifyIncidentsPage/VerifyIncidentsPage.jsx
index 92273a8..f3f88ea 100644
--- a/client/src/containers/VerifyIncidentsPage/VerifyIncidentsPage.jsx
+++ b/client/src/containers/VerifyIncidentsPage/VerifyIncidentsPage.jsx
@@ -420,13 +420,13 @@ class VerifyIncidentsPage extends Component {
);
}
- if (incidentReports == null) {
+ if (incidentReports == null) {
return (
);
- }
+ }
return (