aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-04-08 11:52:26 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-04-20 08:49:57 +0200
commitb248b5c93ae39b52bd77508559862c7885dedec0 (patch)
tree9f0eebdf0c8e944337a7a21cc99dad904c2444a2 /sonar-server/src
parentc9e264eb2b42f89a13502a4b7721b4577f5c2634 (diff)
downloadsonarqube-b248b5c93ae39b52bd77508559862c7885dedec0.tar.gz
sonarqube-b248b5c93ae39b52bd77508559862c7885dedec0.zip
[SONAR-1973] Add status and type constants
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/review.rb36
2 files changed, 27 insertions, 13 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
index c1ee0a44cdf..464bfdde0ce 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
@@ -56,8 +56,8 @@ class ReviewsController < ApplicationController
@review = Review.new(params[:review])
@review.user = current_user
- @review.status = "open"
- @review.review_type = "simple"
+ @review.status = Review.default_status
+ @review.review_type = Review.default_type
@review_comment = ReviewComment.new(params[:review_comment])
@review_comment.user = current_user
@review.review_comments << @review_comment
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
index 13ee58b80fe..2e42efb6f15 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
@@ -26,24 +26,38 @@ class Review < ActiveRecord::Base
validates_presence_of :review_type, :message => "can't be empty"
validates_presence_of :status, :message => "can't be empty"
- INFO = "info"
- MINOR = "minor"
- MAJOR = "major"
- CRITICAL = "critical"
- BLOCKER = "blocker"
+ SEVERITY_INFO = "info"
+ SEVERITY_MINOR = "minor"
+ SEVERITY_MAJOR = "major"
+ SEVERITY_CRITICAL = "critical"
+ SEVERITY_BLOCKER = "blocker"
+
+ TYPE_COMMENTS = "comments"
+ TYPE_FALSE_POSITIVE = "f-positive"
+
+ STATUS_OPEN = "open"
+ STATUS_CLOSED = "closed"
def self.default_severity
- return MAJOR
+ return SEVERITY_MAJOR
+ end
+
+ def self.default_type
+ return TYPE_COMMENTS
+ end
+
+ def self.default_status
+ return STATUS_OPEN
end
def self.severity_options
severity_ops = []
- severity_ops << ["Info", INFO]
- severity_ops << ["Minor", MINOR]
- severity_ops << ["Major", MAJOR]
- severity_ops << ["Critical", CRITICAL]
- severity_ops << ["Blocker", BLOCKER]
+ severity_ops << ["Info", SEVERITY_INFO]
+ severity_ops << ["Minor", SEVERITY_MINOR]
+ severity_ops << ["Major", SEVERITY_MAJOR]
+ severity_ops << ["Critical", SEVERITY_CRITICAL]
+ severity_ops << ["Blocker", SEVERITY_BLOCKER]
return severity_ops
end