Merge "Display the effective max object size limit on ProjectInfoScreen"

This commit is contained in:
David Pursehouse 2013-08-22 08:43:21 +00:00 committed by Gerrit Code Review
commit f16c90e12e
5 changed files with 29 additions and 1 deletions

View File

@ -147,6 +147,7 @@ public interface GerritCss extends CssResource {
String link();
String linkMenuBar();
String linkMenuItemNotLast();
String maxObjectSizeLimitPanel();
String menuBarUserName();
String menuBarUserNameAvatar();
String menuBarUserNameFocusPanel();

View File

@ -25,4 +25,7 @@ public interface AdminMessages extends Messages {
String deletedReference(String name);
String deletedSection(String name);
String effectiveMaxObjectSizeLimit(String effectiveMaxObjectSizeLimit);
String globalMaxObjectSizeLimit(String globalMaxObjectSizeLimit);
}

View File

@ -5,3 +5,5 @@ project = Project {0}
deletedGroup = Deleted Group {0}
deletedReference = Reference {0} was deleted
deletedSection = Section {0} was deleted
effectiveMaxObjectSizeLimit = effective: {0}
globalMaxObjectSizeLimit = The global max object size limit is set to {0}. The limit cannot be increased on project level.

View File

@ -36,6 +36,8 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@ -54,6 +56,7 @@ public class ProjectInfoScreen extends ProjectScreen {
private ListBox state;
private ListBox contentMerge;
private NpTextBox maxObjectSizeLimit;
private Label effectiveMaxObjectSizeLimit;
// Section: Contributor Agreements
private ListBox contributorAgreements;
@ -185,7 +188,12 @@ public class ProjectInfoScreen extends ProjectScreen {
maxObjectSizeLimit = new NpTextBox();
saveEnabler.listenTo(maxObjectSizeLimit);
grid.addHtml(Util.C.headingMaxObjectSizeLimit(), maxObjectSizeLimit);
effectiveMaxObjectSizeLimit = new Label();
HorizontalPanel p = new HorizontalPanel();
p.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitPanel());
p.add(maxObjectSizeLimit);
p.add(effectiveMaxObjectSizeLimit);
grid.addHtml(Util.C.headingMaxObjectSizeLimit(), p);
}
private static ListBox newInheritedBooleanBox() {
@ -302,6 +310,15 @@ public class ProjectInfoScreen extends ProjectScreen {
setSubmitType(result.submit_type());
setState(result.state());
maxObjectSizeLimit.setText(result.max_object_size_limit().configured_value());
if (result.max_object_size_limit().inherited_value() != null) {
effectiveMaxObjectSizeLimit.setVisible(true);
effectiveMaxObjectSizeLimit.setText(
Util.M.effectiveMaxObjectSizeLimit(result.max_object_size_limit().value()));
effectiveMaxObjectSizeLimit.setTitle(
Util.M.globalMaxObjectSizeLimit(result.max_object_size_limit().inherited_value()));
} else {
effectiveMaxObjectSizeLimit.setVisible(false);
}
saveProject.setEnabled(false);
}

View File

@ -1543,3 +1543,8 @@ a:hover.downloadLink {
.projectNameColumn {
min-width: 300px;
}
/** ProjectSettings */
.maxObjectSizeLimitPanel td {
padding-right: 5px;
}