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;
|
package com.google.gerrit.client;
|
||||||
|
|
||||||
import static com.google.gerrit.common.data.GlobalCapability.ADMINISTRATE_SERVER;
|
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.account.AccountCapabilities;
|
||||||
import com.google.gerrit.client.auth.openid.OpenIdSignInDialog;
|
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.menuDiffPatchSets(), PatchScreen.TopView.PATCH_SETS);
|
||||||
addDiffLink(diffBar, C.menuDiffFiles(), PatchScreen.TopView.FILES);
|
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) {
|
if (signedIn) {
|
||||||
final LinkMenuBar menuBar = new LinkMenuBar();
|
final LinkMenuBar menuBar = new LinkMenuBar();
|
||||||
addLink(menuBar, C.menuGroups(), PageLinks.ADMIN_GROUPS);
|
addLink(menuBar, C.menuGroups(), PageLinks.ADMIN_GROUPS);
|
||||||
addLink(menuBar, C.menuProjects(), PageLinks.ADMIN_PROJECTS);
|
|
||||||
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
|
AccountCapabilities.all(new GerritCallback<AccountCapabilities>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(AccountCapabilities result) {
|
public void onSuccess(AccountCapabilities result) {
|
||||||
|
|||||||
@@ -68,10 +68,13 @@ public interface GerritConstants extends Constants {
|
|||||||
String menuDiffPatchSets();
|
String menuDiffPatchSets();
|
||||||
String menuDiffFiles();
|
String menuDiffFiles();
|
||||||
|
|
||||||
|
String menuProjects();
|
||||||
|
String menuProjectsList();
|
||||||
|
String menuProjectsCreate();
|
||||||
|
|
||||||
String menuAdmin();
|
String menuAdmin();
|
||||||
String menuPeople();
|
String menuPeople();
|
||||||
String menuGroups();
|
String menuGroups();
|
||||||
String menuProjects();
|
|
||||||
String menuPlugins();
|
String menuPlugins();
|
||||||
|
|
||||||
String menuDocumentation();
|
String menuDocumentation();
|
||||||
|
|||||||
@@ -51,10 +51,13 @@ menuDiffPreferences = Preferences
|
|||||||
menuDiffPatchSets = Patch Sets
|
menuDiffPatchSets = Patch Sets
|
||||||
menuDiffFiles = Files
|
menuDiffFiles = Files
|
||||||
|
|
||||||
|
menuProjects = Projects
|
||||||
|
menuProjectsList = List
|
||||||
|
menuProjectsCreate = Create New Project
|
||||||
|
|
||||||
menuAdmin = Admin
|
menuAdmin = Admin
|
||||||
menuPeople = People
|
menuPeople = People
|
||||||
menuGroups = Groups
|
menuGroups = Groups
|
||||||
menuProjects = Projects
|
|
||||||
menuPlugins = Plugins
|
menuPlugins = Plugins
|
||||||
|
|
||||||
menuDocumentation = Documentation
|
menuDocumentation = Documentation
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ public interface GerritCss extends CssResource {
|
|||||||
String contributorAgreementShortDescription();
|
String contributorAgreementShortDescription();
|
||||||
String coverMessage();
|
String coverMessage();
|
||||||
String createGroupLink();
|
String createGroupLink();
|
||||||
String createProjectLink();
|
|
||||||
String createProjectPanel();
|
String createProjectPanel();
|
||||||
String dataCell();
|
String dataCell();
|
||||||
String dataHeader();
|
String dataHeader();
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ public interface AdminConstants extends Constants {
|
|||||||
String noMembersInfo();
|
String noMembersInfo();
|
||||||
String headingExternalGroup();
|
String headingExternalGroup();
|
||||||
String headingCreateGroup();
|
String headingCreateGroup();
|
||||||
String headingCreateProject();
|
|
||||||
String headingParentProjectName();
|
String headingParentProjectName();
|
||||||
String columnProjectName();
|
String columnProjectName();
|
||||||
String headingAgreements();
|
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.
|
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
|
headingExternalGroup = Selected External Group
|
||||||
headingCreateGroup = Create New Group
|
headingCreateGroup = Create New Group
|
||||||
headingCreateProject = Create New Project
|
|
||||||
headingAgreements = Contributor Agreements
|
headingAgreements = Contributor Agreements
|
||||||
|
|
||||||
projectSubmitType_FAST_FORWARD_ONLY = Fast Forward Only
|
projectSubmitType_FAST_FORWARD_ONLY = Fast Forward Only
|
||||||
|
|||||||
@@ -14,12 +14,7 @@
|
|||||||
|
|
||||||
package com.google.gerrit.client.admin;
|
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.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.ProjectInfo;
|
||||||
import com.google.gerrit.client.projects.ProjectMap;
|
import com.google.gerrit.client.projects.ProjectMap;
|
||||||
import com.google.gerrit.client.rpc.ScreenLoadCallback;
|
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.client.ui.Screen;
|
||||||
import com.google.gerrit.common.PageLinks;
|
import com.google.gerrit.common.PageLinks;
|
||||||
import com.google.gwt.user.client.History;
|
import com.google.gwt.user.client.History;
|
||||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
||||||
|
|
||||||
public class ProjectListScreen extends Screen {
|
public class ProjectListScreen extends Screen {
|
||||||
private VerticalPanel createProjectLinkPanel;
|
|
||||||
private ProjectsTable projects;
|
private ProjectsTable projects;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLoad() {
|
protected void onLoad() {
|
||||||
super.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) {
|
ProjectMap.all(new ScreenLoadCallback<ProjectMap>(this) {
|
||||||
@Override
|
@Override
|
||||||
protected void preDisplay(final ProjectMap result) {
|
protected void preDisplay(final ProjectMap result) {
|
||||||
@@ -58,13 +44,6 @@ public class ProjectListScreen extends Screen {
|
|||||||
super.onInitUI();
|
super.onInitUI();
|
||||||
setPageTitle(Util.C.projectListTitle());
|
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() {
|
projects = new ProjectsTable() {
|
||||||
@Override
|
@Override
|
||||||
protected void onOpenRow(final int row) {
|
protected void onOpenRow(final int row) {
|
||||||
|
|||||||
@@ -1153,10 +1153,6 @@ a:hover.downloadLink {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.createProjectLink {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.createProjectPanel {
|
.createProjectPanel {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
background-color: trimColor;
|
background-color: trimColor;
|
||||||
|
|||||||
Reference in New Issue
Block a user