From: Stas Vilchik Date: Tue, 27 Mar 2018 08:47:58 +0000 (+0200) Subject: sort pull requests by key X-Git-Tag: 7.5~1462 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0515ca13f5217af62237cef39c3218f0efc5c7a3;p=sonarqube.git sort pull requests by key --- diff --git a/server/sonar-web/src/main/js/helpers/branches.ts b/server/sonar-web/src/main/js/helpers/branches.ts index 510ed8c3f85..cb930b0a80b 100644 --- a/server/sonar-web/src/main/js/helpers/branches.ts +++ b/server/sonar-web/src/main/js/helpers/branches.ts @@ -120,8 +120,8 @@ export function sortBranchesAsTree(branchLikes: BranchLike[]) { // finally all orhpan pull requests and branches result.push( - ...pullRequests.filter(pr => pr.isOrphan), - ...shortLivingBranches.filter(branch => branch.isOrphan) + ...sortBy(pullRequests.filter(pr => pr.isOrphan), pullRequest => pullRequest.key), + ...sortBy(shortLivingBranches.filter(branch => branch.isOrphan), branch => branch.name) ); return result; @@ -139,11 +139,11 @@ export function sortBranchesAsTree(branchLikes: BranchLike[]) { i++; } - return sortBy(found, 'name'); + return sortBy(found, branch => branch.name); } function getPullRequests(base: string) { - return pullRequests.filter(pr => pr.base === base); + return sortBy(pullRequests.filter(pr => pr.base === base), pullRequest => pullRequest.key); } }