]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11153 loaded issues when opening a permalink for a distant line
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 24 Aug 2018 13:48:54 +0000 (15:48 +0200)
committerSonarTech <sonartech@sonarsource.com>
Mon, 27 Aug 2018 18:21:57 +0000 (20:21 +0200)
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx

index 6ea9df12ea08391b715fc6d2124ab21d65a965aa..d9008a88fbcf034652d9b3a1be53cd59229c94dc 100644 (file)
@@ -223,8 +223,10 @@ export default class SourceViewerBase extends React.PureComponent<Props, State>
 
   fetchComponent() {
     this.setState({ loading: true });
+
+    const to = (this.props.aroundLine || 0) + LINES;
     const loadIssues = (component: SourceViewerFile, sources: SourceLine[]) => {
-      this.props.loadIssues(this.props.component, 1, LINES, this.props.branchLike).then(
+      this.props.loadIssues(this.props.component, 1, to, this.props.branchLike).then(
         issues => {
           if (this.mounted) {
             const finalSources = sources.slice(0, LINES);