Link to project dashboard by default for project links
I8874fd59 changed the project link from ChangeScreen2 to go to the project's default dashboard. Make other project links, specifically those using ProjectLink, have the same behavior. This does lose the functionality of clicking a project name in the change table linking to a search for changes in the project matching that change's status. This small loss is outweighed by consistency in behavior across the application. Change-Id: I3f6257ecd8d098a2c3ee9680174817664517da61
This commit is contained in:
@@ -20,7 +20,6 @@ import com.google.gerrit.client.ui.FancyFlexTable;
|
|||||||
import com.google.gerrit.client.ui.ProjectLink;
|
import com.google.gerrit.client.ui.ProjectLink;
|
||||||
import com.google.gerrit.common.data.AccountProjectWatchInfo;
|
import com.google.gerrit.common.data.AccountProjectWatchInfo;
|
||||||
import com.google.gerrit.reviewdb.client.AccountProjectWatch;
|
import com.google.gerrit.reviewdb.client.AccountProjectWatch;
|
||||||
import com.google.gerrit.reviewdb.client.Change.Status;
|
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.user.client.ui.CheckBox;
|
import com.google.gwt.user.client.ui.CheckBox;
|
||||||
@@ -126,7 +125,7 @@ public class MyWatchesTable extends FancyFlexTable<AccountProjectWatchInfo> {
|
|||||||
|
|
||||||
protected void populate(final int row, final AccountProjectWatchInfo info) {
|
protected void populate(final int row, final AccountProjectWatchInfo info) {
|
||||||
final FlowPanel fp = new FlowPanel();
|
final FlowPanel fp = new FlowPanel();
|
||||||
fp.add(new ProjectLink(info.getProject().getNameKey(), Status.NEW));
|
fp.add(new ProjectLink(info.getProject().getNameKey()));
|
||||||
if (info.getWatch().getFilter() != null) {
|
if (info.getWatch().getFilter() != null) {
|
||||||
Label filter = new Label(info.getWatch().getFilter());
|
Label filter = new Label(info.getWatch().getFilter());
|
||||||
filter.setStyleName(Gerrit.RESOURCES.css().watchedProjectFilter());
|
filter.setStyleName(Gerrit.RESOURCES.css().watchedProjectFilter());
|
||||||
|
|||||||
@@ -160,8 +160,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
|
|||||||
|
|
||||||
table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c));
|
table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c));
|
||||||
table.setWidget(row, C_OWNER, link(c.getOwner()));
|
table.setWidget(row, C_OWNER, link(c.getOwner()));
|
||||||
table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c
|
table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey()));
|
||||||
.getStatus()));
|
|
||||||
table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c
|
table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c
|
||||||
.getStatus(), c.getBranch(), c.getTopic()));
|
.getStatus(), c.getBranch(), c.getTopic()));
|
||||||
table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn()));
|
table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn()));
|
||||||
|
|||||||
@@ -224,8 +224,7 @@ public class ChangeTable2 extends NavigationTable<ChangeInfo> {
|
|||||||
table.setText(row, C_OWNER, "");
|
table.setText(row, C_OWNER, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
table.setWidget(
|
table.setWidget(row, C_PROJECT, new ProjectLink(c.project_name_key()));
|
||||||
row, C_PROJECT, new ProjectLink(c.project_name_key(), c.status()));
|
|
||||||
table.setWidget(row, C_BRANCH, new BranchLink(c.project_name_key(), c
|
table.setWidget(row, C_BRANCH, new BranchLink(c.project_name_key(), c
|
||||||
.status(), c.branch(), c.topic()));
|
.status(), c.branch(), c.topic()));
|
||||||
if (Gerrit.isSignedIn()
|
if (Gerrit.isSignedIn()
|
||||||
|
|||||||
@@ -14,35 +14,16 @@
|
|||||||
|
|
||||||
package com.google.gerrit.client.ui;
|
package com.google.gerrit.client.ui;
|
||||||
|
|
||||||
import com.google.gerrit.client.Gerrit;
|
|
||||||
import com.google.gerrit.client.changes.QueryScreen;
|
|
||||||
import com.google.gerrit.common.PageLinks;
|
import com.google.gerrit.common.PageLinks;
|
||||||
import com.google.gerrit.reviewdb.client.Change;
|
|
||||||
import com.google.gerrit.reviewdb.client.Project;
|
import com.google.gerrit.reviewdb.client.Project;
|
||||||
import com.google.gerrit.reviewdb.client.Change.Status;
|
|
||||||
|
|
||||||
/** Link to the open changes of a project. */
|
/** Link to the default dashboard of a project. */
|
||||||
public class ProjectLink extends InlineHyperlink {
|
public class ProjectLink extends InlineHyperlink {
|
||||||
private Project.NameKey project;
|
public ProjectLink(Project.NameKey proj) {
|
||||||
private Status status;
|
this(proj.get(), proj);
|
||||||
|
|
||||||
public ProjectLink(final Project.NameKey proj, Change.Status stat) {
|
|
||||||
this(proj.get(), proj, stat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectLink(final String text, final Project.NameKey proj,
|
public ProjectLink(String text, Project.NameKey proj) {
|
||||||
Change.Status stat) {
|
super(text, PageLinks.toProjectDefaultDashboard(proj));
|
||||||
super(text, PageLinks.toChangeQuery(PageLinks.projectQuery(proj, stat)));
|
|
||||||
status = stat;
|
|
||||||
project = proj;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void go() {
|
|
||||||
Gerrit.display(getTargetHistoryToken(), createScreen());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Screen createScreen() {
|
|
||||||
return QueryScreen.forQuery(PageLinks.projectQuery(project, status));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user