Skip to content

Commit

Permalink
Merge pull request #51 from agatapst/native-filters/sort-select-input
Browse files Browse the repository at this point in the history
chore: Sort select inputs in Filter Config modal alphabetically
  • Loading branch information
villebro authored Dec 4, 2020
2 parents c529840 + d52a419 commit 6592543
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion superset-frontend/src/components/SupersetResourceSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export default function SupersetResourceSelect<T = unknown, V = string>({
endpoint: `/api/v1/${resource}/?q=${query}`,
}).then(
response => {
return response.json.result.map(transformItem);
return response.json.result
.map(transformItem)
.sort((a: Value<V>, b: Value<V>) => a.label.localeCompare(b.label));
},
async badResponse => {
const { error, message } = await getClientErrorObject(badResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export function ColumnSelect({
endpoint: `/api/v1/dataset/${datasetId}`,
}).then(
({ json: { result } }) => {
return result.columns.map((col: any) => col.column_name);
return result.columns
.map((col: any) => col.column_name)
.sort((a: string, b: string) => a.localeCompare(b));
},
async badResponse => {
const { error, message } = await getClientErrorObject(badResponse);
Expand Down

0 comments on commit 6592543

Please sign in to comment.