{"action":"created","comment":{"url":"https://api.github.com/repos/woocommerce/wc-admin/pulls/comments/214114810","pull_request_review_id":151100303,"id":214114810,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDExNDgxMA==","diff_hunk":"@@ -70,11 +72,20 @@ class RevenueReport extends Component {\n \n \t\t\tresponse.json().then( () => {\n \t\t\t\t// Ignore data, just use our fake data once we have a response\n-\t\t\t\tthis.setState( { stats: rawData } );\n+\t\t\t\tthis.setState( { stats: mockData } );\n \t\t\t} );\n \t\t} );\n \t}\n \n+\tonDownload( headers, rows, totals, query ) {\n+\t\treturn () => {","path":"client/analytics/report/revenue/index.js","position":43,"original_position":43,"commit_id":"c07b1a8f14e394824f17689b8ce8ee2660a647be","original_commit_id":"c07b1a8f14e394824f17689b8ce8ee2660a647be","user":{"login":"timmyc","id":22080,"node_id":"MDQ6VXNlcjIyMDgw","avatar_url":"https://avatars0.githubusercontent.com/u/22080?v=4","gravatar_id":"","url":"https://api.github.com/users/timmyc","html_url":"https://github.com/timmyc","followers_url":"https://api.github.com/users/timmyc/followers","following_url":"https://api.github.com/users/timmyc/following{/other_user}","gists_url":"https://api.github.com/users/timmyc/gists{/gist_id}","starred_url":"https://api.github.com/users/timmyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmyc/subscriptions","organizations_url":"https://api.github.com/users/timmyc/orgs","repos_url":"https://api.github.com/users/timmyc/repos","events_url":"https://api.github.com/users/timmyc/events{/privacy}","received_events_url":"https://api.github.com/users/timmyc/received_events","type":"User","site_admin":false},"body":"Should we add a `TODO` note here about implementing a \"full\" download solution if the data set is larger than what is contained in the client side data?","created_at":"2018-08-30T17:25:52Z","updated_at":"2018-08-30T17:38:19Z","html_url":"https://github.com/woocommerce/wc-admin/pull/326#discussion_r214114810","pull_request_url":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/woocommerce/wc-admin/pulls/comments/214114810"},"html":{"href":"https://github.com/woocommerce/wc-admin/pull/326#discussion_r214114810"},"pull_request":{"href":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326"}}},"pull_request":{"url":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326","id":211759794,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNzU5Nzk0","html_url":"https://github.com/woocommerce/wc-admin/pull/326","diff_url":"https://github.com/woocommerce/wc-admin/pull/326.diff","patch_url":"https://github.com/woocommerce/wc-admin/pull/326.patch","issue_url":"https://api.github.com/repos/woocommerce/wc-admin/issues/326","number":326,"state":"open","locked":false,"title":"Add CSV download to Revenue table","user":{"login":"Aljullu","id":3616980,"node_id":"MDQ6VXNlcjM2MTY5ODA=","avatar_url":"https://avatars3.githubusercontent.com/u/3616980?v=4","gravatar_id":"","url":"https://api.github.com/users/Aljullu","html_url":"https://github.com/Aljullu","followers_url":"https://api.github.com/users/Aljullu/followers","following_url":"https://api.github.com/users/Aljullu/following{/other_user}","gists_url":"https://api.github.com/users/Aljullu/gists{/gist_id}","starred_url":"https://api.github.com/users/Aljullu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aljullu/subscriptions","organizations_url":"https://api.github.com/users/Aljullu/orgs","repos_url":"https://api.github.com/users/Aljullu/repos","events_url":"https://api.github.com/users/Aljullu/events{/privacy}","received_events_url":"https://api.github.com/users/Aljullu/received_events","type":"User","site_admin":false},"body":"Adds the option to download table contents as a CSV file.\r\n\r\n![image](https://user-images.githubusercontent.com/3616980/44790412-91db0580-ab9f-11e8-99a8-a4ad9ce8ae6f.png)\r\n\r\n**Steps to test**\r\n\r\n- Run `npm test` to verify tests are passing.\r\n- Once #316 is merged, the 'steps to test' from that PR will have to be followed as well. Currently, the revenue table is populated with mock data so it can be skipped.\r\n- Go to the _Revenue_ tab under _Analytics_.\r\n- Press _Download_ and verify that a CSV file is downloaded to the browser and its contents match the table. Also verify the file name looks like `revenue-2018-08-30.csv`.\r\n\r\nThere might be some small conflicts with #316, basically because I'm reusing (and moving) the mock data file while the other PR deletes it.\r\n\r\n**Notes**\r\n- A new dependency is added: `browser-filesaver`.\r\n- This PR implements the button for the _Revenue_ table, only. It can be easily implemented in other tables with the utils in `lib/csv`.","created_at":"2018-08-29T13:47:24Z","updated_at":"2018-08-30T17:38:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaddf248127a8209aff4e30fd21710ca8ceea2e9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":921901163,"node_id":"MDU6TGFiZWw5MjE5MDExNjM=","url":"https://api.github.com/repos/woocommerce/wc-admin/labels/Analytics","name":"Analytics","color":"80f7d3","default":false},{"id":921782814,"node_id":"MDU6TGFiZWw5MjE3ODI4MTQ=","url":"https://api.github.com/repos/woocommerce/wc-admin/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false},{"id":921891130,"node_id":"MDU6TGFiZWw5MjE4OTExMzA=","url":"https://api.github.com/repos/woocommerce/wc-admin/labels/[Tests]%20Includes%20Tests","name":"[Tests] Includes Tests","color":"5ae8a3","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326/commits","review_comments_url":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326/comments","review_comment_url":"https://api.github.com/repos/woocommerce/wc-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/woocommerce/wc-admin/issues/326/comments","statuses_url":"https://api.github.com/repos/woocommerce/wc-admin/statuses/c07b1a8f14e394824f17689b8ce8ee2660a647be","head":{"label":"woocommerce:add/table-csv-download","ref":"add/table-csv-download","sha":"c07b1a8f14e394824f17689b8ce8ee2660a647be","user":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":128732084,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg3MzIwODQ=","name":"wc-admin","full_name":"woocommerce/wc-admin","owner":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/woocommerce/wc-admin","description":null,"fork":false,"url":"https://api.github.com/repos/woocommerce/wc-admin","forks_url":"https://api.github.com/repos/woocommerce/wc-admin/forks","keys_url":"https://api.github.com/repos/woocommerce/wc-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woocommerce/wc-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woocommerce/wc-admin/teams","hooks_url":"https://api.github.com/repos/woocommerce/wc-admin/hooks","issue_events_url":"https://api.github.com/repos/woocommerce/wc-admin/issues/events{/number}","events_url":"https://api.github.com/repos/woocommerce/wc-admin/events","assignees_url":"https://api.github.com/repos/woocommerce/wc-admin/assignees{/user}","branches_url":"https://api.github.com/repos/woocommerce/wc-admin/branches{/branch}","tags_url":"https://api.github.com/repos/woocommerce/wc-admin/tags","blobs_url":"https://api.github.com/repos/woocommerce/wc-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woocommerce/wc-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woocommerce/wc-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/woocommerce/wc-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woocommerce/wc-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/woocommerce/wc-admin/languages","stargazers_url":"https://api.github.com/repos/woocommerce/wc-admin/stargazers","contributors_url":"https://api.github.com/repos/woocommerce/wc-admin/contributors","subscribers_url":"https://api.github.com/repos/woocommerce/wc-admin/subscribers","subscription_url":"https://api.github.com/repos/woocommerce/wc-admin/subscription","commits_url":"https://api.github.com/repos/woocommerce/wc-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/woocommerce/wc-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/woocommerce/wc-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/woocommerce/wc-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/woocommerce/wc-admin/contents/{+path}","compare_url":"https://api.github.com/repos/woocommerce/wc-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woocommerce/wc-admin/merges","archive_url":"https://api.github.com/repos/woocommerce/wc-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woocommerce/wc-admin/downloads","issues_url":"https://api.github.com/repos/woocommerce/wc-admin/issues{/number}","pulls_url":"https://api.github.com/repos/woocommerce/wc-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/woocommerce/wc-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/woocommerce/wc-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woocommerce/wc-admin/labels{/name}","releases_url":"https://api.github.com/repos/woocommerce/wc-admin/releases{/id}","deployments_url":"https://api.github.com/repos/woocommerce/wc-admin/deployments","created_at":"2018-04-09T07:29:35Z","updated_at":"2018-08-29T23:52:02Z","pushed_at":"2018-08-30T16:10:04Z","git_url":"git://github.com/woocommerce/wc-admin.git","ssh_url":"git@github.com:woocommerce/wc-admin.git","clone_url":"https://github.com/woocommerce/wc-admin.git","svn_url":"https://github.com/woocommerce/wc-admin","homepage":null,"size":1818,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":76,"license":null,"forks":0,"open_issues":76,"watchers":11,"default_branch":"master"}},"base":{"label":"woocommerce:master","ref":"master","sha":"3fcf86839650d5831247c03d21ff2cc1baaabf4d","user":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":128732084,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg3MzIwODQ=","name":"wc-admin","full_name":"woocommerce/wc-admin","owner":{"login":"woocommerce","id":473596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/473596?v=4","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/woocommerce/wc-admin","description":null,"fork":false,"url":"https://api.github.com/repos/woocommerce/wc-admin","forks_url":"https://api.github.com/repos/woocommerce/wc-admin/forks","keys_url":"https://api.github.com/repos/woocommerce/wc-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woocommerce/wc-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woocommerce/wc-admin/teams","hooks_url":"https://api.github.com/repos/woocommerce/wc-admin/hooks","issue_events_url":"https://api.github.com/repos/woocommerce/wc-admin/issues/events{/number}","events_url":"https://api.github.com/repos/woocommerce/wc-admin/events","assignees_url":"https://api.github.com/repos/woocommerce/wc-admin/assignees{/user}","branches_url":"https://api.github.com/repos/woocommerce/wc-admin/branches{/branch}","tags_url":"https://api.github.com/repos/woocommerce/wc-admin/tags","blobs_url":"https://api.github.com/repos/woocommerce/wc-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woocommerce/wc-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woocommerce/wc-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/woocommerce/wc-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woocommerce/wc-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/woocommerce/wc-admin/languages","stargazers_url":"https://api.github.com/repos/woocommerce/wc-admin/stargazers","contributors_url":"https://api.github.com/repos/woocommerce/wc-admin/contributors","subscribers_url":"https://api.github.com/repos/woocommerce/wc-admin/subscribers","subscription_url":"https://api.github.com/repos/woocommerce/wc-admin/subscription","commits_url":"https://api.github.com/repos/woocommerce/wc-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/woocommerce/wc-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/woocommerce/wc-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/woocommerce/wc-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/woocommerce/wc-admin/contents/{+path}","compare_url":"https://api.github.com/repos/woocommerce/wc-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woocommerce/wc-admin/merges","archive_url":"https://api.github.com/repos/woocommerce/wc-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woocommerce/wc-admin/downloads","issues_url":"https://api.github.com/repos/woocommerce/wc-admin/issues{/number}","pulls_url":"https://api.github.com/repos/woocommerce/wc-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/woocommerce/wc-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/woocommerce/wc-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woocommerce/wc-admin/labels{/name}","releases_url":"https://api.github.com/repos/woocommerce/wc-admin/releases{/id}","deployments_url":"https://api.github.com/repos/woocommerce/wc-admin/deployments","created_at":"2018-04-09T07:29:35Z","updated_at":"2018-08-29T23:52:02Z","pushed_at":"2018-08-30T16:10:04Z","git_url":"git://github.com/woocommerce/wc-admin.git","ssh_url":"git@github.com:woocommerce/wc-admin.git","clone_url":"https://github.com/woocommerce/wc-admin.git","svn_url":"https://github.com/woocommerce/wc-admin","homepage":null,"size":1818,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":76,"license":null,"forks":0,"open_issues":76,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326"},"html":{"href":"https://github.com/woocommerce/wc-admin/pull/326"},"issue":{"href":"https://api.github.com/repos/woocommerce/wc-admin/issues/326"},"comments":{"href":"https://api.github.com/repos/woocommerce/wc-admin/issues/326/comments"},"review_comments":{"href":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326/comments"},"review_comment":{"href":"https://api.github.com/repos/woocommerce/wc-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/woocommerce/wc-admin/pulls/326/commits"},"statuses":{"href":"https://api.github.com/repos/woocommerce/wc-admin/statuses/c07b1a8f14e394824f17689b8ce8ee2660a647be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"timmyc"}}