{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/jetpack/issues/10758","repository_url":"https://api.github.com/repos/Automattic/jetpack","labels_url":"https://api.github.com/repos/Automattic/jetpack/issues/10758/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/10758/comments","events_url":"https://api.github.com/repos/Automattic/jetpack/issues/10758/events","html_url":"https://github.com/Automattic/jetpack/pull/10758","id":386320053,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MDkyMDE3","number":10758,"title":"Admin: introduce affiliate code in upgrade links in admin UI","user":{"login":"eliorivero","id":1041600,"node_id":"MDQ6VXNlcjEwNDE2MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1041600?v=4","gravatar_id":"","url":"https://api.github.com/users/eliorivero","html_url":"https://github.com/eliorivero","followers_url":"https://api.github.com/users/eliorivero/followers","following_url":"https://api.github.com/users/eliorivero/following{/other_user}","gists_url":"https://api.github.com/users/eliorivero/gists{/gist_id}","starred_url":"https://api.github.com/users/eliorivero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliorivero/subscriptions","organizations_url":"https://api.github.com/users/eliorivero/orgs","repos_url":"https://api.github.com/users/eliorivero/repos","events_url":"https://api.github.com/users/eliorivero/events{/privacy}","received_events_url":"https://api.github.com/users/eliorivero/received_events","type":"User","site_admin":false},"labels":[{"id":377383130,"node_id":"MDU6TGFiZWwzNzczODMxMzA=","url":"https://api.github.com/repos/Automattic/jetpack/labels/Admin%20Page","name":"Admin Page","color":"006b75","default":false},{"id":136599217,"node_id":"MDU6TGFiZWwxMzY1OTkyMTc=","url":"https://api.github.com/repos/Automattic/jetpack/labels/[Status]%20In%20Progress","name":"[Status] In Progress","color":"ededed","default":false},{"id":70896534,"node_id":"MDU6TGFiZWw3MDg5NjUzNA==","url":"https://api.github.com/repos/Automattic/jetpack/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"eliorivero","id":1041600,"node_id":"MDQ6VXNlcjEwNDE2MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1041600?v=4","gravatar_id":"","url":"https://api.github.com/users/eliorivero","html_url":"https://github.com/eliorivero","followers_url":"https://api.github.com/users/eliorivero/followers","following_url":"https://api.github.com/users/eliorivero/following{/other_user}","gists_url":"https://api.github.com/users/eliorivero/gists{/gist_id}","starred_url":"https://api.github.com/users/eliorivero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliorivero/subscriptions","organizations_url":"https://api.github.com/users/eliorivero/orgs","repos_url":"https://api.github.com/users/eliorivero/repos","events_url":"https://api.github.com/users/eliorivero/events{/privacy}","received_events_url":"https://api.github.com/users/eliorivero/received_events","type":"User","site_admin":false},"assignees":[{"login":"eliorivero","id":1041600,"node_id":"MDQ6VXNlcjEwNDE2MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1041600?v=4","gravatar_id":"","url":"https://api.github.com/users/eliorivero","html_url":"https://github.com/eliorivero","followers_url":"https://api.github.com/users/eliorivero/followers","following_url":"https://api.github.com/users/eliorivero/following{/other_user}","gists_url":"https://api.github.com/users/eliorivero/gists{/gist_id}","starred_url":"https://api.github.com/users/eliorivero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliorivero/subscriptions","organizations_url":"https://api.github.com/users/eliorivero/orgs","repos_url":"https://api.github.com/users/eliorivero/repos","events_url":"https://api.github.com/users/eliorivero/events{/privacy}","received_events_url":"https://api.github.com/users/eliorivero/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-11-30T19:30:53Z","updated_at":"2018-12-01T00:17:26Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/10758","html_url":"https://github.com/Automattic/jetpack/pull/10758","diff_url":"https://github.com/Automattic/jetpack/pull/10758.diff","patch_url":"https://github.com/Automattic/jetpack/pull/10758.patch"},"body":"== IN PROGRESS ==\r\n\r\nThis PR updates the upgrade links in admin UI like inline text links, Upgrade badges in AAG, or Upgrade buttons in banners to include, if it exists, an affiliate code.\r\n\r\n#### Changes proposed in this Pull Request:\r\n<!--- Explain what functional changes your PR includes -->\r\n\r\nThis PR introduces a new component UpgradeLink which is used to create a link so user can jump to Calypso and acquire an upgrade through the purchase of a Jetpack plan. The link will open Calypso in a new tab.\r\n\r\nThe component only needs the source where this link was clicked, for tracking purposes. It will compose the URL and append the source parameter and the site raw URL on its own. If an affiliate link exists, it will be also append to the link.\r\n\r\nIt also introduces a function to create a URL for certain cases where the string must be passed, and now the complete `<a>` element.\r\n\r\n\r\n#### Testing instructions:\r\n<!-- Please include detailed testing steps, explaining how to test your change. -->\r\n<!-- Bear in mind that context you working on is not obvious for everyone.  -->\r\n<!-- Adding \"simple\" configuration steps will help reviewers to get to your PR as quickly as possible. -->\r\n<!-- \"Before / After\" screenshots can also be very helpful when the change is visual. -->\r\n\r\n* Create an affiliate code with `wp option add jetpack_affiliate_code abc123`\r\n* Go to Jetpack UI and ensure calls to upgrade have the affiliate code as the `aff` parameter.\r\n\r\n#### Proposed changelog entry for your changes:\r\n* No necessary to log this change since those that need to know about it will be notified.\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/jetpack/issues/comments/443378788","html_url":"https://github.com/Automattic/jetpack/pull/10758#issuecomment-443378788","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/10758","id":443378788,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzM3ODc4OA==","user":{"login":"oskosk","id":746152,"node_id":"MDQ6VXNlcjc0NjE1Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/746152?v=4","gravatar_id":"","url":"https://api.github.com/users/oskosk","html_url":"https://github.com/oskosk","followers_url":"https://api.github.com/users/oskosk/followers","following_url":"https://api.github.com/users/oskosk/following{/other_user}","gists_url":"https://api.github.com/users/oskosk/gists{/gist_id}","starred_url":"https://api.github.com/users/oskosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskosk/subscriptions","organizations_url":"https://api.github.com/users/oskosk/orgs","repos_url":"https://api.github.com/users/oskosk/repos","events_url":"https://api.github.com/users/oskosk/events{/privacy}","received_events_url":"https://api.github.com/users/oskosk/received_events","type":"User","site_admin":false},"created_at":"2018-12-01T00:17:26Z","updated_at":"2018-12-01T00:17:26Z","author_association":"CONTRIBUTOR","body":"@elio after reviewing the code, and after the chat in slack about this, I added a commit moving `getUpgradeUrl` to the selectors file for initial state. The commit does the following:\r\n\r\n* Move getUpgradeUrl to initial state selectors file (state/initial-state/reducer)\r\n* Removes buildUpgradeUrl, and moves its functionality into the getUpgradeUrl selector\r\n* Updates ugprade-link to build the generic upgrade link in mapStateToProps\r\n* Updates settings-cards, to buld the video premium upgrade link in mapStateToProps\r\n\r\nPlease feel free to remove it if it's not what you expected\r\n"}}
{"actor":{"display_login":"oskosk"}}