diff --git a/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search.js b/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search.js index 664d59f61b..cfdd52438b 100644 --- a/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search.js +++ b/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search.js @@ -72,10 +72,6 @@ } } - _accountOrAnon(name) { - return this.getUserName(this._serverConfig, name, false); - } - /** * Fetch from the API the predicted projects. * @@ -154,11 +150,12 @@ _mapAccountsHelper(accounts, predicate) { return accounts.map(account => { + const userName = this.getUserName(this._serverConfig, account, false); return { label: account.name || '', text: account.email ? `${predicate}:${account.email}` : - `${predicate}:"${this._accountOrAnon(account)}"`, + `${predicate}:"${userName}"`, }; }); } diff --git a/polygerrit-ui/app/scripts/gr-display-name-utils/gr-display-name-utils.js b/polygerrit-ui/app/scripts/gr-display-name-utils/gr-display-name-utils.js index 6e503c73b0..f0d0e7fcd6 100644 --- a/polygerrit-ui/app/scripts/gr-display-name-utils/gr-display-name-utils.js +++ b/polygerrit-ui/app/scripts/gr-display-name-utils/gr-display-name-utils.js @@ -44,17 +44,13 @@ } static getAccountDisplayName(config, account, enableEmail) { - const reviewerName = this._accountOrAnon(config, account, enableEmail); + const reviewerName = this.getUserName(config, account, !!enableEmail); const reviewerEmail = this._accountEmail(account.email); const reviewerStatus = account.status ? '(' + account.status + ')' : ''; return [reviewerName, reviewerEmail, reviewerStatus] .filter(p => p.length > 0).join(' '); } - static _accountOrAnon(config, reviewer, enableEmail) { - return this.getUserName(config, reviewer, !!enableEmail); - } - static _accountEmail(email) { if (typeof email !== 'undefined') { return '<' + email + '>';