Skip to content

Commit 4c81fe4

Browse files
authored
fix: Views not sorted alphabetically in sidebar (#2943)
1 parent f0c9683 commit 4c81fe4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dashboard/Data/Views/Views.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import TableView from 'dashboard/TableView.react';
1515
import tableStyles from 'dashboard/TableView.scss';
1616
import * as ViewPreferences from 'lib/ViewPreferences';
1717
import generatePath from 'lib/generatePath';
18+
import stringCompare from 'lib/stringCompare';
1819
import { ActionTypes as SchemaActionTypes } from 'lib/stores/SchemaStore';
1920
import subscribeTo from 'lib/subscribeTo';
2021
import { withRouter } from 'lib/withRouter';
@@ -541,6 +542,8 @@ class Views extends TableView {
541542
this.setState({ editView: view, editIndex: index });
542543
},
543544
}));
545+
// Sort views alphabetically like in the Browser component
546+
categories.sort((a, b) => stringCompare(a.name, b.name));
544547
const current = this.props.params.name || '';
545548
return (
546549
<CategoryList

0 commit comments

Comments
 (0)