Skip to content

Commit

Permalink
#1243 Fix the display of user selection component and use user API v1…
Browse files Browse the repository at this point in the history
… to list users
  • Loading branch information
nadouani committed Apr 30, 2020
1 parent 480fb40 commit 3fbed45
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions frontend/app/scripts/directives/updatableUser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
'use strict';
angular.module('theHiveDirectives')
.directive('updatableUser', function(UserSrv, UtilsSrv, PSearchSrv) {
.directive('updatableUser', function(UserSrv, UtilsSrv, AuthenticationSrv, NotificationSrv) {
return {
restrict: 'E',
link: function(scope, element, attrs, ctrl, transclude) {
Expand All @@ -17,15 +17,15 @@
scope.$watch('updatable.updating', function(value) {

if(value === true && !cached) {
scope.userList = PSearchSrv(undefined, 'user', {
scope: scope,
baseFilter: {
'status': 'Ok'
},
loadAll: true,
sort: '+name',
skipStream: true
});
UserSrv.list(AuthenticationSrv.currentUser.organisation, {_is: { locked: false }})
.then(function(users) {
scope.userList = users;

console.log(scope.userList);
})
.catch(function(err) {
NotificationSrv.error('Fetching users', err.data, err.status);
});
cached = true;
}
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/views/directives/updatable-user.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span class="caret"></span>
</button>
<ul class="dropdown-menu scroll-dropdown" uib-dropdown-menu>
<li ng-repeat="user in userList.allValues">
<li ng-repeat="user in userList">
<a ng-click="update(user.login)">{{user.organisation}}/{{user.name}}</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/views/partials/case/case.details.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h4 class="vpad10 text-primary">Summary</h4>
</dd>
</dl>

<dl class="dl-horizontal clear">
<dl class="dl-horizontal">
<dt class="pull-left">Assignee</dt>
<dd ng-if="canEdit">
<updatable-user on-update="updateField('owner', newValue)" value="caze.owner"/>
Expand Down

0 comments on commit 3fbed45

Please sign in to comment.