Hyperlink change owner to open changes by same owner

Some users like to quickly find other changes written by the same
user, especially if they aren't immediately listed in the Related
Changes panel, such as changes that cross projects. Hyperlink the
owner name to all changes by the same user.

Change-Id: Iffdc09fddbfcabf3f90a7272b31bfe0044f9d48c
This commit is contained in:
Shawn Pearce 2014-02-19 12:49:06 -08:00
parent 035d20cbf9
commit cf5c00e99f
2 changed files with 12 additions and 6 deletions

View File

@ -137,7 +137,7 @@ public class ChangeScreen2 extends Screen {
@UiField Element ccText;
@UiField Reviewers reviewers;
@UiField Element ownerText;
@UiField InlineHyperlink ownerLink;
@UiField Element statusText;
@UiField Image projectQuery;
@UiField InlineHyperlink projectLink;
@ -825,11 +825,17 @@ public class ChangeScreen2 extends Screen {
String name = info.owner().name() != null
? info.owner().name()
: Gerrit.getConfig().getAnonymousCowardName();
String email = info.owner().email() != null
ownerLink.setText(name);
ownerLink.setTitle(info.owner().email() != null
? info.owner().email()
: name;
ownerText.setInnerText(name);
ownerText.setTitle(email);
: name);
ownerLink.setTargetHistoryToken(PageLinks.toAccountQuery(
info.owner().name() != null
? info.owner().name()
: info.owner().email() != null
? info.owner().email()
: String.valueOf(info.owner()._account_id()), Change.Status.NEW));
}
private void renderSubmitType(String action) {

View File

@ -368,7 +368,7 @@ limitations under the License.
<table id='change_infoTable'>
<tr>
<th><ui:msg>Owner</ui:msg></th>
<td ui:field='ownerText'/>
<td><x:InlineHyperlink ui:field='ownerLink'/></td>
</tr>
<tr>
<th><ui:msg>Reviewers</ui:msg></th>