Fix diplay of project name for inherited dashboards

The project field in DashboardInfo should contain the name of the
project that defines the dashboard, but currently it is always set to
the name of the project for which the dashboards are retrieved. This
means that the value is wrong for all inherited dashboards. As result
the 'Inherited From' column in the DashboardsTable is always empty.

Change-Id: Ic6924db7ba594f92564a265737a79dfb3b412827
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2012-12-06 15:52:52 +01:00
parent 2009d58cb7
commit 88f1e56667
2 changed files with 1 additions and 2 deletions

View File

@@ -68,14 +68,12 @@ class ListDashboards implements RestReadView<ProjectResource> {
List<List<DashboardInfo>> all = Lists.newArrayList();
ProjectControl ctl = resource.getControl();
String myProject = ctl.getProject().getName();
Set<Project.NameKey> seen = Sets.newHashSet();
boolean setDefault = true;
for (;;) {
if (ctl.isVisible()) {
List<DashboardInfo> list = scan(ctl, setDefault);
for (DashboardInfo d : list) {
d.project = myProject;
if (d.isDefault != null && Boolean.TRUE.equals(d.isDefault)) {
setDefault = false;
}