console: sort filter and sort column options alphabetically, close #9966

GITHUB_PR_NUMBER: 9967
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/9967

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10453
Co-authored-by: Bert Verhelst <1710840+bertyhell@users.noreply.github.com>
GitOrigin-RevId: 21c8429e32ac9e7e2cf70bc3b8dd3c93ca6ce5cb
This commit is contained in:
hasura-bot 2023-12-22 16:14:31 +05:30
parent 469f993920
commit 4ba35c33ee
2 changed files with 16 additions and 12 deletions

View File

@ -52,12 +52,14 @@ export const FilterRows = ({
onRemove?.(); onRemove?.();
}; };
const columnOptions: SelectItem[] = columns.map(column => { const columnOptions: SelectItem[] = columns
return { .sort((a, b) => (a.name > b.name ? 1 : -1))
label: column.name, .map(column => {
value: column.name, return {
}; label: column.name,
}); value: column.name,
};
});
const operatorOptions: SelectItem[] = operators.map(operator => ({ const operatorOptions: SelectItem[] = operators.map(operator => ({
label: `[${operator.value}] ${operator.name}`, label: `[${operator.value}] ${operator.name}`,

View File

@ -32,12 +32,14 @@ export const SortRows = ({
} }
}, [initialSorts?.length]); }, [initialSorts?.length]);
const columnOptions: SelectItem[] = columns.map(column => { const columnOptions: SelectItem[] = columns
return { .sort((a, b) => (a.name > b.name ? 1 : -1))
label: column.name, .map(column => {
value: column.name, return {
}; label: column.name,
}); value: column.name,
};
});
const orderByOptions = [ const orderByOptions = [
{ {