diff --git a/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Filter/FilterRows.tsx b/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Filter/FilterRows.tsx index 519d88aadb8..54534bd6ff7 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Filter/FilterRows.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Filter/FilterRows.tsx @@ -52,12 +52,14 @@ export const FilterRows = ({ onRemove?.(); }; - const columnOptions: SelectItem[] = columns.map(column => { - return { - label: column.name, - value: column.name, - }; - }); + const columnOptions: SelectItem[] = columns + .sort((a, b) => (a.name > b.name ? 1 : -1)) + .map(column => { + return { + label: column.name, + value: column.name, + }; + }); const operatorOptions: SelectItem[] = operators.map(operator => ({ label: `[${operator.value}] ${operator.name}`, diff --git a/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Sort/SortRows.tsx b/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Sort/SortRows.tsx index 33d69ebfb31..4f4ad08b1ee 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Sort/SortRows.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/BrowseRows/components/RunQuery/Sort/SortRows.tsx @@ -32,12 +32,14 @@ export const SortRows = ({ } }, [initialSorts?.length]); - const columnOptions: SelectItem[] = columns.map(column => { - return { - label: column.name, - value: column.name, - }; - }); + const columnOptions: SelectItem[] = columns + .sort((a, b) => (a.name > b.name ? 1 : -1)) + .map(column => { + return { + label: column.name, + value: column.name, + }; + }); const orderByOptions = [ {