From 0515ca13f5217af62237cef39c3218f0efc5c7a3 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 27 Mar 2018 10:47:58 +0200 Subject: [PATCH] sort pull requests by key --- server/sonar-web/src/main/js/helpers/branches.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); } } -- 2.39.5