Show Email Addresses when Searching

Its hard to tell users apart when they have the same name,
to help users distinguish who is who when searching, this
patch enables the search helper to show both the name and email.

Change-Id: I8f783f7674a47b789636245c785cb9a9a26c4370
Story: 2000132
Task: 24370
This commit is contained in:
Kendall Nelson 2018-08-07 15:08:25 -07:00
parent e7b10dbb39
commit 1b8516cb86
6 changed files with 12 additions and 6 deletions

View File

@ -67,7 +67,8 @@ angular.module('sb.search').factory('SearchHelper',
criteria.push(
Criteria.create('User',
params.assignee_id,
result.full_name)
result.full_name + ' <'
+ result.email + '>')
);
}
);

View File

@ -1,4 +1,6 @@
<td>{{user.full_name}}</td>
<td>&lt;{{user.email}}&gt;</td>
<td class="text-right">
<span class="text-muted">Last Login:</span>
{{user.last_login | date: 'mediumDate'}}

View File

@ -70,7 +70,9 @@ angular.module('sb.services').factory('Search',
var userResults = [];
result.forEach(function (item) {
userResults.push(
Criteria.create('user', item.id, item.full_name)
Criteria.create('user', item.id,
item.full_name,
item.email)
);
});
deferred.resolve(userResults);

View File

@ -91,7 +91,7 @@
<i class="fa fa-refresh fa-spin"></i>
</span>
<span ng-show="creator.full_name">
{{creator.full_name}}
{{creator.full_name}} &lt;{{creator.email}}&gt;
</span>
<br/>
<strong>Last updated:</strong>

View File

@ -144,7 +144,7 @@ angular.module('sb.util').directive('userTypeahead',
*/
$scope.formatUserName = function (model) {
if (!!model) {
return model.full_name;
return model.full_name + ' <' + model.email + '>';
}
return '';
};

View File

@ -8,7 +8,8 @@
ng-if="user && !user.$resolved"></i>
&nbsp;
<span ng-if="user && enabled">{{user.full_name}}</span>
<span ng-if="user && enabled">{{user.full_name}}
&lt;{{user.email}}&gt;</span>
&nbsp;
<a href=""
@ -48,7 +49,7 @@
ng-keypress="handleEnterKey($event)"
typeahead-editable="false"
typeahead-wait-ms="200"
typeahead="user as user.full_name for user in searchUsers($viewValue)"
typeahead="user as formatUserName(user) + ' <' + user.email + '>' + for user in searchUsers($viewValue)"
typeahead-loading="loadingUsers"
typeahead-input-formatter="formatUserName($model)"
typeahead-on-select="updateViewValue($model.id);"