From 0c54e07f8f7c86b9788f1460d13b5e013df18d17 Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Wed, 12 Dec 2018 15:52:10 +0000 Subject: [PATCH] fetchSelected -> updateSelected --- src/actions/index.js | 8 ++------ src/components/Dashboard.jsx | 2 +- src/store/initial.js | 14 ++++---------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index 590f56d..ce48225 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -126,18 +126,14 @@ export function updateDomain(domain) { } -export function fetchSelected(selected) { - if (!selected || !selected.length || selected.length === 0) { - return updateSelected([]) - } +export function fetchSource(source) { return dispatch => { - dispatch(updateSelected(selected)) if (!SOURCES_URL) { dispatch(fetchSourceError('No source extension specified.')) } else { dispatch(toggleFetchingSources()) - fetch(SOURCES_URL) + fetch(`${SOURCES_URL}`) .then(response => { if (!response.ok) { throw new Error('No sources are available at the URL specified in the config specified.') diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 744b990..ef5e0d5 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -51,7 +51,7 @@ class Dashboard extends React.Component { let eventsToSelect = selected.map(event => this.getEventById(event.id)); eventsToSelect = eventsToSelect.sort((a, b) => parseDate(a.timestamp) - parseDate(b.timestamp)) - this.props.actions.fetchSelected(eventsToSelect) + this.props.actions.updateSelected(eventsToSelect) } } diff --git a/src/store/initial.js b/src/store/initial.js index dbe0dd7..03d8fef 100644 --- a/src/store/initial.js +++ b/src/store/initial.js @@ -106,7 +106,7 @@ const initial = { ui: { style: { categories: { - default: 'red', + default: 'yellow', // Add here other categories to differentiate by color, like: alpha: '#00ff00', beta: '#ff0000', @@ -115,17 +115,11 @@ const initial = { narratives: { default: { - style: 'dotted', // ['dotted', 'solid'] - opacity: 0.9, // range between 0 and 1 - stroke: 'red', // Any hex or rgb code + style: 'solid', // ['dotted', 'solid'] + opacity: 0.5, // range between 0 and 1 + stroke: 'transparent', // Any hex or rgb code strokeWidth: 2 }, - narrative_1: { - style: 'solid', // ['dotted', 'solid'] - opacity: 0.4, // range between 0 and 1 - stroke: '#f18f01', // Any hex or rgb code - strokeWidth: 2 - } } }, dom: {