Related Changes: Strike through abandoned changes

This makes it easy to distinguish between merged and abandoned changes.

Change-Id: I3ecc5c4cb2bf86ef9e8aae7ef0af87e54e154fec
This commit is contained in:
Stefan Beller
2015-06-18 15:52:24 -07:00
parent 7e23cd08d3
commit 03d67908ae
4 changed files with 16 additions and 2 deletions

View File

@@ -544,6 +544,11 @@ the commit was done on `branch-a`, but was then pushed to
`refs/for/branch-b`. `refs/for/branch-b`.
A black dot is also present if the change was abandoned. A black dot is also present if the change was abandoned.
** [[closed-ancestor-abandoned]]Strikethrough Subject:
+
When the commit is abandoned, its subject line will be striked
through.
+ +
image::images/user-review-ui-change-screen-related-changes-indicators.png[width=800, link="images/user-review-ui-change-screen-related-changes-indicators.png"] image::images/user-review-ui-change-screen-related-changes-indicators.png[width=800, link="images/user-review-ui-change-screen-related-changes-indicators.png"]

View File

@@ -59,6 +59,7 @@ public class RelatedChanges extends TabPanel {
String pointer(); String pointer();
String row(); String row();
String subject(); String subject();
String strikedSubject();
String submittable(); String submittable();
String tabPanel(); String tabPanel();
} }

View File

@@ -20,6 +20,7 @@ import com.google.gerrit.client.changes.ChangeInfo.CommitInfo;
import com.google.gerrit.client.changes.Util; import com.google.gerrit.client.changes.Util;
import com.google.gerrit.client.config.GitwebInfo; import com.google.gerrit.client.config.GitwebInfo;
import com.google.gerrit.common.PageLinks; import com.google.gerrit.common.PageLinks;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArray; import com.google.gwt.core.client.JsArray;
@@ -280,7 +281,11 @@ class RelatedChangesTab implements IsWidget {
sb.append(POINTER_HTML); sb.append(POINTER_HTML);
sb.closeSpan(); sb.closeSpan();
if (info.status() == Change.Status.ABANDONED) {
sb.openSpan().setStyleName(RelatedChanges.R.css().strikedSubject());
} else {
sb.openSpan().setStyleName(RelatedChanges.R.css().subject()); sb.openSpan().setStyleName(RelatedChanges.R.css().subject());
}
String url = url(); String url = url();
if (url != null) { if (url != null) {
sb.openAnchor().setAttribute("href", url); sb.openAnchor().setAttribute("href", url);

View File

@@ -38,13 +38,16 @@
visibility: hidden; visibility: hidden;
} }
.subject { .subject, .strikedSubject {
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
width: 355px; width: 355px;
} }
.strikedSubject {
text-decoration: line-through;
}
.tabPanel .gwt-TabBarItem, .tabPanel .gwt-TabBarItem,
.tabPanel .gwt-TabBarItem-selected, .tabPanel .gwt-TabBarItem-selected,