{"action":"created","issue":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/1156","repository_url":"https://api.github.com/repos/mitodl/micromasters","labels_url":"https://api.github.com/repos/mitodl/micromasters/issues/1156/labels{/name}","comments_url":"https://api.github.com/repos/mitodl/micromasters/issues/1156/comments","events_url":"https://api.github.com/repos/mitodl/micromasters/issues/1156/events","html_url":"https://github.com/mitodl/micromasters/pull/1156","id":179854209,"number":1156,"title":"refactor getPreferredName","user":{"login":"aliceriot","id":6207644,"avatar_url":"https://avatars.githubusercontent.com/u/6207644?v=3","gravatar_id":"","url":"https://api.github.com/users/aliceriot","html_url":"https://github.com/aliceriot","followers_url":"https://api.github.com/users/aliceriot/followers","following_url":"https://api.github.com/users/aliceriot/following{/other_user}","gists_url":"https://api.github.com/users/aliceriot/gists{/gist_id}","starred_url":"https://api.github.com/users/aliceriot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliceriot/subscriptions","organizations_url":"https://api.github.com/users/aliceriot/orgs","repos_url":"https://api.github.com/users/aliceriot/repos","events_url":"https://api.github.com/users/aliceriot/events{/privacy}","received_events_url":"https://api.github.com/users/aliceriot/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":"annagav","id":7574259,"avatar_url":"https://avatars.githubusercontent.com/u/7574259?v=3","gravatar_id":"","url":"https://api.github.com/users/annagav","html_url":"https://github.com/annagav","followers_url":"https://api.github.com/users/annagav/followers","following_url":"https://api.github.com/users/annagav/following{/other_user}","gists_url":"https://api.github.com/users/annagav/gists{/gist_id}","starred_url":"https://api.github.com/users/annagav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annagav/subscriptions","organizations_url":"https://api.github.com/users/annagav/orgs","repos_url":"https://api.github.com/users/annagav/repos","events_url":"https://api.github.com/users/annagav/events{/privacy}","received_events_url":"https://api.github.com/users/annagav/received_events","type":"User","site_admin":false},"assignees":[{"login":"annagav","id":7574259,"avatar_url":"https://avatars.githubusercontent.com/u/7574259?v=3","gravatar_id":"","url":"https://api.github.com/users/annagav","html_url":"https://github.com/annagav","followers_url":"https://api.github.com/users/annagav/followers","following_url":"https://api.github.com/users/annagav/following{/other_user}","gists_url":"https://api.github.com/users/annagav/gists{/gist_id}","starred_url":"https://api.github.com/users/annagav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annagav/subscriptions","organizations_url":"https://api.github.com/users/annagav/orgs","repos_url":"https://api.github.com/users/annagav/repos","events_url":"https://api.github.com/users/annagav/events{/privacy}","received_events_url":"https://api.github.com/users/annagav/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2016-09-28T18:42:35Z","updated_at":"2016-09-29T14:24:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mitodl/micromasters/pulls/1156","html_url":"https://github.com/mitodl/micromasters/pull/1156","diff_url":"https://github.com/mitodl/micromasters/pull/1156.diff","patch_url":"https://github.com/mitodl/micromasters/pull/1156.patch"},"body":"#### What are the relevant tickets?\r\n\r\ncloses #1068 \r\n\r\n#### What's this PR do?\r\n\r\nThis refactors the `getPreferredName` function to be a little smarter. Basically, it now has the correct precedence for first names (`preferred_name > first_name > username`).\r\n\r\n#### Where should the reviewer start?\r\n\r\nRead over the changes!\r\n\r\n#### How should this be manually tested?\r\n\r\n1. go to `/profile`\r\n2. delete `preferred_name`, `first_name`, and `last_name` in the fields.\r\n3. you should see `Hello ${username}`\r\n4. add a first name\r\n5. you should see `Hello ${first_name}`\r\n6. add a last name\r\n7. you should see `Hello ${first_name} ${last_name}`\r\n8. add a preferred name\r\n9. you should see `Hello ${preferred_name}`\r\n\r\nI think that's it!\r\n\r\n#### Any background context you want to provide?\r\n\r\n#### Screenshots (if appropriate)\r\n\r\n![preferred](https://cloud.githubusercontent.com/assets/6207644/18928164/f85a0486-858c-11e6-80fc-e064c797a263.png)\r\n\r\n#### What GIF best describes this PR or how it makes you feel?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mitodl/micromasters/issues/comments/250481353","html_url":"https://github.com/mitodl/micromasters/pull/1156#issuecomment-250481353","issue_url":"https://api.github.com/repos/mitodl/micromasters/issues/1156","id":250481353,"user":{"login":"annagav","id":7574259,"avatar_url":"https://avatars.githubusercontent.com/u/7574259?v=3","gravatar_id":"","url":"https://api.github.com/users/annagav","html_url":"https://github.com/annagav","followers_url":"https://api.github.com/users/annagav/followers","following_url":"https://api.github.com/users/annagav/following{/other_user}","gists_url":"https://api.github.com/users/annagav/gists{/gist_id}","starred_url":"https://api.github.com/users/annagav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annagav/subscriptions","organizations_url":"https://api.github.com/users/annagav/orgs","repos_url":"https://api.github.com/users/annagav/repos","events_url":"https://api.github.com/users/annagav/events{/privacy}","received_events_url":"https://api.github.com/users/annagav/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T14:24:50Z","updated_at":"2016-09-29T14:24:50Z","body":"Let's leave it as it is. Functionality looks good!"}}
{"actor":{"display_login":"annagav"}}