Show "create change" button even when no actions returned
Change-Id: I68b85fbca9f9aa2baab99e5bb7f8a573eeac20da
This commit is contained in:
@@ -554,9 +554,13 @@ public class ProjectInfoScreen extends ProjectScreen {
|
|||||||
private void initProjectActions(ConfigInfo info) {
|
private void initProjectActions(ConfigInfo info) {
|
||||||
actionsGrid.clear(true);
|
actionsGrid.clear(true);
|
||||||
actionsGrid.removeAllRows();
|
actionsGrid.removeAllRows();
|
||||||
|
boolean showCreateChange = Gerrit.isSignedIn();
|
||||||
|
|
||||||
NativeMap<ActionInfo> actions = info.actions();
|
NativeMap<ActionInfo> actions = info.actions();
|
||||||
if (actions == null || actions.isEmpty()) {
|
if (actions == null) {
|
||||||
|
actions = NativeMap.create().cast();
|
||||||
|
}
|
||||||
|
if (actions.isEmpty() && !showCreateChange) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
actions.copyKeysIntoChildren("id");
|
actions.copyKeysIntoChildren("id");
|
||||||
@@ -571,7 +575,9 @@ public class ProjectInfoScreen extends ProjectScreen {
|
|||||||
actions.get(id)));
|
actions.get(id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Gerrit.isSignedIn()) {
|
// TODO: The user should have create permission on the branch referred to by
|
||||||
|
// HEAD. This would have to happen on the server side.
|
||||||
|
if (showCreateChange) {
|
||||||
actionsPanel.add(createChangeAction());
|
actionsPanel.add(createChangeAction());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user