aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-05-27 17:13:38 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-05-27 17:13:38 +0200
commitbd5a4fe69a24fd59f14527896df49a044267fbc5 (patch)
tree673337f6ca6e215874487e45db7149b45558e5c2 /plugins
parent478b960bfbe4f7b22e4971109b0f1ab27b0e3810 (diff)
downloadsonarqube-bd5a4fe69a24fd59f14527896df49a044267fbc5.tar.gz
sonarqube-bd5a4fe69a24fd59f14527896df49a044267fbc5.zip
SONAR-4298 Delete FalsePositiveReviewsWidget in favor of FalsePositiveIssuesWidget (same key is now used)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectIssuesDashboard.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/FalsePositiveIssuesWidget.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java36
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties9
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb2
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb16
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/reviews_per_developer.html.erb99
8 files changed, 5 insertions, 163 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index aaf5040048d..a8d3cb24978 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -46,7 +46,6 @@ import org.sonar.plugins.core.web.TestsViewer;
import org.sonar.plugins.core.widgets.*;
import org.sonar.plugins.core.widgets.issues.ActionPlansWidget;
import org.sonar.plugins.core.widgets.issues.*;
-import org.sonar.plugins.core.widgets.reviews.FalsePositiveReviewsWidget;
import org.sonar.plugins.core.widgets.reviews.MyReviewsWidget;
import org.sonar.plugins.core.widgets.reviews.ProjectReviewsWidget;
@@ -409,7 +408,6 @@ public final class CorePlugin extends SonarPlugin {
MyReviewsWidget.class,
MyUnresolvedIssuesWidget.class,
ProjectReviewsWidget.class,
- FalsePositiveReviewsWidget.class,
FalsePositiveIssuesWidget.class,
ActionPlansWidget.class,
org.sonar.plugins.core.widgets.ActionPlansWidget.class,
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectIssuesDashboard.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectIssuesDashboard.java
index 28f1da9df36..ad0bc769c01 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectIssuesDashboard.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectIssuesDashboard.java
@@ -52,7 +52,7 @@ public final class ProjectIssuesDashboard extends DashboardTemplate {
private void addSecondColumn(Dashboard dashboard) {
dashboard.addWidget("reviews_per_developer", 2);
dashboard.addWidget("my_unresolved_issues", 2);
- dashboard.addWidget("false_positive_issues", 2);
+ dashboard.addWidget("false_positive_reviews", 2);
}
} \ No newline at end of file
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/FalsePositiveIssuesWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/FalsePositiveIssuesWidget.java
index 2dc9593601c..39937271c97 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/FalsePositiveIssuesWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/FalsePositiveIssuesWidget.java
@@ -31,6 +31,6 @@ import org.sonar.plugins.core.widgets.CoreWidget;
})
public class FalsePositiveIssuesWidget extends CoreWidget {
public FalsePositiveIssuesWidget() {
- super("false_positive_issues", "False positive open issues", "/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb");
+ super("false_positive_reviews", "False positive open issues", "/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb");
}
}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java
deleted file mode 100644
index 5dbc55c9a3b..00000000000
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.plugins.core.widgets.reviews;
-
-import org.sonar.api.web.WidgetCategory;
-import org.sonar.api.web.WidgetProperties;
-import org.sonar.api.web.WidgetProperty;
-import org.sonar.api.web.WidgetPropertyType;
-import org.sonar.plugins.core.widgets.CoreWidget;
-
-@WidgetCategory({"Reviews"})
-@WidgetProperties({
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
-})
-public class FalsePositiveReviewsWidget extends CoreWidget {
- public FalsePositiveReviewsWidget() {
- super("false_positive_reviews", "False positive open reviews", "/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb");
- }
-}
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
index dc067cc3e9f..13aee2b34e2 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
@@ -1058,15 +1058,10 @@ widget.project_reviews.description=Shows all the open/reopened reviews.
widget.project_reviews.property.numberOfLines.name=Number of lines
widget.project_reviews.property.numberOfLines.desc=Maximum number of reviews displayed at the same time.
-widget.false_positive_reviews.name=False positives
+widget.false_positive_reviews.name=False positives issues
widget.false_positive_reviews.description=Shows all the false positives found on the project.
widget.false_positive_reviews.property.numberOfLines.name=Number of lines
-widget.false_positive_reviews.property.numberOfLines.desc=Maximum number of reviews displayed at the same time.
-
-widget.false_positive_issues.name=False positives issues
-widget.false_positive_issues.description=Shows all the false positives found on the project.
-widget.false_positive_issues.property.numberOfLines.name=Number of lines
-widget.false_positive_issues.property.numberOfLines.desc=Maximum number of issues displayed at the same time.
+widget.false_positive_reviews.property.numberOfLines.desc=Maximum number of issues displayed at the same time.
widget.reviews_per_developer.name=Unresolved issues per assignee
widget.reviews_per_developer.description=Shows the number of unresolved issues per assignee.
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb
index 614bba608fc..52b9cadb949 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/false_positive_issues.html.erb
@@ -6,7 +6,7 @@
search_options['resolved'] = 'true'
search_options['resolutions'] = 'FALSE-POSITIVE'
- title = message('widget.false_positive_issues.name')
+ title = message('widget.false_positive_reviews.name')
%>
<%= render :partial => 'project/widgets/issues/issues_list_widget',
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb
deleted file mode 100644
index 4ad13c58ddf..00000000000
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<%
- if has_role?(:user, @project)
-
- search_options = {}
- search_options['projects'] = @project.key
- search_options['statuses'] = "#{Review::STATUS_RESOLVED}"
- search_options['resolutions'] = "#{Review::RESOLUTION_FALSE_POSITIVE}"
-
- title = message('widget.false_positive_reviews.name')
-%>
-
- <%= render :partial => 'project/widgets/reviews/reviews_list_widget',
- :locals => {:search_options => search_options, :title => title,
- :widget_id => widget.id.to_s, :widget_properties => widget_properties} %>
-
-<% end %> \ No newline at end of file
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/reviews_per_developer.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/reviews_per_developer.html.erb
deleted file mode 100644
index c232402b39f..00000000000
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/reviews_per_developer.html.erb
+++ /dev/null
@@ -1,99 +0,0 @@
-<%
- options = {}
- options['statuses'] = "#{Review::STATUS_OPEN},#{Review::STATUS_REOPENED}"
- options['projects'] = @project.key
- if @dashboard_configuration.selected_period?
- from_date = dashboard_configuration.from_datetime
- options['from'] = from_date
- to_date = DateTime.now
- options['to'] = to_date
- end
- reviews = Review.search(options)
-
- unless reviews.empty?
- reviews_by_dev = {}
- counter_no_assignee = 0
- reviews.each do |review|
- dev = review.assignee
- if dev
- counter = reviews_by_dev[dev]
- if counter
- reviews_by_dev[dev] = counter+1
- else
- reviews_by_dev[dev] = 1
- end
- else
- counter_no_assignee += 1
- end
- end
- counter_max = 0
- counter_max = reviews_by_dev.values.max unless reviews_by_dev.empty?
- counter_max = counter_no_assignee if counter_no_assignee > counter_max
-
- div_id = "review-per-dev-widget-#{widget.id.to_s}"
- end
-%>
-
-<h3><%= message('widget.reviews_per_developer.name') -%></h3>
-
-<% if reviews.size ==0 %>
-
- <span class="empty_widget"><%= message('widget.my_reviews.no_review') -%></span>
-
-<% else %>
-
-<div id="<%= div_id -%>">
-
- <table class="data width100">
- <thead>
- <tr>
- <th coslpan="3">
- </th>
- </tr>
- </thead>
- <tbody>
- <%
- reviews_by_dev.sort{|h1,h2| h2[1] <=> h1[1]}.each do |dev, count|
- %>
- <tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>">
- <td class="max-width">
- <%= link_to dev.name,
- :controller => "project_reviews", :action => "index", :statuses => "#{Review::STATUS_OPEN},#{Review::STATUS_REOPENED}", :assignees => dev.login,
- :projects => @project.id, :from => from_date, :to => to_date -%>
- </td>
- <td class="nowrap">
- <%= '+' if @dashboard_configuration.selected_period? -%><%= count.to_s -%>
- </td>
- <% if counter_max > 0 %>
- <td>
- <%= barchart(:width => 100, :percent => (100 * count / counter_max).to_i) %>
- </td>
- <% end %>
- </tr>
- <%
- end
- # And now show the unassigned reviews counter
- unless counter_no_assignee==0
- %>
- <tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>">
- <td class="max-width">
- <%= link_to message('widget.reviews_per_developer.not_assigned'),
- :controller => "project_reviews", :action => "index", :statuses => "#{Review::STATUS_OPEN},#{Review::STATUS_REOPENED}", :assignees => '',
- :projects => @project.id, :from => from_date, :to => to_date -%>
- </td>
- <td class="nowrap">
- <%= '+' if @dashboard_configuration.selected_period? -%><%= counter_no_assignee.to_s -%>
- </td>
- <% if counter_max > 0 %>
- <td>
- <%= barchart(:width => 100, :percent => (100 * counter_no_assignee / counter_max).to_i) %>
- </td>
- <% end %>
- </tr>
- <% end %>
- </tbody>
- </table>
-
-</div>
-
-<% end %>