SideBySide2: Show project name before file path

On large complex projects like Android its useful to know which
project a file is in when reviewing the file.  Its common for
reviewers to span projects and many projects may have a common file
like Makefile or BUCK.

Bug: issue 148
Change-Id: I3c8e4fbc57be7de723199cf647508238f4a9feb7
This commit is contained in:
Shawn Pearce
2013-11-20 01:38:15 -08:00
parent cd2fc945ae
commit b107d3d3a4
3 changed files with 9 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.client.diff;
import com.google.gerrit.client.Gerrit; import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.changes.ChangeApi; import com.google.gerrit.client.changes.ChangeApi;
import com.google.gerrit.client.changes.ChangeInfo;
import com.google.gerrit.client.changes.ReviewInfo; import com.google.gerrit.client.changes.ReviewInfo;
import com.google.gerrit.client.changes.Util; import com.google.gerrit.client.changes.Util;
import com.google.gerrit.client.patches.PatchUtil; import com.google.gerrit.client.patches.PatchUtil;
@@ -53,6 +54,7 @@ class Header extends Composite {
private static final Binder uiBinder = GWT.create(Binder.class); private static final Binder uiBinder = GWT.create(Binder.class);
@UiField CheckBox reviewed; @UiField CheckBox reviewed;
@UiField Element project;
@UiField Element filePath; @UiField Element filePath;
@UiField Element noDiff; @UiField Element noDiff;
@@ -144,6 +146,10 @@ class Header extends Composite {
} }
} }
void set(ChangeInfo info) {
project.setInnerText(info.project());
}
void setReviewed(boolean r) { void setReviewed(boolean r) {
reviewed.setValue(r, true); reviewed.setValue(r, true);
} }

View File

@@ -29,6 +29,7 @@ limitations under the License.
vertical-align: bottom; vertical-align: bottom;
} }
.path { .path {
white-space: no-wrap;
} }
.navigation { .navigation {
position: absolute; position: absolute;
@@ -48,7 +49,7 @@ limitations under the License.
title='Mark file as reviewed (Shortcut: r)'> title='Mark file as reviewed (Shortcut: r)'>
<ui:attribute name='title'/> <ui:attribute name='title'/>
</g:CheckBox> </g:CheckBox>
<span ui:field='filePath' class='{style.path}'/> <span class='{style.path}'><span ui:field='project'/> / <span ui:field='filePath'/></span>
<span ui:field='noDiff' class='{style.nodiff}'> <span ui:field='noDiff' class='{style.nodiff}'>
<ui:msg>No Differences</ui:msg> <ui:msg>No Differences</ui:msg>

View File

@@ -212,6 +212,7 @@ public class SideBySide2 extends Screen {
JsArray<RevisionInfo> list = info.revisions().values(); JsArray<RevisionInfo> list = info.revisions().values();
RevisionInfo.sortRevisionInfoByNumber(list); RevisionInfo.sortRevisionInfoByNumber(list);
diffTable.setUpPatchSetNav(list, diff); diffTable.setUpPatchSetNav(list, diff);
header.set(info);
}})); }}));
ConfigInfoCache.get(changeId, group.addFinal( ConfigInfoCache.get(changeId, group.addFinal(