mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-08 03:18:36 +03:00
Minor cleanup (#220)
* Fix README; add missing dev dependency * Fix validators to filter out bad events and sources * Better defaults in config
This commit is contained in:
@@ -3,7 +3,6 @@ module.exports = {
|
||||
display_title: 'example',
|
||||
SERVER_ROOT: 'http://localhost:4040',
|
||||
EVENTS_EXT: '/api/timemap_data/export_events/deeprows',
|
||||
CATEGORIES_EXT: '/api/timemap_data/export_categories/rows',
|
||||
ASSOCIATIONS_EXT: '/api/timemap_data/export_associations/deeprows',
|
||||
SOURCES_EXT: '/api/timemap_data/export_sources/deepids',
|
||||
SITES_EXT: '',
|
||||
@@ -18,7 +17,6 @@ module.exports = {
|
||||
},
|
||||
features: {
|
||||
COLOR_BY_ASSOCIATION: true,
|
||||
USE_CATEGORIES: true,
|
||||
USE_ASSOCIATIONS: true,
|
||||
USE_SOURCES: true,
|
||||
USE_COVER: false,
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
"workbox-webpack-plugin": "5.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/highlight": "^7.14.5",
|
||||
"ava": "1.0.0-beta.8",
|
||||
"mocha": "^5.2.0",
|
||||
"node-sass": "4.13.1",
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
"categories": "Categories",
|
||||
"categories_label": "Categories",
|
||||
"explore_by_category__title": "Explore events by category",
|
||||
"explore_by_category__description": "‘Categories’ refer to the victims of a given incident.<br><br>If no categories are selected, all datapoints are displayed.",
|
||||
"explore_by_category__description": "",
|
||||
"shapes": "Shapes",
|
||||
"shapes_label": "Shapes",
|
||||
"explore_by_shapes__title": "Explore events by shape breakdown",
|
||||
|
||||
@@ -184,6 +184,7 @@ class Toolbar extends React.Component {
|
||||
return (
|
||||
<div
|
||||
className={classes}
|
||||
key={iconKey}
|
||||
onClick={() => {
|
||||
this.selectTab(_selected);
|
||||
}}
|
||||
|
||||
@@ -87,12 +87,15 @@ export function validateDomain(domain, features) {
|
||||
|
||||
function validateArray(items, domainKey, schema) {
|
||||
items.forEach((item) => {
|
||||
if (domainKey === "events" && item.date === "" && item.time === "")
|
||||
return;
|
||||
validateArrayItem(item, domainKey, schema);
|
||||
});
|
||||
}
|
||||
|
||||
function validateObject(obj, domainKey, itemSchema) {
|
||||
Object.keys(obj).forEach((key) => {
|
||||
if (key === "") return;
|
||||
const vl = obj[key];
|
||||
const result = Joi.validate(vl, itemSchema);
|
||||
if (result.error !== null) {
|
||||
|
||||
Reference in New Issue
Block a user