Update approvals table when adding reviewer.
Fixed a bug where the Approvals table wasn't updating after adding a
reviewer, which made it difficult to see if the add actually worked.
Signed-off-by: Brad Larson <bklarson@gmail.com>
diff --git a/src/main/java/com/google/gerrit/client/changes/ApprovalTable.java b/src/main/java/com/google/gerrit/client/changes/ApprovalTable.java
index c2bb8f6..284e1a9 100644
--- a/src/main/java/com/google/gerrit/client/changes/ApprovalTable.java
+++ b/src/main/java/com/google/gerrit/client/changes/ApprovalTable.java
@@ -19,6 +19,7 @@
import com.google.gerrit.client.data.AccountInfoCache;
import com.google.gerrit.client.data.ApprovalDetail;
import com.google.gerrit.client.data.ApprovalType;
+import com.google.gerrit.client.data.ChangeDetail;
import com.google.gerrit.client.patches.PatchUtil;
import com.google.gerrit.client.reviewdb.Account;
import com.google.gerrit.client.reviewdb.ApprovalCategory;
@@ -27,6 +28,7 @@
import com.google.gerrit.client.reviewdb.ChangeApproval;
import com.google.gerrit.client.rpc.Common;
import com.google.gerrit.client.rpc.GerritCallback;
+import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.AccountDashboardLink;
import com.google.gerrit.client.ui.AddMemberBox;
import com.google.gwt.user.client.ui.ClickListener;
@@ -204,6 +206,16 @@
public void onSuccess(final VoidResult result) {
addMemberBox.setEnabled(true);
addMemberBox.setText("");
+ Util.DETAIL_SVC.changeDetail(changeId,
+ new ScreenLoadCallback<ChangeDetail>() {
+ public void onSuccess(final ChangeDetail r) {
+ if (isAttached()) {
+ setAccountInfoCache(r.getAccounts());
+ display(r.getChange(), r.getMissingApprovals(), r
+ .getApprovals());
+ }
+ }
+ });
}
@Override