]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4293 My unresolved action plan should display all issues on global dahsboard
authorJulien Lancelot <julien.lancelot@gmail.com>
Tue, 14 May 2013 16:45:38 +0000 (18:45 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Tue, 14 May 2013 16:45:38 +0000 (18:45 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActiveIssuesWidget.java [deleted file]
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/MyUnresolvedIssuesWidget.java
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/active_issues.html.erb [deleted file]
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/my_unresolved_issues.html.erb
sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list_widget.html.erb

index 3927df83dc17c772f1ad7164c2868000cefa67a3..5e3865a69ed05a377a06ee85246afaf7c09ec538 100644 (file)
@@ -46,7 +46,6 @@ 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.ActiveIssuesWidget;
 import org.sonar.plugins.core.widgets.issues.FalsePositiveIssuesWidget;
 import org.sonar.plugins.core.widgets.issues.MyUnresolvedIssuesWidget;
 import org.sonar.plugins.core.widgets.reviews.*;
@@ -408,7 +407,6 @@ public final class CorePlugin extends SonarPlugin {
       MyReviewsWidget.class,
       MyUnresolvedIssuesWidget.class,
       ProjectReviewsWidget.class,
-      ActiveIssuesWidget.class,
       FalsePositiveReviewsWidget.class,
       FalsePositiveIssuesWidget.class,
       ReviewsPerDeveloperWidget.class,
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActiveIssuesWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/issues/ActiveIssuesWidget.java
deleted file mode 100644 (file)
index 00e192a..0000000
+++ /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.issues;
-
-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({"Issues"})
-@WidgetProperties({
-  @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
-})
-public class ActiveIssuesWidget extends CoreWidget {
-  public ActiveIssuesWidget() {
-    super("active_issues", "Active issues", "/org/sonar/plugins/core/widgets/issues/active_issues.html.erb");
-  }
-}
index 01e03a09b9cd63a995e4c759796a0be954b83387..0bcdbdd9e4cc96b68299fd3c91c43ef607edd378 100644 (file)
  */
 package org.sonar.plugins.core.widgets.issues;
 
-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.api.web.*;
 import org.sonar.plugins.core.widgets.CoreWidget;
 
+import static org.sonar.api.web.WidgetScope.GLOBAL;
+
 @WidgetCategory({"Issues"})
+@WidgetScope(GLOBAL)
 @WidgetProperties({
   @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
 })
 public class MyUnresolvedIssuesWidget extends CoreWidget {
   public MyUnresolvedIssuesWidget() {
-    super("my_unresolved_issues", "My unresolved issues", "/org/sonar/plugins/core/widgets/issues/my_unresolved_issues.html.erb");
+    super("my_unresolved_issues", "My unresolved issues", "/Users/julienlancelot/Dev/Sources/sonar/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/my_unresolved_issues.html.erb");
   }
 }
index 3185f11c87a0a354626b44d44ac97f1ab8817cba..a51547b1c90c26c8cf89483c5fba01f13d8d0c47 100644 (file)
@@ -1068,21 +1068,15 @@ 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.project_reviews2.name=Active issues
-widget.project_reviews2.description=Shows all the open/reopened issues.
-widget.project_reviews2.property.numberOfLines.name=Number of lines
-widget.project_reviews2.property.numberOfLines.desc=Maximum number of issues displayed at the same time.
-
 widget.false_positive_reviews.name=False positives
 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_reviews2.name=False positives 2
-widget.false_positive_reviews2.description=Shows all the false positives found on the project.
-widget.false_positive_reviews2.property.numberOfLines.name=Number of lines
-widget.false_positive_reviews2.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.reviews_per_developer.name=Active reviews per developer
 widget.reviews_per_developer.description=Shows the number of open/reopened reviews per developer.
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/active_issues.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/active_issues.html.erb
deleted file mode 100644 (file)
index 6617104..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<%
-   if has_role?(:user, @project)
-
-     search_options = {}
-     search_options['componentRoots'] = @project.key
-     search_options['statuses'] = "OPEN,REOPENED"
-     
-     title = message('widget.project_reviews2.name')
-%>
-
-  <%= render :partial => 'project/widgets/issues/issues_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
index 41f73f891aaa031328f8b91298a0c4ae685f953b..b043744408b0901f9abf369fff14262faad5f79a 100644 (file)
@@ -1,8 +1,8 @@
 <%
-   if current_user && has_role?(:user, @project)
+   if !@project || has_role?(:user, @project)
 
      search_options = {}
-     search_options['componentRoots'] = @project.key
+     search_options['componentRoots'] = @project.key if @project
      search_options['resolved'] = 'false'
      search_options['assignees'] = current_user.login
      
index e2e3d1351ecf2bb2321be3b83abfe3ad628d2e4a..76e60d23963401f3d3bc12c32f7f36b887587c89 100644 (file)
@@ -237,13 +237,7 @@ class IssueController < ApplicationController
   #
 
   def widget_issues_list
-    @snapshot = Snapshot.find(params[:snapshot_id])
-    unless @snapshot && has_role?(:user, @snapshot)
-      render :text => "<b>Cannot access the issues of this project</b>: access denied."
-      return
-    end
-
-    @dashboard_configuration = Api::DashboardConfiguration.new(nil, :period_index => params[:period], :snapshot => @snapshot)
+    @dashboard_configuration = Api::DashboardConfiguration.new(nil, :period_index => params[:period])
     render :partial => 'project/widgets/issues/issues_list'
   end
 
index bbf8dfadbd7b7ef638ea63751304dfc8ca4b0d10..85b0749941daf3021d6710247fecee7c28a0dc7f 100644 (file)
@@ -4,7 +4,7 @@
    search_options = params unless search_options
 
    search_options['sort'] = 'UPDATE_DATE'
-   if @dashboard_configuration.selected_period?
+   if @dashboard_configuration && @dashboard_configuration.selected_period?
      search_options['createdAfter'] = @dashboard_configuration.from_datetime
      search_options['createdBefore'] = DateTime.now
    end
@@ -46,7 +46,6 @@
              link_params = search_options
              link_params[:controller] = 'issue'
              link_params[:action] = 'widget_issues_list'
-             link_params[:snapshot_id] = @snapshot.id
              link_params[:table_limit] = table_limit
              link_params[:widget_id] = widget_id
              link_params[:period] = params[:period]
index 28105a8233cc380e99ecf4d06c87f24971050298..c6a289783209160b388445d99c1222ab479b754d 100644 (file)
@@ -1,11 +1,9 @@
 <%
      table_limit = widget_properties["numberOfLines"]
 
-     if @dashboard_configuration.selected_period?
-       # TODO
-       search_options['from'] = @dashboard_configuration.from_datetime
-       # TODO
-       search_options['to'] = DateTime.now
+     if @dashboard_configuration && @dashboard_configuration.selected_period?
+       search_options['createdAfter'] = @dashboard_configuration.from_datetime
+       search_options['createdBefore'] = DateTime.now
      end
 %>