{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/comments/183757955","pull_request_review_id":114816569,"id":183757955,"diff_hunk":"@@ -9,17 +9,37 @@ import {getTeams} from 'mattermost-redux/actions/teams';\n import {loadRolesIfNeeded} from 'mattermost-redux/actions/roles';\n import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general';\n import {getRoles} from 'mattermost-redux/selectors/entities/roles';\n+import {getJoinableTeams, getTeamMemberships} from 'mattermost-redux/selectors/entities/teams';\n+import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';\n \n import SelectTeam from './select_team.jsx';\n \n function mapStateToProps(state) {\n     const license = getLicense(state);\n     const config = getConfig(state);\n+    const currentUser = getCurrentUser(state);\n+    const myTeamMemberships = Object.values(getTeamMemberships(state));\n+\n+    function sortTeams(a, b) {\n+        const options = {\n+            numeric: true,\n+            sensitivity: 'base',\n+        };\n+        return a.display_name.localeCompare(b.display_name, currentUser.locale || 'en', options);\n+    }\n+\n+    const joinableTeams = Object.values(getJoinableTeams(state)).\n+        filter((team) => team.delete_at === 0).\n+        sort(sortTeams);","path":"components/select_team/index.js","position":25,"original_position":25,"commit_id":"0260abd4f4b9582dc5425b802dfc4e3ab3ec5988","original_commit_id":"0260abd4f4b9582dc5425b802dfc4e3ab3ec5988","user":{"login":"jwilander","id":2672098,"avatar_url":"https://avatars0.githubusercontent.com/u/2672098?v=4","gravatar_id":"","url":"https://api.github.com/users/jwilander","html_url":"https://github.com/jwilander","followers_url":"https://api.github.com/users/jwilander/followers","following_url":"https://api.github.com/users/jwilander/following{/other_user}","gists_url":"https://api.github.com/users/jwilander/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilander/subscriptions","organizations_url":"https://api.github.com/users/jwilander/orgs","repos_url":"https://api.github.com/users/jwilander/repos","events_url":"https://api.github.com/users/jwilander/events{/privacy}","received_events_url":"https://api.github.com/users/jwilander/received_events","type":"User","site_admin":false},"body":"This is going to be a new object every time, probably better to make a selector to do this","created_at":"2018-04-24T14:42:05Z","updated_at":"2018-04-24T14:42:39Z","html_url":"https://github.com/mattermost/mattermost-webapp/pull/1073#discussion_r183757955","pull_request_url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/comments/183757955"},"html":{"href":"https://github.com/mattermost/mattermost-webapp/pull/1073#discussion_r183757955"},"pull_request":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073","id":180631665,"html_url":"https://github.com/mattermost/mattermost-webapp/pull/1073","diff_url":"https://github.com/mattermost/mattermost-webapp/pull/1073.diff","patch_url":"https://github.com/mattermost/mattermost-webapp/pull/1073.patch","issue_url":"https://api.github.com/repos/mattermost/mattermost-webapp/issues/1073","number":1073,"state":"open","locked":false,"title":"Migrate select team to redux store","user":{"login":"saturninoabril","id":5334504,"avatar_url":"https://avatars2.githubusercontent.com/u/5334504?v=4","gravatar_id":"","url":"https://api.github.com/users/saturninoabril","html_url":"https://github.com/saturninoabril","followers_url":"https://api.github.com/users/saturninoabril/followers","following_url":"https://api.github.com/users/saturninoabril/following{/other_user}","gists_url":"https://api.github.com/users/saturninoabril/gists{/gist_id}","starred_url":"https://api.github.com/users/saturninoabril/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saturninoabril/subscriptions","organizations_url":"https://api.github.com/users/saturninoabril/orgs","repos_url":"https://api.github.com/users/saturninoabril/repos","events_url":"https://api.github.com/users/saturninoabril/events{/privacy}","received_events_url":"https://api.github.com/users/saturninoabril/received_events","type":"User","site_admin":false},"body":"#### Summary\r\nWhile working in this PR: https://github.com/mattermost/mattermost-webapp/pull/1070, I thought of migrating this SelectItem to use our redux store. Also added test.\r\n\r\n(Note: I'll just rebase after the said PR is accepted and merged.)\r\n\r\n#### Ticket Link\r\nnone\r\n\r\n#### Checklist\r\n- [x] Ran `make check-style` to check for style errors (required for all pull requests)\r\n- [x] Ran `make test` to ensure unit and component tests passed\r\n- [x] Added or updated unit tests (required for all new features)\r\n","created_at":"2018-04-10T14:58:38Z","updated_at":"2018-04-24T14:42:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b28fb9c3dd8d968567874525ea9e36ad56eaf28","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jespino","id":290303,"avatar_url":"https://avatars0.githubusercontent.com/u/290303?v=4","gravatar_id":"","url":"https://api.github.com/users/jespino","html_url":"https://github.com/jespino","followers_url":"https://api.github.com/users/jespino/followers","following_url":"https://api.github.com/users/jespino/following{/other_user}","gists_url":"https://api.github.com/users/jespino/gists{/gist_id}","starred_url":"https://api.github.com/users/jespino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jespino/subscriptions","organizations_url":"https://api.github.com/users/jespino/orgs","repos_url":"https://api.github.com/users/jespino/repos","events_url":"https://api.github.com/users/jespino/events{/privacy}","received_events_url":"https://api.github.com/users/jespino/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":685999255,"url":"https://api.github.com/repos/mattermost/mattermost-webapp/labels/2:%20Dev%20Review","name":"2: Dev Review","color":"eb6420","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073/commits","review_comments_url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073/comments","review_comment_url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/mattermost-webapp/issues/1073/comments","statuses_url":"https://api.github.com/repos/mattermost/mattermost-webapp/statuses/0260abd4f4b9582dc5425b802dfc4e3ab3ec5988","head":{"label":"saturninoabril:migrate-select-team","ref":"migrate-select-team","sha":"0260abd4f4b9582dc5425b802dfc4e3ab3ec5988","user":{"login":"saturninoabril","id":5334504,"avatar_url":"https://avatars2.githubusercontent.com/u/5334504?v=4","gravatar_id":"","url":"https://api.github.com/users/saturninoabril","html_url":"https://github.com/saturninoabril","followers_url":"https://api.github.com/users/saturninoabril/followers","following_url":"https://api.github.com/users/saturninoabril/following{/other_user}","gists_url":"https://api.github.com/users/saturninoabril/gists{/gist_id}","starred_url":"https://api.github.com/users/saturninoabril/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saturninoabril/subscriptions","organizations_url":"https://api.github.com/users/saturninoabril/orgs","repos_url":"https://api.github.com/users/saturninoabril/repos","events_url":"https://api.github.com/users/saturninoabril/events{/privacy}","received_events_url":"https://api.github.com/users/saturninoabril/received_events","type":"User","site_admin":false},"repo":{"id":102709140,"name":"mattermost-webapp","full_name":"saturninoabril/mattermost-webapp","owner":{"login":"saturninoabril","id":5334504,"avatar_url":"https://avatars2.githubusercontent.com/u/5334504?v=4","gravatar_id":"","url":"https://api.github.com/users/saturninoabril","html_url":"https://github.com/saturninoabril","followers_url":"https://api.github.com/users/saturninoabril/followers","following_url":"https://api.github.com/users/saturninoabril/following{/other_user}","gists_url":"https://api.github.com/users/saturninoabril/gists{/gist_id}","starred_url":"https://api.github.com/users/saturninoabril/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saturninoabril/subscriptions","organizations_url":"https://api.github.com/users/saturninoabril/orgs","repos_url":"https://api.github.com/users/saturninoabril/repos","events_url":"https://api.github.com/users/saturninoabril/events{/privacy}","received_events_url":"https://api.github.com/users/saturninoabril/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/saturninoabril/mattermost-webapp","description":"Webapp of Mattermost server: https://github.com/mattermost/mattermost-server","fork":true,"url":"https://api.github.com/repos/saturninoabril/mattermost-webapp","forks_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/forks","keys_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/teams","hooks_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/hooks","issue_events_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/issues/events{/number}","events_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/events","assignees_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/assignees{/user}","branches_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/branches{/branch}","tags_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/tags","blobs_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/statuses/{sha}","languages_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/languages","stargazers_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/stargazers","contributors_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/contributors","subscribers_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/subscribers","subscription_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/subscription","commits_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/contents/{+path}","compare_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/merges","archive_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/downloads","issues_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/issues{/number}","pulls_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/pulls{/number}","milestones_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/milestones{/number}","notifications_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/labels{/name}","releases_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/releases{/id}","deployments_url":"https://api.github.com/repos/saturninoabril/mattermost-webapp/deployments","created_at":"2017-09-07T08:03:14Z","updated_at":"2018-04-24T14:22:18Z","pushed_at":"2018-04-24T14:23:50Z","git_url":"git://github.com/saturninoabril/mattermost-webapp.git","ssh_url":"git@github.com:saturninoabril/mattermost-webapp.git","clone_url":"https://github.com/saturninoabril/mattermost-webapp.git","svn_url":"https://github.com/saturninoabril/mattermost-webapp","homepage":null,"size":99688,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"2d690d4cb653773606ff1b75d82f132c1e2cb06b","user":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":102689445,"name":"mattermost-webapp","full_name":"mattermost/mattermost-webapp","owner":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mattermost/mattermost-webapp","description":"Webapp of Mattermost server: https://github.com/mattermost/mattermost-server","fork":false,"url":"https://api.github.com/repos/mattermost/mattermost-webapp","forks_url":"https://api.github.com/repos/mattermost/mattermost-webapp/forks","keys_url":"https://api.github.com/repos/mattermost/mattermost-webapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/mattermost-webapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/mattermost-webapp/teams","hooks_url":"https://api.github.com/repos/mattermost/mattermost-webapp/hooks","issue_events_url":"https://api.github.com/repos/mattermost/mattermost-webapp/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/mattermost-webapp/events","assignees_url":"https://api.github.com/repos/mattermost/mattermost-webapp/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/mattermost-webapp/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/mattermost-webapp/tags","blobs_url":"https://api.github.com/repos/mattermost/mattermost-webapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/mattermost-webapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/mattermost-webapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/mattermost-webapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/mattermost-webapp/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/mattermost-webapp/languages","stargazers_url":"https://api.github.com/repos/mattermost/mattermost-webapp/stargazers","contributors_url":"https://api.github.com/repos/mattermost/mattermost-webapp/contributors","subscribers_url":"https://api.github.com/repos/mattermost/mattermost-webapp/subscribers","subscription_url":"https://api.github.com/repos/mattermost/mattermost-webapp/subscription","commits_url":"https://api.github.com/repos/mattermost/mattermost-webapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/mattermost-webapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/mattermost-webapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/mattermost-webapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/mattermost-webapp/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/mattermost-webapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/mattermost-webapp/merges","archive_url":"https://api.github.com/repos/mattermost/mattermost-webapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/mattermost-webapp/downloads","issues_url":"https://api.github.com/repos/mattermost/mattermost-webapp/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/mattermost-webapp/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/mattermost-webapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/mattermost-webapp/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/mattermost-webapp/releases{/id}","deployments_url":"https://api.github.com/repos/mattermost/mattermost-webapp/deployments","created_at":"2017-09-07T04:00:02Z","updated_at":"2018-04-24T10:04:20Z","pushed_at":"2018-04-24T14:26:17Z","git_url":"git://github.com/mattermost/mattermost-webapp.git","ssh_url":"git@github.com:mattermost/mattermost-webapp.git","clone_url":"https://github.com/mattermost/mattermost-webapp.git","svn_url":"https://github.com/mattermost/mattermost-webapp","homepage":null,"size":100276,"stargazers_count":179,"watchers_count":179,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":352,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":352,"open_issues":27,"watchers":179,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073"},"html":{"href":"https://github.com/mattermost/mattermost-webapp/pull/1073"},"issue":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/issues/1073"},"comments":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/issues/1073/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/pulls/1073/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/mattermost-webapp/statuses/0260abd4f4b9582dc5425b802dfc4e3ab3ec5988"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jwilander"}}