]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12191 Re-enable secondary location autoscroll for 1 location
authorJeremy Davis <jeremy.davis@sonarsource.com>
Mon, 17 Jun 2019 09:04:12 +0000 (11:04 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 28 Jun 2019 06:45:43 +0000 (08:45 +0200)
server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx

index 2845950c8ac1df2e28a8d0a445d2447ba61f6f66..d63d251974ae39acf175e7403ee608bf2c23e8c6 100644 (file)
@@ -117,7 +117,8 @@ export default class IssuesSourceViewer extends React.PureComponent<Props> {
         : openIssue.textRange && openIssue.textRange.endLine;
 
       const component = selectedLocation ? selectedLocation.component : openIssue.component;
-
+      const allMessagesEmpty =
+        locations !== undefined && locations.every(location => !location.msg);
       const highlightedLocations = locations.filter(location => location.component === component);
 
       // do not load issues when open another file for a location
@@ -132,7 +133,7 @@ export default class IssuesSourceViewer extends React.PureComponent<Props> {
             branchLike={this.props.branchLike}
             component={component}
             displayAllIssues={true}
-            displayLocationMarkers={false}
+            displayLocationMarkers={!allMessagesEmpty}
             highlightedLocationMessage={highlightedLocationMessage}
             highlightedLocations={highlightedLocations}
             loadIssues={loadIssues}