mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Alphabetize New Query sidebar table dropdown (#939)
This commit is contained in:
parent
7108a816b7
commit
0a9f0cccb4
1 changed files with 4 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { flatten, map, flatMap } from 'lodash';
|
||||
import { flatten, map, flatMap, sortBy } from 'lodash';
|
||||
import osqueryTablesJSON from '../osquery_tables.json';
|
||||
|
||||
const appendPlatformKeyToTables = (parsedTables) => {
|
||||
|
|
@ -15,7 +15,9 @@ export const normalizeTables = (tablesJSON) => {
|
|||
const { tables: parsedTables } = typeof tablesJSON === 'object' ? tablesJSON : JSON.parse(tablesJSON);
|
||||
const tablesWithPlatformKey = appendPlatformKeyToTables(parsedTables);
|
||||
|
||||
return flatten(tablesWithPlatformKey);
|
||||
const flattenedTables = flatten(tablesWithPlatformKey);
|
||||
|
||||
return sortBy(flattenedTables, (table) => { return table.name; });
|
||||
};
|
||||
|
||||
export const osqueryTables = normalizeTables(osqueryTablesJSON);
|
||||
|
|
|
|||
Loading…
Reference in a new issue