{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/954","repository_url":"https://api.github.com/repos/DoSomething/phoenix-next","labels_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/954/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/954/comments","events_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/954/events","html_url":"https://github.com/DoSomething/phoenix-next/pull/954","id":329168714,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNDkyNDYy","number":954,"title":"Add Bertly shortened link to SocialDriveAction component","user":{"login":"mendelB","id":12417657,"node_id":"MDQ6VXNlcjEyNDE3NjU3","avatar_url":"https://avatars3.githubusercontent.com/u/12417657?v=4","gravatar_id":"","url":"https://api.github.com/users/mendelB","html_url":"https://github.com/mendelB","followers_url":"https://api.github.com/users/mendelB/followers","following_url":"https://api.github.com/users/mendelB/following{/other_user}","gists_url":"https://api.github.com/users/mendelB/gists{/gist_id}","starred_url":"https://api.github.com/users/mendelB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendelB/subscriptions","organizations_url":"https://api.github.com/users/mendelB/orgs","repos_url":"https://api.github.com/users/mendelB/repos","events_url":"https://api.github.com/users/mendelB/events{/privacy}","received_events_url":"https://api.github.com/users/mendelB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-04T18:35:36Z","updated_at":"2018-06-04T20:11:44Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/DoSomething/phoenix-next/pulls/954","html_url":"https://github.com/DoSomething/phoenix-next/pull/954","diff_url":"https://github.com/DoSomething/phoenix-next/pull/954.diff","patch_url":"https://github.com/DoSomething/phoenix-next/pull/954.patch"},"body":"## _PULL REQUEST OVERVIEW_\r\n\r\n### What does this PR do?\r\n\r\nThis PR adds an API call to the `SocialDriveAction` component to fetch a shortened Bertly link via our Phoenix Bertly proxy endpoint.\r\n\r\nWhat happens is we make the API call once the component mounts, and have all the buttons disabled until the state has it's `shortenedLink` property set (which happens as a callback once the API response is returned)\r\n\r\n**UPDATE** I snuck in some changes to the Facebook share link handler to use the more robust share action flow. (I know it's completely repetitive of the `ShareAction`. Hoping we can clean this up as we refactor. Ashley really wanted this in. #blameCanada)\r\n\r\n### Any background context you want to provide?\r\nI added a new `postRequest` method to the `/helpers/api` so that we can avoid setting the authentication headers and `PHOENIX_URL` and whatnot from the `socialDriveAction` component.\r\n\r\nI'm not sure that my `token` param approach was the right one for this method, but it seemed like an easy way to pass along the needed user token from state.\r\n\r\nI also did not add an error `catch` to the API call, since if it errors out it'll just stay in the 'disabled' state forever. (wasn't sure of a better way for now, but I'm sure we can tweak this as we continue fleshing this out)\r\n\r\nThe git diffs for the actual `render()` markup is all kaboodled and thus gonna be annoying to review. You can just look out for some `disabled` attributes on `button`s, a [utility class name](157741116) and the [link bar value](https://github.com/DoSomething/phoenix-next/pull/954/files#diff-6fa015ab9fa63a40da148508a9827503R68) being conditioned on the `shortenedLink` state property being 'truthy'.\r\n \r\n### What are the relevant tickets/cards?\r\n\r\nRefs [Pivotal ID #157741116](https://www.pivotaltracker.com/story/show/157741116)\r\n\r\n![jun-04-2018 14-31-31](https://user-images.githubusercontent.com/12417657/40934826-0e6c85e0-6804-11e8-90cc-02b9e96b5e8b.gif)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/comments/394483010","html_url":"https://github.com/DoSomething/phoenix-next/pull/954#issuecomment-394483010","issue_url":"https://api.github.com/repos/DoSomething/phoenix-next/issues/954","id":394483010,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDQ4MzAxMA==","user":{"login":"mendelB","id":12417657,"node_id":"MDQ6VXNlcjEyNDE3NjU3","avatar_url":"https://avatars3.githubusercontent.com/u/12417657?v=4","gravatar_id":"","url":"https://api.github.com/users/mendelB","html_url":"https://github.com/mendelB","followers_url":"https://api.github.com/users/mendelB/followers","following_url":"https://api.github.com/users/mendelB/following{/other_user}","gists_url":"https://api.github.com/users/mendelB/gists{/gist_id}","starred_url":"https://api.github.com/users/mendelB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendelB/subscriptions","organizations_url":"https://api.github.com/users/mendelB/orgs","repos_url":"https://api.github.com/users/mendelB/repos","events_url":"https://api.github.com/users/mendelB/events{/privacy}","received_events_url":"https://api.github.com/users/mendelB/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T20:11:44Z","updated_at":"2018-06-04T20:11:44Z","author_association":"CONTRIBUTOR","body":"\r\n**UPDATE** I snuck in some changes to the Facebook share link handler to use the more robust share action flow. (I know it's completely repetitive of the `ShareAction`. Hoping we can clean this up as we refactor. Ashley really wanted this in. #blameCanada)"}}
{"actor":{"display_login":"mendelB"}}