diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-27 10:05:57 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-27 10:10:05 +0200 |
commit | b846cafb9473956559688699d2f270afafd26c7c (patch) | |
tree | afa496712a957e99c4b19ff1c5801651edb0abd8 | |
parent | 7dccf5e8d7bbbe78a6c90a36040eb4158bf1985f (diff) | |
download | sonarqube-b846cafb9473956559688699d2f270afafd26c7c.tar.gz sonarqube-b846cafb9473956559688699d2f270afafd26c7c.zip |
SONAR-6766 add execution flow step numbers, decrease the contrast of issue location highlighting
4 files changed, 12 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/components/source-viewer/main.js b/server/sonar-web/src/main/js/components/source-viewer/main.js index da399afc2a3..07d06086db1 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/main.js +++ b/server/sonar-web/src/main/js/components/source-viewer/main.js @@ -740,7 +740,11 @@ define([ secondaryLocations = issue.get('secondaryLocations'), _locations = [primaryLocation].concat(secondaryLocations); issue.get('executionFlows').forEach(function (flow) { - _locations = [].concat(_locations, flow.locations); + var flowLocationsCount = _.size(flow.locations); + var flowLocations = flow.locations.map(function (loc, index) { + return _.extend({ index: flowLocationsCount - index }, loc); + }); + _locations = [].concat(_locations, flowLocations); }); _locations.forEach(this.showIssueLocation, this); }, diff --git a/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-issue-location.hbs b/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-issue-location.hbs index 52ff583e982..181e85b2497 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-issue-location.hbs +++ b/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-issue-location.hbs @@ -1 +1,4 @@ -<div class="source-viewer-issue-location" title="{{msg}}">{{limitString msg}}</div> +<div class="source-viewer-issue-location" title="{{msg}}"> + {{#if index}}<strong>{{index}}: </strong>{{/if}} + {{limitString msg}} +</div> diff --git a/server/sonar-web/src/main/less/components/source.less b/server/sonar-web/src/main/less/components/source.less index bb9189a21cc..8df7809d9df 100644 --- a/server/sonar-web/src/main/less/components/source.less +++ b/server/sonar-web/src/main/less/components/source.less @@ -135,11 +135,10 @@ .source-line-code-secondary-issue { display: inline-block; - background-color: @red; - color: #fff !important; + background-color: @issueBackgroundColor; &.highlighted { - background-color: mix(#B3D4FF, @red, 60%); + background-color: mix(#B3D4FF, @issueBackgroundColor, 40%); } } @@ -472,9 +471,7 @@ line-height: @source-line-height - 1px; margin-right: 10px; padding: 0 10px; - border-radius: 3px; - background-color: @red; - color: #fff; + background-color: #ffeaea; font-size: 12px; .text-ellipsis; } diff --git a/server/sonar-web/test/medium/source-viewer.spec.js b/server/sonar-web/test/medium/source-viewer.spec.js index 45e1a428b00..0062379dc74 100644 --- a/server/sonar-web/test/medium/source-viewer.spec.js +++ b/server/sonar-web/test/medium/source-viewer.spec.js @@ -3,8 +3,6 @@ define(function (require) { require('../helpers/test-page'); bdd.describe('Source Viewer', function () { - var file = { uuid: 'uuid', key: 'key' }; - bdd.describe('Issues', function () { bdd.it('should show precise issue location', function () { return this.remote |