diff options
author | Tomas Ljunggren <tomas.ljunggren@tieto.com> | 2012-01-24 08:22:09 +0100 |
---|---|---|
committer | Tomas Ljunggren <tomas.ljunggren@tieto.com> | 2012-01-24 08:22:25 +0100 |
commit | c514d8c4acefb6a13fc8db3476f9e140a478194e (patch) | |
tree | d30cfa3582dc14daa3fe01b15f88b3b8cbedc017 | |
parent | 7ae43beb5b3800105e9eb35e5fc3f8ac048e2358 (diff) | |
parent | 4a9b21d6f79664fa057dadf4e9653f76497726e1 (diff) |
Merge remote-tracking branch 'origin/corrections/qtqainfra-355' into integration/v2.2.1
Change-Id: Ic3a458cec3868d2d915bb829dcdc57612493a4a2
4 files changed, 50 insertions, 26 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..4c57e0e2cc 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 @@ -43,6 +43,7 @@ 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 +63,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; @@ -177,7 +180,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 +236,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 +253,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 +283,11 @@ public class PublishCommentScreen extends AccountScreen implements approvalButtons.add(b); vp.add(b); } - body.add(vp); + DisclosurePanel atp = new DisclosurePanel(ct.getCategory().getName()); + atp.setContent(vp); + atp.setOpen(!ApprovalCategory.SANITY_REVIEW.equals(ct + .getCategory().getId())); + body.add(atp); } private void display(final PatchSetPublishDetail r) { @@ -365,7 +372,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 +391,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/changes/PublishTopicCommentScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishTopicCommentScreen.java index d4bfa9090b..4b1974dac9 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishTopicCommentScreen.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/PublishTopicCommentScreen.java @@ -36,6 +36,7 @@ import com.google.gerrit.reviewdb.Topic; 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.DisclosurePanel; 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; @@ -213,8 +214,6 @@ public class PublishTopicCommentScreen extends AccountScreen implements private void initApprovalType(final ChangeSetPublishDetail 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()); final List<ApprovalCategoryValue> lst = @@ -244,7 +243,11 @@ public class PublishTopicCommentScreen extends AccountScreen implements approvalButtons.add(b); vp.add(b); } - body.add(vp); + + DisclosurePanel atp = new DisclosurePanel(ct.getCategory().getName()); + atp.setContent(vp); + atp.setOpen(!ApprovalCategory.SANITY_REVIEW.equals(ct.getCategory().getId())); + body.add(atp); } private void display(final ChangeSetPublishDetail r) { 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 **/ diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Approvals.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Approvals.java index d8a348dade..41fad4890b 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Approvals.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Approvals.java @@ -31,6 +31,7 @@ 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.Composite; +import com.google.gwt.user.client.ui.DisclosurePanel; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.RadioButton; @@ -80,7 +81,7 @@ public class Approvals extends Composite { private static SavedState lastState; private boolean saveState = true; - private final VerticalPanel body; + private final Panel body; private final PatchSet.Id patchSetId; private Collection<ValueRadioButton> approvalButtons; private Message message; @@ -90,7 +91,7 @@ public class Approvals extends Composite { public Approvals(final PatchSet.Id patchSetId) { this.patchSetId = patchSetId; - body = new VerticalPanel(); + body = new FlowPanel(); approvalButtons = new ArrayList<ValueRadioButton>(); message = new Message(patchSetId); @@ -155,8 +156,6 @@ public class Approvals extends Composite { 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()); final List<ApprovalCategoryValue> lst = @@ -186,7 +185,11 @@ public class Approvals extends Composite { approvalButtons.add(b); vp.add(b); } - body.add(vp); + DisclosurePanel atp = new DisclosurePanel(ct.getCategory().getName()); + atp.setContent(vp); + atp.setOpen(!ApprovalCategory.SANITY_REVIEW.equals(ct + .getCategory().getId())); + body.add(atp); } private void populateActions(final PatchSetPublishDetail result) { |