From: Stas Vilchik Date: Mon, 2 Feb 2015 09:16:23 +0000 (+0100) Subject: SONAR-6144 Component Viewer doesn't show coverage after line 1'000 X-Git-Tag: 5.1-RC1~472 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32dffb03da285890ab2c89a8bddec86cba5d619b;p=sonarqube.git SONAR-6144 Component Viewer doesn't show coverage after line 1'000 --- diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js index fd234f62677..85d14bc9a94 100644 --- a/server/sonar-web/src/main/js/source-viewer/viewer.js +++ b/server/sonar-web/src/main/js/source-viewer/viewer.js @@ -165,7 +165,7 @@ define([ source.unshift({line: 0}); } source = source.map(function (row) { - return _.extend(row, {coverageStatus: that.getCoverageStatus(row)}); + return _.extend(row, { coverageStatus: that.getCoverageStatus(row) }); }); var firstLine = _.first(source).line, linesRequested = options.to - options.from + 1; @@ -539,6 +539,9 @@ define([ if (source.length === 0 || (source.length > 0 && _.first(source).line === 1)) { source.unshift({line: 0}); } + source = source.map(function (row) { + return _.extend(row, { coverageStatus: that.getCoverageStatus(row) }); + }); that.model.set({ source: source, hasSourceBefore: (data.sources.length === that.LINES_AROUND) && (_.first(source).line > 0) @@ -574,6 +577,9 @@ define([ source = source.slice(source.length - that.TOTAL_LINES_LIMIT); that.model.set({ hasSourceBefore: true }); } + source = source.map(function (row) { + return _.extend(row, { coverageStatus: that.getCoverageStatus(row) }); + }); that.model.set({ source: source, hasSourceAfter: data.sources.length === that.LINES_AROUND