Merge "Only show the 'Edit Config' button if refs/meta/config is visible"

This commit is contained in:
David Pursehouse
2016-11-29 12:07:16 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ import com.google.gwt.core.client.JavaScriptObject;
public class ProjectAccessInfo extends JavaScriptObject {
public final native boolean canAddRefs() /*-{ return this.can_add ? true : false; }-*/;
public final native boolean isOwner() /*-{ return this.is_owner ? true : false; }-*/;
public final native boolean configVisible() /*-{ return this.config_visible ? true : false; }-*/;
protected ProjectAccessInfo() {
}

View File

@@ -72,6 +72,7 @@ import java.util.Map.Entry;
public class ProjectInfoScreen extends ProjectScreen {
private boolean isOwner;
private boolean configVisible;
private LabeledWidgetsGrid grid;
private Panel pluginOptionsPanel;
@@ -154,6 +155,7 @@ public class ProjectInfoScreen extends ProjectScreen {
@Override
public void onSuccess(ProjectAccessInfo result) {
isOwner = result.isOwner();
configVisible = result.configVisible();
enableForm();
saveProject.setVisible(isOwner);
}
@@ -625,7 +627,7 @@ public class ProjectInfoScreen extends ProjectScreen {
actionsPanel.add(createChangeAction());
}
if (isOwner) {
if (isOwner && configVisible) {
actionsPanel.add(createEditConfigAction());
}
}