Merge "Suppress change edit icon for closed changes on SBS2"

This commit is contained in:
Shawn Pearce
2014-10-17 20:01:43 +00:00
committed by Gerrit Code Review
3 changed files with 12 additions and 6 deletions

View File

@@ -169,11 +169,13 @@ class DiffTable extends Composite {
}
void set(DiffPreferences prefs, JsArray<RevisionInfo> list, DiffInfo info,
boolean editExists, int currentPatchSet) {
boolean editExists, int currentPatchSet, boolean open) {
this.changeType = info.change_type();
this.autoHideHeader = prefs.autoHideDiffTableHeader();
patchSetSelectBoxA.setUpPatchSetNav(list, info.meta_a(), editExists, currentPatchSet);
patchSetSelectBoxB.setUpPatchSetNav(list, info.meta_b(), editExists, currentPatchSet);
patchSetSelectBoxA.setUpPatchSetNav(list, info.meta_a(), editExists,
currentPatchSet, open);
patchSetSelectBoxB.setUpPatchSetNav(list, info.meta_b(), editExists,
currentPatchSet, open);
JsArrayString hdr = info.diff_header();
if (hdr != null) {

View File

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

View File

@@ -223,7 +223,11 @@ public class SideBySide2 extends Screen {
int currentPatchSet = info.revision(info.current_revision())._number();
JsArray<RevisionInfo> list = info.revisions().values();
RevisionInfo.sortRevisionInfoByNumber(list);
diffTable.set(prefs, list, diff, edit != null, currentPatchSet);
// TODO(davido): Change edit feature doesn't support drafts atm,
// so we cannot use info.status().isOpen()
boolean renderChangeEditIcon = info.status() == Change.Status.NEW;
diffTable.set(prefs, list, diff, edit != null, currentPatchSet,
renderChangeEditIcon);
header.setChangeInfo(info);
}}));