Add an "Add Comment" button to change screen

It is hard to spot for novice gerrit users, how they can an comment to a
change when seeing the comments of other people.

As a relief, add an "Add Comment" button below existing comments.

Change-Id: I2d284cfbe1860e03304f907e0badeb3b87999994
This commit is contained in:
Steffen Gebert
2013-01-01 18:32:19 +01:00
parent 25c96152dd
commit c73b47148c
3 changed files with 14 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ public interface ChangeConstants extends Constants {
String changeScreenDependsOn();
String changeScreenNeededBy();
String changeScreenComments();
String changeScreenAddComment();
String approvalTableReviewer();
String approvalTableAddReviewer();

View File

@@ -56,6 +56,7 @@ changeScreenDependencies = Dependencies
changeScreenDependsOn = Depends On
changeScreenNeededBy = Needed By
changeScreenComments = Comments
changeScreenAddComment = Add Comment
approvalTableReviewer = Reviewer
approvalTableAddReviewer = Add Reviewer

View File

@@ -33,11 +33,14 @@ import com.google.gerrit.reviewdb.client.ChangeMessage;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DisclosurePanel;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Grid;
@@ -400,6 +403,15 @@ public class ChangeScreen extends Screen
comments.add(cp);
}
final Button b = new Button(Util.C.changeScreenAddComment());
b.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
PatchSet.Id currentPatchSetId = patchSetsBlock.getCurrentPatchSet().getId();
Gerrit.display(Dispatcher.toPublish(currentPatchSetId));
}
});
comments.add(b);
comments.setVisible(msgList.size() > 0);
}