Dashboard: Link dashboard section titles to the underlying search
Change-Id: I71e80335e9dd2e8a155f800cbd9a79c5cdbd5f1d
This commit is contained in:
parent
d1d3fcfdd2
commit
1a0c7a7d31
@ -18,7 +18,9 @@ import com.google.gerrit.client.Gerrit;
|
|||||||
import com.google.gerrit.client.NotFoundScreen;
|
import com.google.gerrit.client.NotFoundScreen;
|
||||||
import com.google.gerrit.client.rpc.Natives;
|
import com.google.gerrit.client.rpc.Natives;
|
||||||
import com.google.gerrit.client.rpc.ScreenLoadCallback;
|
import com.google.gerrit.client.rpc.ScreenLoadCallback;
|
||||||
|
import com.google.gerrit.client.ui.InlineHyperlink;
|
||||||
import com.google.gerrit.client.ui.Screen;
|
import com.google.gerrit.client.ui.Screen;
|
||||||
|
import com.google.gerrit.common.PageLinks;
|
||||||
import com.google.gerrit.extensions.client.ListChangesOption;
|
import com.google.gerrit.extensions.client.ListChangesOption;
|
||||||
import com.google.gerrit.reviewdb.client.Account;
|
import com.google.gerrit.reviewdb.client.Account;
|
||||||
import com.google.gwt.core.client.JsArray;
|
import com.google.gwt.core.client.JsArray;
|
||||||
@ -61,10 +63,14 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
|||||||
incoming = new ChangeTable.Section();
|
incoming = new ChangeTable.Section();
|
||||||
closed = new ChangeTable.Section();
|
closed = new ChangeTable.Section();
|
||||||
|
|
||||||
outgoing.setTitleText(Util.C.outgoingReviews());
|
String who = mine ? "self" : ownerId.toString();
|
||||||
incoming.setTitleText(Util.C.incomingReviews());
|
outgoing.setTitleWidget(new InlineHyperlink(Util.C.outgoingReviews(),
|
||||||
|
PageLinks.toChangeQuery(queryOutGoing(who))));
|
||||||
|
incoming.setTitleWidget(new InlineHyperlink(Util.C.incomingReviews(),
|
||||||
|
PageLinks.toChangeQuery(queryInComing(who))));
|
||||||
incoming.setHighlightUnreviewed(mine);
|
incoming.setHighlightUnreviewed(mine);
|
||||||
closed.setTitleText(Util.C.recentlyClosed());
|
closed.setTitleWidget(new InlineHyperlink(Util.C.recentlyClosed(),
|
||||||
|
PageLinks.toChangeQuery(queryClosed(who))));
|
||||||
|
|
||||||
table.addSection(outgoing);
|
table.addSection(outgoing);
|
||||||
table.addSection(incoming);
|
table.addSection(incoming);
|
||||||
@ -73,6 +79,18 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
|||||||
table.setSavePointerId("owner:" + ownerId);
|
table.setSavePointerId("owner:" + ownerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String queryOutGoing(String who) {
|
||||||
|
return "is:open owner:" + who;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String queryInComing(String who) {
|
||||||
|
return "is:open reviewer:" + who + " -owner:" + who;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String queryClosed(String who) {
|
||||||
|
return "is:closed (owner:" + who + " OR reviewer:" + who + ")";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLoad() {
|
protected void onLoad() {
|
||||||
super.onLoad();
|
super.onLoad();
|
||||||
@ -88,9 +106,9 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
|||||||
mine
|
mine
|
||||||
? EnumSet.of(ListChangesOption.REVIEWED)
|
? EnumSet.of(ListChangesOption.REVIEWED)
|
||||||
: EnumSet.noneOf(ListChangesOption.class),
|
: EnumSet.noneOf(ListChangesOption.class),
|
||||||
"is:open owner:" + who,
|
queryOutGoing(who),
|
||||||
"is:open reviewer:" + who + " -owner:" + who,
|
queryInComing(who),
|
||||||
"is:closed (owner:" + who + " OR reviewer:" + who + ") -age:4w limit:10");
|
queryClosed(who) + " -age:4w limit:10");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user