Populate ChangeAttribute with WIP and private status.

Change-Id: Ic2830c573e9245edf57551a42fc63eef71983c99
This commit is contained in:
Sven Selberg 2017-12-19 11:03:39 +01:00
parent 4309f56243
commit 560974482c
3 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,12 @@ status:: Current state of this change.
ABANDONED;; Change was abandoned by its owner or administrator.
private:: Boolean indicating if the change is
link:intro-user.html#private-changes[private].
wip:: Boolean indicating if the change is
link:intro-user.html#wip[work in progress].
comments:: All inline/file comments for this change in <<message,message attributes>>.
trackingIds:: Issue tracking system links in

View File

@ -16,6 +16,7 @@ package com.google.gerrit.server.data;
import com.google.gerrit.extensions.common.PluginDefinedInfo;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class ChangeAttribute {
@ -35,6 +36,10 @@ public class ChangeAttribute {
public Boolean open;
public Change.Status status;
public List<MessageAttribute> comments;
public Boolean wip;
@SerializedName("private")
public Boolean isPrivate;
public List<TrackingIdAttribute> trackingIds;
public PatchSetAttribute currentPatchSet;

View File

@ -157,6 +157,8 @@ public class EventFactory {
a.assignee = asAccountAttribute(change.getAssignee());
a.status = change.getStatus();
a.createdOn = change.getCreatedOn().getTime() / 1000L;
a.wip = change.isWorkInProgress() ? true : null;
a.isPrivate = change.isPrivate() ? true : null;
return a;
}