Move the Groups and Plugins menu items to the top level.

It was inconsistent to access projects administration from the top-level
Projects menu item and, at the same time, have to go to Admin > Groups
or Admin > Plugins to access the Groups or Plugins administration.

This change also removes the top-level Admin menu as it becomes
unnecessary once the Groups and Plugins are moved to the top-level.

Change-Id: Ia58b768317a1998165d782d81952552b5395cbc6
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This commit is contained in:
Sasa Zivkov
2012-09-27 13:22:43 +02:00
committed by Edwin Kempin
parent 8fd5b44d3e
commit bdc014f90e
7 changed files with 25 additions and 25 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.client;
import static com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER;
import static com.google.gerrit.common.data.GlobalCapability.CREATE_PROJECT;
import static com.google.gerrit.common.data.GlobalCapability.CREATE_GROUP;
import com.google.gerrit.client.account.AccountCapabilities;
import com.google.gerrit.client.auth.openid.OpenIdSignInDialog;
@@ -610,17 +611,28 @@ public class Gerrit implements EntryPoint {
menuLeft.add(projectsBar, C.menuProjects());
if (signedIn) {
final LinkMenuBar menuBar = new LinkMenuBar();
addLink(menuBar, C.menuGroups(), PageLinks.ADMIN_GROUPS);
final LinkMenuBar groupsBar = new LinkMenuBar();
addLink(groupsBar, C.menuGroupsList(), PageLinks.ADMIN_GROUPS);
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
@Override
public void onSuccess(AccountCapabilities result) {
if (result.canPerform(CREATE_GROUP)) {
addLink(groupsBar, C.menuGroupsCreate(), PageLinks.ADMIN_CREATE_GROUP);
}
}
}, CREATE_GROUP);
menuLeft.add(groupsBar, C.menuGroups());
final LinkMenuBar pluginsBar = new LinkMenuBar();
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
@Override
public void onSuccess(AccountCapabilities result) {
if (result.canPerform(ADMINISTRATE_SERVER)) {
addLink(menuBar, C.menuPlugins(), PageLinks.ADMIN_PLUGINS);
addLink(pluginsBar, C.menuPluginsInstalled(), PageLinks.ADMIN_PLUGINS);
menuLeft.add(pluginsBar, C.menuPlugins());
}
}
}, ADMINISTRATE_SERVER);
menuLeft.add(menuBar, C.menuAdmin());
}
if (getConfig().isDocumentationAvailable()) {

View File

@@ -73,10 +73,12 @@ public interface GerritConstants extends Constants {
String menuProjectsList();
String menuProjectsCreate();
String menuAdmin();
String menuPeople();
String menuGroups();
String menuGroupsList();
String menuGroupsCreate();
String menuPlugins();
String menuPluginsInstalled();
String menuDocumentation();
String menuDocumentationIndex();

View File

@@ -56,10 +56,13 @@ menuProjects = Projects
menuProjectsList = List
menuProjectsCreate = Create New Project
menuAdmin = Admin
menuPeople = People
menuGroups = Groups
menuGroupsList = List
menuGroupsCreate = Create New Group
menuPlugins = Plugins
menuPluginsInstalled = Installed
menuDocumentation = Documentation
menuDocumentationIndex = Index

View File

@@ -108,7 +108,6 @@ public interface AdminConstants extends Constants {
String projectAdminTabAccess();
String plugins();
String pluginTabInstalled();
String pluginDisabled();
String columnPluginName();

View File

@@ -88,7 +88,6 @@ projectAdminTabBranches = Branches
projectAdminTabAccess = Access
plugins = Plugins
pluginTabInstalled = Installed
pluginDisabled = Disabled
columnPluginName = Plugin Name
columnPluginVersion = Version

View File

@@ -14,16 +14,12 @@
package com.google.gerrit.client.admin;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.AccountScreen;
import com.google.gerrit.client.ui.Hyperlink;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.common.data.GroupList;
import com.google.gwt.user.client.ui.VerticalPanel;
public class GroupListScreen extends AccountScreen {
private VerticalPanel createGroupLinkPanel;
private GroupTable groups;
@Override
@@ -33,7 +29,6 @@ public class GroupListScreen extends AccountScreen {
.visibleGroups(new ScreenLoadCallback<GroupList>(this) {
@Override
protected void preDisplay(GroupList result) {
createGroupLinkPanel.setVisible(result.isCanCreateGroup());
groups.display(result.getGroups());
groups.finishDisplay();
}
@@ -45,12 +40,6 @@ public class GroupListScreen extends AccountScreen {
super.onInitUI();
setPageTitle(Util.C.groupListTitle());
createGroupLinkPanel = new VerticalPanel();
createGroupLinkPanel.setStyleName(Gerrit.RESOURCES.css().createGroupLink());
createGroupLinkPanel.add(new Hyperlink(Util.C.headingCreateGroup(),
PageLinks.ADMIN_CREATE_GROUP));
add(createGroupLinkPanel);
groups = new GroupTable(true /* hyperlink to admin */, PageLinks.ADMIN_GROUPS);
add(groups);
}

View File

@@ -14,16 +14,12 @@
package com.google.gerrit.client.admin;
import static com.google.gerrit.common.PageLinks.ADMIN_PLUGINS;
import com.google.gerrit.client.ui.Screen;
import com.google.gerrit.client.ui.MenuScreen;
public abstract class PluginScreen extends MenuScreen {
public abstract class PluginScreen extends Screen {
public PluginScreen() {
setRequiresSignIn(true);
link(Util.C.pluginTabInstalled(), ADMIN_PLUGINS);
}
@Override