From 0a9f0cccb49c71e0b6c8d0e3e15e2cea6894fd50 Mon Sep 17 00:00:00 2001 From: Kyle Knight Date: Thu, 12 Jan 2017 12:23:17 -0600 Subject: [PATCH] Alphabetize New Query sidebar table dropdown (#939) --- frontend/utilities/osquery_tables.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/utilities/osquery_tables.js b/frontend/utilities/osquery_tables.js index 26e4fc1e8d..1dace6785f 100644 --- a/frontend/utilities/osquery_tables.js +++ b/frontend/utilities/osquery_tables.js @@ -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);