this.selectNarrativeStep(this.props.app.narrativeState.current + 1),
- onPrev: () => this.selectNarrativeStep(this.props.app.narrativeState.current - 1),
+ onNext: () => this.selectNarrativeStep(this.props.narrativeIdx + 1),
+ onPrev: () => this.selectNarrativeStep(this.props.narrativeIdx - 1),
onSelectNarrative: this.setNarrative
}}
/>
@@ -367,6 +361,11 @@ function mapDispatchToProps (dispatch) {
}
export default connect(
- state => state,
+ state => ({
+ ...state,
+ narrativeIdx: selectors.selectNarrativeIdx(state),
+ narratives: selectors.selectNarratives(state),
+ selected: selectors.selectSelected(state)
+ }),
mapDispatchToProps
)(Dashboard)
diff --git a/src/components/Map.jsx b/src/components/Map.jsx
index e74462c..ce971be 100644
--- a/src/components/Map.jsx
+++ b/src/components/Map.jsx
@@ -276,11 +276,11 @@ function mapStateToProps (state) {
shapes: selectors.selectShapes(state)
},
app: {
- views: state.app.filters.views,
+ views: state.app.associations.views,
selected: selectors.selectSelected(state),
highlighted: state.app.highlighted,
map: state.app.map,
- narrative: state.app.narrative,
+ narrative: state.app.associations.narrative,
flags: {
isShowingSites: state.app.flags.isShowingSites
}
diff --git a/src/components/Timeline.jsx b/src/components/Timeline.jsx
index bd34538..11b9d87 100644
--- a/src/components/Timeline.jsx
+++ b/src/components/Timeline.jsx
@@ -398,7 +398,7 @@ class Timeline extends React.Component {
function mapStateToProps (state) {
return {
dimensions: selectors.selectDimensions(state),
- isNarrative: !!state.app.narrative,
+ isNarrative: !!state.app.associations.narrative,
domain: {
events: selectors.selectStackedEvents(state),
projects: selectors.selectProjects(state),
@@ -409,7 +409,7 @@ function mapStateToProps (state) {
selected: state.app.selected,
language: state.app.language,
timeline: state.app.timeline,
- narrative: state.app.narrative
+ narrative: state.app.associations.narrative
},
ui: {
dom: state.ui.dom,
diff --git a/src/components/Toolbar/FilterListPanel.js b/src/components/Toolbar/FilterListPanel.js
index 53bb31a..c3447f1 100644
--- a/src/components/Toolbar/FilterListPanel.js
+++ b/src/components/Toolbar/FilterListPanel.js
@@ -3,57 +3,71 @@ import Checkbox from '../presentational/Checkbox'
import copy from '../../common/data/copy.json'
/** recursively get an array of node keys to toggle */
-function childrenToToggle (node, activeFilters, parentOn) {
- const isOn = activeFilters.includes(node.key)
- if (!node.children) {
- return [node.key]
+function childrenToToggle (filter, activeFilters, parentOn) {
+ const [key, children] = filter
+ const isOn = activeFilters.includes(key)
+ if (children === {}) {
+ return [key]
}
- const childKeys = Object.values(node.children)
- .flatMap(n => childrenToToggle(n, activeFilters, isOn))
+ const childKeys = Object.entries(children)
+ .flatMap(filter => childrenToToggle(filter, activeFilters, isOn))
// NB: if turning a parent off, don't toggle off children on.
// likewise if turning a parent on, don't toggle on children off
if (!((!parentOn && isOn) || (parentOn && !isOn))) {
- childKeys.push(node.key)
+ childKeys.push(key)
}
return childKeys
}
+function aggregatePaths (filters) {
+ function insertPath (children = {}, [headOfPath, ...remainder]) {
+ let childKey = Object.keys(children).find(key => key === headOfPath)
+ if (!childKey) children[headOfPath] = {}
+ if (remainder.length > 0) insertPath(children[headOfPath], remainder)
+ return children
+ }
+
+ const allPaths = []
+ filters.forEach(filterItem => allPaths.push(filterItem.filter_paths))
+
+ let aggregatedPaths = allPaths.reduce((children, path) => insertPath(children, path), {})
+ return aggregatedPaths
+}
+
function FilterListPanel ({
filters,
activeFilters,
onSelectFilter,
language
}) {
- function createNodeComponent (node, depth) {
- const matchingKeys = childrenToToggle(node, activeFilters, activeFilters.includes(node.key))
- const children = Object.values(node.children)
+ function createNodeComponent (filter, depth) {
+ const [key, children] = filter
+ const matchingKeys = childrenToToggle(filter, activeFilters, activeFilters.includes(key))
+
return (
- {/* */}
onSelectFilter(matchingKeys)}
/>
- {children.length > 0
- ? children.map(filter => createNodeComponent(filter, depth + 1))
+ {Object.keys(children).length > 0
+ ? Object.entries(children).map(filter => createNodeComponent(filter, depth + 1))
: null}
)
}
- function renderTree (children) {
+ function renderTree (filters) {
+ const aggregatedFilterPaths = aggregatePaths(filters)
+
return (
- {Object.values(children).map(filter => createNodeComponent(filter, 1))}
+ {Object.entries(aggregatedFilterPaths).map(filter => createNodeComponent(filter, 1))}
)
}
@@ -62,7 +76,7 @@ function FilterListPanel ({
{copy[language].toolbar.filters}
{copy[language].toolbar.explore_by_filter__description}
- {renderTree(filters.children)}
+ {renderTree(filters)}
)
}
diff --git a/src/components/Toolbar/Layout.js b/src/components/Toolbar/Layout.js
index feaa8e0..cceab2a 100644
--- a/src/components/Toolbar/Layout.js
+++ b/src/components/Toolbar/Layout.js
@@ -62,8 +62,8 @@ class Toolbar extends React.Component {
return (
)
@@ -113,15 +113,15 @@ class Toolbar extends React.Component {
}
renderToolbarPanels () {
- const { features } = this.props
+ const { features, narratives } = this.props
let classes = (this.state._selected >= 0) ? 'toolbar-panels' : 'toolbar-panels folded'
return (
{this.renderClosePanel()}
- {features.USE_NARRATIVES ? this.renderToolbarNarrativePanel() : null}
+ {narratives && narratives.length !== 0 ? this.renderToolbarNarrativePanel() : null}
{features.CATEGORIES_AS_FILTERS ? this.renderToolbarCategoriesPanel() : null}
- {features.USE_FILTERS ? this.renderToolbarFilterPanel() : null}
+ {features.USE_ASSOCIATIONS ? this.renderToolbarFilterPanel() : null}
)
@@ -145,7 +145,8 @@ class Toolbar extends React.Component {
}
renderToolbarTabs () {
- const { features } = this.props
+ const { features, narratives } = this.props
+ const narrativesExist = narratives && narratives.length !== 0
let title = copy[this.props.language].toolbar.title
if (process.env.display_title) title = process.env.display_title
const narrativesLabel = copy[this.props.language].toolbar.narratives_label
@@ -153,17 +154,17 @@ class Toolbar extends React.Component {
const categoriesLabel = 'Categories' // TODO:
const narrativesIdx = 0
- const categoriesIdx = features.USE_NARRATIVES ? 1 : 0
- const filtersIdx = (features.USE_NARRATIVES && features.CATEGORIES_AS_FILTERS) ? 2 : (
- features.USE_NARRATIVES || features.CATEGORIES_AS_FILTERS ? 1 : 0
+ const categoriesIdx = narrativesExist ? 1 : 0
+ const filtersIdx = (narrativesExist && features.CATEGORIES_AS_FILTERS) ? 2 : (
+ narrativesExist || features.CATEGORIES_AS_FILTERS ? 1 : 0
)
return (
- {features.USE_NARRATIVES ? this.renderToolbarTab(narrativesIdx, narrativesLabel, 'timeline') : null}
+ {narrativesExist ? this.renderToolbarTab(narrativesIdx, narrativesLabel, 'timeline') : null}
{features.CATEGORIES_AS_FILTERS ? this.renderToolbarTab(categoriesIdx, categoriesLabel, 'widgets') : null}
- {features.USE_FILTERS ? this.renderToolbarTab(filtersIdx, filtersLabel, 'filter_list') : null}
+ {features.USE_ASSOCIATIONS ? this.renderToolbarTab(filtersIdx, filtersLabel, 'filter_list') : null}
{
- const filtersLang = copy[language].cardstack.filters
- const noFiltersLang = copy[language].cardstack.nofilters
-
- if (filters.length > 0) {
- return (
-
-
{filtersLang}:
-
- {filters.map((filter, idx) => {
- return (
-
- {filter.name}
- {(idx < filters.length - 1)
- ? ','
- : ''}
-
- )
- })}
-
-
- )
- }
- return (
-
-
{filtersLang}
-
{noFiltersLang}
-
- )
-}
-
-export default CardFilters
diff --git a/src/components/presentational/Card/Narrative.js b/src/components/presentational/Card/Narrative.js
deleted file mode 100644
index 150180f..0000000
--- a/src/components/presentational/Card/Narrative.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react'
-
-import CardNarrativeLink from './NarrativeLink'
-
-const CardNarrative = (props) => (
-
-)
-
-export default CardNarrative
diff --git a/src/components/presentational/Card/NarrativeLink.js b/src/components/presentational/Card/NarrativeLink.js
deleted file mode 100644
index b292e16..0000000
--- a/src/components/presentational/Card/NarrativeLink.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from 'react'
-
-const CardNarrativeLink = ({ event, makeTimelabel, select }) => {
- if (event !== null) {
- const timelabel = makeTimelabel(event.timestamp)
-
- return (
- select(event)}>
- {`${timelabel} / ${event.location}`}
-
- )
- }
-
- return (None)
-}
-
-export default CardNarrativeLink
diff --git a/src/components/presentational/Map/Narratives.js b/src/components/presentational/Map/Narratives.js
index 8e0aefa..cbae8c7 100644
--- a/src/components/presentational/Map/Narratives.js
+++ b/src/components/presentational/Map/Narratives.js
@@ -26,6 +26,8 @@ function MapNarratives ({
return styles[styleName]
}
+ const narrativesExist = narratives && narratives.length !== 0
+
function hasNoLocation (step) {
return (step.latitude === '' || step.longitude === '')
}
@@ -141,7 +143,7 @@ function MapNarratives ({
let lastMarked = null
- if (features.FILTERS_AS_NARRATIVES) {
+ if (narrativesExist) {
for (let idx = 0; idx < n.steps.length; idx += 1) {
const step = n.steps[idx]
if (lastMarked) {
@@ -174,7 +176,7 @@ function MapNarratives ({
function renderNarrative (n) {
const narrativeId = `narrative-${n.id.replace(/ /g, '_')}`
- const body = features.FILTERS_AS_NARRATIVES
+ const body = narrativesExist
? renderBetweenMarked(n)
: (features.NARRATIVE_STEP_STYLES
? renderBetweenMarked(n)
diff --git a/src/reducers/app.js b/src/reducers/app.js
index c94785d..c1761f9 100644
--- a/src/reducers/app.js
+++ b/src/reducers/app.js
@@ -83,17 +83,19 @@ function updateNarrative (appState, action) {
minTime = minTime - Math.abs((maxTime - minTime) / 10)
maxTime = maxTime + Math.abs((maxTime - minTime) / 10)
}
-
return {
...appState,
- narrative: action.narrative,
- narrativeState: {
- current: action.narrative ? 0 : null
+ associations: {
+ ...appState.associations,
+ narrative: action.narrative
},
- filters: {
- ...appState.filters,
- timerange: [minTime, maxTime],
- mapBounds: (action.narrative) ? [cornerBound0, cornerBound1] : null
+ map: {
+ ...appState.map,
+ bounds: (action.narrative) ? [cornerBound0, cornerBound1] : null
+ },
+ timeline: {
+ ...appState.timeline,
+ range: [minTime, maxTime]
}
}
}
@@ -112,7 +114,7 @@ function toggleFilter (appState, action) {
action.value = [action.value]
}
- let newFilters = appState.filters[action.filter].slice(0)
+ let newFilters = appState.associations.filters.slice(0)
action.value.forEach(vl => {
if (newFilters.includes(vl)) {
newFilters = newFilters.filter(s => s !== vl)
@@ -123,9 +125,9 @@ function toggleFilter (appState, action) {
return {
...appState,
- filters: {
- ...appState.filters,
- [action.filter]: newFilters
+ associations: {
+ ...appState.associations,
+ filters: newFilters
}
}
}
diff --git a/src/reducers/validate/associationsSchema.js b/src/reducers/validate/associationsSchema.js
new file mode 100644
index 0000000..4d921cc
--- /dev/null
+++ b/src/reducers/validate/associationsSchema.js
@@ -0,0 +1,10 @@
+import Joi from 'joi'
+
+const associationsSchema = Joi.object().keys({
+ id: Joi.string().allow('').required(),
+ desc: Joi.string().allow(''),
+ mode: Joi.string().allow('').required(),
+ filter_paths: Joi.array()
+})
+
+export default associationsSchema
diff --git a/src/reducers/validate/eventSchema.js b/src/reducers/validate/eventSchema.js
index 6b7cb64..312f7da 100644
--- a/src/reducers/validate/eventSchema.js
+++ b/src/reducers/validate/eventSchema.js
@@ -23,10 +23,8 @@ function createEventSchema (custom) {
type: Joi.string().allow(''),
category: Joi.string().allow(''),
category_full: Joi.string().allow(''),
- narratives: Joi.array(),
+ associations: Joi.array(),
sources: Joi.array(),
- filters: Joi.array().allow(''),
- tags: Joi.array().allow(''),
comments: Joi.string().allow(''),
time_display: Joi.string().allow(''),
// nested
diff --git a/src/reducers/validate/narrativeSchema.js b/src/reducers/validate/narrativeSchema.js
deleted file mode 100644
index 2f4c8ff..0000000
--- a/src/reducers/validate/narrativeSchema.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import Joi from 'joi'
-
-const narrativeSchema = Joi.object().keys({
- id: Joi.string().required(),
- description: Joi.string().allow('').required(),
- label: Joi.string().required()
-})
-
-export default narrativeSchema
diff --git a/src/reducers/validate/validators.js b/src/reducers/validate/validators.js
index 05e6dbb..486458c 100644
--- a/src/reducers/validate/validators.js
+++ b/src/reducers/validate/validators.js
@@ -3,11 +3,11 @@ import Joi from 'joi'
import createEventSchema from './eventSchema'
import categorySchema from './categorySchema'
import siteSchema from './siteSchema'
-import narrativeSchema from './narrativeSchema'
+import associationsSchema from './associationsSchema'
import sourceSchema from './sourceSchema'
import shapeSchema from './shapeSchema'
-import { calcDatetime, capitalize, isFilterLeaf, isFilterDuplicate } from '../../common/utilities'
+import { calcDatetime, capitalize } from '../../common/utilities'
/*
* Create an error notification object
@@ -25,50 +25,20 @@ function isValidDate (d) {
return d instanceof Date && !isNaN(d)
}
-/*
-* Traverse a filter tree and check its duplicates. Also recompose as
-* description if `features.USE_FILTER_DESCRIPTIONS` is true.
-*/
-function validateFilterTree (node, parent, set, duplicates, hasFilterDescriptions) {
- if (hasFilterDescriptions) {
- if (node.key === '_root') {
- node.isDescription = true // setting first set of nodes to values
- } else if (!parent.isDescription) {
- node.isDescription = true
- } else {
- node.isDescription = false
- }
-
- if (node.isDescription && node.key !== 'root') {
- parent.description = node.key
- parent.children = node.children
- delete parent.isDescription
- }
- if (isFilterLeaf(node)) {
- delete parent.isDescription
- }
- }
-
- if (typeof (node) !== 'object' || typeof (node.children) !== 'object') {
- return
- }
- // If it's a leaf, check that it's not duplicate
- if (isFilterLeaf(node)) {
- if (isFilterDuplicate(node, set)) {
+function findDuplicateAssociations (associations) {
+ const seenSet = new Set([])
+ const duplicates = []
+ associations.forEach(item => {
+ if (seenSet.has(item.id)) {
duplicates.push({
- id: node.key,
- error: makeError('Filters', node.key, 'filter was found more than once in hierarchy. Ignoring duplicate.')
+ id: item.id,
+ error: makeError('Association', item.id, 'association was found more than once. Ignoring duplicate.')
})
- delete parent.children[node.key]
} else {
- set.add(node.key)
+ seenSet.add(item.id)
}
- } else {
- // If it's not a leaf, simply keep going
- Object.values(node.children).forEach((childNode) => {
- validateFilterTree(childNode, node, set, duplicates, hasFilterDescriptions)
- })
- }
+ })
+ return duplicates
}
/*
@@ -79,9 +49,8 @@ export function validateDomain (domain, features) {
events: [],
categories: [],
sites: [],
- narratives: [],
+ associations: [],
sources: {},
- filters: {},
shapes: [],
notifications: domain ? domain.notifications : null
}
@@ -94,7 +63,7 @@ export function validateDomain (domain, features) {
events: [],
categories: [],
sites: [],
- narratives: [],
+ associations: [],
sources: [],
shapes: []
}
@@ -114,12 +83,6 @@ export function validateDomain (domain, features) {
function validateArray (items, domainKey, schema) {
items.forEach(item => {
- // NB: backwards compatibility with 'tags' for 'filters'
- if (domainKey === 'events') {
- if (!item.filters && !!item.tags) {
- item.filters = item.tags
- }
- }
validateArrayItem(item, domainKey, schema)
})
}
@@ -149,7 +112,7 @@ export function validateDomain (domain, features) {
validateArray(domain.events, 'events', eventSchema)
validateArray(domain.categories, 'categories', categorySchema)
validateArray(domain.sites, 'sites', siteSchema)
- validateArray(domain.narratives, 'narratives', narrativeSchema)
+ validateArray(domain.associations, 'associations', associationsSchema)
validateObject(domain.sources, 'sources', sourceSchema)
validateObject(domain.shapes, 'shapes', shapeSchema)
@@ -162,20 +125,16 @@ export function validateDomain (domain, features) {
})
)
- // Validate uniqueness of filters
- const filterSet = new Set([])
- const duplicateFilters = []
- validateFilterTree(domain.filters, {}, filterSet, duplicateFilters, features.USE_FILTER_DESCRIPTIONS)
-
- // Duplicated filters
- if (duplicateFilters.length > 0) {
+ const duplicateAssociations = findDuplicateAssociations(domain.associations)
+ // Duplicated associations
+ if (duplicateAssociations.length > 0) {
sanitizedDomain.notifications.push({
- message: `Filters are required to be unique. Ignoring duplicates for now.`,
- items: duplicateFilters,
+ message: `Associations are required to be unique. Ignoring duplicates for now.`,
+ items: duplicateAssociations,
type: 'error'
})
}
- sanitizedDomain.filters = domain.filters
+ sanitizedDomain.associations = domain.associations
// append events with datetime and sort
sanitizedDomain.events = sanitizedDomain.events.filter((event, idx) => {
diff --git a/src/selectors/index.js b/src/selectors/index.js
index 9441594..4b5d2b6 100644
--- a/src/selectors/index.js
+++ b/src/selectors/index.js
@@ -1,24 +1,24 @@
import { createSelector } from 'reselect'
import { insetSourceFrom, dateMin, dateMax } from '../common/utilities'
import { isTimeRangedIn } from './helpers'
+import { FILTER_MODE, NARRATIVE_MODE } from '../common/constants'
// Input selectors
export const getEvents = state => state.domain.events
export const getCategories = state => state.domain.categories
-export const getNarratives = state => state.domain.narratives
-export const getActiveNarrative = state => state.app.narrative
-export const getActiveStep = state => state.app.narrativeState.current
+export const getNarratives = state => state.domain.associations.filter(item => item.mode === NARRATIVE_MODE)
+export const getActiveNarrative = state => state.app.associations.narrative
export const getSelected = state => state.app.selected
export const getSites = state => state.domain.sites
export const getSources = state => state.domain.sources
export const getShapes = state => state.domain.shapes
+export const getFilters = state => state.domain.associations.filter(item => item.mode === FILTER_MODE)
export const getNotifications = state => state.domain.notifications
-export const getFilterTree = state => state.domain.filters
-export const getActiveFilters = state => state.app.filters.filters
-export const getActiveCategories = state => state.app.filters.categories
+export const getActiveFilters = state => state.app.associations.filters
+export const getActiveCategories = state => state.app.associations.categories
export const getTimeRange = state => state.app.timeline.range
export const getTimelineDimensions = state => state.app.timeline.dimensions
-export const selectNarrative = state => state.app.narrative
+export const selectNarrative = state => state.app.associations.narrative
export const getFeatures = state => state.features
export const getEventRadius = state => state.ui.eventRadius
@@ -49,9 +49,9 @@ export const selectEvents = createSelector(
[getEvents, getActiveFilters, getActiveCategories, getTimeRange, getFeatures],
(events, activeFilters, activeCategories, timeRange, features) => {
return events.reduce((acc, event) => {
- const isMatchingFilter = (event.filters &&
- event.filters.map(filter =>
- activeFilters.includes(filter))
+ const isMatchingFilter = (event.associations &&
+ event.associations.map(association =>
+ activeFilters.includes(association))
.some(s => s)
) || activeFilters.length === 0
const isActiveFilter = isMatchingFilter || activeFilters.length === 0
@@ -76,7 +76,7 @@ export const selectEvents = createSelector(
export const selectNarratives = createSelector(
[getEvents, getNarratives, getSources, getFeatures],
(events, narrativesMeta, sources, features) => {
- if (!features.USE_NARRATIVES) {
+ if (Array.isArray(narrativesMeta) && narrativesMeta.length === 0) {
return []
}
const narratives = {}
@@ -84,40 +84,62 @@ export const selectNarratives = createSelector(
/* populate narratives dict with events */
events.forEach(evt => {
- evt.narratives.forEach(narrative => {
- // initialise
- if (!narratives[narrative]) { narratives[narrative] = narrativeSkeleton(narrative) }
-
- // add evt to steps
- // NB: insetSourceFrom is a 'curried' function to allow with maps
- narratives[narrative].steps.push(insetSourceFrom(sources)(evt))
+ evt.associations.forEach(association => {
+ const foundNarrative = narrativesMeta.find(narr => narr.id === association)
+ if (foundNarrative) {
+ const { id: narrId } = foundNarrative
+ // initialise
+ if (!narratives[narrId]) { narratives[narrId] = narrativeSkeleton(narrId) }
+ // add evt to steps
+ // NB: insetSourceFrom is a 'curried' function to allow with maps
+ narratives[narrId].steps.push(insetSourceFrom(sources)(evt))
+ }
})
})
-
/* sort steps by time */
Object.keys(narratives).forEach(key => {
const steps = narratives[key].steps
steps.sort((a, b) => a.datetime - b.datetime)
- if (narrativesMeta.find(n => n.id === key)) {
+ const existingAssociatedNarrative = narrativesMeta.find(n => n.id === key)
+
+ if (existingAssociatedNarrative) {
narratives[key] = {
- ...narrativesMeta.find(n => n.id === key),
+ ...existingAssociatedNarrative,
...narratives[key]
}
}
})
-
// Return narratives in original order
// + filter those that are undefined
return narrativesMeta.map(n => narratives[n.id]).filter(d => d)
})
+/** We iterate through narrative.steps and check the idx there against the selected array and we return the idx */
+export const selectNarrativeIdx = createSelector(
+ [getSelected, getActiveNarrative],
+ (selected, narrative) => {
+ // Only one event selected in narrative mode
+ if (narrative === null) return -1
+
+ const selectedEvent = selected[0]
+ let selectedIdx
+
+ narrative.steps.forEach((step, idx) => {
+ if (selectedEvent.id === step.id) {
+ selectedIdx = idx
+ }
+ })
+ return selectedIdx
+ }
+)
+
/** Aggregate information about the narrative and the current step into
* a single object. If narrative is null, the whole object is null.
*/
export const selectActiveNarrative = createSelector(
- [getActiveNarrative, getActiveStep],
+ [getActiveNarrative, selectNarrativeIdx],
(narrative, current) => narrative
? { ...narrative, current }
: null
@@ -245,7 +267,6 @@ export const selectSelected = createSelector(
if (selected.length === 0) {
return []
}
-
return selected.map(insetSourceFrom(sources))
}
)
diff --git a/src/store/initial.js b/src/store/initial.js
index 0b6f8e0..beb475b 100644
--- a/src/store/initial.js
+++ b/src/store/initial.js
@@ -6,17 +6,16 @@ const initial = {
* The Domain or 'domain' of this state refers to the tree of data
* available for render and display.
* Selections and filters in the 'app' subtree will operate the domain
- * in mapStateToProps of the Dashboard, and deterimne which items
+ * in mapStateToProps of the Dashboard, and determine which items
* in the domain will get rendered by React
*/
domain: {
events: [],
- narratives: [],
locations: [],
categories: [],
+ associations: [],
sources: {},
sites: [],
- filters: {},
notifications: []
},
@@ -24,23 +23,20 @@ const initial = {
* The 'app' subtree of this state determines the data and information to be
* displayed.
* It may refer to those the user interacts with, by selecting,
- * fitlering and so on, which ultimately operate on the data to be displayed.
+ * filtering and so on, which ultimately operate on the data to be displayed.
* Additionally, some of the 'app' flags are determined by the config file
* or by the characteristics of the client, browser, etc.
*/
app: {
errors: {
- source: null
+ source: false
},
highlighted: null,
selected: [],
source: null,
- narrative: null,
- narrativeState: {
- current: null
- },
- filters: {
+ associations: {
filters: [],
+ narrative: null,
categories: [],
views: {
events: true,
@@ -137,12 +133,11 @@ const initial = {
features: {
USE_COVER: false,
- USE_FILTERS: false,
+ USE_ASSOCIATIONS: false,
USE_SEARCH: false,
USE_SITES: false,
USE_SOURCES: false,
USE_SHAPES: false,
- USE_NARRATIVES: false,
GRAPH_NONLOCATED: false,
HIGHLIGHT_GROUPS: false
}