Merge "Move the Groups and Plugins menu items to the top level."
This commit is contained in:
@@ -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()) {
|
||||
|
@@ -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();
|
||||
|
@@ -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
|
||||
@@ -90,4 +93,4 @@ jumpMineDraftComments = Go to draft comments
|
||||
projectAccessError = You don't have permissions to modify the access rights for the following refs:
|
||||
projectAccessProposeForReviewHint = You may propose these modifications to the project owners by clicking on 'Save for Review'.
|
||||
|
||||
userCannotVoteToolTip = User cannot vote in this category
|
||||
userCannotVoteToolTip = User cannot vote in this category
|
||||
|
@@ -108,7 +108,6 @@ public interface AdminConstants extends Constants {
|
||||
String projectAdminTabAccess();
|
||||
|
||||
String plugins();
|
||||
String pluginTabInstalled();
|
||||
String pluginDisabled();
|
||||
|
||||
String columnPluginName();
|
||||
|
@@ -88,7 +88,6 @@ projectAdminTabBranches = Branches
|
||||
projectAdminTabAccess = Access
|
||||
|
||||
plugins = Plugins
|
||||
pluginTabInstalled = Installed
|
||||
pluginDisabled = Disabled
|
||||
columnPluginName = Plugin Name
|
||||
columnPluginVersion = Version
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user