diff --git a/public/app/core/components/user_picker.ts b/public/app/core/components/user_picker.ts
new file mode 100644
index 00000000000..2dad2ebcdba
--- /dev/null
+++ b/public/app/core/components/user_picker.ts
@@ -0,0 +1,76 @@
+import coreModule from 'app/core/core_module';
+import appEvents from 'app/core/app_events';
+import _ from 'lodash';
+
+const template = `
+
+
+
+`;
+export class UserPickerCtrl {
+ userSegment: any;
+ userLogin: string;
+ userId: number;
+ debouncedSearchUsers: any;
+
+ /** @ngInject */
+ constructor(private backendSrv, private $scope, $sce, private uiSegmentSrv) {
+ this.userSegment = this.uiSegmentSrv.newSegment({value: 'Choose User', selectMode: true});
+ this.debouncedSearchUsers = _.debounce(this.searchUsers, 500, {'leading': true, 'trailing': false});
+ }
+
+ searchUsers(query: string) {
+ return Promise.resolve(this.backendSrv.get('/api/users/search?perpage=10&page=1&query=' + query).then(result => {
+ return _.map(result.users, this.userKey.bind(this));
+ }));
+ }
+
+ onChange() {
+ this.userLogin = this.userSegment.value.split(' - ')[0];
+ console.log(this.userLogin);
+
+ this.backendSrv.get('/api/users/search?perpage=10&page=1&query=' + this.userLogin)
+ .then(result => {
+ if (!result) {
+ return;
+ }
+
+ result.users.forEach(u => {
+ if (u.login === this.userLogin) {
+ this.userId = u.id;
+ }
+ });
+ });
+ }
+
+ private userKey(user: User) {
+ return this.uiSegmentSrv.newSegment(user.login + ' - ' + user.email);
+ }
+
+
+}
+
+export interface User {
+ id: number;
+ name: string;
+ login: string;
+ email: string;
+}
+
+export function userPicker() {
+ return {
+ restrict: 'E',
+ template: template,
+ controller: UserPickerCtrl,
+ bindToController: true,
+ controllerAs: 'ctrl',
+ scope: {
+ userLogin: '=',
+ userId: '=',
+ }
+ };
+}
+
+coreModule.directive('userPicker', userPicker);
diff --git a/public/app/core/core.ts b/public/app/core/core.ts
index 4ecb4318bf7..d159f6b7ecc 100644
--- a/public/app/core/core.ts
+++ b/public/app/core/core.ts
@@ -46,7 +46,7 @@ import {contextSrv} from './services/context_srv';
import {KeybindingSrv} from './services/keybindingSrv';
import {helpModal} from './components/help/help';
import {NavModelSrv, NavModel} from './nav_model_srv';
-
+import {userPicker} from './components/user_picker';
export {
arrayJoin,
@@ -72,4 +72,5 @@ export {
helpModal,
NavModelSrv,
NavModel,
+ userPicker,
};
diff --git a/public/app/features/org/partials/edit_user_group.html b/public/app/features/org/partials/edit_user_group.html
index 085d349f6a7..18e8d3fe001 100644
--- a/public/app/features/org/partials/edit_user_group.html
+++ b/public/app/features/org/partials/edit_user_group.html
@@ -21,8 +21,8 @@