Verified Commit 87c7557c authored by Jelle van der Waa's avatar Jelle van der Waa 🚧

Use a custom sort implementation for suite ordering

Order the repository's so core/extraa is ordered before [community]
parent 28e918c9
......@@ -25,6 +25,14 @@ class App extends React.Component {
);
}
compareSuites(element) {
if (element.name == 'core' || element.name == 'extra') {
return -1;
} else {
return 1;
}
}
componentDidMount() {
const url = '/api/v0/pkgs/list';
......@@ -47,10 +55,12 @@ class App extends React.Component {
const suiteList = [];
for (let repo of Object.keys(suites).sort()) {
for (let repo of Object.keys(suites)) {
suiteList.push({name: repo, pkgs: suites[repo]});
}
suiteList.sort(this.compareSuites);
this.setState({suites: suiteList});
}).catch((error) => {
console.log(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment