mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 05:18:34 +03:00
Removed commented out logic
This commit is contained in:
@@ -41,13 +41,7 @@ export function fetchDomain () {
|
||||
.catch(() => handleError('events'))
|
||||
)
|
||||
).then(results => results.flatMap(t => t))
|
||||
|
||||
// let catPromise = Promise.resolve([])
|
||||
// if (features.USE_CATEGORIES) {
|
||||
// catPromise = fetch(CATEGORY_URL)
|
||||
// .then(response => response.json())
|
||||
// .catch(() => handleError(domainMsg('categories')))
|
||||
// }
|
||||
|
||||
|
||||
let associationsPromise = Promise.resolve([])
|
||||
if (features.USE_ASSOCIATIONS) {
|
||||
@@ -87,7 +81,6 @@ export function fetchDomain () {
|
||||
|
||||
return Promise.all([
|
||||
eventPromise,
|
||||
// catPromise,
|
||||
associationsPromise,
|
||||
sourcesPromise,
|
||||
sitesPromise,
|
||||
@@ -96,7 +89,6 @@ export function fetchDomain () {
|
||||
.then(response => {
|
||||
const result = {
|
||||
events: response[0],
|
||||
// categories: response[1],
|
||||
associations: response[1],
|
||||
sources: response[2],
|
||||
sites: response[3],
|
||||
|
||||
@@ -148,7 +148,6 @@ const TimelineEvents = ({
|
||||
>
|
||||
{renderProjects()}
|
||||
{events.reduce(renderEvent, [])}
|
||||
{/* {events.map(event => renderEvent(event))} */}
|
||||
</g>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import Joi from 'joi'
|
||||
|
||||
const categorySchema = Joi.object().keys({
|
||||
category: Joi.string().required(),
|
||||
description: Joi.string(),
|
||||
group: Joi.string()
|
||||
})
|
||||
|
||||
export default categorySchema
|
||||
@@ -1,7 +1,6 @@
|
||||
import Joi from 'joi'
|
||||
|
||||
import createEventSchema from './eventSchema'
|
||||
import categorySchema from './categorySchema'
|
||||
import siteSchema from './siteSchema'
|
||||
import associationsSchema from './associationsSchema'
|
||||
import sourceSchema from './sourceSchema'
|
||||
@@ -47,7 +46,6 @@ function findDuplicateAssociations (associations) {
|
||||
export function validateDomain (domain, features) {
|
||||
const sanitizedDomain = {
|
||||
events: [],
|
||||
// categories: [],
|
||||
sites: [],
|
||||
associations: [],
|
||||
sources: {},
|
||||
@@ -61,7 +59,6 @@ export function validateDomain (domain, features) {
|
||||
|
||||
const discardedDomain = {
|
||||
events: [],
|
||||
// categories: [],
|
||||
sites: [],
|
||||
associations: [],
|
||||
sources: [],
|
||||
@@ -110,7 +107,6 @@ export function validateDomain (domain, features) {
|
||||
|
||||
const eventSchema = createEventSchema(features.CUSTOM_EVENT_FIELDS)
|
||||
validateArray(domain.events, 'events', eventSchema)
|
||||
// validateArray(domain.categories, 'categories', categorySchema)
|
||||
validateArray(domain.sites, 'sites', siteSchema)
|
||||
validateArray(domain.associations, 'associations', associationsSchema)
|
||||
validateObject(domain.sources, 'sources', sourceSchema)
|
||||
|
||||
@@ -12,7 +12,6 @@ const initial = {
|
||||
domain: {
|
||||
events: [],
|
||||
locations: [],
|
||||
// categories: [],
|
||||
associations: [],
|
||||
sources: {},
|
||||
sites: [],
|
||||
|
||||
Reference in New Issue
Block a user