Commit 8575ee72 authored by Mark Florian's avatar Mark Florian

Use more explicit/less confusing function name

It takes options objects (id/name key/value pairs), not `Map`s.
parent d9bb4cd1
import { SEVERITY_LEVELS, REPORT_TYPES, BASE_FILTERS } from './constants';
const mapToArray = map => Object.entries(map).map(([id, name]) => ({ id, name }));
const optionsObjectToArray = obj => Object.entries(obj).map(([id, name]) => ({ id, name }));
export default () => ({
filters: [
{
name: 'Severity',
id: 'severity',
options: [BASE_FILTERS.severity, ...mapToArray(SEVERITY_LEVELS)],
options: [BASE_FILTERS.severity, ...optionsObjectToArray(SEVERITY_LEVELS)],
selection: new Set(['all']),
},
{
name: 'Report type',
id: 'report_type',
options: [BASE_FILTERS.report_type, ...mapToArray(REPORT_TYPES)],
options: [BASE_FILTERS.report_type, ...optionsObjectToArray(REPORT_TYPES)],
selection: new Set(['all']),
},
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment