Replace PatchDetailService saveDraft and deleteDraft

Change-Id: Ia3bafdd87a7760b52a153fa8ebdcafd9152d53e5
This commit is contained in:
Shawn Pearce
2013-12-09 12:30:12 -08:00
parent cb8fc9b4b5
commit b74e0e34b3
7 changed files with 83 additions and 223 deletions

View File

@@ -34,7 +34,6 @@ import com.google.gerrit.client.ui.PatchLink;
import com.google.gerrit.client.ui.SmallHeading;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.common.changes.ListChangesOption;
import com.google.gerrit.common.changes.Side;
import com.google.gerrit.common.data.ChangeDetail;
import com.google.gerrit.common.data.SubmitTypeRecord;
import com.google.gerrit.reviewdb.client.Change;
@@ -485,26 +484,12 @@ public class PublishCommentScreen extends AccountScreen implements
for (String path : paths) {
JsArray<CommentInfo> comments = drafts.get(path);
for (int i = 0; i < comments.length(); i++) {
d.add(toComment(path, comments.get(i)));
d.add(CommentEditorPanel.toComment(patchSetId, path, comments.get(i)));
}
}
return d;
}
private PatchLineComment toComment(String path, CommentInfo i) {
PatchLineComment p = new PatchLineComment(
new PatchLineComment.Key(
new Patch.Key(patchSetId, path),
i.id()),
i.line(),
Gerrit.getUserAccount().getId(),
i.in_reply_to(),
i.updated());
p.setMessage(i.message());
p.setSide((short) (i.side() == Side.PARENT ? 0 : 1));
return p;
}
private static class ValueRadioButton extends RadioButton {
final LabelInfo label;
final String value;