Add narrative schemas

This commit is contained in:
Franc Camps-Febrer
2018-12-03 16:40:27 +00:00
parent 85b31f59a0
commit e02b1c93e1
8 changed files with 36 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ import {
export const getEvents = state => state.domain.events
export const getLocations = state => state.domain.locations
export const getCategories = state => state.domain.categories
export const getNarratives = state => state.domain.narratives
export const getSites = (state) => {
if (process.env.features.USE_SITES) return state.domain.sites
return []
@@ -84,8 +85,8 @@ export const selectEvents = createSelector(
* and if TAGS are being used, select them if their tags are enabled
*/
export const selectNarratives = createSelector(
[getEvents, getTagsFilter, getTimeRange],
(events, tagFilters, timeRange) => {
[getEvents, getNarratives, getTagsFilter, getTimeRange],
(events, narrativeMetadata, tagFilters, timeRange) => {
const narratives = {};
events.forEach((evt) => {
@@ -112,7 +113,7 @@ export const selectNarratives = createSelector(
narratives[key].byId[step.id].prev = (i > 0) ? steps[i - 1] : null;
});
});
console.log(narrativeMetadata, narratives)
return Object.values(narratives);
});