Skip to content

Commit a947a75

Browse files
committed
Sort the ecosystems list for presentation in the UI
In the page footer and the 'select' list on the packages page, the list of ecosystems should be sorted in a predictable order.
1 parent e1d2331 commit a947a75

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

internal/server/dashboard.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,25 @@ type PackagesListPageData struct {
114114
}
115115

116116
func supportedEcosystems() []string {
117+
// this list should be kept sorted in lexicographic order so
118+
// that the 'select' list in the UI will be in the expected
119+
// order
117120
return []string{
118-
"npm",
119121
"cargo",
122+
"composer",
123+
"conan",
124+
"conda",
125+
"cran",
126+
"deb",
120127
"gem",
121128
"golang",
122129
"hex",
123-
"pub",
124-
"pypi",
125130
"maven",
131+
"npm",
126132
"nuget",
127-
"composer",
128-
"conan",
129-
"conda",
130-
"cran",
131133
"oci",
132-
"deb",
134+
"pub",
135+
"pypi",
133136
"rpm",
134137
}
135138
}

0 commit comments

Comments
 (0)