mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-13 05:48:32 +03:00
update prefixedTabs
This commit is contained in:
16
src/lib.js
16
src/lib.js
@@ -1,13 +1,15 @@
|
|||||||
import BP from './lib/blueprinters'
|
import BP from './lib/blueprinters'
|
||||||
|
|
||||||
export function prefixedTabs (prefix) {
|
export function prefixedTabs (prefix, cfg) {
|
||||||
|
if (!cfg) cfg = {}
|
||||||
|
const prf = key => cfg[key] ? `${prefix}_` : ''
|
||||||
return {
|
return {
|
||||||
[`${prefix}_export_events`]: BP.deeprows,
|
[`${prf('events')}export_events`]: BP.deeprows,
|
||||||
[`${prefix}_export_categories`]: [BP.groups, BP.rows],
|
[`${prf('categories')}export_categories`]: [BP.groups, BP.rows],
|
||||||
[`${prefix}_export_filters`]: BP.tree,
|
[`${prf('filters')}export_filters`]: BP.tree,
|
||||||
[`${prefix}_export_narratives`]: BP.rows,
|
[`${prf('narratives')}export_narratives`]: BP.rows,
|
||||||
[`${prefix}_export_sources`]: BP.deepids,
|
[`${prf('sources')}export_sources`]: BP.deepids,
|
||||||
[`${prefix}_export_sites`]: BP.rows
|
[`${prf('sites')}export_sites`]: BP.rows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user