ChangeScreen2: mark patch sets with draft comments in revision list

Bug: Issue 2072
Change-Id: I10294b78cd3d832b5b64b146286f9368e12fa87b
This commit is contained in:
David Ostrovsky
2013-09-30 21:36:09 +02:00
committed by David Pursehouse
parent a92fc47ef4
commit 17d0d337aa
8 changed files with 51 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ import static com.google.gerrit.common.changes.ListChangesOption.CURRENT_FILES;
import static com.google.gerrit.common.changes.ListChangesOption.CURRENT_REVISION;
import static com.google.gerrit.common.changes.ListChangesOption.DETAILED_ACCOUNTS;
import static com.google.gerrit.common.changes.ListChangesOption.DETAILED_LABELS;
import static com.google.gerrit.common.changes.ListChangesOption.DRAFT_COMMENTS;
import static com.google.gerrit.common.changes.ListChangesOption.LABELS;
import static com.google.gerrit.common.changes.ListChangesOption.MESSAGES;
import static com.google.gerrit.common.changes.ListChangesOption.REVIEWED;
@@ -834,6 +835,18 @@ public class ChangeJson {
out.actions.put(d.getId(), new ActionInfo(d));
}
}
if (has(DRAFT_COMMENTS)
&& userProvider.get().isIdentifiedUser()) {
IdentifiedUser user = (IdentifiedUser)userProvider.get();
out.hasDraftComments =
db.get().patchComments()
.draftByPatchSetAuthor(in.getId(), user.getAccountId())
.iterator().hasNext()
? true
: null;
}
return out;
}
@@ -936,6 +949,7 @@ public class ChangeJson {
static class RevisionInfo {
private transient boolean isCurrent;
Boolean draft;
Boolean hasDraftComments;
int _number;
Map<String, FetchInfo> fetch;
CommitInfo commit;