aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-16 11:25:28 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-17 11:32:58 +0200
commitea05fdeff86b320bba6178d6f074f8d146692fcb (patch)
treee03cfec7500129c5e2458b1ea25f634596ca9d8b
parent87f55940473777bd4080595a8369a7cf958745c4 (diff)
downloadsonarqube-ea05fdeff86b320bba6178d6f074f8d146692fcb.tar.gz
sonarqube-ea05fdeff86b320bba6178d6f074f8d146692fcb.zip
SONAR-9647 Issue box is not displayed for not file level issues
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js10
-rw-r--r--server/sonar-web/src/main/less/components/source.less2
2 files changed, 9 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js
index 508878f6d89..2cfee3e3c05 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js
+++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js
@@ -293,7 +293,9 @@ export default class SourceViewerBase extends React.PureComponent {
const onResolve = component => {
this.props.onReceiveComponent(component);
- this.loadSources().then(
+ const sourcesRequest =
+ component.q === 'FIL' || component.q === 'UTS' ? this.loadSources() : Promise.resolve([]);
+ sourcesRequest.then(
sources => loadIssues(component, sources),
response => onFailLoadSources(response, component)
);
@@ -331,7 +333,11 @@ export default class SourceViewerBase extends React.PureComponent {
const firstSourceLine = this.state.sources[0];
const lastSourceLine = this.state.sources[this.state.sources.length - 1];
this.props
- .loadIssues(this.props.component, firstSourceLine.line, lastSourceLine.line)
+ .loadIssues(
+ this.props.component,
+ firstSourceLine && firstSourceLine.line,
+ lastSourceLine && lastSourceLine.line
+ )
.then(issues => {
if (this.mounted) {
this.setState({
diff --git a/server/sonar-web/src/main/less/components/source.less b/server/sonar-web/src/main/less/components/source.less
index ffee5c07c43..cceccae581e 100644
--- a/server/sonar-web/src/main/less/components/source.less
+++ b/server/sonar-web/src/main/less/components/source.less
@@ -87,7 +87,7 @@
}
}
-.source-line-last .source-line-code-inner {
+.source-line-last .source-line-code {
padding-bottom: 80px;
}