mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-11 21:08:33 +03:00
make config cleaner
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { tabs, prefixedTabs } from './lib'
|
import { timemap } from './lib'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
gsheets: [],
|
gsheets: [],
|
||||||
@@ -6,7 +6,7 @@ export default {
|
|||||||
{
|
{
|
||||||
name: 'timemap_data',
|
name: 'timemap_data',
|
||||||
path: 'data/timemap_data.xlsx',
|
path: 'data/timemap_data.xlsx',
|
||||||
tabs
|
tabs: timemap.default
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/lib.js
12
src/lib.js
@@ -1,6 +1,6 @@
|
|||||||
import BP from './lib/blueprinters'
|
import BP from './lib/blueprinters'
|
||||||
|
|
||||||
export function prefixedTabs (prefix, cfg) {
|
function prefixedTabs (prefix, cfg) {
|
||||||
if (!cfg) cfg = {}
|
if (!cfg) cfg = {}
|
||||||
const prf = key => cfg[key] ? `${prefix}_` : ''
|
const prf = key => cfg[key] ? `${prefix}_` : ''
|
||||||
return {
|
return {
|
||||||
@@ -13,11 +13,7 @@ export function prefixedTabs (prefix, cfg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tabs = {
|
export const timemap = {
|
||||||
export_events: BP.deeprows,
|
default: prefixedTabs(),
|
||||||
export_categories: [BP.groups, BP.rows],
|
prefixedTabs
|
||||||
export_filters: BP.tree,
|
|
||||||
export_narratives: BP.rows,
|
|
||||||
export_sources: BP.deepids,
|
|
||||||
export_sites: BP.rows
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user