InlineEdit: Don't offer edit icon on binary files

Currently there is no way to retrieve patch type info in side by side
screen.  Extend GET changes/<id>/revisions/<rev>/files/<path>/diff
to return binary flag. Suppress change edit icon on patch set select
panel when binary file is opened.

Bug: Issue 3162
Change-Id: I92daf8fde462a0c9977821a60fb19538e4bfae45
This commit is contained in:
David Ostrovsky
2015-02-13 01:16:37 +01:00
parent 6a78963c0c
commit cdbef230c0
9 changed files with 22 additions and 8 deletions

View File

@@ -82,7 +82,7 @@ class PatchSetSelectBox extends Composite {
}
void setUpPatchSetNav(JsArray<RevisionInfo> list, DiffInfo.FileMeta meta,
boolean editExists, int currentPatchSet, boolean open) {
boolean editExists, int currentPatchSet, boolean open, boolean binary) {
InlineHyperlink baseLink = null;
InlineHyperlink selectedLink = null;
if (sideA) {
@@ -110,7 +110,7 @@ class PatchSetSelectBox extends Composite {
if (!Patch.COMMIT_MSG.equals(path)) {
linkPanel.add(createDownloadLink());
}
if (open && idActive != null && Gerrit.isSignedIn()) {
if (!binary && open && idActive != null && Gerrit.isSignedIn()) {
if ((editExists && idActive.get() == 0)
|| (!editExists && idActive.get() == currentPatchSet)) {
linkPanel.add(createEditIcon());