Allow categories to be selected by title and not id; allow for primary key field

This commit is contained in:
efarooqui
2021-04-30 17:47:16 -07:00
parent d6c5b55152
commit 123ed80d74
7 changed files with 17 additions and 16 deletions

View File

@@ -134,9 +134,9 @@ const TimelineEvents = ({
// those timelines: so we create as many event 'shadows' as there are
// categories
const evShadows = getEventCategories(event, categories).map((cat) => {
const y = getY({ ...event, category: cat.id });
const y = getY({ ...event, category: cat.title });
const colour = event.colour ? event.colour : getCategoryColor(cat.id);
const colour = event.colour ? event.colour : getCategoryColor(cat.title);
const styles = {
fill: colour,
fillOpacity: y > 0 ? calcOpacity(1) : 0,

View File

@@ -65,7 +65,7 @@ const TimelineMarkers = ({
(isLatitude(event.latitude) && isLongitude(event.longitude)) ||
(features.GRAPH_NONLOCATED && event.projectOffset !== -1);
const evShadows = getEventCategories(event, categories).map((cat) =>
getEventY({ ...event, category: cat.id })
getEventY({ ...event, category: cat.title })
);
function renderMarkerForEvent(y) {