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 8caf5fced6
5 changed files with 9 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

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