aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/SourceViewer/helpers
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2018-03-12 12:06:11 +0100
committerTeryk Bellahsene <teryk@users.noreply.github.com>2018-03-13 14:05:36 +0100
commit913c82c8772fd4747626a1fbe665ccda2e5ca9f1 (patch)
treed48784851df80905ce125cc60ac8aec8570751a9 /server/sonar-web/src/main/js/components/SourceViewer/helpers
parent751e4000e40a4af66b80767d632b1bef64dc5647 (diff)
downloadsonarqube-913c82c8772fd4747626a1fbe665ccda2e5ca9f1.tar.gz
sonarqube-913c82c8772fd4747626a1fbe665ccda2e5ca9f1.zip
SONAR-10374 Support pull request in the web app
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer/helpers')
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.tsx13
1 files changed, 7 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.tsx b/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.tsx
index 8354099e6f3..e23ce75a528 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.tsx
@@ -18,20 +18,21 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { searchIssues } from '../../../api/issues';
-import { Issue } from '../../../app/types';
+import { BranchLike, Issue } from '../../../app/types';
+import { getBranchLikeQuery } from '../../../helpers/branches';
import { parseIssueFromResponse } from '../../../helpers/issues';
import { RawQuery } from '../../../helpers/query';
// maximum possible value
const PAGE_SIZE = 500;
-function buildQuery(component: string, branch: string | undefined) {
+function buildQuery(component: string, branchLike: BranchLike | undefined) {
return {
additionalFields: '_all',
resolved: 'false',
componentKeys: component,
- branch,
- s: 'FILE_LINE'
+ s: 'FILE_LINE',
+ ...getBranchLikeQuery(branchLike)
};
}
@@ -75,9 +76,9 @@ export default function loadIssues(
component: string,
_fromLine: number,
toLine: number,
- branch: string | undefined
+ branchLike: BranchLike | undefined
): Promise<Issue[]> {
- const query = buildQuery(component, branch);
+ const query = buildQuery(component, branchLike);
return new Promise(resolve => {
loadPageAndNext(query, toLine, 1).then(issues => {
resolve(issues);