update prefixedTabs

This commit is contained in:
FA Internal SSH
2020-06-17 08:29:47 +00:00
parent 4663e23940
commit b1aa8e6703

View File

@@ -1,13 +1,15 @@
import BP from './lib/blueprinters'
export function prefixedTabs (prefix) {
export function prefixedTabs (prefix, cfg) {
if (!cfg) cfg = {}
const prf = key => cfg[key] ? `${prefix}_` : ''
return {
[`${prefix}_export_events`]: BP.deeprows,
[`${prefix}_export_categories`]: [BP.groups, BP.rows],
[`${prefix}_export_filters`]: BP.tree,
[`${prefix}_export_narratives`]: BP.rows,
[`${prefix}_export_sources`]: BP.deepids,
[`${prefix}_export_sites`]: BP.rows
[`${prf('events')}export_events`]: BP.deeprows,
[`${prf('categories')}export_categories`]: [BP.groups, BP.rows],
[`${prf('filters')}export_filters`]: BP.tree,
[`${prf('narratives')}export_narratives`]: BP.rows,
[`${prf('sources')}export_sources`]: BP.deepids,
[`${prf('sites')}export_sites`]: BP.rows
}
}