From 009a26264cac67da595d3b01f72a3ff5cbfb51ed Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Thu, 7 Oct 2021 10:08:47 +0100 Subject: [PATCH] NavBar: Order App plugins alphabetically (#40078) * NavBar: Order App plugins alphabetically * Update pkg/api/index.go Co-authored-by: Will Browne Co-authored-by: Will Browne --- pkg/api/index.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/api/index.go b/pkg/api/index.go index 014555785e1..cce70a15503 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -123,6 +123,11 @@ func (hs *HTTPServer) getAppLinks(c *models.ReqContext) ([]*dtos.NavLink, error) } } + if len(appLinks) > 0 { + sort.SliceStable(appLinks, func(i, j int) bool { + return appLinks[i].Text < appLinks[j].Text + }) + } return appLinks, nil }