From e0ebc492cc6085a6cc2302ab2f34c0f5f28d619a Mon Sep 17 00:00:00 2001 From: Bruce Zu Date: Mon, 29 Jul 2013 15:23:09 +0800 Subject: [PATCH] Label: Make the meaning of the blank cell visible On changes dashboard the label columns often have some blank cells especially when user has some customized label for some special branch. [1] some of them mean for current change this label is not applicable. [2] some of them mean this label is applied on this change's branch but this change has not got any vote on this label yet. In order to figure out what a blank cell means, a user has to click that row to open the ChangeScreen and check the approval table. This commit makes it easy to distinguish these blank cells by setting blank cells matching case [1] to display grey background and have a title 'Label not applicable'. Even for the case where all labels are project-specific, this feature is valuable. Change-Id: Ic965ad51f60919ecf1d3cefb9456271950d51302 --- .../main/java/com/google/gerrit/client/GerritConstants.java | 2 ++ .../java/com/google/gerrit/client/GerritConstants.properties | 2 ++ .../src/main/java/com/google/gerrit/client/GerritCss.java | 1 + .../java/com/google/gerrit/client/changes/ChangeTable2.java | 3 ++- gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java index fb720859d8..717bf8c858 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java @@ -48,6 +48,8 @@ public interface GerritConstants extends Constants { String inactiveAccountBody(); + String labelNotApplicable(); + String menuAll(); String menuAllOpen(); String menuAllMerged(); diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties index 6f3dca5675..4c4fcf7136 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties @@ -31,6 +31,8 @@ noSuchGroupTitle = Code Review - Unknown Group inactiveAccountBody = This user is currently inactive. +labelNotApplicable = Label not applicable + menuAll = All menuAllOpen = Open menuAllMerged = Merged diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritCss.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritCss.java index 2fef7eed65..b285c0b9f3 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritCss.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritCss.java @@ -141,6 +141,7 @@ public interface GerritCss extends CssResource { String infoTable(); String inputFieldTypeHint(); String labelList(); + String labelNotApplicable(); String leftMostCell(); String lineHeader(); String lineNumber(); diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable2.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable2.java index f993ad9690..cedbd4be78 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable2.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable2.java @@ -230,7 +230,8 @@ public class ChangeTable2 extends NavigationTable { LabelInfo label = c.label(name); if (label == null) { - table.clearCell(row, col); + fmt.getElement(row, col).setTitle(Gerrit.C.labelNotApplicable()); + fmt.addStyleName(row, col, Gerrit.RESOURCES.css().labelNotApplicable()); continue; } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css index 8087b68f33..908c07f04c 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css @@ -595,6 +595,9 @@ a:hover { .changeTable .dataCell.singleLine { white-space: nowrap; } +.changeTable .dataCell.labelNotApplicable { + background: #F5F5F5; +} .changeTable .iconHeader { border-top: 1px solid backgroundColor; border-bottom: 1px solid backgroundColor;