DashList: Sort starred and searched dashboard alphabetically (#31605)

This commit is contained in:
Alex Khomenko 2021-03-03 08:59:01 +02:00 committed by GitHub
parent 4ad25fa45c
commit e21b2748f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,9 +105,9 @@ export function DashList(props: PanelProps<DashListOptions>) {
const [starredDashboards, recentDashboards, searchedDashboards] = useMemo(() => {
const dashboardList = [...dashboards.values()];
return [
dashboardList.filter((dash) => dash.isStarred),
dashboardList.filter((dash) => dash.isStarred).sort((a, b) => a.title.localeCompare(b.title)),
dashboardList.filter((dash) => dash.isRecent),
dashboardList.filter((dash) => dash.isSearchResult),
dashboardList.filter((dash) => dash.isSearchResult).sort((a, b) => a.title.localeCompare(b.title)),
];
}, [dashboards]);