Add an "Inherited From" column to the ProjectDashboardsScreen
This extra column makes it easier to track down where a project dashboard is defined. Change-Id: Id0277ef2c8c656bc42e4584c4368b66ab96a4bdf
This commit is contained in:

committed by
Edwin Kempin

parent
9b2cd548da
commit
9f7aecdaab
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
public interface DashboardConstants extends Constants {
|
||||
String dashboardName();
|
||||
String dashboardDescription();
|
||||
String dashboardInherited();
|
||||
String dashboardItem();
|
||||
String dashboardDefaultToolTip();
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
dashboardName = Dashboard Name
|
||||
dashboardDescription = Dashboard Description
|
||||
dashboardInherited = Inherited From
|
||||
dashboardItem = dashboard
|
||||
dashboardDefaultToolTip = Project Default Dashboard
|
@@ -16,6 +16,7 @@ package com.google.gerrit.client.dashboards;
|
||||
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.ui.NavigationTable;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gwt.user.client.History;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
|
||||
@@ -26,8 +27,11 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class DashboardsTable extends NavigationTable<DashboardInfo> {
|
||||
public DashboardsTable() {
|
||||
Project.NameKey project;
|
||||
|
||||
public DashboardsTable(final Project.NameKey project) {
|
||||
super(Util.C.dashboardItem());
|
||||
this.project = project;
|
||||
initColumnHeaders();
|
||||
}
|
||||
|
||||
@@ -36,9 +40,11 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
|
||||
fmt.setColSpan(0, 0, 2);
|
||||
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
|
||||
fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
|
||||
fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
|
||||
|
||||
table.setText(0, 1, Util.C.dashboardName());
|
||||
table.setText(0, 2, Util.C.dashboardDescription());
|
||||
table.setText(0, 3, Util.C.dashboardInherited());
|
||||
}
|
||||
|
||||
public void display(DashboardMap dashes) {
|
||||
@@ -72,7 +78,7 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
|
||||
table.setText(row, 0, section);
|
||||
|
||||
final FlexCellFormatter fmt = table.getFlexCellFormatter();
|
||||
fmt.setColSpan(row, 0, 4);
|
||||
fmt.setColSpan(row, 0, 5);
|
||||
fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().sectionHeader());
|
||||
}
|
||||
|
||||
@@ -85,6 +91,7 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
|
||||
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
|
||||
fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
|
||||
fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
|
||||
fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
|
||||
|
||||
populate(row, k);
|
||||
}
|
||||
@@ -97,6 +104,9 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
|
||||
}
|
||||
table.setWidget(row, 2, new Anchor(k.name(), "#" + link(k)));
|
||||
table.setText(row, 3, k.description());
|
||||
if (!project.get().equals(k.projectName())) {
|
||||
table.setText(row, 4, k.projectName());
|
||||
}
|
||||
|
||||
setRowItem(row, k);
|
||||
}
|
||||
|
Reference in New Issue
Block a user