{"action":"created","issue":{"url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/issues/7","repository_url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin","labels_url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/issues/7/comments","events_url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/issues/7/events","html_url":"https://github.com/leekelleher/umbraco-bulk-user-admin/pull/7","id":163735998,"number":7,"title":"Adding in filtering for dashboard table","user":{"login":"jamiepollock","id":5408006,"avatar_url":"https://avatars.githubusercontent.com/u/5408006?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiepollock","html_url":"https://github.com/jamiepollock","followers_url":"https://api.github.com/users/jamiepollock/followers","following_url":"https://api.github.com/users/jamiepollock/following{/other_user}","gists_url":"https://api.github.com/users/jamiepollock/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiepollock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiepollock/subscriptions","organizations_url":"https://api.github.com/users/jamiepollock/orgs","repos_url":"https://api.github.com/users/jamiepollock/repos","events_url":"https://api.github.com/users/jamiepollock/events{/privacy}","received_events_url":"https://api.github.com/users/jamiepollock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-04T19:47:35Z","updated_at":"2016-07-04T20:00:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/pulls/7","html_url":"https://github.com/leekelleher/umbraco-bulk-user-admin/pull/7","diff_url":"https://github.com/leekelleher/umbraco-bulk-user-admin/pull/7.diff","patch_url":"https://github.com/leekelleher/umbraco-bulk-user-admin/pull/7.patch"},"body":"This PR should cover basic filtering of data outlined in #6 .\r\n\r\nA user can search invariant exact for a name, email user type and also whether a user is active or inactive.\r\n\r\nThe case doesn't matter but it must be the full value.\r\n\r\nI've tested this against Umbraco v7.4.3 with a few 1000 users. To create so many users I setup an UmbracoApiController like so to quickly create multiple users of a specific type. I was initially a bit concerned with how it would work with large numbers of users to bring back and filter by Linq but it's not so bad actually. There is a short delay but nothing world-breaking.\r\n\r\n*Note:* This doesn't currently cover power words which allow users to do stuff like `is:admin`. I'd consider this a stage 2 unless otherwise agreed.\r\n\r\n```c#\r\nusing System;\r\nusing System.Net;\r\nusing System.Net.Http;\r\nusing System.Web.Http;\r\nusing Umbraco.Web.WebApi;\r\n\r\nnamespace DemoApp.Controllers\r\n{\r\n    public class UserTestApiController : UmbracoApiController\r\n    {\r\n        [HttpGet]\r\n        public HttpResponseMessage Create(int number = 50, string userTypeAlias = \"admin\")\r\n        {\r\n            if (number < 1)\r\n            {\r\n                return Request.CreateValidationErrorResponse(\"number must be higher than 0\");\r\n            }\r\n\r\n\r\n            var userType = Services.UserService.GetUserTypeByAlias(userTypeAlias);\r\n\r\n            if (userType == null)\r\n            {\r\n                return\r\n                    Request.CreateValidationErrorResponse(\"Unable to find a user type with the alias, \" + userTypeAlias);\r\n            }\r\n\r\n            var count = 0;\r\n\r\n            for (var index = 0; index <= number; index++)\r\n            {\r\n\r\n                try\r\n                {\r\n                    var userName = string.Format(\"User{0}-{1:yy-mm-dd}\", index, DateTime.Now);\r\n                    var email = string.Format(\"{0}@foo.com\", userName.Replace(\"-\", string.Empty));\r\n\r\n                    var exists = Services.UserService.Exists(userName);\r\n\r\n                    if (exists == false)\r\n                    {\r\n                        var user = Services.UserService.CreateUserWithIdentity(userName, email, userType);\r\n\r\n                        Services.UserService.Save(user);\r\n                    }\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);\r\n                }\r\n            }\r\n\r\n\r\n            return Request.CreateResponse(HttpStatusCode.OK,\r\n                string.Format(\"{0} successfully {1} create\", number, userTypeAlias));\r\n        }\r\n\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/issues/comments/230348027","html_url":"https://github.com/leekelleher/umbraco-bulk-user-admin/pull/7#issuecomment-230348027","issue_url":"https://api.github.com/repos/leekelleher/umbraco-bulk-user-admin/issues/7","id":230348027,"user":{"login":"jamiepollock","id":5408006,"avatar_url":"https://avatars.githubusercontent.com/u/5408006?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiepollock","html_url":"https://github.com/jamiepollock","followers_url":"https://api.github.com/users/jamiepollock/followers","following_url":"https://api.github.com/users/jamiepollock/following{/other_user}","gists_url":"https://api.github.com/users/jamiepollock/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiepollock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiepollock/subscriptions","organizations_url":"https://api.github.com/users/jamiepollock/orgs","repos_url":"https://api.github.com/users/jamiepollock/repos","events_url":"https://api.github.com/users/jamiepollock/events{/privacy}","received_events_url":"https://api.github.com/users/jamiepollock/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T20:00:12Z","updated_at":"2016-07-04T20:00:12Z","body":"@mattbrailsford sounds like an interesting idea. I've not created a custom Lucene index before might not be something I can get done tomorrow but could certainly look into it.\r\n\r\nObviously we'd be sorting and searching against just the data required for this list. Name, Email, User Type & Active. Aside from email everything is pretty standard any not too out of the ordinary of what you'd find in typical a Lucene index.\r\n\r\nWhat do you think @leekelleher?"}}
{"actor":{"display_login":"jamiepollock"}}