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:
Lachlan Kermode
2021-10-22 04:28:16 +13:00
committed by GitHub
parent f03366416a
commit 3d8ec706ed
5 changed files with 6 additions and 3 deletions

View File

@@ -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,

View File

@@ -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",

View File

@@ -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",

View File

@@ -184,6 +184,7 @@ class Toolbar extends React.Component {
return (
<div
className={classes}
key={iconKey}
onClick={() => {
this.selectTab(_selected);
}}

View File

@@ -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) {