aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-05-27 17:36:15 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-05-27 17:36:15 +0200
commit0a6d2e59e58d0a854a9dd9b5a5915e97ac5a8a49 (patch)
tree7c91108d5f612cf6c066913bb5364173cbefb0d3
parentf2451770aed2d7d78a9d45191d25f2f429ddc788 (diff)
downloadsonarqube-0a6d2e59e58d0a854a9dd9b5a5915e97ac5a8a49.tar.gz
sonarqube-0a6d2e59e58d0a854a9dd9b5a5915e97ac5a8a49.zip
SONAR-4296 Delete ActionPlansWidget on reviews in favor of ActionPlansWidget on issues (same key is now used)
-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/ActionPlansWidget.java35
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActionPlansWidget.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties11
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/action_plans.html.erb92
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb6
7 files changed, 7 insertions, 143 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 ade0e86d442..9791fe5d5ac 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
@@ -44,7 +44,6 @@ import org.sonar.plugins.core.timemachine.*;
import org.sonar.plugins.core.web.Lcom4Viewer;
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.ProjectReviewsWidget;
@@ -408,7 +407,6 @@ public final class CorePlugin extends SonarPlugin {
ProjectReviewsWidget.class,
FalsePositiveIssuesWidget.class,
ActionPlansWidget.class,
- org.sonar.plugins.core.widgets.ActionPlansWidget.class,
UnresolvedIssuesPerAssigneeWidget.class,
UnresolvedIssuesStatusesWidget.class,
NewIssuesEmailTemplate.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 444db852088..853fa090f22 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
@@ -46,7 +46,7 @@ public final class ProjectIssuesDashboard extends DashboardTemplate {
private void addFirstColumn(Dashboard dashboard) {
dashboard.addWidget("unresolved_issues_statuses", 1);
- dashboard.addWidget("issues_action_plans", 1);
+ dashboard.addWidget("action_plans", 1);
}
private void addSecondColumn(Dashboard dashboard) {
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ActionPlansWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ActionPlansWidget.java
deleted file mode 100644
index 912a046e04a..00000000000
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ActionPlansWidget.java
+++ /dev/null
@@ -1,35 +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;
-
-import org.sonar.api.web.WidgetCategory;
-import org.sonar.api.web.WidgetProperties;
-import org.sonar.api.web.WidgetProperty;
-import org.sonar.api.web.WidgetPropertyType;
-
-@WidgetCategory({"Action plans", "Reviews"})
-@WidgetProperties({
- @WidgetProperty(key = "showClosedReviews", type = WidgetPropertyType.BOOLEAN, defaultValue = "true")
-})
-public class ActionPlansWidget extends CoreWidget {
- public ActionPlansWidget() {
- super("action_plans", "Action plans", "/org/sonar/plugins/core/widgets/action_plans.html.erb");
- }
-}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActionPlansWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActionPlansWidget.java
index 6da3c1c362a..652e3a2792a 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActionPlansWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActionPlansWidget.java
@@ -31,6 +31,6 @@ import org.sonar.plugins.core.widgets.CoreWidget;
})
public class ActionPlansWidget extends CoreWidget {
public ActionPlansWidget() {
- super("issues_action_plans", "Issues action plans", "/org/sonar/plugins/core/widgets/issues/action_plans.html.erb");
+ super("action_plans", "Issues action plans", "/org/sonar/plugins/core/widgets/issues/action_plans.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 fa054126914..e1024aa9283 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
@@ -1066,17 +1066,10 @@ widget.unresolved_issues_statuses.description=Display the number of unresolved i
widget.action_plans.name=Action plans
widget.action_plans.description=Shows all the open action plans of the project
-widget.action_plans.property.showClosedReviews.name=Show Closed Reviews
+widget.action_plans.property.showResolvedIssues.name=Show Resolved Issues
widget.action_plans.title=Open action plans
widget.action_plans.no_action_plan=No action plan
-widget.action_plans.x_open_reviews={0} open reviews
-
-widget.issues_action_plans.name=Issues action plans
-widget.issues_action_plans.description=Shows all the open action plans of the project
-widget.issues_action_plans.property.showResolvedIssues.name=Show Resolved Issues
-widget.issues_action_plans.title=Open action plans
-widget.issues_action_plans.no_action_plan=No action plan
-widget.issues_action_plans.x_unresolved_issues={0} unresolved issues
+widget.action_plans.x_unresolved_issues={0} unresolved issues
widget.treemap-widget.name=Treemap of components
widget.treemap-widget.description=Displays a treemap of all direct components of the selected resource
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/action_plans.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/action_plans.html.erb
deleted file mode 100644
index bbd2b41f3c4..00000000000
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/action_plans.html.erb
+++ /dev/null
@@ -1,92 +0,0 @@
-<%
- if has_role?(:user, @project)
- open_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id],
- :include => 'reviews', :order => 'deadline ASC')
-
- div_id = "action-plan-widget-#{widget.id.to_s}"
-%>
-
-<div class="line-block">
- <% if has_role?(:admin, @project) %>
- <div style="float:right">
- <a href="<%= url_for :controller => 'action_plans', :action => 'index', :id => @project.id -%>">
- <%= message('widgets.more') -%>
- </a>
- </div>
- <% end %>
-
- <h3><%= message('widget.action_plans.title') -%></h3>
-</div>
-
-
-<div id="<%= div_id -%>">
-
-<% if open_action_plans.size ==0 %>
-
- <span class="empty_widget"><%= message('widget.action_plans.no_action_plan') -%></span>
-
-<%
- else
- show_closed_reviews = widget_properties["showClosedReviews"]
- if show_closed_reviews
- line_class = "top"
- else
- line_class = "middle"
- max_open_reviews = open_action_plans.map {|plan| plan.open_reviews.size}.max
- end
-%>
-
- <table class="width100 <%= show_closed_reviews ? 'actionPlans' : 'data' -%>">
- <thead>
- <tr>
- <th colspan="<%= show_closed_reviews ? '3' : '4' %>"></th>
- </tr>
- </thead>
- <tbody>
- <%
- open_action_plans.each do |plan|
- %>
- <tr class="<%= show_closed_reviews ? '' : cycle("even", "odd", :name => "action_plan_" + widget.id.to_s) -%>">
- <td class="nowrap <%= line_class -%>"><%= h(plan.name) -%></td>
- <td class="nowrap small <%= line_class -%> <%= 'over-due' if plan.over_due? -%>" style="text-align: right; padding-left:10px"><%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' ' -%></td>
-
- <% if show_closed_reviews %>
- <% if plan.progress[:total]==0 %>
- <td class="noprogress nowrap <%= line_class -%>"><%= message('action_plans.no_reviews_linked_to_action_plan') -%></td>
- <% else %>
- <td class="progress <%= line_class -%>">
- <%= render :partial => 'action_plans/progress', :locals => {:action_plan => plan} -%>
- </td>
- <% end %>
- <%
- else
- open_reviews_size = plan.open_reviews.size
- %>
- <td class="right <%= line_class -%>" style="padding-left:20px">
- <% if open_reviews_size == 0 %>
- <%= open_reviews_size -%>
- <% else %>
- <a href="<%= url_for({:controller => 'project_reviews', :action => 'index', :action_plan_id => plan.id,
- :id => plan.project_id, :statuses => Review::STATUS_OPEN + ',' + Review::STATUS_REOPENED}) -%>"
- title="<%= message('widget.action_plans.x_open_reviews', :params => open_reviews_size.to_s) -%>"><%= open_reviews_size -%></a>
- <% end %>
- </td>
- <td class="<%= line_class -%>" style="padding: 0 40px 0 10px; width: 300px;">
- <div class="barchart" style="width: 100%">
- <div style="width: <%= max_open_reviews > 0 ? 100 * open_reviews_size / max_open_reviews : 0 -%>%;background-color:#777;"></div>
- </div>
- </td>
- <% end %>
-
- </tr>
- <%
- end
- %>
- </tbody>
- </table>
-
-<% end %>
-
-</div>
-
-<% end %>
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb
index dd4e8477709..5054635cd9a 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb
@@ -15,7 +15,7 @@
</div>
<% end %>
- <h3><%= message('widget.issues_action_plans.title') -%></h3>
+ <h3><%= message('widget.action_plans.title') -%></h3>
</div>
@@ -23,7 +23,7 @@
<% if open_action_plans.size ==0 %>
- <span class="empty_widget"><%= message('widget.issues_action_plans.no_action_plan') -%></span>
+ <span class="empty_widget"><%= message('widget.action_plans.no_action_plan') -%></span>
<%
else
@@ -68,7 +68,7 @@
<% else %>
<a href="<%= url_for({:controller => 'issues', :action => 'search',
:actionPlans => plan.key, :resolved => 'false'}) -%>"
- title="<%= message('widget.issues_action_plans.x_unresolved_issues', :params => unresolved_issues_size.to_s) -%>"><%= unresolved_issues_size -%></a>
+ title="<%= message('widget.action_plans.x_unresolved_issues', :params => unresolved_issues_size.to_s) -%>"><%= unresolved_issues_size -%></a>
<% end %>
</td>
<td class="<%= line_class -%>" style="padding: 0 40px 0 10px; width: 300px;">