PolyGerrit: Add gr-account-link to gr-group-members

Previously, avatars were missing from gr-group-members.

This also updates gr-account-link to fallback to using username or name
if email does not work.

Change-Id: I6e7c35bf7ebd2d01ae24998235d36105b2d265be
This commit is contained in:
Paladox none
2017-08-21 09:36:42 +00:00
committed by Becky Siegel
parent d901cac677
commit cc5ffb2221
3 changed files with 4 additions and 14 deletions

View File

@@ -21,6 +21,7 @@ limitations under the License.
<link rel="import" href="../../../bower_components/iron-input/iron-input.html">
<link rel="import" href="../../../styles/gr-form-styles.html">
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../shared/gr-account-link/gr-account-link.html">
<link rel="import" href="../../shared/gr-autocomplete/gr-autocomplete.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<link rel="import" href="../../shared/gr-overlay/gr-overlay.html">
@@ -107,7 +108,7 @@ limitations under the License.
<template is="dom-repeat" items="[[_groupMembers]]">
<tr>
<td class="nameColumn">
<a href$="[[_memberUrl(item)]]">[[item.name]]</a>
<gr-account-link account="[[item]]"></gr-account-link>
</td>
<td>[[item.email]]</td>
<td hidden$="[[!_groupOwner]]">

View File

@@ -93,18 +93,6 @@
return this._loading || this._loading === undefined;
},
_memberUrl(item) {
if (item.email) {
item = item.email;
} else if (item.username) {
item = item.username;
} else {
item = item.name;
}
return this.getBaseUrl() + '/q/owner:' + this.encodeURL(item, true) +
' status:open';
},
_groupUrl(item) {
return this.getBaseUrl() + '/admin/groups/' + this.encodeURL(item, true);
},

View File

@@ -32,7 +32,8 @@
_computeOwnerLink(account) {
if (!account) { return; }
return Gerrit.Nav.getUrlForOwner(
account.email || account.username || account._account_id);
account.email || account.username || account.name ||
account._account_id);
},
_computeShowEmail(account) {