Related Changes: Additionally add black dot based on state

It used to be the case that the
    (!info.hasChangeNumber() || !info.hasRevisionNumber()))
triggered on merged or abandoned changes. This is not the case any more
for all merged and abandoned changes, so we need to transport depend on
the state of the change directly to also mark those changes, not covered
by the condition as above.

Change-Id: I08f97c844d8981a3b400705108e494570d25fc78
This commit is contained in:
Stefan Beller
2015-06-18 11:40:18 -07:00
parent 3e8bd6e30d
commit 7e23cd08d3
3 changed files with 15 additions and 1 deletions

View File

@@ -333,6 +333,7 @@ public class RelatedChanges extends TabPanel {
c.setBranch(i.branch());
c.setProject(i.project());
c.setSubmittable(i.submittable() && i.mergeable());
c.setStatus(i.status().asChangeStatus().toString());
arr.push(c);
}
}
@@ -356,6 +357,11 @@ public class RelatedChanges extends TabPanel {
final native String branch() /*-{ return this.branch }-*/;
final native String project() /*-{ return this.project }-*/;
final native boolean submittable() /*-{ return this._submittable ? true : false; }-*/;
final Change.Status status() {
String s = statusRaw();
return s != null ? Change.Status.valueOf(s) : null;
}
private final native String statusRaw() /*-{ return this.status; }-*/;
final native void setId(String i)
/*-{ if(i)this.change_id=i; }-*/;
@@ -409,6 +415,9 @@ public class RelatedChanges extends TabPanel {
final native void setSubmittable(boolean s)
/*-{ this._submittable=s; }-*/;
final native void setStatus(String s)
/*-{ if(s)this.status=s; }-*/;
protected ChangeAndCommit() {
}
}

View File

@@ -306,6 +306,10 @@ class RelatedChangesTab implements IsWidget {
sb.setStyleName(RelatedChanges.R.css().gitweb());
sb.setAttribute("title", gw.getLinkName());
sb.append('\u25CF'); // Unicode 'BLACK CIRCLE'
} else if (info.status() != null && !info.status().isOpen()) {
sb.setStyleName(RelatedChanges.R.css().gitweb());
sb.setAttribute("title", Util.toLongString(info.status()));
sb.append('\u25CF'); // Unicode 'BLACK CIRCLE'
} else if (notConnected) {
sb.setStyleName(RelatedChanges.R.css().indirect());
sb.setAttribute("title", Resources.C.indirectAncestor());