diff --git a/src/Certificate/Quiz.jsx b/src/Certificate/Quiz.jsx
index 38171d652b..e1e57d4a66 100644
--- a/src/Certificate/Quiz.jsx
+++ b/src/Certificate/Quiz.jsx
@@ -70,7 +70,7 @@ class Question extends Component {
{
- group =>
+ group => (
{
this.props.content.options.map(
(option, i) =>
@@ -82,7 +82,7 @@ class Question extends Component {
/>{option}),
)
}
-
+
)
}
diff --git a/src/DataDictionary/DataDictionary.test.jsx b/src/DataDictionary/DataDictionary.test.jsx
index 4c43ddfe3f..6df8886c42 100644
--- a/src/DataDictionary/DataDictionary.test.jsx
+++ b/src/DataDictionary/DataDictionary.test.jsx
@@ -50,7 +50,7 @@ describe('the DataDictionary component', () => {
const ux = mount(
-
+ ,
);
expect(ux.find('table').length).toBe(2);
});
diff --git a/src/DataDictionary/DictionaryGraph.test.jsx b/src/DataDictionary/DictionaryGraph.test.jsx
index b4f12d69a7..581d8f914d 100644
--- a/src/DataDictionary/DictionaryGraph.test.jsx
+++ b/src/DataDictionary/DictionaryGraph.test.jsx
@@ -27,7 +27,7 @@ describe('the DictionaryGraph', () => {
it('boots to a full view', () => {
const { $graph } = buildTest();
expect($graph.length).toBe(1);
- expect(!! $graph.find('div[data-toggle="full"]')).toBe(true);
+ expect(!!$graph.find('div[data-toggle="full"]')).toBe(true);
});
it('toggles between full and compact views', () => {
@@ -35,7 +35,7 @@ describe('the DictionaryGraph', () => {
const $toggleButton = $dom.find('a#toggle_button');
expect($toggleButton.length).toBe(1);
$toggleButton.simulate('click');
- expect(!! $graph.find('div[data-toggle="abridged"]')).toBe(true);
+ expect(!!$graph.find('div[data-toggle="abridged"]')).toBe(true);
expect(document.querySelector('#data_model_graph')).toBeDefined();
// jsdom does not yet support svg
// const ellipseList = document.querySelectorAll('ellipse');
diff --git a/src/DataModelGraph/utils.js b/src/DataModelGraph/utils.js
index 11fed96830..27c6dbfc52 100644
--- a/src/DataModelGraph/utils.js
+++ b/src/DataModelGraph/utils.js
@@ -163,7 +163,7 @@ export function nodesBreadthFirst(nodes, edges) {
}
// queue.shift is O(n), so just keep pushing, and move the head
- for (let head = 0; head < queue.length; head+=1) {
+ for (let head = 0; head < queue.length; head += 1) {
const { query, level } = queue[head]; // breadth first
result.bfOrder.push(query);
processedNodes.add(query);
diff --git a/src/Login/Login.jsx b/src/Login/Login.jsx
index 5fe2dec8a4..d10e466b01 100644
--- a/src/Login/Login.jsx
+++ b/src/Login/Login.jsx
@@ -21,9 +21,9 @@ const LoginButton = styled.a`
const Login = (props) => {
let next = basename;
const location = props.location; // this is the react-router "location"
- const queryParams = querystring.parse(location.search ? location.search.replace(/^\?+/,'') : '');
+ const queryParams = querystring.parse(location.search ? location.search.replace(/^\?+/, '') : '');
if (queryParams.next) {
- next = basename === '/' ? queryParams.next : basename + queryParmas.next;
+ next = basename === '/' ? queryParams.next : basename + queryParams.next;
}
return (
diff --git a/src/Login/ProtectedContent.jsx b/src/Login/ProtectedContent.jsx
index 4e19504e69..07a8eddf46 100644
--- a/src/Login/ProtectedContent.jsx
+++ b/src/Login/ProtectedContent.jsx
@@ -13,11 +13,12 @@ let lastTokenRefreshMs = 0;
/**
* Redux listener - just clears auth-cache on logout
*/
-export function logoutListener(state={}, action) {
+export function logoutListener(state = {}, action) {
switch (action.type) {
case 'RECEIVE_API_LOGOUT':
lastAuthMs = 0;
lastTokenRefreshMs = 0;
+ break;
default: // noop
}
return state;
@@ -32,7 +33,7 @@ export function logoutListener(state={}, action) {
*/
export function intersection(aList, bList) {
const key2Count = aList.concat(bList).reduce(
- (db,it) => { if (db[it]) { db[it] += 1; } else { db[it] = 1; } return db; },
+ (db, it) => { if (db[it]) { db[it] += 1; } else { db[it] = 1; } return db; },
{},
);
return Object.entries(key2Count)
@@ -72,10 +73,10 @@ class ProtectedContent extends React.Component {
// user is authenticated - now check if he has certs
const isMissingCerts = intersection(requiredCerts, user.certificates_uploaded).length !== requiredCerts.length;
// take quiz if this user doesn't have required certificate
- if (this.props.location.pathname !== '/quiz' && isMissingCerts) {
+ if (this.props.match.path !== '/quiz' && isMissingCerts) {
newState.redirectTo = '/quiz';
// do not update lastAuthMs (indicates time of last successful auth)
- } else if (this.props.location.pathname === '/quiz' && !isMissingCerts) {
+ } else if (this.props.match.path === '/quiz' && !isMissingCerts) {
newState.redirectTo = '/';
}
return newState;
@@ -195,7 +196,7 @@ class ProtectedContent extends React.Component {
*/
componentDidMount() {
getReduxStore().then(
- store =>
+ store =>
Promise.all(
[
store.dispatch({ type: 'CLEAR_COUNTS' }), // clear some counters
diff --git a/src/reducers.js b/src/reducers.js
index 52ee2df2a3..3edb0d1ce5 100644
--- a/src/reducers.js
+++ b/src/reducers.js
@@ -1,6 +1,5 @@
import { reducer as formReducer } from 'redux-form';
import { combineReducers } from 'redux';
-//import { routerReducer } from 'react-router-redux';
import userProfile from './UserProfile/reducers';
import certificate from './Certificate/reducers';
import submission from './Submission/reducers';