diff --git a/src/actions/index.js b/src/actions/index.js
index 99f65e0..590f56d 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -16,6 +16,16 @@ const NARRATIVE_URL = urlFromEnv('NARRATIVE_EXT');
const SITES_URL = urlFromEnv('SITES_EXT');
const eventUrlMap = (event) => `${process.env.SERVER_ROOT}${process.env.EVENT_DESC_ROOT}/${(event.id) ? event.id : event}`;
+
+const DEBUG_GER = 'DEBUG_GER'
+function _debugger(value) {
+ console.log(value)
+ return {
+ type: DEBUG_GER,
+ value
+ }
+}
+
/*
* Create an error notification object
* Types: ['error', 'warning', 'good', 'neural']
@@ -64,7 +74,7 @@ export function fetchDomain () {
.catch(handleError('sites'))
}
- let tagsPromise
+ let tagsPromise = Promise.resolve([])
if (process.env.features.USE_TAGS) {
tagsPromise = fetch(TAG_URL)
.then(response => response.json())
@@ -118,7 +128,6 @@ export function updateDomain(domain) {
export function fetchSelected(selected) {
if (!selected || !selected.length || selected.length === 0) {
- console.log('hitting base')
return updateSelected([])
}
return dispatch => {
@@ -127,6 +136,23 @@ export function fetchSelected(selected) {
dispatch(fetchSourceError('No source extension specified.'))
} else {
dispatch(toggleFetchingSources())
+
+ fetch(SOURCES_URL)
+ .then(response => {
+ if (!response.ok) {
+ throw new Error('No sources are available at the URL specified in the config specified.')
+ } else {
+ return response.json()
+ }
+ })
+ .then(sources => {
+ dispatch(_debugger(sources))
+ })
+ .catch(err => {
+ dispatch(fetchSourceError(err.message))
+ dispatch(toggleFetchingSources())
+ })
+
}
}
diff --git a/src/components/Card.jsx b/src/components/Card.jsx
index 0184063..520b7b9 100644
--- a/src/components/Card.jsx
+++ b/src/components/Card.jsx
@@ -89,8 +89,12 @@ class Card extends React.Component {
renderSource() {
return (
TODO: display source properly.
{source}
+ {renderContent()}{descriptionText}
+{description}