aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/models
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-12-18 17:47:40 +0100
committerFabrice Bellingard <bellingard@gmail.com>2011-12-19 08:40:38 +0100
commit97a1d845f94d1bed1b5516a7837a47079959b4a8 (patch)
treeae4e74fb801d0ef93a909700921eb62222d4f087 /sonar-server/src/main/webapp/WEB-INF/app/models
parentf8f1e54873eef3c3bcae4e9d54de87f9140cc027 (diff)
downloadsonarqube-97a1d845f94d1bed1b5516a7837a47079959b4a8.tar.gz
sonarqube-97a1d845f94d1bed1b5516a7837a47079959b4a8.zip
SONAR-2662 Create action plans which are a set of manual reviews
- Improve progress bar - Display the list of reviews in a separate page which is still in the context of the project
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/models')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/review.rb13
2 files changed, 11 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb
index 34e20850ec7..72046216539 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb
@@ -51,7 +51,7 @@ class ActionPlan < ActiveRecord::Base
def progress
total_reviews = reviews.size
open_reviews = reviews.select{|r| r.open? || r.reopened?}.size
- {:total => total_reviews, :open => open_reviews}
+ {:total => total_reviews, :open => open_reviews, :resolved => total_reviews-open_reviews}
end
private
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 1d3740b9405..e7dcdae8766 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
@@ -227,7 +227,6 @@ class Review < ActiveRecord::Base
conditions=[]
values={}
-
if options['id'].present?
conditions << 'id=:id'
values[:id]=options['id'].to_i
@@ -236,8 +235,7 @@ class Review < ActiveRecord::Base
conditions << 'id in (:ids)'
values[:ids]=ids.map { |id| id.to_i }
else
-
-
+
# --- 'review_type' is deprecated since 2.9 ---
# Following code just for backward compatibility
review_type = options['review_type']
@@ -321,6 +319,15 @@ class Review < ActiveRecord::Base
values[:assignees]=assignees.map { |user_id| user_id.to_i }
end
end
+
+ action_plan_id = options['action_plan_id']
+ if action_plan_id
+ action_plan = ActionPlan.find action_plan_id.to_i, :include => 'reviews'
+ if action_plan
+ conditions << 'id in (:ids)'
+ values[:ids]=action_plan.reviews.map { |r| r.id }
+ end
+ end
from=options['from']
if from