From 860d96245089300ba787786b7266ea687c3df431 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 16 May 2019 15:09:48 +0200 Subject: [PATCH] SONAR-12111 Fix source misalignment --- .../ComponentSourceSnippetViewer.tsx | 7 ++++++- server/sonar-web/src/main/js/apps/issues/styles.css | 10 ++++++++++ .../src/main/js/components/SourceViewer/styles.css | 10 ---------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetViewer.tsx index d989e9f5a4a..0a044115980 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetViewer.tsx @@ -214,6 +214,7 @@ export default class ComponentSourceSnippetViewer extends React.PureComponent 1} displayLocationMarkers={true} duplications={lineDuplications} @@ -318,6 +320,8 @@ export default class ComponentSourceSnippetViewer extends React.PureComponent !!s.duplicated); + return (
{snippet[0].line > 1 && ( @@ -333,6 +337,7 @@ export default class ComponentSourceSnippetViewer extends React.PureComponent {snippet.map((line, index) => this.renderLine({ + displayDuplications, index, issuesForLine: issuesByLine[line.line] || [], issueLocations: locationsByLine[line.line] || [], diff --git a/server/sonar-web/src/main/js/apps/issues/styles.css b/server/sonar-web/src/main/js/apps/issues/styles.css index 85d3c2e3460..0aa8aeecd54 100644 --- a/server/sonar-web/src/main/js/apps/issues/styles.css +++ b/server/sonar-web/src/main/js/apps/issues/styles.css @@ -304,6 +304,16 @@ } } +.issue-location { + display: inline-block; + vertical-align: top; + line-height: 18px; + height: 18px; + box-sizing: border-box; + background-color: var(--issueBgColor); + transition: background-color 0.3s ease; +} + .issues-workspace-list-component { padding: 10px 10px 6px; } diff --git a/server/sonar-web/src/main/js/components/SourceViewer/styles.css b/server/sonar-web/src/main/js/components/SourceViewer/styles.css index db5f812a00b..d3be8536680 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/styles.css +++ b/server/sonar-web/src/main/js/components/SourceViewer/styles.css @@ -293,16 +293,6 @@ user-select: text; } -.issue-location { - display: inline-block; - vertical-align: top; - line-height: 18px; - height: 18px; - box-sizing: border-box; - background-color: var(--issueBgColor); - transition: background-color 0.3s ease; -} - .issue-location.highlighted { border-color: #e1e1f2; background-color: #e1e1f2; -- 2.39.5