Fix owner column to link to same status
If a change search result is displaying merged changes, clicking on the owner name should query for merged changes by the owner. Bug: issue 1596 Change-Id: Ib103f8d15d66273ca034e05ef71721dbba3ab723
This commit is contained in:

committed by
Gerrit Code Review

parent
f360d97a6f
commit
b8adb7f36f
@@ -60,8 +60,11 @@ public class PageLinks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String toAccountQuery(final String fullname) {
|
public static String toAccountQuery(final String fullname) {
|
||||||
String query = op("owner", fullname) + " status:open";
|
return toAccountQuery(fullname, Status.NEW);
|
||||||
return toChangeQuery(query, TOP);
|
}
|
||||||
|
|
||||||
|
public static String toAccountQuery(String fullname, Status status) {
|
||||||
|
return toChangeQuery(op("owner", fullname) + " " + status(status), TOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String toChangeQuery(final String query) {
|
public static String toChangeQuery(final String query) {
|
||||||
@@ -73,17 +76,19 @@ public class PageLinks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String projectQuery(Project.NameKey proj, Status status) {
|
public static String projectQuery(Project.NameKey proj, Status status) {
|
||||||
|
return status(status) + " " + op("project", proj.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String status(Status status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case ABANDONED:
|
case ABANDONED:
|
||||||
return "status:abandoned " + op("project", proj.get());
|
return "status:abandoned";
|
||||||
|
|
||||||
case MERGED:
|
case MERGED:
|
||||||
return "status:merged " + op("project", proj.get());
|
return "status:merged";
|
||||||
|
|
||||||
case NEW:
|
case NEW:
|
||||||
case SUBMITTED:
|
case SUBMITTED:
|
||||||
default:
|
default:
|
||||||
return "status:open " + op("project", proj.get());
|
return "status:open";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -213,7 +213,7 @@ public class ChangeTable2 extends NavigationTable<ChangeInfo> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table.setWidget(row, C_OWNER, new InlineHyperlink(owner,
|
table.setWidget(row, C_OWNER, new InlineHyperlink(owner,
|
||||||
PageLinks.toAccountQuery(owner)));
|
PageLinks.toAccountQuery(owner, c.status())));
|
||||||
|
|
||||||
table.setWidget(
|
table.setWidget(
|
||||||
row, C_PROJECT, new ProjectLink(c.project_name_key(), c.status()));
|
row, C_PROJECT, new ProjectLink(c.project_name_key(), c.status()));
|
||||||
|
Reference in New Issue
Block a user