AccountDashboardScreen: List work in progress changes in separate section
Add a "Work in progress" section above "Outgoing reviews", which shows all open WiP changes by the owner. Modify the "Outgoing reviews" section to exclude WiP changes. Change-Id: Iee6a7f513720b6983b304c7e7b93163f6fbbaa5d
This commit is contained in:
@@ -46,6 +46,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
private final Account.Id ownerId;
|
||||
private final boolean mine;
|
||||
private ChangeTable table;
|
||||
private ChangeTable.Section workInProgress;
|
||||
private ChangeTable.Section outgoing;
|
||||
private ChangeTable.Section incoming;
|
||||
private ChangeTable.Section closed;
|
||||
@@ -72,11 +73,15 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
};
|
||||
table.addStyleName(Gerrit.RESOURCES.css().accountDashboard());
|
||||
|
||||
workInProgress = new ChangeTable.Section();
|
||||
outgoing = new ChangeTable.Section();
|
||||
incoming = new ChangeTable.Section();
|
||||
closed = new ChangeTable.Section();
|
||||
|
||||
String who = mine ? "self" : ownerId.toString();
|
||||
workInProgress.setTitleWidget(
|
||||
new InlineHyperlink(
|
||||
Util.C.workInProgress(), PageLinks.toChangeQuery(queryWorkInProgress(who))));
|
||||
outgoing.setTitleWidget(
|
||||
new InlineHyperlink(Util.C.outgoingReviews(), PageLinks.toChangeQuery(queryOutgoing(who))));
|
||||
incoming.setTitleWidget(
|
||||
@@ -85,6 +90,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
closed.setTitleWidget(
|
||||
new InlineHyperlink(Util.C.recentlyClosed(), PageLinks.toChangeQuery(queryClosed(who))));
|
||||
|
||||
table.addSection(workInProgress);
|
||||
table.addSection(outgoing);
|
||||
table.addSection(incoming);
|
||||
table.addSection(closed);
|
||||
@@ -92,8 +98,12 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
table.setSavePointerId("owner:" + ownerId);
|
||||
}
|
||||
|
||||
private static String queryWorkInProgress(String who) {
|
||||
return "is:open is:wip owner:" + who;
|
||||
}
|
||||
|
||||
private static String queryOutgoing(String who) {
|
||||
return "is:open owner:" + who;
|
||||
return "is:open -is:wip owner:" + who;
|
||||
}
|
||||
|
||||
private static String queryIncoming(String who) {
|
||||
@@ -123,6 +133,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
}
|
||||
},
|
||||
mine ? MY_DASHBOARD_OPTIONS : DashboardTable.OPTIONS,
|
||||
queryWorkInProgress(who),
|
||||
queryOutgoing(who),
|
||||
queryIncoming(who),
|
||||
queryClosed(who) + " -age:4w limit:10");
|
||||
@@ -142,9 +153,10 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
return;
|
||||
}
|
||||
|
||||
ChangeList out = result.get(0);
|
||||
ChangeList in = result.get(1);
|
||||
ChangeList done = result.get(2);
|
||||
ChangeList wip = result.get(0);
|
||||
ChangeList out = result.get(1);
|
||||
ChangeList in = result.get(2);
|
||||
ChangeList done = result.get(3);
|
||||
|
||||
if (mine) {
|
||||
setWindowTitle(Util.C.myDashboardTitle());
|
||||
@@ -167,7 +179,8 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
|
||||
Collections.sort(Natives.asList(out), outComparator());
|
||||
|
||||
table.updateColumnsForLabels(out, in, done);
|
||||
table.updateColumnsForLabels(wip, out, in, done);
|
||||
workInProgress.display(wip);
|
||||
outgoing.display(out);
|
||||
incoming.display(in);
|
||||
closed.display(done);
|
||||
|
||||
@@ -43,6 +43,8 @@ public interface ChangeConstants extends Constants {
|
||||
|
||||
String unknownDashboardTitle();
|
||||
|
||||
String workInProgress();
|
||||
|
||||
String incomingReviews();
|
||||
|
||||
String outgoingReviews();
|
||||
|
||||
@@ -12,6 +12,7 @@ isWorkInProgress = (WorkInProgress)
|
||||
|
||||
myDashboardTitle = My Reviews
|
||||
unknownDashboardTitle = Code Review Dashboard
|
||||
workInProgress Work in progress
|
||||
incomingReviews = Incoming reviews
|
||||
outgoingReviews = Outgoing reviews
|
||||
recentlyClosed = Recently closed
|
||||
|
||||
Reference in New Issue
Block a user