aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-30 12:28:59 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-30 12:42:57 +0200
commit3fa0d737fb0177414765ca800f0271b6859437d9 (patch)
tree2ccfd4406a68f04afa3fbe056340d2a5bf08907f /server/sonar-web/src
parent06cf42d775c122816abe43a75de2b346047240d2 (diff)
parent438fd4cdc2827241186205216320623791fce9e3 (diff)
downloadsonarqube-3fa0d737fb0177414765ca800f0271b6859437d9.tar.gz
sonarqube-3fa0d737fb0177414765ca800f0271b6859437d9.zip
Merge from branch-5.1
* origin/branch-5.1: Remove log to console in unit test Fix regression on issue paging with one component Fix indexing of source lines SONAR-6340 highlight cancelled reports fix display of overlapping duplications do not show global error if the request is sent from modal window cancel analysis when the snapshot is not found - SONAR-6340 Conflicts: server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs server/sonar-web/src/main/js/source-viewer/viewer.js
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee1
-rw-r--r--server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs2
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js10
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js10
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js4
-rw-r--r--server/sonar-web/src/main/js/source-viewer/viewer.js12
-rw-r--r--server/sonar-web/src/main/less/pages/analysis-reports.less5
7 files changed, 38 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee b/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee
index 66411deeea8..81b6f8bd034 100644
--- a/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee
+++ b/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee
@@ -32,6 +32,7 @@ define [
@$el.addClass 'analysis-reports-report-pending' if status is 'PENDING'
@$el.addClass 'analysis-reports-report-working' if status is 'WORKING'
@$el.addClass 'analysis-reports-report-done' if status is 'SUCCESS'
+ @$el.addClass 'analysis-reports-report-cancelled' if status is 'CANCELLED'
@$el.addClass 'analysis-reports-report-failed' if status is 'FAIL'
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs
index 4a596a1959d..433825e60cf 100644
--- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs
+++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs
@@ -21,7 +21,7 @@
{{#notEq file.key ../component.key}}
<div class="component-name-path">
- <a data-uuid="{{file.uuid}}" title="{{file.name}}">
+ <a class="link-action" data-uuid="{{file.uuid}}" title="{{file.name}}">
<span>{{collapsedDirFromPath file.name}}</span><span
class="component-name-file">{{fileFromPath file.name}}</span>
</a>
diff --git a/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js b/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js
index 1443c801805..3ff81d43723 100644
--- a/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js
@@ -154,7 +154,15 @@ define([
this.$('.alert').addClass('hidden');
var that = this,
url = baseUrl + '/api/rules/' + action;
- return $.post(url, options).done(function () {
+ return $.ajax({
+ url: url,
+ type: 'POST',
+ data: options,
+ statusCode: {
+ // do not show global error
+ 400: null
+ }
+ }).done(function () {
if (that.options.templateRule) {
that.options.app.controller.showDetails(that.options.templateRule);
} else {
diff --git a/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js b/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js
index d9f2e20c2a3..6fd9ce49c3f 100644
--- a/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js
@@ -102,7 +102,15 @@ define([
sendRequest: function (action, options) {
var that = this,
url = baseUrl + '/api/rules/' + action;
- return $.post(url, options).done(function (r) {
+ return $.ajax({
+ url: url,
+ type: 'POST',
+ data: options,
+ statusCode: {
+ // do not show global error
+ 400: null
+ }
+ }).done(function (r) {
if (typeof r === 'string') {
r = JSON.parse(r);
}
diff --git a/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js
index 18362015704..2e2e0f9be56 100644
--- a/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js
@@ -103,6 +103,10 @@ define([
rule_key: ruleKey,
severity: severity,
params: paramsHash
+ },
+ statusCode: {
+ // do not show global error
+ 400: null
}
}).done(function () {
that.trigger('profileActivated', severity, params);
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 72f197f7008..66600022fa2 100644
--- a/server/sonar-web/src/main/js/source-viewer/viewer.js
+++ b/server/sonar-web/src/main/js/source-viewer/viewer.js
@@ -434,10 +434,16 @@ define([
blocks = this.model.get('duplications')[index - 1].blocks,
inRemovedComponent = _.some(blocks, function (b) {
return b._ref == null;
- });
+ }),
+ foundOne = false;
blocks = _.filter(blocks, function (b) {
- var outOfBounds = b.from > line || b.from + b.size < line;
- return (b._ref != null) && ((b._ref !== '1') || (b._ref === '1' && outOfBounds));
+ var outOfBounds = b.from > line || b.from + b.size < line,
+ currentFile = b._ref === '1',
+ isOk = (b._ref != null) && (!currentFile || (currentFile && (outOfBounds || foundOne)));
+ if (b._ref === '1' && !outOfBounds) {
+ foundOne = true;
+ }
+ return isOk;
});
var popup = new DuplicationPopupView({
triggerEl: $(e.currentTarget),
diff --git a/server/sonar-web/src/main/less/pages/analysis-reports.less b/server/sonar-web/src/main/less/pages/analysis-reports.less
index df4abf70d11..b995f9412dd 100644
--- a/server/sonar-web/src/main/less/pages/analysis-reports.less
+++ b/server/sonar-web/src/main/less/pages/analysis-reports.less
@@ -27,6 +27,7 @@
@pendingColor: #fdfce2;
@workingColor: #ecf9fc;
@doneColor: #ecfced;
+@cancelledColor: #fcecec;
@failedColor: #fcecec;
@@ -59,6 +60,10 @@
background-color: @doneColor !important;
}
+.analysis-reports-report-cancelled {
+ background-color: @cancelledColor !important;
+}
+
.analysis-reports-report-failed {
background-color: @failedColor !important;