lint additional files

This commit is contained in:
Lachlan Kermode
2019-01-22 16:15:55 +00:00
parent 20d39f3bf9
commit 3de7b3a8c5
19 changed files with 135 additions and 180 deletions

View File

@@ -14,7 +14,6 @@ import {
UPDATE_SOURCE,
RESET_ALLFILTERS,
TOGGLE_LANGUAGE,
TOGGLE_MAPVIEW,
TOGGLE_SITES,
TOGGLE_FETCHING_DOMAIN,
TOGGLE_FETCHING_SOURCES,
@@ -36,7 +35,7 @@ function updateSelected (appState, action) {
})
}
function updateNarrative(appState, action) {
function updateNarrative (appState, action) {
let minTime = appState.timeline.range[0]
let maxTime = appState.timeline.range[1]
@@ -159,13 +158,13 @@ function updateCategoryFilters (appState, action) {
})
}
function updateTimeRange(appState, action) { // XXX
function updateTimeRange (appState, action) { // XXX
return {
...appState,
timeline: {
...appState.timeline,
range: action.timerange
},
}
}
}
@@ -190,18 +189,6 @@ function toggleLanguage (appState, action) {
})
}
function toggleMapView (appState, action) {
const isLayerInView = !appState.views[layer]
const newViews = {}
newViews[layer] = isLayerInView
const views = Object.assign({}, appState.views, newViews)
return Object.assign({}, appState, {
filters: Object.assign({}, appState.filters, {
views
})
})
}
function toggleSites (appState, action) {
return {
...appState,
@@ -293,8 +280,6 @@ function app (appState = initial.app, action) {
return resetAllFilters(appState, action)
case TOGGLE_LANGUAGE:
return toggleLanguage(appState, action)
case TOGGLE_MAPVIEW:
return toggleMapView(appState, action)
case TOGGLE_SITES:
return toggleSites(appState, action)
case FETCH_ERROR:

View File

@@ -5,7 +5,7 @@ export function parseDateTimes (arrayToParse) {
arrayToParse.forEach(item => {
let incomingDateTime = `${item.date}T00:00`
if (item.time) incomingDateTime = `${item.date}T${item.time}`
const parser = d3.timeParse(process.env.incomingDateTime_FORMAT)
const parser = d3.timeParse(process.env.INCOMING_DATETIME_FORMAT)
item.timestamp = d3.timeFormat('%Y-%m-%dT%H:%M:%S')(parser(incomingDateTime))
parsedArray.push(item)

View File

@@ -62,7 +62,7 @@ export function validateDomain (domain) {
sources: {},
tags: {},
shapes: [],
notifications: domain.notifications,
notifications: domain.notifications
}
const discardedDomain = {
@@ -119,11 +119,11 @@ export function validateDomain (domain) {
// NB: [lat, lon] array is best format for projecting into map
sanitizedDomain.shapes = sanitizedDomain.shapes.map(shape => ({
name: shape.name,
points: shape.items.map(coords => (
coords.replace(/\s/g, '').split(',')
))
})
name: shape.name,
points: shape.items.map(coords => (
coords.replace(/\s/g, '').split(',')
))
})
)
// Message the number of failed items in domain