{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/125067289","pull_request_review_id":47423301,"id":125067289,"diff_hunk":"@@ -0,0 +1,182 @@\n+/**\n+ * External dependencies\n+ */\n+import React, { PropTypes, Component } from 'react';\n+import classnames from 'classnames';\n+import { connect } from 'react-redux';\n+import { find, findIndex, isEqual } from 'lodash';\n+import { translate, moment } from 'i18n-calypso';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import Table from 'woocommerce/components/table';\n+import TableRow from 'woocommerce/components/table/table-row';\n+import TableItem from 'woocommerce/components/table/table-item';\n+import Card from 'components/card';\n+import QuerySiteStats from 'components/data/query-site-stats';\n+import {\n+\tisRequestingSiteStatsForQuery,\n+\tgetSiteStatsNormalizedData\n+} from 'state/stats/lists/selectors';\n+import StatsModulePlaceholder from 'my-sites/stats/stats-module/placeholder';\n+import ErrorPanel from 'my-sites/stats/stats-error';\n+import Sparkline from '../../../components/sparkline';\n+import Delta from '../../../components/delta';\n+import { parseUnitPeriods } from 'state/stats/lists/utils';\n+\n+class StoreStatsWidgetList extends Component {\n+\n+\tstatic propTypes = {\n+\t\tdata: PropTypes.object.isRequired, // TODO refactor to array :(\n+\t\temptyMessage: PropTypes.string,\n+\t\tselectedDate: PropTypes.string.isRequired,\n+\t\tsiteId: PropTypes.number,\n+\t\tstatType: PropTypes.string,\n+\t\tquery: PropTypes.object.isRequired,\n+\t\twidgets: PropTypes.array.isRequired,\n+\t};\n+\n+\tstate = {\n+\t\tloaded: false\n+\t};\n+\n+\tcomponentWillReceiveProps( nextProps ) {\n+\t\tif ( ! nextProps.requesting && this.props.requesting ) {\n+\t\t\tthis.setState( { loaded: true } );\n+\t\t}\n+\t\tif ( ! isEqual( nextProps.query, this.props.query ) && this.state.loaded ) {\n+\t\t\tthis.setState( { loaded: false } );\n+\t\t}\n+\t}\n+\n+\tgetEndPeriod = ( date ) => {\n+\t\tconst { unit } = this.props.query;\n+\t\treturn ( unit === 'week' )\n+\t\t\t? moment( date ).endOf( 'isoWeek' ).format( 'YYYY-MM-DD' )\n+\t\t\t: moment( date ).endOf( unit ).format( 'YYYY-MM-DD' );\n+\t};\n+\n+\tgetDeltasBySelectedPeriod = () => {\n+\t\treturn find( this.props.data.deltas, ( item ) =>\n+\t\t\titem.period === this.props.selectedDate\n+\t\t);\n+\t};\n+\n+\tgetDeltaByStat = ( stat ) => {\n+\t\treturn this.getDeltasBySelectedPeriod()[ stat ];\n+\t};\n+\n+\tgetDeltaSincePeriod = () => {\n+\t\tconst delta = this.getDeltasBySelectedPeriod();\n+\t\treturn parseUnitPeriods( Object.keys( delta )[ 0 ].reference_period );\n+\t}\n+\n+\tgetSelectedIndex = ( data ) => {\n+\t\treturn findIndex( data, d => d.period === this.props.selectedDate );\n+\t};\n+\n+\trender() {\n+\t\tconst { selectedDate, siteId, statType, query, data, emptyMessage, widgets } = this.props;\n+\t\tconst selectedIndex = this.getSelectedIndex( data.data );\n+\t\tconst { loaded } = this.state;\n+\t\tconst isLoading = ! loaded && ! ( data && data.length );\n+\t\tconst hasEmptyData = loaded && data && data.length === 0;\n+\t\tlet values = [];\n+\t\tlet titles = null;\n+\t\tlet widgetData = null;\n+\t\tlet widgetList = null;\n+\n+\t\tif ( ! isLoading && ! hasEmptyData ) {\n+\t\t\tvalues = [\n+\t\t\t\t{\n+\t\t\t\t\tkey: 'title',\n+\t\t\t\t\tlabel: translate( 'Stat' )","path":"client/extensions/woocommerce/app/store-stats/store-stats-widget-list/index.js","position":94,"original_position":94,"commit_id":"e0e3d1829d8c8b1c76f7917645f370dc7ff3ebd8","original_commit_id":"e0e3d1829d8c8b1c76f7917645f370dc7ff3ebd8","user":{"login":"a8ci18n","id":25137612,"avatar_url":"https://avatars3.githubusercontent.com/u/25137612?v=3","gravatar_id":"","url":"https://api.github.com/users/a8ci18n","html_url":"https://github.com/a8ci18n","followers_url":"https://api.github.com/users/a8ci18n/followers","following_url":"https://api.github.com/users/a8ci18n/following{/other_user}","gists_url":"https://api.github.com/users/a8ci18n/gists{/gist_id}","starred_url":"https://api.github.com/users/a8ci18n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a8ci18n/subscriptions","organizations_url":"https://api.github.com/users/a8ci18n/orgs","repos_url":"https://api.github.com/users/a8ci18n/repos","events_url":"https://api.github.com/users/a8ci18n/events{/privacy}","received_events_url":"https://api.github.com/users/a8ci18n/received_events","type":"User","site_admin":false},"body":"Hi! I've found a possible matching string that has already been translated **78** times:\n`translate( 'Stats' )` *ES Score: 7*\n\nHelp me improve these suggestions: react with :thumbsdown: if the suggestion doesn't make any sense, or with :thumbsup: if it's a particularly good one (even if not implemented).","created_at":"2017-06-30T15:32:10Z","updated_at":"2017-06-30T15:32:10Z","html_url":"https://github.com/Automattic/wp-calypso/pull/15713#discussion_r125067289","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/125067289"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/15713#discussion_r125067289"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713","id":128349227,"html_url":"https://github.com/Automattic/wp-calypso/pull/15713","diff_url":"https://github.com/Automattic/wp-calypso/pull/15713.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/15713.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/15713","number":15713,"state":"open","locked":false,"title":"Store Stats in Calypso: sparkline widgets added","user":{"login":"greenafrican","id":1160732,"avatar_url":"https://avatars0.githubusercontent.com/u/1160732?v=3","gravatar_id":"","url":"https://api.github.com/users/greenafrican","html_url":"https://github.com/greenafrican","followers_url":"https://api.github.com/users/greenafrican/followers","following_url":"https://api.github.com/users/greenafrican/following{/other_user}","gists_url":"https://api.github.com/users/greenafrican/gists{/gist_id}","starred_url":"https://api.github.com/users/greenafrican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenafrican/subscriptions","organizations_url":"https://api.github.com/users/greenafrican/orgs","repos_url":"https://api.github.com/users/greenafrican/repos","events_url":"https://api.github.com/users/greenafrican/events{/privacy}","received_events_url":"https://api.github.com/users/greenafrican/received_events","type":"User","site_admin":false},"body":"Fixes #15536 \r\n\r\nDon't merge (testing speed issues)","created_at":"2017-06-30T11:21:45Z","updated_at":"2017-06-30T15:32:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cfbe964b0a3646cba1ee4576417b86babaf4117","assignee":{"login":"greenafrican","id":1160732,"avatar_url":"https://avatars0.githubusercontent.com/u/1160732?v=3","gravatar_id":"","url":"https://api.github.com/users/greenafrican","html_url":"https://github.com/greenafrican","followers_url":"https://api.github.com/users/greenafrican/followers","following_url":"https://api.github.com/users/greenafrican/following{/other_user}","gists_url":"https://api.github.com/users/greenafrican/gists{/gist_id}","starred_url":"https://api.github.com/users/greenafrican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenafrican/subscriptions","organizations_url":"https://api.github.com/users/greenafrican/orgs","repos_url":"https://api.github.com/users/greenafrican/repos","events_url":"https://api.github.com/users/greenafrican/events{/privacy}","received_events_url":"https://api.github.com/users/greenafrican/received_events","type":"User","site_admin":false},"assignees":[{"login":"greenafrican","id":1160732,"avatar_url":"https://avatars0.githubusercontent.com/u/1160732?v=3","gravatar_id":"","url":"https://api.github.com/users/greenafrican","html_url":"https://github.com/greenafrican","followers_url":"https://api.github.com/users/greenafrican/followers","following_url":"https://api.github.com/users/greenafrican/following{/other_user}","gists_url":"https://api.github.com/users/greenafrican/gists{/gist_id}","starred_url":"https://api.github.com/users/greenafrican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenafrican/subscriptions","organizations_url":"https://api.github.com/users/greenafrican/orgs","repos_url":"https://api.github.com/users/greenafrican/repos","events_url":"https://api.github.com/users/greenafrican/events{/privacy}","received_events_url":"https://api.github.com/users/greenafrican/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713/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/15713/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e0e3d1829d8c8b1c76f7917645f370dc7ff3ebd8","head":{"label":"Automattic:add/sparkline-widget-tables","ref":"add/sparkline-widget-tables","sha":"e0e3d1829d8c8b1c76f7917645f370dc7ff3ebd8","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.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://avatars2.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":"2017-06-30T08:47:06Z","pushed_at":"2017-06-30T15:31:25Z","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":67431,"stargazers_count":8880,"watchers_count":8880,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1174,"mirror_url":null,"open_issues_count":2123,"forks":1174,"open_issues":2123,"watchers":8880,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"0c0a8e063f31d25dc9ef84bc41654eaa76a17695","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.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://avatars2.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":"2017-06-30T08:47:06Z","pushed_at":"2017-06-30T15:31:25Z","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":67431,"stargazers_count":8880,"watchers_count":8880,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1174,"mirror_url":null,"open_issues_count":2123,"forks":1174,"open_issues":2123,"watchers":8880,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/15713"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/15713"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/15713/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/15713/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/15713/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e0e3d1829d8c8b1c76f7917645f370dc7ff3ebd8"}}}}
{"actor":{"display_login":"a8ci18n"}}