Merge changes I5f96a74c,Ia202f9c9
* changes: Sort incoming reviews by updated date Sort outgoing reviews by created date
This commit is contained in:
@@ -111,8 +111,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(out.asList(), compare());
|
||||
Collections.sort(in.asList(), compare());
|
||||
Collections.sort(out.asList(), outComparator());
|
||||
|
||||
table.updateColumnsForLabels(out, in, done);
|
||||
outgoing.display(out);
|
||||
@@ -121,18 +120,11 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
|
||||
table.finishDisplay();
|
||||
}
|
||||
|
||||
private Comparator<ChangeInfo> compare() {
|
||||
private Comparator<ChangeInfo> outComparator() {
|
||||
return new Comparator<ChangeInfo>() {
|
||||
@Override
|
||||
public int compare(ChangeInfo a, ChangeInfo b) {
|
||||
int cmp = a.project().compareTo(b.project());
|
||||
if (cmp != 0) return cmp;
|
||||
cmp = a.branch().compareTo(b.branch());
|
||||
if (cmp != 0) return cmp;
|
||||
|
||||
String at = a.topic() != null ? a.topic() : "";
|
||||
String bt = b.topic() != null ? b.topic() : "";
|
||||
cmp = at.compareTo(bt);
|
||||
int cmp = a.created().compareTo(b.created());
|
||||
if (cmp != 0) return cmp;
|
||||
return a._number() - b._number();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,18 @@ public class ChangeInfo extends JavaScriptObject {
|
||||
return new Change.Id(_number());
|
||||
}
|
||||
|
||||
public final Timestamp created() {
|
||||
Timestamp ts = _get_cts();
|
||||
if (ts == null) {
|
||||
ts = JavaSqlTimestamp_JsonSerializer.parseTimestamp(createdRaw());
|
||||
_set_cts(ts);
|
||||
}
|
||||
return ts;
|
||||
}
|
||||
|
||||
private final native Timestamp _get_cts() /*-{ return this._cts; }-*/;
|
||||
private final native void _set_cts(Timestamp ts) /*-{ this._cts = ts; }-*/;
|
||||
|
||||
public final Timestamp updated() {
|
||||
return JavaSqlTimestamp_JsonSerializer.parseTimestamp(updatedRaw());
|
||||
}
|
||||
@@ -56,6 +68,7 @@ public class ChangeInfo extends JavaScriptObject {
|
||||
private final native String statusRaw() /*-{ return this.status; }-*/;
|
||||
public final native String subject() /*-{ return this.subject; }-*/;
|
||||
public final native AccountInfo owner() /*-{ return this.owner; }-*/;
|
||||
private final native String createdRaw() /*-{ return this.created; }-*/;
|
||||
private final native String updatedRaw() /*-{ return this.updated; }-*/;
|
||||
public final native boolean starred() /*-{ return this.starred ? true : false; }-*/;
|
||||
public final native String _sortkey() /*-{ return this._sortkey; }-*/;
|
||||
|
||||
Reference in New Issue
Block a user