summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOla Bjuremo <ola.bjuremo@tieto.com>2011-11-29 16:07:32 +0100
committerTomas Ljunggren <tomas.ljunggren@tieto.com>2011-12-07 13:04:51 +0100
commit782740a58ce87f4ebe1ec5b9b60dbe5978315cc2 (patch)
tree88a230e35de6bfb970e41c14401744887bb8e9e2
parentcd11f1d0065d01fc31c76e1d13e15afab7b20ba2 (diff)
Hide sanity review radio buttons
Sanity review category box now starts in hidden mode. All review categories are now expandable boxes. Task-number: QTQAINFRA-355 Change-Id: I28ba61d00aec52da95d2ae6f890d18ed13fce2ac Reviewed-by: Ola Bjuremo <ola.bjuremo@tieto.com>
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishCommentScreen.java44
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css12
2 files changed, 38 insertions, 18 deletions
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishCommentScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishCommentScreen.java
index af10932023..4385e0160f 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishCommentScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishCommentScreen.java
@@ -37,12 +37,14 @@ import com.google.gerrit.reviewdb.Patch;
import com.google.gerrit.reviewdb.PatchLineComment;
import com.google.gerrit.reviewdb.PatchSet;
import com.google.gerrit.reviewdb.PatchSetApproval;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
+import com.google.gwt.user.client.ui.DisclosurePanel;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.VerticalPanel;
@@ -62,7 +64,9 @@ public class PublishCommentScreen extends AccountScreen implements
ClickHandler, CommentEditorContainer {
private static SavedState lastState;
- private enum Action { NOOP, SUBMIT, STAGING };
+ private enum Action {
+ NOOP, SUBMIT, STAGING
+ };
private final PatchSet.Id patchSetId;
private Collection<ValueRadioButton> approvalButtons;
@@ -70,6 +74,7 @@ public class PublishCommentScreen extends AccountScreen implements
private Panel approvalPanel;
private NpTextArea message;
private FlowPanel draftsPanel;
+ private DisclosurePanel approvalTypePanel;
private Button send;
private Button submit;
private Button staging;
@@ -177,7 +182,7 @@ public class PublishCommentScreen extends AccountScreen implements
} else if (cancel == sender) {
saveStateOnUnload = false;
goChange();
- } else if(staging == sender) {
+ } else if (staging == sender) {
onSend(Action.STAGING);
}
}
@@ -233,7 +238,8 @@ public class PublishCommentScreen extends AccountScreen implements
ApprovalTypes types = Gerrit.getConfig().getApprovalTypes();
for (ApprovalType type : types.getApprovalTypes()) {
- String permission = Permission.forLabel(type.getCategory().getLabelName());
+ String permission =
+ Permission.forLabel(type.getCategory().getLabelName());
PermissionRange range = r.getRange(permission);
if (range != null && !range.isEmpty()) {
initApprovalType(r, body, type, range);
@@ -249,7 +255,6 @@ public class PublishCommentScreen extends AccountScreen implements
private void initApprovalType(final PatchSetPublishDetail r,
final Panel body, final ApprovalType ct, final PermissionRange range) {
- body.add(new SmallHeading(ct.getCategory().getName() + ":"));
final VerticalPanel vp = new VerticalPanel();
vp.setStyleName(Gerrit.RESOURCES.css().approvalCategoryList());
@@ -280,7 +285,11 @@ public class PublishCommentScreen extends AccountScreen implements
approvalButtons.add(b);
vp.add(b);
}
- body.add(vp);
+ approvalTypePanel = new DisclosurePanel(ct.getCategory().getName());
+ approvalTypePanel.setContent(vp);
+ approvalTypePanel.setOpen(!ApprovalCategory.SANITY_REVIEW.equals(ct
+ .getCategory().getId()));
+ body.add(approvalTypePanel);
}
private void display(final PatchSetPublishDetail r) {
@@ -365,7 +374,7 @@ public class PublishCommentScreen extends AccountScreen implements
new HashSet<ApprovalCategoryValue.Id>(values.values()),
new GerritCallback<VoidResult>() {
public void onSuccess(final VoidResult result) {
- if(action == Action.SUBMIT) {
+ if (action == Action.SUBMIT) {
submit();
} else if (action == Action.STAGING) {
staging();
@@ -384,19 +393,18 @@ public class PublishCommentScreen extends AccountScreen implements
}
private void submit() {
- Util.MANAGE_SVC.submit(patchSetId,
- new GerritCallback<ChangeDetail>() {
- public void onSuccess(ChangeDetail result) {
- saveStateOnUnload = false;
- goChange();
- }
+ Util.MANAGE_SVC.submit(patchSetId, new GerritCallback<ChangeDetail>() {
+ public void onSuccess(ChangeDetail result) {
+ saveStateOnUnload = false;
+ goChange();
+ }
- @Override
- public void onFailure(Throwable caught) {
- goChange();
- super.onFailure(caught);
- }
- });
+ @Override
+ public void onFailure(Throwable caught) {
+ goChange();
+ super.onFailure(caught);
+ }
+ });
}
private void staging() {
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
index a067c1dc8a..d175d91a85 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
@@ -1245,6 +1245,18 @@ a:hover.downloadLink {
display: none;
}
+.publishCommentsScreen .gwt-DisclosurePanel .header td {
+ font-weight: bold;
+ white-space: nowrap;
+}
+
+.publishCommentsScreen .gwt-DisclosurePanel .complexHeader {
+ white-space: nowrap;
+}
+.publishCommentsScreen .gwt-DisclosurePanel .complexHeader span {
+ white-space: nowrap;
+}
+
/** AbandonChangeDialog **/