Skip to content

Commit

Permalink
console: sort filter and sort column options alphabetically, close #9966
Browse files Browse the repository at this point in the history


GITHUB_PR_NUMBER: 9967
GITHUB_PR_URL: #9967

PR-URL: hasura/graphql-engine-mono#10453
Co-authored-by: Bert Verhelst <1710840+bertyhell@users.noreply.github.com>
GitOrigin-RevId: 21c8429e32ac9e7e2cf70bc3b8dd3c93ca6ce5cb
  • Loading branch information
hasura-bot and bertyhell committed Dec 22, 2023
1 parent 469f993 commit 4ba35c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down

0 comments on commit 4ba35c3

Please sign in to comment.