aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-08-27 10:05:57 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-08-27 10:10:05 +0200
commitb846cafb9473956559688699d2f270afafd26c7c (patch)
treeafa496712a957e99c4b19ff1c5801651edb0abd8
parent7dccf5e8d7bbbe78a6c90a36040eb4158bf1985f (diff)
downloadsonarqube-b846cafb9473956559688699d2f270afafd26c7c.tar.gz
sonarqube-b846cafb9473956559688699d2f270afafd26c7c.zip
SONAR-6766 add execution flow step numbers, decrease the contrast of issue location highlighting
-rw-r--r--server/sonar-web/src/main/js/components/source-viewer/main.js6
-rw-r--r--server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-issue-location.hbs5
-rw-r--r--server/sonar-web/src/main/less/components/source.less9
-rw-r--r--server/sonar-web/test/medium/source-viewer.spec.js2
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