{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/89242832","pull_request_review_id":9790227,"id":89242832,"diff_hunk":"@@ -2,34 +2,39 @@\n  * External dependencies\n  */\n import React from 'react';\n+import { connect } from 'react-redux';\n+import page from 'page';\n import i18n from 'i18n-calypso';\n \n /**\n  * Internal dependencies\n  */\n-import { addCurrentPlanToCartAndRedirect, getCurrentPlan, getDayOfTrial } from 'lib/plans';\n+import { cartItems } from 'lib/cart-values';\n+import { getDayOfTrial } from 'lib/plans';\n+import { addItem } from 'lib/upgrades/actions';\n import Notice from 'components/notice';\n+import { getSelectedSiteId } from 'state/ui/selectors';\n+import { getSiteSlug } from 'state/sites/selectors';\n+import { getCurrentPlan, isRequestingSitePlans } from 'state/sites/plans/selectors';\n \n const FreeTrialNotice = React.createClass( {\n \tpropTypes: {\n \t\tcart: React.PropTypes.object.isRequired,\n-\t\tsitePlans: React.PropTypes.object.isRequired,\n-\t\tselectedSite: React.PropTypes.oneOfType( [\n-\t\t\tReact.PropTypes.object,\n-\t\t\tReact.PropTypes.bool\n-\t\t] ).isRequired\n+\t\t// connected props\n+\t\tcurrentPlan: React.PropTypes.object,\n+\t\tisRequestingSitePlans: React.PropTypes.bool,\n+\t\tselectedSiteSlug: React.PropTypes.string\n \t},\n \n \taddPlanAndRedirect( event ) {\n \t\tevent.preventDefault();\n-\n-\t\taddCurrentPlanToCartAndRedirect( this.props.sitePlans, this.props.selectedSite );\n+\t\taddItem( cartItems.planItem( this.props.currentPlan.productSlug ) );\n+\t\tpage( `/checkout/${ this.props.selectedSiteSlug }` );\n \t},\n \n \trender() {\n-\t\tconst { cart, sitePlans } = this.props,\n-\t\t\tisDataLoading = ! cart.hasLoadedFromServer || ! sitePlans.hasLoadedFromServer,\n-\t\t\tcurrentPlan = getCurrentPlan( sitePlans.data );\n+\t\tconst { cart, currentPlan, isRequestingSitePlans: isRequestingPlans } = this.props,\n+\t\t\tisDataLoading = isRequestingPlans || ! cart.hasLoadedFromServer;\n \n \t\tif ( isDataLoading || ! currentPlan.freeTrial ) {","path":"client/my-sites/upgrades/domain-search/free-trial-notice.jsx","position":49,"original_position":49,"commit_id":"e16d94947594b6cf6882e445d53631085a710821","original_commit_id":"e16d94947594b6cf6882e445d53631085a710821","user":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"body":"We'll likely need a to add a `\t<QuerySitePlans siteId={ siteId } />` note that this should be rendered before any loading checks do an early return.\r\n","created_at":"2016-11-23T01:03:55Z","updated_at":"2016-11-23T01:03:55Z","html_url":"https://github.com/Automattic/wp-calypso/pull/9593#discussion_r89242832","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/89242832"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/9593#discussion_r89242832"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593","id":94922801,"html_url":"https://github.com/Automattic/wp-calypso/pull/9593","diff_url":"https://github.com/Automattic/wp-calypso/pull/9593.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/9593.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9593","number":9593,"state":"open","locked":false,"title":"lib/plans: Drop getCurrentPlan() and addCurrentPlanToCartAndRedirect()","user":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"body":"Have consumers use getCurrentPlan() selector instead, and inline addCurrentPlanToCartAndRedirect().\r\n\r\nTo test: Make sure that Calypso still works, in particular:\r\n* The 'Free Trial Notice' -- visible in domain search\r\n* The 'Cart Trial Ad' -- visible in the Popover cart during the trial period of a plan\r\n\r\nIdeally someone familiar with plans related components should review this. cc'ing @gwwar since you filed #8715.\r\n\r\nFixes #8715","created_at":"2016-11-22T23:58:02Z","updated_at":"2016-11-23T01:03:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c856e0ecad0b344b6b42c743290b2cfa9d94170f","assignee":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"assignees":[{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/9593/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e16d94947594b6cf6882e445d53631085a710821","head":{"label":"Automattic:remove/lib-plans-get-current-plan","ref":"remove/lib-plans-get-current-plan","sha":"e16d94947594b6cf6882e445d53631085a710821","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-11-22T19:05:44Z","pushed_at":"2016-11-23T00:36:12Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":152765,"stargazers_count":8100,"watchers_count":8100,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1023,"mirror_url":null,"open_issues_count":1554,"forks":1023,"open_issues":1554,"watchers":8100,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"a3c8569b5f4d524c9a96e5b945cc1d81db663599","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-11-22T19:05:44Z","pushed_at":"2016-11-23T00:36:12Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":152765,"stargazers_count":8100,"watchers_count":8100,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1023,"mirror_url":null,"open_issues_count":1554,"forks":1023,"open_issues":1554,"watchers":8100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/9593"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/9593"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/9593/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/9593/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e16d94947594b6cf6882e445d53631085a710821"}}}}
{"actor":{"display_login":"gwwar"}}