Merge "Highlight patch sets that have drafts"
This commit is contained in:
@@ -176,6 +176,7 @@ public interface GerritCss extends CssResource {
|
|||||||
String patchSetLink();
|
String patchSetLink();
|
||||||
String patchSetRevision();
|
String patchSetRevision();
|
||||||
String patchSetUserIdentity();
|
String patchSetUserIdentity();
|
||||||
|
String patchSetWithDraft();
|
||||||
String patchSizeCell();
|
String patchSizeCell();
|
||||||
String pluginsTable();
|
String pluginsTable();
|
||||||
String posscore();
|
String posscore();
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ class PatchSetComplexDisclosurePanel extends ComplexDisclosurePanel
|
|||||||
} else {
|
} else {
|
||||||
addOpenHandler(this);
|
addOpenHandler(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ps.getHasDraftComments()) {
|
||||||
|
addStyleName(Gerrit.RESOURCES.css().patchSetWithDraft());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDiffBaseId(PatchSet.Id diffBaseId) {
|
public void setDiffBaseId(PatchSet.Id diffBaseId) {
|
||||||
|
|||||||
@@ -872,6 +872,10 @@ a:hover {
|
|||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.patchSetWithDraft .header td {
|
||||||
|
color: #ff5555;
|
||||||
|
}
|
||||||
|
|
||||||
.changeScreen .gwt-DisclosurePanel .content {
|
.changeScreen .gwt-DisclosurePanel .content {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,12 @@ public class ChangeDetailFactory extends Handler<ChangeDetail> {
|
|||||||
ResultSet<PatchSet> source = db.patchSets().byChange(changeId);
|
ResultSet<PatchSet> source = db.patchSets().byChange(changeId);
|
||||||
List<PatchSet> patches = new ArrayList<PatchSet>();
|
List<PatchSet> patches = new ArrayList<PatchSet>();
|
||||||
for (PatchSet ps : source) {
|
for (PatchSet ps : source) {
|
||||||
|
final CurrentUser user = control.getCurrentUser();
|
||||||
|
if (user instanceof IdentifiedUser) {
|
||||||
|
final Account.Id me = ((IdentifiedUser) user).getAccountId();
|
||||||
|
ps.setHasDraftComments(db.patchComments()
|
||||||
|
.draftByPatchSetAuthor(ps.getId(), me).toList().size() > 0);
|
||||||
|
}
|
||||||
if (control.isPatchVisible(ps, db)) {
|
if (control.isPatchVisible(ps, db)) {
|
||||||
patches.add(ps);
|
patches.add(ps);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,9 @@ public final class PatchSet {
|
|||||||
@Column(id = 5)
|
@Column(id = 5)
|
||||||
protected boolean draft;
|
protected boolean draft;
|
||||||
|
|
||||||
|
/** Not persisted in the database */
|
||||||
|
protected boolean hasDraftComments;
|
||||||
|
|
||||||
protected PatchSet() {
|
protected PatchSet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,6 +190,14 @@ public final class PatchSet {
|
|||||||
return id.toRefName();
|
return id.toRefName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getHasDraftComments() {
|
||||||
|
return hasDraftComments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasDraftComments(boolean hasDraftComments) {
|
||||||
|
this.hasDraftComments = hasDraftComments;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[PatchSet " + getId().toString() + "]";
|
return "[PatchSet " + getId().toString() + "]";
|
||||||
|
|||||||
Reference in New Issue
Block a user