Merging in develop branch

This commit is contained in:
efarooqui
2020-10-20 15:26:15 -07:00
12 changed files with 122 additions and 77 deletions

View File

@@ -1,2 +1,5 @@
export const FILTER_MODE = 'FILTER'
export const NARRATIVE_MODE = 'NARRATIVE'
export const ASSOCIATION_MODES = {
CATEGORY: 'CATEGORY',
NARRATIVE: 'NARRATIVE',
FILTER: 'FILTER'
}

View File

@@ -63,6 +63,18 @@ export function trimAndEllipse (string, stringNum) {
return string
}
export function getEventCategories (event, categories) {
const matchedCategories = []
if (event.associations && event.associations.length > 0) {
event.associations.reduce((acc, val) => {
const foundCategory = categories.find(cat => cat.id === val)
if (foundCategory) acc.push(foundCategory)
return acc
}, matchedCategories)
}
return matchedCategories
}
/**
* Inset the full source represenation from 'allSources' into an event. The
* function is 'curried' to allow easy use with maps. To use for a single