From b09f85748bba5c83b77f29b36c4a6321165df4b2 Mon Sep 17 00:00:00 2001 From: efarooqui Date: Wed, 28 Apr 2021 18:10:41 -0700 Subject: [PATCH] Modifying lat long to have decimals and not commas; adding extra title field to associations --- src/reducers/validate/associationsSchema.js | 1 + src/reducers/validate/validators.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/reducers/validate/associationsSchema.js b/src/reducers/validate/associationsSchema.js index cf721e4..220b597 100644 --- a/src/reducers/validate/associationsSchema.js +++ b/src/reducers/validate/associationsSchema.js @@ -2,6 +2,7 @@ import Joi from "joi"; const associationsSchema = Joi.object().keys({ id: Joi.string().allow("").required(), + title: Joi.string().allow("").required(), desc: Joi.string().allow(""), mode: Joi.string().allow("").required(), filter_paths: Joi.array(), diff --git a/src/reducers/validate/validators.js b/src/reducers/validate/validators.js index 79c878d..e796dba 100644 --- a/src/reducers/validate/validators.js +++ b/src/reducers/validate/validators.js @@ -137,6 +137,10 @@ export function validateDomain(domain, features) { // append events with datetime and sort sanitizedDomain.events = sanitizedDomain.events.filter((event, idx) => { event.id = idx; + // if lat, long come in with commas, replace with decimal format + event.latitude = event.latitude.replace(",", "."); + event.longitude = event.longitude.replace(",", "."); + event.datetime = calcDatetime(event.date, event.time); if (!isValidDate(event.datetime)) { discardedDomain.events.push({