Move the project listing menu items to a new top-level item
Right now, finding the project listing is very opaque to end users. Nobody expects to look under "Admin," and furthermore, anonymous users are unable to find that link at all. Introducing a new top-level "Projects" menu that has "List" in it to take you to the project listing. Also move "Create new project" from the top of that listing to the menu, since its current location is ugly and it makes sense for it to be grouped under the new top level. Change-Id: Ief58300bba301d11ab287fab02e3487fa4d84669
This commit is contained in:
@@ -15,6 +15,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 com.google.gerrit.client.account.AccountCapabilities;
|
||||
import com.google.gerrit.client.auth.openid.OpenIdSignInDialog;
|
||||
@@ -584,10 +585,23 @@ public class Gerrit implements EntryPoint {
|
||||
addDiffLink(diffBar, C.menuDiffPatchSets(), PatchScreen.TopView.PATCH_SETS);
|
||||
addDiffLink(diffBar, C.menuDiffFiles(), PatchScreen.TopView.FILES);
|
||||
|
||||
final LinkMenuBar projectsBar = new LinkMenuBar();
|
||||
addLink(projectsBar, C.menuProjectsList(), PageLinks.ADMIN_PROJECTS);
|
||||
if(signedIn) {
|
||||
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
|
||||
@Override
|
||||
public void onSuccess(AccountCapabilities result) {
|
||||
if (result.canPerform(CREATE_PROJECT)) {
|
||||
addLink(projectsBar, C.menuProjectsCreate(), PageLinks.ADMIN_CREATE_PROJECT);
|
||||
}
|
||||
}
|
||||
}, CREATE_PROJECT);
|
||||
}
|
||||
menuLeft.add(projectsBar, C.menuProjects());
|
||||
|
||||
if (signedIn) {
|
||||
final LinkMenuBar menuBar = new LinkMenuBar();
|
||||
addLink(menuBar, C.menuGroups(), PageLinks.ADMIN_GROUPS);
|
||||
addLink(menuBar, C.menuProjects(), PageLinks.ADMIN_PROJECTS);
|
||||
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
|
||||
@Override
|
||||
public void onSuccess(AccountCapabilities result) {
|
||||
|
||||
@@ -68,10 +68,13 @@ public interface GerritConstants extends Constants {
|
||||
String menuDiffPatchSets();
|
||||
String menuDiffFiles();
|
||||
|
||||
String menuProjects();
|
||||
String menuProjectsList();
|
||||
String menuProjectsCreate();
|
||||
|
||||
String menuAdmin();
|
||||
String menuPeople();
|
||||
String menuGroups();
|
||||
String menuProjects();
|
||||
String menuPlugins();
|
||||
|
||||
String menuDocumentation();
|
||||
|
||||
@@ -51,10 +51,13 @@ menuDiffPreferences = Preferences
|
||||
menuDiffPatchSets = Patch Sets
|
||||
menuDiffFiles = Files
|
||||
|
||||
menuProjects = Projects
|
||||
menuProjectsList = List
|
||||
menuProjectsCreate = Create New Project
|
||||
|
||||
menuAdmin = Admin
|
||||
menuPeople = People
|
||||
menuGroups = Groups
|
||||
menuProjects = Projects
|
||||
menuPlugins = Plugins
|
||||
|
||||
menuDocumentation = Documentation
|
||||
|
||||
@@ -79,7 +79,6 @@ public interface GerritCss extends CssResource {
|
||||
String contributorAgreementShortDescription();
|
||||
String coverMessage();
|
||||
String createGroupLink();
|
||||
String createProjectLink();
|
||||
String createProjectPanel();
|
||||
String dataCell();
|
||||
String dataHeader();
|
||||
|
||||
@@ -60,7 +60,6 @@ public interface AdminConstants extends Constants {
|
||||
String noMembersInfo();
|
||||
String headingExternalGroup();
|
||||
String headingCreateGroup();
|
||||
String headingCreateProject();
|
||||
String headingParentProjectName();
|
||||
String columnProjectName();
|
||||
String headingAgreements();
|
||||
|
||||
@@ -41,7 +41,6 @@ headingIncludedGroups = Included Groups
|
||||
noMembersInfo = Group Members can only be viewed for Gerrit internal groups. For external groups and Gerrit system groups the members cannot be displayed.
|
||||
headingExternalGroup = Selected External Group
|
||||
headingCreateGroup = Create New Group
|
||||
headingCreateProject = Create New Project
|
||||
headingAgreements = Contributor Agreements
|
||||
|
||||
projectSubmitType_FAST_FORWARD_ONLY = Fast Forward Only
|
||||
|
||||
@@ -14,12 +14,7 @@
|
||||
|
||||
package com.google.gerrit.client.admin;
|
||||
|
||||
import static com.google.gerrit.common.data.GlobalCapability.CREATE_PROJECT;
|
||||
|
||||
import com.google.gerrit.client.Dispatcher;
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.account.AccountCapabilities;
|
||||
import com.google.gerrit.client.rpc.GerritCallback;
|
||||
import com.google.gerrit.client.projects.ProjectInfo;
|
||||
import com.google.gerrit.client.projects.ProjectMap;
|
||||
import com.google.gerrit.client.rpc.ScreenLoadCallback;
|
||||
@@ -28,22 +23,13 @@ import com.google.gerrit.client.ui.ProjectsTable;
|
||||
import com.google.gerrit.client.ui.Screen;
|
||||
import com.google.gerrit.common.PageLinks;
|
||||
import com.google.gwt.user.client.History;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
|
||||
public class ProjectListScreen extends Screen {
|
||||
private VerticalPanel createProjectLinkPanel;
|
||||
private ProjectsTable projects;
|
||||
|
||||
@Override
|
||||
protected void onLoad() {
|
||||
super.onLoad();
|
||||
createProjectLinkPanel.setVisible(false);
|
||||
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
|
||||
@Override
|
||||
public void onSuccess(AccountCapabilities ac) {
|
||||
createProjectLinkPanel.setVisible(ac.canPerform(CREATE_PROJECT));
|
||||
}
|
||||
}, CREATE_PROJECT);
|
||||
ProjectMap.all(new ScreenLoadCallback<ProjectMap>(this) {
|
||||
@Override
|
||||
protected void preDisplay(final ProjectMap result) {
|
||||
@@ -58,13 +44,6 @@ public class ProjectListScreen extends Screen {
|
||||
super.onInitUI();
|
||||
setPageTitle(Util.C.projectListTitle());
|
||||
|
||||
createProjectLinkPanel = new VerticalPanel();
|
||||
createProjectLinkPanel.setStyleName(Gerrit.RESOURCES.css()
|
||||
.createProjectLink());
|
||||
createProjectLinkPanel.add(new Hyperlink(Util.C.headingCreateProject(),
|
||||
PageLinks.ADMIN_CREATE_PROJECT));
|
||||
add(createProjectLinkPanel);
|
||||
|
||||
projects = new ProjectsTable() {
|
||||
@Override
|
||||
protected void onOpenRow(final int row) {
|
||||
|
||||
@@ -1153,10 +1153,6 @@ a:hover.downloadLink {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.createProjectLink {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.createProjectPanel {
|
||||
margin-bottom: 10px;
|
||||
background-color: trimColor;
|
||||
|
||||
Reference in New Issue
Block a user