diff --git a/ui/src/kapacitor/containers/KapacitorRulePage.js b/ui/src/kapacitor/containers/KapacitorRulePage.js index ccd381ec0..bfcb28ab2 100644 --- a/ui/src/kapacitor/containers/KapacitorRulePage.js +++ b/ui/src/kapacitor/containers/KapacitorRulePage.js @@ -76,7 +76,7 @@ export const KapacitorRulePage = React.createClass({ .catch(() => { addFlashMessage({ type: 'error', - text: "We couldn't find a configured Kapacitor for this source", + text: 'We couldn\'t find a configured Kapacitor for this source', }) }) }) diff --git a/ui/src/shared/actions/sources.js b/ui/src/shared/actions/sources.js index 15adb1abe..eb0841cd5 100644 --- a/ui/src/shared/actions/sources.js +++ b/ui/src/shared/actions/sources.js @@ -6,6 +6,8 @@ import { } from 'src/shared/apis' import {publishNotification} from './notifications' +import {HTTP_NOT_FOUND} from 'src/shared/constants' + export const loadSources = sources => ({ type: 'LOAD_SOURCES', payload: { @@ -51,7 +53,7 @@ export const removeAndLoadSources = source => async dispatch => { } catch (err) { // A 404 means that either a concurrent write occurred or the source // passed to this action creator doesn't exist (or is undefined) - if (err.status !== 404) { + if (err.status !== HTTP_NOT_FOUND) { // eslint-disable-line no-magic-numbers throw err } diff --git a/ui/src/shared/constants/index.js b/ui/src/shared/constants/index.js index a10ed2493..f7867058b 100644 --- a/ui/src/shared/constants/index.js +++ b/ui/src/shared/constants/index.js @@ -390,6 +390,7 @@ export const REVERT_STATE_DELAY = 1500 // ms export const HTTP_UNAUTHORIZED = 401 export const HTTP_FORBIDDEN = 403 +export const HTTP_NOT_FOUND = 404 export const AUTOREFRESH_DEFAULT = 15000 // in milliseconds diff --git a/ui/src/shared/middleware/appStorage.js b/ui/src/shared/middleware/appStorage.js index 5f8ced083..2df6a306c 100644 --- a/ui/src/shared/middleware/appStorage.js +++ b/ui/src/shared/middleware/appStorage.js @@ -2,7 +2,7 @@ // There are some tradeoffs between using localStorage vs. using on-disk files via electron. // localStorage was chosen, for now, to simplify use of this app outside of electron. export default function makeAppStorage(localStorage) { - return store => { + return () => { // eslint-disable-line no-unused-vars return next => { return action => { diff --git a/ui/src/sources/components/SourceForm.js b/ui/src/sources/components/SourceForm.js index 8769c6e2c..55caaa8b7 100644 --- a/ui/src/sources/components/SourceForm.js +++ b/ui/src/sources/components/SourceForm.js @@ -22,7 +22,7 @@ export const SourceForm = React.createClass({ name: this.sourceName.value, username: this.sourceUsername.value, password: this.sourcePassword.value, - default: this.sourceDefault.checked, + 'default': this.sourceDefault.checked, telegraf: this.sourceTelegraf.value, insecureSkipVerify: this.sourceInsecureSkipVerify ? this.sourceInsecureSkipVerify.checked