{"action":"created","issue":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/1000","repository_url":"https://api.github.com/repos/mitodl/micromasters","labels_url":"https://api.github.com/repos/mitodl/micromasters/issues/1000/labels{/name}","comments_url":"https://api.github.com/repos/mitodl/micromasters/issues/1000/comments","events_url":"https://api.github.com/repos/mitodl/micromasters/issues/1000/events","html_url":"https://github.com/mitodl/micromasters/pull/1000","id":176053352,"number":1000,"title":"Added enrollment dialog","user":{"login":"noisecapella","id":863262,"avatar_url":"https://avatars.githubusercontent.com/u/863262?v=3","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitodl/micromasters/labels/Waiting%20on%20Author","name":"Waiting on Author","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"gsidebo","id":14932219,"avatar_url":"https://avatars.githubusercontent.com/u/14932219?v=3","gravatar_id":"","url":"https://api.github.com/users/gsidebo","html_url":"https://github.com/gsidebo","followers_url":"https://api.github.com/users/gsidebo/followers","following_url":"https://api.github.com/users/gsidebo/following{/other_user}","gists_url":"https://api.github.com/users/gsidebo/gists{/gist_id}","starred_url":"https://api.github.com/users/gsidebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsidebo/subscriptions","organizations_url":"https://api.github.com/users/gsidebo/orgs","repos_url":"https://api.github.com/users/gsidebo/repos","events_url":"https://api.github.com/users/gsidebo/events{/privacy}","received_events_url":"https://api.github.com/users/gsidebo/received_events","type":"User","site_admin":false},"assignees":[{"login":"gsidebo","id":14932219,"avatar_url":"https://avatars.githubusercontent.com/u/14932219?v=3","gravatar_id":"","url":"https://api.github.com/users/gsidebo","html_url":"https://github.com/gsidebo","followers_url":"https://api.github.com/users/gsidebo/followers","following_url":"https://api.github.com/users/gsidebo/following{/other_user}","gists_url":"https://api.github.com/users/gsidebo/gists{/gist_id}","starred_url":"https://api.github.com/users/gsidebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsidebo/subscriptions","organizations_url":"https://api.github.com/users/gsidebo/orgs","repos_url":"https://api.github.com/users/gsidebo/repos","events_url":"https://api.github.com/users/gsidebo/events{/privacy}","received_events_url":"https://api.github.com/users/gsidebo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-09-09T16:36:48Z","updated_at":"2016-09-12T16:23:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mitodl/micromasters/pulls/1000","html_url":"https://github.com/mitodl/micromasters/pull/1000","diff_url":"https://github.com/mitodl/micromasters/pull/1000.diff","patch_url":"https://github.com/mitodl/micromasters/pull/1000.patch"},"body":"WIP: no tests yet!\r\n\r\n#### What are the relevant tickets?\r\nFixes #796 \r\n\r\n#### What's this PR do?\r\nAdds a dialog box which opens when the user clicks 'Enroll in a new program'. This dialog is used to add a new `ProgramEnrollment` for the user.\r\n\r\n#### How should this be manually tested?\r\nMake sure you are not enrolled in every live program. Then you should see the link in the program selector. Note that:\r\n\r\n - If you select the 'Enroll in a new program' option, it should not change the currently selected program displayed in the dropdown.\r\n - If you click 'Cancel' the dialog should close and nothing should change.\r\n - If you click 'Enroll' without a program selected you should get a validation warning. (The warning should disappear if you close and open the dialog again.)\r\n - You should see only programs you have not yet enrolled in.\r\n - When you select a program and click 'Enroll', it should close the dialog immediately and POST to the API. If it succeeds you should see a success message with a check mark like in the screenshot for #796. If it fails you should see an error icon with an error message. In both cases the toast will disappear after five seconds.\r\n - After a successful enrollment you will automatically be switched to the new program in the context.\r\n\r\n#### Any background context you want to provide?\r\nThe click outside the dialog to close it is not supported due to complications with material-ui and react-select: https://github.com/JedWatson/react-select/issues/532\r\nThere may be some workaround for that, I haven't spent much time on it. Made an issue: #1002\r\n\r\nAlso, program page URLs are not available in the dashboard at the moment so they won't be displayed in the UI. Made an issue: #1003 \r\n\r\n#### Screenshots (if appropriate)\r\n![screenshot from 2016-09-09 12-39-58](https://cloud.githubusercontent.com/assets/863262/18395004/8b668360-768a-11e6-8452-ac41d04848d7.png)\r\n"},"comment":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/comments/246403361","html_url":"https://github.com/mitodl/micromasters/pull/1000#issuecomment-246403361","issue_url":"https://api.github.com/repos/mitodl/micromasters/issues/1000","id":246403361,"user":{"login":"noisecapella","id":863262,"avatar_url":"https://avatars.githubusercontent.com/u/863262?v=3","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T16:23:33Z","updated_at":"2016-09-12T16:23:33Z","body":"Comments addressed, I'm going back to working on tests now"}}
{"actor":{"display_login":"noisecapella"}}