Merge branch 'stable-2.9'

* stable-2.9:
  ChangeScreen2: Include space before 'in Settings' in welcome bar
  Link to project dashboard by default for project links
This commit is contained in:
Shawn Pearce 2014-05-01 13:03:43 -07:00
commit 40bc657d24
5 changed files with 9 additions and 31 deletions

View File

@ -20,7 +20,6 @@ import com.google.gerrit.client.ui.FancyFlexTable;
import com.google.gerrit.client.ui.ProjectLink;
import com.google.gerrit.common.data.AccountProjectWatchInfo;
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.ClickHandler;
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) {
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) {
Label filter = new Label(info.getWatch().getFilter());
filter.setStyleName(Gerrit.RESOURCES.css().watchedProjectFilter());

View File

@ -65,7 +65,7 @@ limitations under the License.
styleName='{style.action}'
href='javascript:;'
title='Switch back to the old screen'><ui:attribute name='title'/>revert
to the old screen</g:Anchor><span ui:field='settings'> in Settings &gt; Preferences</span>.
to the old screen</g:Anchor><span ui:field='settings'>&#160;in Settings &gt; Preferences</span>.
<g:Anchor ui:field='keepNew'
styleName='{style.action}'
href='javascript:;'

View File

@ -160,8 +160,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c));
table.setWidget(row, C_OWNER, link(c.getOwner()));
table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c
.getStatus()));
table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey()));
table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c
.getStatus(), c.getBranch(), c.getTopic()));
table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn()));

View File

@ -224,8 +224,7 @@ public class ChangeTable2 extends NavigationTable<ChangeInfo> {
table.setText(row, C_OWNER, "");
}
table.setWidget(
row, C_PROJECT, new ProjectLink(c.project_name_key(), c.status()));
table.setWidget(row, C_PROJECT, new ProjectLink(c.project_name_key()));
table.setWidget(row, C_BRANCH, new BranchLink(c.project_name_key(), c
.status(), c.branch(), c.topic()));
if (Gerrit.isSignedIn()

View File

@ -14,35 +14,16 @@
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.reviewdb.client.Change;
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 {
private Project.NameKey project;
private Status status;
public ProjectLink(final Project.NameKey proj, Change.Status stat) {
this(proj.get(), proj, stat);
public ProjectLink(Project.NameKey proj) {
this(proj.get(), proj);
}
public ProjectLink(final String text, final Project.NameKey proj,
Change.Status stat) {
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));
public ProjectLink(String text, Project.NameKey proj) {
super(text, PageLinks.toProjectDefaultDashboard(proj));
}
}