Avoid reloading the group after successful rename
The call to the server is not needed since all information to update the UI is already locally available. Change-Id: I7d59dc601fa3afd6ccc55f1d9d8b0b5b59606354 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
package com.google.gerrit.client.admin;
|
||||
|
||||
import com.google.gerrit.client.Dispatcher;
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.VoidResult;
|
||||
import com.google.gerrit.client.groups.GroupApi;
|
||||
@@ -99,7 +98,12 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
|
||||
GroupApi.renameGroup(getGroupUUID(), newName,
|
||||
new GerritCallback<com.google.gerrit.client.VoidResult>() {
|
||||
public void onSuccess(final com.google.gerrit.client.VoidResult result) {
|
||||
Gerrit.display(Dispatcher.toGroup(getGroupUUID(), AccountGroupScreen.INFO));
|
||||
saveName.setEnabled(false);
|
||||
setPageTitle(Util.M.group(newName));
|
||||
groupNameTxt.setText(newName);
|
||||
if (getGroupUUID().equals(getOwnerGroupUUID())) {
|
||||
ownerTxt.setText(newName);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,6 +71,10 @@ public abstract class AccountGroupScreen extends MenuScreen {
|
||||
groupDetail.ownerGroup.setName(ownerGroup.name());
|
||||
}
|
||||
|
||||
protected AccountGroup.UUID getOwnerGroupUUID() {
|
||||
return groupDetail.group.getOwnerGroupUUID();
|
||||
}
|
||||
|
||||
protected void setMembersTabVisible(final boolean visible) {
|
||||
setLinkVisible(membersTabToken, visible);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user