From 73e1d5bb27a020277499fe0be5d059184c59c233 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Mon, 17 Jun 2019 11:04:12 +0200 Subject: [PATCH] SONAR-12191 Re-enable secondary location autoscroll for 1 location --- .../main/js/apps/issues/components/IssuesSourceViewer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx index 2845950c8ac..d63d251974a 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx @@ -117,7 +117,8 @@ export default class IssuesSourceViewer extends React.PureComponent { : 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 { branchLike={this.props.branchLike} component={component} displayAllIssues={true} - displayLocationMarkers={false} + displayLocationMarkers={!allMessagesEmpty} highlightedLocationMessage={highlightedLocationMessage} highlightedLocations={highlightedLocations} loadIssues={loadIssues} -- 2.39.5