summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-12-07 17:35:03 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-12-07 18:16:30 +0100
commitd28a121fe58d6155048ba244e92a36540cba9990 (patch)
tree5e56e3fe37f1bad8d28c2e32dded8b40ea2d75c5
parentc6374cf5b6820acd23b5a172b94cc56e90614e2d (diff)
downloadsonarqube-d28a121fe58d6155048ba244e92a36540cba9990.tar.gz
sonarqube-d28a121fe58d6155048ba244e92a36540cba9990.zip
SONAR-7030 Update widgets from Custom dashboard
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/dashboard/template/ProjectCustomDashboard.java (renamed from server/sonar-server/src/main/java/org/sonar/server/dashboard/template/ProjectDefaultDashboard.java)19
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectDefaultDashboardTest.java)10
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/dashboard/template/ProjectCustomDashboardTest/filters.xml (renamed from server/sonar-server/src/test/resources/org/sonar/server/dashboard/template/ProjectDefaultDashboardTest/filters.xml)0
4 files changed, 18 insertions, 15 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/dashboard/template/ProjectDefaultDashboard.java b/server/sonar-server/src/main/java/org/sonar/server/dashboard/template/ProjectCustomDashboard.java
index 3803fb2db63..bb24d96305b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/dashboard/template/ProjectDefaultDashboard.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/dashboard/template/ProjectCustomDashboard.java
@@ -28,21 +28,21 @@ import org.sonar.db.issue.IssueFilterDto;
import org.sonar.server.dashboard.widget.ProjectIssueFilterWidget;
/**
- * Default dashboard
+ * Custom dashboard
*
* @since 2.13
*/
-public final class ProjectDefaultDashboard extends DashboardTemplate {
+public final class ProjectCustomDashboard extends DashboardTemplate {
private final IssueFilterDao issueFilterDao;
- public ProjectDefaultDashboard(IssueFilterDao issueFilterDao) {
+ public ProjectCustomDashboard(IssueFilterDao issueFilterDao) {
this.issueFilterDao = issueFilterDao;
}
@Override
public String getName() {
- return "Dashboard";
+ return "Custom";
}
@Override
@@ -55,16 +55,19 @@ public final class ProjectDefaultDashboard extends DashboardTemplate {
}
private void addFirstColumn(Dashboard dashboard) {
- dashboard.addWidget("technical_debt_pyramid", 1);
+ dashboard.addWidget("size", 1);
+ dashboard.addWidget("code_coverage", 1);
+ dashboard.addWidget("duplications", 1);
+ dashboard.addWidget("documentation_comments", 1);
}
private void addSecondColumn(Dashboard dashboard) {
+ dashboard.addWidget("rules", 2);
+ dashboard.addWidget("timeline", 2);
IssueFilterDto unresolvedIssues = getIssueFilterByName("Unresolved Issues");
-
dashboard.addWidget(ProjectIssueFilterWidget.ID, 2)
.setProperty(ProjectIssueFilterWidget.FILTER_PROPERTY, Long.toString(unresolvedIssues.getId()))
- .setProperty(ProjectIssueFilterWidget.DISTRIBUTION_AXIS_PROPERTY, "severities")
- .setProperty(ProjectIssueFilterWidget.DISPLAY_MODE, "debt");
+ .setProperty(ProjectIssueFilterWidget.DISTRIBUTION_AXIS_PROPERTY, "createdAt");
}
private IssueFilterDto getIssueFilterByName(String name) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
index de74d22e9fe..53b153bb349 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
@@ -66,7 +66,7 @@ import org.sonar.server.computation.taskprocessor.CeTaskProcessorModule;
import org.sonar.server.computation.ws.CeWsModule;
import org.sonar.server.config.ws.PropertiesWs;
import org.sonar.server.dashboard.template.GlobalDefaultDashboard;
-import org.sonar.server.dashboard.template.ProjectDefaultDashboard;
+import org.sonar.server.dashboard.template.ProjectCustomDashboard;
import org.sonar.server.dashboard.widget.ActionPlansWidget;
import org.sonar.server.dashboard.widget.AlertsWidget;
import org.sonar.server.dashboard.widget.BubbleChartWidget;
@@ -352,7 +352,7 @@ public class PlatformLevel4 extends PlatformLevel {
// Dashboard
DashboardsWs.class,
org.sonar.server.dashboard.ws.ShowAction.class,
- ProjectDefaultDashboard.class,
+ ProjectCustomDashboard.class,
GlobalDefaultDashboard.class,
AlertsWidget.class,
CoverageWidget.class,
diff --git a/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectDefaultDashboardTest.java b/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java
index 55d1b2120f3..b2b44a0c7f4 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectDefaultDashboardTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java
@@ -33,22 +33,22 @@ import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
@Category(DbTests.class)
-public class ProjectDefaultDashboardTest {
+public class ProjectCustomDashboardTest {
@Rule
public DbTester dbTester = DbTester.create(System2.INSTANCE);
- ProjectDefaultDashboard template;
+ ProjectCustomDashboard template;
@Before
public void setUp() {
IssueFilterDao issueFilterDao = new IssueFilterDao(dbTester.myBatis());
- template = new ProjectDefaultDashboard(issueFilterDao);
+ template = new ProjectCustomDashboard(issueFilterDao);
}
@Test
public void should_have_a_name() {
- assertThat(template.getName()).isEqualTo("Dashboard");
+ assertThat(template.getName()).isEqualTo("Custom");
}
@Test
@@ -57,7 +57,7 @@ public class ProjectDefaultDashboardTest {
Dashboard dashboard = template.createDashboard();
assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS);
- assertThat(dashboard.getWidgets()).hasSize(2);
+ assertThat(dashboard.getWidgets()).hasSize(7);
}
@Test
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/dashboard/template/ProjectDefaultDashboardTest/filters.xml b/server/sonar-server/src/test/resources/org/sonar/server/dashboard/template/ProjectCustomDashboardTest/filters.xml
index 8ec92ddcdbf..8ec92ddcdbf 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/dashboard/template/ProjectDefaultDashboardTest/filters.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/dashboard/template/ProjectCustomDashboardTest/filters.xml