aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-03-27 10:47:58 +0200
committerSonarTech <sonartech@sonarsource.com>2018-03-28 20:20:58 +0200
commit0515ca13f5217af62237cef39c3218f0efc5c7a3 (patch)
treee6beee556342fe665081e208368a4001114704ca
parent9bed278a7b11a213a551847b9672cbbab198f59b (diff)
downloadsonarqube-0515ca13f5217af62237cef39c3218f0efc5c7a3.tar.gz
sonarqube-0515ca13f5217af62237cef39c3218f0efc5c7a3.zip
sort pull requests by key
-rw-r--r--server/sonar-web/src/main/js/helpers/branches.ts8
1 files 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);
}
}