Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying lat long to have decimals and not commas; adding extra titl… #200

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Modifying lat long to have decimals and not commas; adding extra titl…
…e field to associations
  • Loading branch information
efarooqui committed Apr 29, 2021
commit 695ed5bc1eb397892e08611adb4fcd50089f4726
1 change: 1 addition & 0 deletions src/reducers/validate/associationsSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 4 additions & 0 deletions src/reducers/validate/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down