{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/50159157","id":50159157,"diff_hunk":"@@ -1,5 +1,127 @@\n+/**\n+ * Internal dependencies\n+ */\n+import i18n from 'lib/mixins/i18n';\n+\n+import moment from 'moment';\n+\n import { States } from './constants.js';\n \n+function mapOptions( state, section, name, mapFunc ) {\n+\tconst rawData = state.siteSettings.exporter.data.get( 'advancedSettings' );\n+\tif ( !rawData || rawData.count() === 0 ) return [];\n+\n+\treturn rawData.get( section ).get( name ).map( mapFunc );","path":"client/state/site-settings/exporter/selectors.js","position":14,"original_position":14,"commit_id":"4c985d0a54b7d416a10ea5b9290af531160b426d","original_commit_id":"4c985d0a54b7d416a10ea5b9290af531160b426d","user":{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars.githubusercontent.com/u/5431237?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsnell","html_url":"https://github.com/dmsnell","followers_url":"https://api.github.com/users/dmsnell/followers","following_url":"https://api.github.com/users/dmsnell/following{/other_user}","gists_url":"https://api.github.com/users/dmsnell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsnell/subscriptions","organizations_url":"https://api.github.com/users/dmsnell/orgs","repos_url":"https://api.github.com/users/dmsnell/repos","events_url":"https://api.github.com/users/dmsnell/events{/privacy}","received_events_url":"https://api.github.com/users/dmsnell/received_events","type":"User","site_admin":false},"body":"Is this all `Immutable.js` data? If so, we can use `getIn()` to nest downwards\r\n\r\n```js\r\nreturn rawData.getIn( [ section, name ] ).map( mapFunc );\r\n```","created_at":"2016-01-19T19:14:28Z","updated_at":"2016-01-19T19:14:28Z","html_url":"https://github.com/Automattic/wp-calypso/pull/1359#discussion_r50159157","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/50159157"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/1359#discussion_r50159157"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359","id":52954397,"html_url":"https://github.com/Automattic/wp-calypso/pull/1359","diff_url":"https://github.com/Automattic/wp-calypso/pull/1359.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/1359.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1359","number":1359,"state":"open","locked":false,"title":"Exporter: WP.com API integration","user":{"login":"jordwest","id":416133,"avatar_url":"https://avatars.githubusercontent.com/u/416133?v=3","gravatar_id":"","url":"https://api.github.com/users/jordwest","html_url":"https://github.com/jordwest","followers_url":"https://api.github.com/users/jordwest/followers","following_url":"https://api.github.com/users/jordwest/following{/other_user}","gists_url":"https://api.github.com/users/jordwest/gists{/gist_id}","starred_url":"https://api.github.com/users/jordwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordwest/subscriptions","organizations_url":"https://api.github.com/users/jordwest/orgs","repos_url":"https://api.github.com/users/jordwest/repos","events_url":"https://api.github.com/users/jordwest/events{/privacy}","received_events_url":"https://api.github.com/users/jordwest/received_events","type":"User","site_admin":false},"body":"~~Awaiting #500 => #1126~~\r\n\r\nThis change completes the exporter, adding the API calls to communicate with wp.com\r\n\r\n![export](https://cloud.githubusercontent.com/assets/416133/12288452/56373daa-ba20-11e5-94e3-11f13c1993e5.png)\r\n\r\n#### How to test\r\n\r\n**Export All**\r\n1. Go to http://calypso.localhost:3000/settings/export and select a site.\r\n2. Click the **Export All** button.\r\n3. A notice should appear with a link to download the export file. You should also receive an email with a link.\r\n\r\n**Export Specific Content**\r\n1. Go to http://calypso.localhost:3000/settings/export and select a site.\r\n2. Click the gear icon.\r\n3. Select Posts, Pages, or Feedback and change some of the settings under that section.\r\n4. Click the **Export Selected Content** button.\r\n5. A notice should appear with a link to download the export file. You should also receive an email with a link.\r\n\r\n**Jetpack sites**\r\nJetpack sites still display the export interface, but should instead show a message with a button link to wp-admin. Since export is still behind a feature flag, this will be covered in #77 under a separate PR.\r\n\r\n**Mobile**\r\nIf you are set up with a local dev proxy, please try it out on mobile. It would be good to get an idea of the flow on Android. I've tested on iOS 9:\r\n![export_mobile_flow](https://cloud.githubusercontent.com/assets/416133/12288388/ce512cac-ba1f-11e5-8f85-a4973dd164d0.gif)\r\n\r\n#### Todo\r\n - [x] Rebase (various changes to Redux and prior PRs)\r\n - [x] Use the site ID from the Redux store instead of passing the `site` prop to the `Exporter` component\r\n - [x] Now that we only allow a single post type to be selected (Post, Page, or Feedback), the API calls need to be constructed from the state differently (modify `prepareExportRequest( ... )` in state/site-settings/exporter/selectors.js)\r\n - [x] Be more specific with the start and end dates passed to the API. Instead of sending '2011-05' for the end date, send '2011-05-31'\r\n - [x] Display loading placeholders instead of the dropdowns while the available advanced settings are being fetched:\r\n<img width=\"807\" alt=\"screen shot 2015-12-17 at 11 13 00 am\" src=\"https://cloud.githubusercontent.com/assets/416133/11867130/70114bc0-a4af-11e5-99fe-7aaeaa36588b.png\">","created_at":"2015-12-08T09:06:44Z","updated_at":"2016-01-19T19:14:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"791625e049a180d1a2a3c3d1cfaf88b716711f67","assignee":{"login":"jordwest","id":416133,"avatar_url":"https://avatars.githubusercontent.com/u/416133?v=3","gravatar_id":"","url":"https://api.github.com/users/jordwest","html_url":"https://github.com/jordwest","followers_url":"https://api.github.com/users/jordwest/followers","following_url":"https://api.github.com/users/jordwest/following{/other_user}","gists_url":"https://api.github.com/users/jordwest/gists{/gist_id}","starred_url":"https://api.github.com/users/jordwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordwest/subscriptions","organizations_url":"https://api.github.com/users/jordwest/orgs","repos_url":"https://api.github.com/users/jordwest/repos","events_url":"https://api.github.com/users/jordwest/events{/privacy}","received_events_url":"https://api.github.com/users/jordwest/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/5","html_url":"https://github.com/Automattic/wp-calypso/milestones/Export:%20First%20Release","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/5/labels","id":1417721,"number":5,"title":"Export: First Release","description":null,"creator":{"login":"rachelmcr","id":8658164,"avatar_url":"https://avatars.githubusercontent.com/u/8658164?v=3","gravatar_id":"","url":"https://api.github.com/users/rachelmcr","html_url":"https://github.com/rachelmcr","followers_url":"https://api.github.com/users/rachelmcr/followers","following_url":"https://api.github.com/users/rachelmcr/following{/other_user}","gists_url":"https://api.github.com/users/rachelmcr/gists{/gist_id}","starred_url":"https://api.github.com/users/rachelmcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachelmcr/subscriptions","organizations_url":"https://api.github.com/users/rachelmcr/orgs","repos_url":"https://api.github.com/users/rachelmcr/repos","events_url":"https://api.github.com/users/rachelmcr/events{/privacy}","received_events_url":"https://api.github.com/users/rachelmcr/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":5,"state":"open","created_at":"2015-11-18T12:12:03Z","updated_at":"2016-01-16T03:40:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359/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/1359/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/4c985d0a54b7d416a10ea5b9290af531160b426d","head":{"label":"Automattic:add/exporter-api-calls","ref":"add/exporter-api-calls","sha":"4c985d0a54b7d416a10ea5b9290af531160b426d","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}","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-01-19T19:02:25Z","pushed_at":"2016-01-19T19:09:02Z","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":32269,"stargazers_count":6606,"watchers_count":6606,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":740,"mirror_url":null,"open_issues_count":1154,"forks":740,"open_issues":1154,"watchers":6606,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"f1d5eb3fff3d90885c72415899c3e17dc820387e","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}","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-01-19T19:02:25Z","pushed_at":"2016-01-19T19:09:02Z","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":32269,"stargazers_count":6606,"watchers_count":6606,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":740,"mirror_url":null,"open_issues_count":1154,"forks":740,"open_issues":1154,"watchers":6606,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/1359"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/1359"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/1359/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1359/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/1359/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/4c985d0a54b7d416a10ea5b9290af531160b426d"}}}}