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.*;
MyReviewsWidget.class,
MyUnresolvedIssuesWidget.class,
ProjectReviewsWidget.class,
- ActiveIssuesWidget.class,
FalsePositiveReviewsWidget.class,
FalsePositiveIssuesWidget.class,
ReviewsPerDeveloperWidget.class,
+++ /dev/null
-/*
- * 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");
- }
-}
*/
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");
}
}
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.
+++ /dev/null
-<%
- 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
<%
- 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
#
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
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
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]
<%
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
%>