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.FalsePositiveIssuesWidget;
-import org.sonar.plugins.core.widgets.issues.MyUnresolvedIssuesWidget;
-import org.sonar.plugins.core.widgets.issues.UnresolvedIssuesPerAssigneeWidget;
+import org.sonar.plugins.core.widgets.issues.*;
import org.sonar.plugins.core.widgets.reviews.*;
import java.util.List;
ActionPlansWidget.class,
org.sonar.plugins.core.widgets.ActionPlansWidget.class,
UnresolvedIssuesPerAssigneeWidget.class,
+ UnresolvedIssuesStatusesWidget.class,
// batch
ProfileSensor.class,
}
private void addFirstColumn(Dashboard dashboard) {
- dashboard.addWidget("issues_action_plans", 1);
+ dashboard.addWidget("unresolved_issues_statuses", 1);
+ dashboard.addWidget("issues_action_plans", 2);
}
private void addSecondColumn(Dashboard dashboard) {
--- /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.plugins.core.widgets.CoreWidget;
+
+@WidgetCategory({"Issues"})
+public class UnresolvedIssuesStatusesWidget extends CoreWidget {
+ public UnresolvedIssuesStatusesWidget() {
+ super("unresolved_issues_statuses", "Unresolved issue statuses", "/org/sonar/plugins/core/widgets/issues/unresolved_issues_statuses.html.erb");
+ }
+}
widget.unresolved_issues_per_assignee.description=Shows the number of unresolved issues per assignee.
widget.unresolved_issues_per_assignee.not_assigned=Not assigned
+widget.unresolved_issues_statuses.name=Unresolved issue statuses
+widget.unresolved_issues_statuses.description=Display the number of unresolved issues according to their status : Open, Reopen and Accepted.
+widget.unresolved_issues_statuses.added=Added:
+widget.unresolved_issues_statuses.removed=Removed:
+
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
--- /dev/null
+<%
+ issues = @snapshot.measure('violations')
+ open_issues = @snapshot.measure('open_issues')
+ reopened_issues = @snapshot.measure('reopened_issues')
+ confirmed_issues = @snapshot.measure('confirmed_issues')
+
+ issues_search_options = {}
+ issues_search_options['resolved'] = 'false'
+ issues_search_options['componentRoots'] = @project.key
+%>
+<table width="100%">
+ <tr>
+ <td valign="top" width="25%">
+ <div class="dashbox">
+ <h3><%= message('issues') -%></h3>
+ <div class="marginbottom10">
+ <span class="big">
+ <%= format_measure(issues, :url => url_for({:controller => 'issues', :action => 'search' }.merge(issues_search_options))) -%>
+ </span>
+ <%= dashboard_configuration.selected_period? ? format_variation(issues) : trend_icon(issues) -%>
+ </div>
+ </div>
+ </td>
+ <td valign="top" width="25%">
+ <div class="dashbox">
+ <h3><%= message('issue.status.OPEN') -%></h3>
+ <div class="marginbottom10">
+ <span class="big">
+ <%= format_measure(open_issues, :url => url_for({:controller => 'issues', :action => 'search', :statuses => 'OPEN'}.merge(issues_search_options))) -%>
+ </span>
+ <%= dashboard_configuration.selected_period? ? format_variation(open_issues) : trend_icon(open_issues) -%>
+ </div>
+ </div>
+ </td>
+ <td valign="top" width="25%">
+ <div class="dashbox">
+ <h3><%= message('issue.status.REOPENED') -%></h3>
+ <div class="marginbottom10">
+ <span class="big">
+ <%= format_measure(reopened_issues, :url => url_for({:controller => 'issues', :action => 'search', :statuses => 'REOPENED'}.merge(issues_search_options))) -%>
+ </span>
+ <%= dashboard_configuration.selected_period? ? format_variation(reopened_issues) : trend_icon(reopened_issues) -%>
+ </div>
+ </div>
+ </td>
+ <td valign="top" width="25%">
+ <div class="dashbox">
+ <h3><%= message('issue.status.CONFIRMED') -%></h3>
+ <div class="marginbottom10">
+ <span class="big">
+ <%= format_measure(confirmed_issues, :url => url_for({:controller => 'issues', :action => 'search', :statuses => 'CONFIRMED'}.merge(issues_search_options))) -%>
+ </span>
+ <%= dashboard_configuration.selected_period? ? format_variation(confirmed_issues) : trend_icon(confirmed_issues) -%>
+ </div>
+ </div>
+ </td>
+ </tr>
+</table>
--- /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.dashboards;
+
+import org.junit.Test;
+import org.sonar.api.web.Dashboard;
+import org.sonar.api.web.DashboardLayout;
+import org.sonar.plugins.core.CorePlugin;
+
+import static org.fest.assertions.Assertions.assertThat;
+
+public class ProjectIssuesDashboardTest {
+
+ ProjectIssuesDashboard template = new ProjectIssuesDashboard();
+
+ @Test
+ public void should_have_a_name() {
+ assertThat(template.getName()).isEqualTo("Issues");
+ }
+
+ @Test
+ public void should_be_registered_as_an_extension() {
+ assertThat(new CorePlugin().getExtensions()).contains(template.getClass());
+ }
+
+ @Test
+ public void should_create_dashboard() {
+ Dashboard dashboard = template.createDashboard();
+
+ assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS);
+ assertThat(dashboard.getWidgets()).hasSize(5);
+ }
+
+}
.setDomain(DOMAIN_ISSUES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
- .setDeleteHistoricalData(true)
.create();
/**
.setDomain(DOMAIN_ISSUES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
- .setDeleteHistoricalData(true)
.create();