From 2bc6affbf59cafb2981ad4a1fb207cd74b3d24d8 Mon Sep 17 00:00:00 2001 From: efarooqui Date: Wed, 9 Sep 2020 21:22:22 -0700 Subject: [PATCH] Fixed up event schema to reduce filters and narratives to associations; removed extraneous comments for deprecated functions --- example.config.js | 2 +- src/common/utilities.js | 13 ------------- src/components/Card.jsx | 2 -- src/reducers/validate/eventSchema.js | 5 +++-- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/example.config.js b/example.config.js index ac443c1..9a72ab6 100644 --- a/example.config.js +++ b/example.config.js @@ -31,7 +31,7 @@ module.exports = { USE_SEARCH: false, USE_SITES: false, USE_SHAPES: false, - GRAPH_NONLOCATED: false, + GRAPH_NONLOHATED: false, HIGHLIGHT_GROUPS: false } } diff --git a/src/common/utilities.js b/src/common/utilities.js index acc2f03..f384105 100644 --- a/src/common/utilities.js +++ b/src/common/utilities.js @@ -199,19 +199,6 @@ export function binarySearch (ar, el, compareFn) { return -m - 1 } -// export const isFilterLeaf = node => (Object.keys(node.children).length === 0) -// export const isFilterDuplicate = (node, set) => { return (set.has(node.key)) } - -// export function findDescriptionInFilterTree (key, node) { -// if (node.key === key) return node.description -// if (isFilterLeaf(node)) return false -// const descs = Object.keys(node.children) -// .map(c => findDescriptionInFilterTree(key, node.children[c])) -// .filter(v => !!v) -// if (descs.length !== 1) return false -// return descs[0] -// } - export function makeNiceDate (datetime) { if (datetime === null) return null // see https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date diff --git a/src/components/Card.jsx b/src/components/Card.jsx index 4079f60..57ad170 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -119,9 +119,7 @@ class Card extends React.Component { renderExtra () { return (
- {/* {this.renderFilters()} */} {this.renderSources()} - {/* {this.renderNarrative()} */}
) } diff --git a/src/reducers/validate/eventSchema.js b/src/reducers/validate/eventSchema.js index 6b7cb64..5608b95 100644 --- a/src/reducers/validate/eventSchema.js +++ b/src/reducers/validate/eventSchema.js @@ -23,9 +23,10 @@ function createEventSchema (custom) { type: Joi.string().allow(''), category: Joi.string().allow(''), category_full: Joi.string().allow(''), - narratives: Joi.array(), + associations: Joi.array(), + // narratives: Joi.array(), sources: Joi.array(), - filters: Joi.array().allow(''), + // filters: Joi.array().allow(''), tags: Joi.array().allow(''), comments: Joi.string().allow(''), time_display: Joi.string().allow(''),