From 03d67908aea34edbe26a278a419dcf38daae0d09 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 18 Jun 2015 15:52:24 -0700 Subject: [PATCH] Related Changes: Strike through abandoned changes This makes it easy to distinguish between merged and abandoned changes. Change-Id: I3ecc5c4cb2bf86ef9e8aae7ef0af87e54e154fec --- Documentation/user-review-ui.txt | 5 +++++ .../com/google/gerrit/client/change/RelatedChanges.java | 1 + .../com/google/gerrit/client/change/RelatedChangesTab.java | 7 ++++++- .../com/google/gerrit/client/change/related_changes.css | 5 ++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Documentation/user-review-ui.txt b/Documentation/user-review-ui.txt index ec9f408f55..c83ac079c8 100644 --- a/Documentation/user-review-ui.txt +++ b/Documentation/user-review-ui.txt @@ -544,6 +544,11 @@ the commit was done on `branch-a`, but was then pushed to `refs/for/branch-b`. 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"] diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChanges.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChanges.java index 687003891d..e354b2abda 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChanges.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChanges.java @@ -59,6 +59,7 @@ public class RelatedChanges extends TabPanel { String pointer(); String row(); String subject(); + String strikedSubject(); String submittable(); String tabPanel(); } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChangesTab.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChangesTab.java index be0e21a03f..ab47b69626 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChangesTab.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/RelatedChangesTab.java @@ -20,6 +20,7 @@ import com.google.gerrit.client.changes.ChangeInfo.CommitInfo; import com.google.gerrit.client.changes.Util; import com.google.gerrit.client.config.GitwebInfo; import com.google.gerrit.common.PageLinks; +import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JsArray; @@ -280,7 +281,11 @@ class RelatedChangesTab implements IsWidget { sb.append(POINTER_HTML); sb.closeSpan(); - sb.openSpan().setStyleName(RelatedChanges.R.css().subject()); + if (info.status() == Change.Status.ABANDONED) { + sb.openSpan().setStyleName(RelatedChanges.R.css().strikedSubject()); + } else { + sb.openSpan().setStyleName(RelatedChanges.R.css().subject()); + } String url = url(); if (url != null) { sb.openAnchor().setAttribute("href", url); diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/related_changes.css b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/related_changes.css index c0c828ab64..5e0e4023f1 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/related_changes.css +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/related_changes.css @@ -38,13 +38,16 @@ visibility: hidden; } -.subject { +.subject, .strikedSubject { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 355px; } +.strikedSubject { + text-decoration: line-through; +} .tabPanel .gwt-TabBarItem, .tabPanel .gwt-TabBarItem-selected,