]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5646 add widget/componentId in response of api/dashboards/show
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 29 Sep 2014 12:18:38 +0000 (14:18 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 29 Sep 2014 12:18:49 +0000 (14:18 +0200)
server/sonar-server/src/main/java/org/sonar/server/dashboard/ws/DashboardsShowAction.java

index 64ac058ed4c46afe32959fcdd1bc6f0b636f4ea4..a1c02826972239eb4da7888605d209d4ed150c6e 100644 (file)
@@ -24,6 +24,7 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.api.utils.text.JsonWriter;
+import org.sonar.core.component.ComponentDto;
 import org.sonar.core.dashboard.DashboardDto;
 import org.sonar.core.dashboard.WidgetDto;
 import org.sonar.core.dashboard.WidgetPropertyDto;
@@ -86,7 +87,6 @@ public class DashboardsShowAction implements DashboardsAction {
           json.endObject();
         }
       }
-
       // load widgets and related properties
       json.name("widgets").beginArray();
       Collection<WidgetDto> widgets = dbClient.widgetDao().findByDashboard(dbSession, dashboard.getKey());
@@ -100,6 +100,7 @@ public class DashboardsShowAction implements DashboardsAction {
         json.prop("col", widget.getColumnIndex());
         json.prop("row", widget.getRowIndex());
         json.prop("configured", widget.getConfigured());
+        json.prop("componentId", widget.getResourceId());
         json.name("props").beginArray();
         for (WidgetPropertyDto prop : propertiesByWidget.get(widget.getKey())) {
           json.beginObject();