From 2ead3fb22af4e02efae3f9f8d4a8508c4467f017 Mon Sep 17 00:00:00 2001 From: Lachie Kermode Date: Mon, 19 Nov 2018 13:52:56 +0000 Subject: [PATCH 1/7] modify config to example sheet --- config.example.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config.example.js b/config.example.js index 140f041..7a5272b 100644 --- a/config.example.js +++ b/config.example.js @@ -1,17 +1,17 @@ module.exports = { - title: 'EXAMPLE_TITLE', + title: 'Example', SERVER_ROOT: 'http://localhost:4040', - EVENT_EXT: '/api//MAP2D_dev/rows', - CATEGORY_EXT: '/api//MAP2D_dev_category/rows', - EVENT_DESC_ROOT: '/api//MAP2D_dev/ids', - TAG_TREE_EXT: '/api//MAP2D_dev_tags/tree', - SITES_EXT: '/api//MAP2D_dev_sites/rows', - MAP_ANCHOR: [27.5813121, -18.5161798], + EVENT_EXT: '/api/example/export_events/rows', + CATEGORY_EXT: '/api/example/export_categories/rows', + EVENT_DESC_ROOT: '/api/example/export_events/ids', + TAG_TREE_EXT: '/api/example/export_tags/tree', + SITES_EXT: '/api/example/export_sites/rows', + MAP_ANCHOR: [31.356397, 34.784818], INCOMING_DATETIME_FORMAT: '%m/%d/%YT%H:%M', - MAPBOX_TOKEN: 'SOME_MAPBOX_TOKEN', + MAPBOX_TOKEN: 'your_token', features: { - USE_TAGS: false, + USE_TAGS: true, USE_SEARCH: false, - USE_SITES: false + USE_SITES: true } } From e7036277f9b9a2273dfe7acb55b438a7d261bce2 Mon Sep 17 00:00:00 2001 From: Lachie Kermode Date: Mon, 19 Nov 2018 13:53:15 +0000 Subject: [PATCH 2/7] add mapbox error if token null --- src/js/map/map.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/js/map/map.js b/src/js/map/map.js index 4996228..c9344d4 100644 --- a/src/js/map/map.js +++ b/src/js/map/map.js @@ -59,16 +59,24 @@ export default function(newApp, ui, select) { .setView(center, zoom) .setMinZoom(10) .setMaxZoom(18) - .setMaxBounds(maxBoundaries); + .setMaxBounds(maxBoundaries) // NB: configure tile endpoint - let s; - if (process.env.MAPBOX_TOKEN) { + let s + if (process.env.MAPBOX_TOKEN && process.env.MAPBOX_TOKEN !== 'your_token') { s = L.tileLayer( `http://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}@2x.png?access_token=${process.env.MAPBOX_TOKEN}` ); } else { - s = L.tileLayer(`${process.env.SERVER_ROOT}/mapbox/{z}/{x}/{y}`); + // eslint-disable-next-line + alert(`No mapbox token specified in config. +Timemap does not currently support any other tiling layer, +so you will need to sign up for one at: + + https://www.mapbox.com/ + +Stop and start the development process in terminal after you have added your token to config.js`) + return } s = s.addTo(map); From 3d42942a5c02ea138e3f785c78e29e4a89b1267d Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 19 Nov 2018 14:40:55 +0000 Subject: [PATCH 3/7] update error handling logic, add empty check for validateTree --- src/actions/index.js | 106 +++++++++++++++---------------- src/components/Dashboard.jsx | 2 +- src/reducers/utils/validators.js | 15 +++-- 3 files changed, 63 insertions(+), 60 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index ce01025..ce86367 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -1,15 +1,15 @@ // TODO: relegate these URLs entirely to environment variables -const EVENT_DATA_URL = `${process.env.SERVER_ROOT}${process.env.EVENT_EXT}`; -const CATEGORY_URL = `${process.env.SERVER_ROOT}${process.env.CATEGORY_EXT}`; -const TAG_TREE_URL = `${process.env.SERVER_ROOT}${process.env.TAG_TREE_EXT}`; -const SITES_URL = `${process.env.SERVER_ROOT}${process.env.SITES_EXT}`; +const EVENT_DATA_URL = `${process.env.SERVER_ROOT}${process.env.EVENT_EXT}` +const CATEGORY_URL = `${process.env.SERVER_ROOT}${process.env.CATEGORY_EXT}` +const TAG_TREE_URL = `${process.env.SERVER_ROOT}${process.env.TAG_TREE_EXT}` +const SITES_URL = `${process.env.SERVER_ROOT}${process.env.SITES_EXT}` const eventUrlMap = (event) => `${process.env.SERVER_ROOT}${process.env.EVENT_DESC_ROOT}/${(event.id) ? event.id : event}` /* * Create an error notification object * Types: ['error', 'warning', 'good', 'neural'] */ -function makeError(type, id, message) { +function makeError (type, id, message) { return { type: 'error', id, @@ -17,62 +17,62 @@ function makeError(type, id, message) { } } -export function fetchDomain() { - let events = []; - let categories = []; - let sites = []; - let notifications = []; - let tags = {}; +export function fetchDomain () { + let notifications = [] - function makeError(domainType) { + function handleError (domainType) { + return () => { notifications.push({ message: `Something went wrong fetching ${domainType}. Check the URL or try disabling them in the config file.`, type: 'error' - }); + }) + return [] + } + } + + return dispatch => { + dispatch(toggleFetchingDomain()) + const promises = [] + + const eventPromise = fetch(EVENT_DATA_URL) + .then(response => response.json()) + .catch(handleError('events')) + + const catPromise = fetch(CATEGORY_URL) + .then(response => response.json()) + .catch(handleError('categories')) + + let sitesPromise = Promise.resolve([]) + if (process.env.features.USE_SITES) { + sitesPromise = fetch(SITES_URL) + .then(response => response.json()) + .catch(handleError('sites')) } - return dispatch => { + let tagsPromise + if (process.env.features.USE_TAGS) { + tagsPromise = fetch(TAG_TREE_URL) + .then(response => response.json()) + .catch(handleError('tags')) + } + + return Promise.all([ eventPromise, catPromise, sitesPromise, tagsPromise]) + .then(response => { dispatch(toggleFetchingDomain()); - const promises = []; - - const eventPromise = fetch(EVENT_DATA_URL) - .then(response => response.json()) - .then(jsonEv => { events = jsonEv; }) - .catch(err => { makeError('events')}); - promises.push(eventPromise); - - const catPromise = fetch(CATEGORY_URL) - .then(response => response.json()) - .then(jsonCat => { categories = jsonCat; }) - .catch(err => { makeError('categories')}); - promises.push(catPromise); - - if (process.env.features.USE_SITES) { - const sitesPromise = fetch(SITES_URL) - .then(response => response.json()) - .then(jsonSites => { sites = jsonSites; }) - .catch(err => { makeError('sites')}); - promises.push(sitesPromise); + const result = { + events: response[0], + categories: response[1], + sites: response[2], + tags: response[3], + notifications } - - if (process.env.features.USE_TAGS) { - const tagTreePromise = fetch(TAG_TREE_URL) - .then(response => response.json()) - .then(jsonTagTree => { tags = jsonTagTree; }) - .catch(err => { makeError('tags')}); - promises.push(tagTreePromise); - } - - return Promise.all(promises) - .then(reponse => { - dispatch(toggleFetchingDomain()); - return { events, categories, sites, tags, notifications }; - }) - .catch(err => { - dispatch(fetchError(err.message)) - dispatch(toggleFetchingDomain()); - }) - }; + return result + }) + .catch(err => { + dispatch(fetchError(err.message)) + dispatch(toggleFetchingDomain()); + }) + }; } export const FETCH_ERROR = 'FETCH_ERROR'; diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 2a496a4..b764983 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -28,7 +28,7 @@ class Dashboard extends React.Component { componentDidMount() { if (!this.props.app.isMobile) { this.props.actions.fetchDomain() - .then((domain) => this.props.actions.updateDomain(domain)); + .then((domain) => this.props.actions.updateDomain(domain)) } } diff --git a/src/reducers/utils/validators.js b/src/reducers/utils/validators.js index 6355e1b..a995d66 100644 --- a/src/reducers/utils/validators.js +++ b/src/reducers/utils/validators.js @@ -26,23 +26,26 @@ const isDuplicate = (node, set) => { return (set.has(node.key)); }; /* * Traverse a tag tree and check its duplicates */ -function validateTree(node, parent, set, duplicates) { +function validateTree (node, parent, set, duplicates) { + if (!Array.isArray(node) || !node.length) { + return + } // If it's a leaf, check that it's not duplicate if (isLeaf(node)) { if (isDuplicate(node, set)) { duplicates.push({ id: node.key, error: makeError('Tags', node.key, 'tag was found more than once in hierarchy. Ignoring duplicate.') - }); - delete parent.children[node.key]; + }) + delete parent.children[node.key] } else { - set.add(node.key); + set.add(node.key) } } else { // If it's not a leaf, simply keep going Object.values(node.children).forEach((childNode) => { - validateTree(childNode, node, set, duplicates); - }); + validateTree(childNode, node, set, duplicates) + }) } } From 7e705fee340f8e94c10571f84fc8a762551384ae Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 19 Nov 2018 15:01:22 +0000 Subject: [PATCH 4/7] rm some semicolons, add tags check in getTagFilters --- src/actions/index.js | 121 +++++++++++++++++++++-------------------- src/reducers/domain.js | 25 ++++----- src/selectors/index.js | 108 ++++++++++++++++++------------------ 3 files changed, 124 insertions(+), 130 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index ce86367..9df2fe0 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -58,7 +58,7 @@ export function fetchDomain () { return Promise.all([ eventPromise, catPromise, sitesPromise, tagsPromise]) .then(response => { - dispatch(toggleFetchingDomain()); + dispatch(toggleFetchingDomain()) const result = { events: response[0], categories: response[1], @@ -70,12 +70,12 @@ export function fetchDomain () { }) .catch(err => { dispatch(fetchError(err.message)) - dispatch(toggleFetchingDomain()); + dispatch(toggleFetchingDomain()) }) }; } -export const FETCH_ERROR = 'FETCH_ERROR'; +export const FETCH_ERROR = 'FETCH_ERROR' export function fetchError(message) { return { type: FETCH_ERROR, @@ -83,113 +83,114 @@ export function fetchError(message) { } } -export const UPDATE_DOMAIN = 'UPDATE_DOMAIN'; +export const UPDATE_DOMAIN = 'UPDATE_DOMAIN' export function updateDomain(domain) { - return { - type: UPDATE_DOMAIN, - domain: { - events: domain.events, - categories: domain.categories, - tags: domain.tags, - sites: domain.sites, - notifications: domain.notifications - } - }; + return { + type: UPDATE_DOMAIN, + domain: { + events: domain.events, + categories: domain.categories, + tags: domain.tags, + sites: domain.sites, + notifications: domain.notifications + } + } } -export function fetchEvents(events) { - return dispatch => { - dispatch(toggleFetchingEvents()); - const urls = events.map(eventUrlMap); - return Promise.all(urls.map(url => fetch(url) - .then(response => response.json()) - ) - ) - .then(json => { - dispatch(toggleFetchingEvents()); - return json; - }); - }; +export function fetchEvents (events) { + return dispatch => { + dispatch(toggleFetchingEvents()) + const urls = events.map(eventUrlMap) + return Promise.all( + urls.map(url => fetch(url) + .then(response => response.json()) + ) + ) + .then(json => { + dispatch(toggleFetchingEvents()) + return json + }) + } } -export const UPDATE_HIGHLIGHTED = 'UPDATE_HIGHLIGHTED'; +export const UPDATE_HIGHLIGHTED = 'UPDATE_HIGHLIGHTED' export function updateHighlighted(highlighted) { return { type: UPDATE_HIGHLIGHTED, highlighted: highlighted - }; + } } -export const UPDATE_SELECTED = 'UPDATE_SELECTED'; +export const UPDATE_SELECTED = 'UPDATE_SELECTED' export function updateSelected(selected) { return { type: UPDATE_SELECTED, selected: selected - }; + } } -export const UPDATE_DISTRICT = 'UPDATE_DISTRICT'; +export const UPDATE_DISTRICT = 'UPDATE_DISTRICT' export function updateDistrict(district) { return { type: UPDATE_DISTRICT, district - }; + } } -export const UPDATE_TAGFILTERS = 'UPDATE_TIMEFILTERS'; +export const UPDATE_TAGFILTERS = 'UPDATE_TIMEFILTERS' export function updateTagFilters(tag) { return { type: UPDATE_TAGFILTERS, tag - }; + } } -export const UPDATE_TIMERANGE = 'UPDATE_TIMERANGE'; +export const UPDATE_TIMERANGE = 'UPDATE_TIMERANGE' export function updateTimeRange(range) { return { type: UPDATE_TIMERANGE, range - }; + } } -export const RESET_ALLFILTERS = 'RESET_ALLFILTERS'; +export const RESET_ALLFILTERS = 'RESET_ALLFILTERS' export function resetAllFilters() { return { type: RESET_ALLFILTERS - }; + } } // UI -export const TOGGLE_FETCHING_DOMAIN = 'TOGGLE_FETCHING_DOMAIN'; +export const TOGGLE_FETCHING_DOMAIN = 'TOGGLE_FETCHING_DOMAIN' export function toggleFetchingDomain() { return { type: TOGGLE_FETCHING_DOMAIN - }; + } } -export const TOGGLE_FETCHING_EVENTS = 'TOGGLE_FETCHING_EVENTS'; +export const TOGGLE_FETCHING_EVENTS = 'TOGGLE_FETCHING_EVENTS' export function toggleFetchingEvents() { return { type: TOGGLE_FETCHING_EVENTS - }; + } } -export const TOGGLE_VIEW = 'TOGGLE_VIEW'; +export const TOGGLE_VIEW = 'TOGGLE_VIEW' export function toggleView() { return { type: TOGGLE_VIEW - }; + } } -export const TOGGLE_TIMELINE = 'TOGGLE_TIMELINE'; +export const TOGGLE_TIMELINE = 'TOGGLE_TIMELINE' export function toggleTimeline() { return { type: TOGGLE_TIMELINE - }; + } } -export const TOGGLE_LANGUAGE = 'TOGGLE_LANGUAGE'; +export const TOGGLE_LANGUAGE = 'TOGGLE_LANGUAGE' export function toggleLanguage(language) { return { type: TOGGLE_LANGUAGE, @@ -197,46 +198,46 @@ export function toggleLanguage(language) { } } -export const OPEN_TOOLBAR = 'OPEN_TOOLBAR'; +export const OPEN_TOOLBAR = 'OPEN_TOOLBAR' export function openToolbar(toolbarTab = 0) { return { type: OPEN_TOOLBAR, toolbarTab: toolbarTab, - }; + } } -export const CLOSE_TOOLBAR = 'CLOSE_TOOLBAR'; +export const CLOSE_TOOLBAR = 'CLOSE_TOOLBAR' export function closeToolbar() { return { type: CLOSE_TOOLBAR - }; + } } -export const OPEN_CABINET = 'OPEN_CABINET'; +export const OPEN_CABINET = 'OPEN_CABINET' export function openCabinet(tabNum) { return { type: OPEN_CABINET, tabNum: tabNum, - }; + } } -export const CLOSE_CABINET = 'CLOSE_CABINET'; +export const CLOSE_CABINET = 'CLOSE_CABINET' export function closeCabinet() { return { type: CLOSE_CABINET - }; + } } -export const TOGGLE_INFOPOPUP = 'TOGGLE_INFOPOPUP'; +export const TOGGLE_INFOPOPUP = 'TOGGLE_INFOPOPUP' export function toggleInfoPopup() { return { type: TOGGLE_INFOPOPUP - }; + } } -export const TOGGLE_NOTIFICATIONS = 'TOGGLE_NOTIFICATIONS'; +export const TOGGLE_NOTIFICATIONS = 'TOGGLE_NOTIFICATIONS' export function toggleNotifications() { return { type: TOGGLE_NOTIFICATIONS - }; + } } diff --git a/src/reducers/domain.js b/src/reducers/domain.js index 11a64d9..4e56634 100644 --- a/src/reducers/domain.js +++ b/src/reducers/domain.js @@ -1,25 +1,22 @@ -import initial from '../store/initial.js'; +import initial from '../store/initial.js' -import { - UPDATE_DOMAIN, -} from '../actions'; +import { UPDATE_DOMAIN } from '../actions' +import { parseDateTimes } from './utils/helpers.js' +import { validate } from './utils/validators.js' -import { parseDateTimes } from './utils/helpers.js'; -import { validate } from './utils/validators.js'; +function updateDomain (domainState, action) { + action.domain.events = parseDateTimes(action.domain.events) -function updateDomain(domainState, action) { - action.domain.events = parseDateTimes(action.domain.events); - - return Object.assign({}, domainState, validate(action.domain)); + return Object.assign({}, domainState, validate(action.domain)) } -function domain(domainState = initial.domain, action) { +function domain (domainState = initial.domain, action) { switch (action.type) { case UPDATE_DOMAIN: - return updateDomain(domainState, action); + return updateDomain(domainState, action) default: - return domainState; + return domainState } } -export default domain; +export default domain diff --git a/src/selectors/index.js b/src/selectors/index.js index cd0bb46..5a8f00b 100644 --- a/src/selectors/index.js +++ b/src/selectors/index.js @@ -3,60 +3,60 @@ import { } from 'reselect' // Input selectors -export const getEvents = state => state.domain.events; -export const getLocations = state => state.domain.locations; -export const getCategories = state => state.domain.categories; +export const getEvents = state => state.domain.events +export const getLocations = state => state.domain.locations +export const getCategories = state => state.domain.categories export const getSites = (state) => { - if (process.env.features.USE_SITES) return state.domain.sites; - return []; + if (process.env.features.USE_SITES) return state.domain.sites + return [] } -export const getAllTags = state => state.domain.tags; +export const getAllTags = state => state.domain.tags -export const getCategoriesFilter = state => state.app.filters.categories; -export const getTagsFilter = state => state.app.filters.tags; -export const getRangeFilter = state => state.app.filters.range; +export const getCategoriesFilter = state => state.app.filters.categories +export const getTagsFilter = state => state.app.filters.tags +export const getRangeFilter = state => state.app.filters.range // NB: should we stick with the default semantics and name these as selectors? // e.g. 'selectEvents', 'selectCoevents'. // Filter events -function isTaggedIn(event, tagFilters) { +function isTaggedIn (event, tagFilters) { if (event.tags) { - const tagsArray = event.tags.split(","); + const tagsArray = event.tags.split(',') const isTagged = tagsArray.some((tag) => { return tagFilters.find((tagFilter) => { - return (tagFilter.key === tag && tagFilter.active); + return (tagFilter.key === tag && tagFilter.active) }) - }); - return isTagged; + }) + return isTagged } else { - return false; + return false } } - /** * Of all available events, selects those that fall within the time range, * and if TAGS are being used, select them if their tags are enabled */ export const getFilteredEvents = createSelector( - [getEvents, getTagsFilter, getRangeFilter], - (events, tagFilters, rangeFilter) => { + [getEvents, getTagsFilter, getRangeFilter], + (events, tagFilters, rangeFilter) => { + return events.reduce((acc, value) => { + const noTags = (tagFilters.length === 0 || !process.env.features.USE_TAGS || tagFilters.every(t => !t.active)) - return events.reduce((acc, value) => { - const noTags = (tagFilters.length === 0 || !process.env.features.USE_TAGS || tagFilters.every(t => !t.active)); + const isTagged = (noTags) || isTaggedIn(value, tagFilters) - const isTagged = (noTags) || isTaggedIn(value, tagFilters); + // TODO: put this datetime format as a constant + const isRange = (rangeFilter[0] < d3.timeParse('%Y-%m-%dT%H:%M:%S')(value.timestamp)) && + (d3.timeParse('%Y-%m-%dT%H:%M:%S')(value.timestamp) < rangeFilter[1]) - const isRange = (rangeFilter[0] < d3.timeParse("%Y-%m-%dT%H:%M:%S")(value.timestamp)) && - (d3.timeParse("%Y-%m-%dT%H:%M:%S")(value.timestamp) < rangeFilter[1]); - - if (isRange && isTagged) { - const event = Object.assign({}, value); - acc[event.id] = event; - } - return acc; - }, []); -}); + if (isRange && isTagged) { + const event = Object.assign({}, value) + acc[event.id] = event + } + return acc + }, []) + } +) /** * Of all the filtered events, group them by location and return a list of @@ -65,12 +65,11 @@ export const getFilteredEvents = createSelector( export const getFilteredLocations = createSelector( [getFilteredEvents], (events) => { - - const filteredLocations = {}; + const filteredLocations = {} events.forEach(event => { - const location = event.location; + const location = event.location if (filteredLocations[location]) { - filteredLocations[location].events.push(event); + filteredLocations[location].events.push(event) } else { filteredLocations[location] = { label: location, @@ -81,17 +80,15 @@ export const getFilteredLocations = createSelector( } }) - // Make locations an array are remove if any are undefined - return Object.values(filteredLocations).filter(item => item); -}); + // Make locations an array are remove if any are undefined + return Object.values(filteredLocations).filter(item => item) + } +) // Filter categories export const getFilteredCategories = createSelector( [getCategories], - (categories) => { - - return Object.values(categories); - }); + (categories) => Object.values(categories)) /** * Return categories by group @@ -99,13 +96,12 @@ export const getFilteredCategories = createSelector( export const getCategoryGroups = createSelector( [getFilteredCategories], (categories) => { - const groups = {}; - categories.forEach((t) => { if (t.group && !groups[t.group]) { groups[t.group] = t.group_label } }); - return Object.keys(groups).concat(['other']); + const groups = {} + categories.forEach((t) => { if (t.group && !groups[t.group]) { groups[t.group] = t.group_label } }) + return Object.keys(groups).concat(['other']) } ) - /** * Given a tree of tags, return those tags as a list, where each node has been * aware of its depth, and given an 'active' flag @@ -113,22 +109,22 @@ export const getCategoryGroups = createSelector( export const getTagFilters = createSelector( [getAllTags], (tags) => { - const allTagFilters = []; - let depth = 0; - function traverseNode(node, depth) { - node.active = (!node.hasOwnProperty('active')) ? false : node.active; - node.depth = depth; + const allTagFilters = [] + let depth = 0 + function traverseNode (node, depth) { + node.active = (!node.hasOwnProperty('active')) ? false : node.active + node.depth = depth if (node.active) allTagFilters.push(node) - depth = depth + 1; + depth = depth + 1 if (Object.keys(node.children).length > 0) { Object.values(node.children).forEach((childNode) => { - traverseNode(childNode, depth); - }); + traverseNode(childNode, depth) + }) } } - if (tags.key && tags.children) traverseNode(tags, depth) - return allTagFilters; + if (tags && tags.key && tags.children) traverseNode(tags, depth) + return allTagFilters } ) From 8c82a9c24cf6b3339de0ec2bc06efb8b60361c1b Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 19 Nov 2018 15:13:51 +0000 Subject: [PATCH 5/7] add wiki link to readme From 96e30ad80664b23d77ccf8f34ce52f1d2fa0c7f1 Mon Sep 17 00:00:00 2001 From: Lachie Kermode Date: Mon, 19 Nov 2018 16:45:04 +0000 Subject: [PATCH 6/7] update example.config.js --- config.example.js | 17 ----------------- example.config.js | 14 +++++++------- 2 files changed, 7 insertions(+), 24 deletions(-) delete mode 100644 config.example.js diff --git a/config.example.js b/config.example.js deleted file mode 100644 index 7a5272b..0000000 --- a/config.example.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - title: 'Example', - SERVER_ROOT: 'http://localhost:4040', - EVENT_EXT: '/api/example/export_events/rows', - CATEGORY_EXT: '/api/example/export_categories/rows', - EVENT_DESC_ROOT: '/api/example/export_events/ids', - TAG_TREE_EXT: '/api/example/export_tags/tree', - SITES_EXT: '/api/example/export_sites/rows', - MAP_ANCHOR: [31.356397, 34.784818], - INCOMING_DATETIME_FORMAT: '%m/%d/%YT%H:%M', - MAPBOX_TOKEN: 'your_token', - features: { - USE_TAGS: true, - USE_SEARCH: false, - USE_SITES: true - } -} diff --git a/example.config.js b/example.config.js index 140f041..92de30c 100644 --- a/example.config.js +++ b/example.config.js @@ -1,12 +1,12 @@ module.exports = { - title: 'EXAMPLE_TITLE', + title: 'Example', SERVER_ROOT: 'http://localhost:4040', - EVENT_EXT: '/api//MAP2D_dev/rows', - CATEGORY_EXT: '/api//MAP2D_dev_category/rows', - EVENT_DESC_ROOT: '/api//MAP2D_dev/ids', - TAG_TREE_EXT: '/api//MAP2D_dev_tags/tree', - SITES_EXT: '/api//MAP2D_dev_sites/rows', - MAP_ANCHOR: [27.5813121, -18.5161798], + EVENT_EXT: '/api/example/export_events/rows', + CATEGORY_EXT: '/api/example/export_categories/rows', + EVENT_DESC_ROOT: '/api/example/export_events/ids', + TAG_TREE_EXT: '/api/example/export_tags/tree', + SITES_EXT: '/api/example/export_sites/rows', + MAP_ANCHOR: [31.356397, 34.784818], INCOMING_DATETIME_FORMAT: '%m/%d/%YT%H:%M', MAPBOX_TOKEN: 'SOME_MAPBOX_TOKEN', features: { From c3fc243f490b4449f2cb616ec7a74cb46013d64a Mon Sep 17 00:00:00 2001 From: Lachie Kermode Date: Mon, 19 Nov 2018 16:47:32 +0000 Subject: [PATCH 7/7] update travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 575e07a..96babc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ cache: - node_modules before_script: - npm install -g yarn - - cp config.example.js config.js + - cp example.config.js config.js install: - yarn script: