aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-03-27 16:03:00 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-03-27 17:54:41 +0100
commit829d5b8d58690097727465868ddc5037b4397528 (patch)
treeee354951b62437c756a708fc696370cf100c331b
parent7ebe878335698392cd48fef42b23517cb250b469 (diff)
downloadsonarqube-829d5b8d58690097727465868ddc5037b4397528.tar.gz
sonarqube-829d5b8d58690097727465868ddc5037b4397528.zip
do not show global error if the request is sent from modal window
-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
3 files changed, 22 insertions, 2 deletions
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 e2dd5d78f48..ee0512e2af3 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
@@ -157,7 +157,15 @@ define([
this.$('.modal-warning').hide();
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 ead147351ba..d8e5fbfd3d3 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
@@ -105,7 +105,15 @@ define([
this.$('.modal-warning').hide();
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);