{"action":"created","comment":{"url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/comments/92703141","pull_request_review_id":13224103,"id":92703141,"diff_hunk":"@@ -0,0 +1,68 @@\n+import React from 'react';\n+\n+const MAX_THUMBNAIL_DIMENSION = 999;\n+\n+export default class Thumbnail extends React.Component {\n+  constructor(props) {\n+    super(props);\n+\n+    this.state = {\n+      failed: false,\n+    };\n+  }\n+\n+  getThumbnailSrc({ origin, width, height, src }) {\n+    const srcPath = src.split('//').pop();\n+    return (`${origin}/${width}x${height}/${srcPath}`);\n+  }\n+\n+  handleError() {\n+    if (!this.state.failed) {\n+      this.setState({ failed: true });\n+    }\n+  }\n+\n+  render() {\n+    const src = this.state.failed ? this.props.src : this.getThumbnailSrc(this.props);\n+\n+    const dimensions = {\n+      width: null,\n+      height: null,\n+    };\n+\n+    const style = {\n+      maxWidth: this.props.width,\n+      maxHeight: this.props.height,\n+    };\n+\n+    if (this.props.format === 'mp4') {\n+      return (\n+        <div>\n+          <video width=\"300\" controls>\n+            <source src={this.props.src} type=\"video/mp4\" />\n+           </video>\n+        </div>\n+      );\n+    }\n+\n+    return (\n+      <img alt=\"\" {...this.props} src={src} {...dimensions} style={style} onError={this.handleError} />","path":"app/components/thumbnail.jsx","position":49,"original_position":49,"commit_id":"de9cf9d37447892a2ed9bf6d0272deac1f12ff53","original_commit_id":"de9cf9d37447892a2ed9bf6d0272deac1f12ff53","user":{"login":"mcbouslog","id":12118751,"avatar_url":"https://avatars.githubusercontent.com/u/12118751?v=3","gravatar_id":"","url":"https://api.github.com/users/mcbouslog","html_url":"https://github.com/mcbouslog","followers_url":"https://api.github.com/users/mcbouslog/followers","following_url":"https://api.github.com/users/mcbouslog/following{/other_user}","gists_url":"https://api.github.com/users/mcbouslog/gists{/gist_id}","starred_url":"https://api.github.com/users/mcbouslog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcbouslog/subscriptions","organizations_url":"https://api.github.com/users/mcbouslog/orgs","repos_url":"https://api.github.com/users/mcbouslog/repos","events_url":"https://api.github.com/users/mcbouslog/events{/privacy}","received_events_url":"https://api.github.com/users/mcbouslog/received_events","type":"User","site_admin":false},"body":"more for my understanding than a review note, what does destructuring `...this.props` give the `img` component we're not already setting individually? or more likely I'm misreading.","created_at":"2016-12-15T21:26:15Z","updated_at":"2016-12-15T22:01:28Z","html_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3330#discussion_r92703141","pull_request_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330","_links":{"self":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/comments/92703141"},"html":{"href":"https://github.com/zooniverse/Panoptes-Front-End/pull/3330#discussion_r92703141"},"pull_request":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330"}}},"pull_request":{"url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330","id":97815659,"html_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3330","diff_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3330.diff","patch_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3330.patch","issue_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3330","number":3330,"state":"open","locked":false,"title":"Refactor media area to ES6. Remove promise renderer","user":{"login":"srallen","id":5016731,"avatar_url":"https://avatars.githubusercontent.com/u/5016731?v=3","gravatar_id":"","url":"https://api.github.com/users/srallen","html_url":"https://github.com/srallen","followers_url":"https://api.github.com/users/srallen/followers","following_url":"https://api.github.com/users/srallen/following{/other_user}","gists_url":"https://api.github.com/users/srallen/gists{/gist_id}","starred_url":"https://api.github.com/users/srallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srallen/subscriptions","organizations_url":"https://api.github.com/users/srallen/orgs","repos_url":"https://api.github.com/users/srallen/repos","events_url":"https://api.github.com/users/srallen/events{/privacy}","received_events_url":"https://api.github.com/users/srallen/received_events","type":"User","site_admin":false},"body":"For #3216, refactors the `media-area.cjsx` into ES6 and removes the `PromiseRenderer`. Since this file was technically a set of components, I broke them out, created a \"controller\" component to handle the data and a separate view component as its child. I also moved it into the lab folder since it is used by the `EditMediaPage` component and the survey task editor. `Thumbnail` remains in the components folder since it is used by talk.\r\n\r\nThis could use some tests, but I'd like to do that separately since this is already touching so many files. If you'd prefer tests coming in with this though, I can do that.\r\n\r\nStaged at https://refactor-media-area.pfe-preview.zooniverse.org/\r\n\r\n# Review Checklist\r\n\r\n- [ ] Does it work in all major browsers: Firefox, Chrome, Edge, Safari?\r\n- [ ] Does it work on mobile?\r\n- [ ] Can you `rm -rf node_modules/ && npm install` and app works as expected?\r\n- [x] Did you deploy a staging branch?\r\n- [ ] Did you get any type checking errors from [Babel Typecheck](https://github.com/codemix/babel-plugin-typecheck)\r\n\r\n\r\n## Optional\r\n\r\n- [x] If it's a new component, is it in ES6? Is it clear of warnings from ESLint?\r\n- [x] Have you replaced any `ChangeListener` or `PromiseRenderer` components with code that updates component state?\r\n- [ ] If changes are made to the classifier, does the dev classifier still work?\r\n- [ ] Have you added in [flow type annotations](https://flowtype.org/docs/type-annotations.html)?\r\n","created_at":"2016-12-13T19:12:38Z","updated_at":"2016-12-15T22:01:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1db190c5cc28c74761d1e21359e52d100ce66f4a","assignee":{"login":"parrish","id":122990,"avatar_url":"https://avatars.githubusercontent.com/u/122990?v=3","gravatar_id":"","url":"https://api.github.com/users/parrish","html_url":"https://github.com/parrish","followers_url":"https://api.github.com/users/parrish/followers","following_url":"https://api.github.com/users/parrish/following{/other_user}","gists_url":"https://api.github.com/users/parrish/gists{/gist_id}","starred_url":"https://api.github.com/users/parrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parrish/subscriptions","organizations_url":"https://api.github.com/users/parrish/orgs","repos_url":"https://api.github.com/users/parrish/repos","events_url":"https://api.github.com/users/parrish/events{/privacy}","received_events_url":"https://api.github.com/users/parrish/received_events","type":"User","site_admin":false},"assignees":[{"login":"parrish","id":122990,"avatar_url":"https://avatars.githubusercontent.com/u/122990?v=3","gravatar_id":"","url":"https://api.github.com/users/parrish","html_url":"https://github.com/parrish","followers_url":"https://api.github.com/users/parrish/followers","following_url":"https://api.github.com/users/parrish/following{/other_user}","gists_url":"https://api.github.com/users/parrish/gists{/gist_id}","starred_url":"https://api.github.com/users/parrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parrish/subscriptions","organizations_url":"https://api.github.com/users/parrish/orgs","repos_url":"https://api.github.com/users/parrish/repos","events_url":"https://api.github.com/users/parrish/events{/privacy}","received_events_url":"https://api.github.com/users/parrish/received_events","type":"User","site_admin":false},{"login":"mcbouslog","id":12118751,"avatar_url":"https://avatars.githubusercontent.com/u/12118751?v=3","gravatar_id":"","url":"https://api.github.com/users/mcbouslog","html_url":"https://github.com/mcbouslog","followers_url":"https://api.github.com/users/mcbouslog/followers","following_url":"https://api.github.com/users/mcbouslog/following{/other_user}","gists_url":"https://api.github.com/users/mcbouslog/gists{/gist_id}","starred_url":"https://api.github.com/users/mcbouslog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcbouslog/subscriptions","organizations_url":"https://api.github.com/users/mcbouslog/orgs","repos_url":"https://api.github.com/users/mcbouslog/repos","events_url":"https://api.github.com/users/mcbouslog/events{/privacy}","received_events_url":"https://api.github.com/users/mcbouslog/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330/commits","review_comments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330/comments","review_comment_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3330/comments","statuses_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/statuses/de9cf9d37447892a2ed9bf6d0272deac1f12ff53","head":{"label":"zooniverse:refactor-media-area","ref":"refactor-media-area","sha":"de9cf9d37447892a2ed9bf6d0272deac1f12ff53","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":19498290,"name":"Panoptes-Front-End","full_name":"zooniverse/Panoptes-Front-End","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/Panoptes-Front-End","description":"Front end for zooniverse/Panoptes","fork":false,"url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End","forks_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/forks","keys_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/teams","hooks_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/events","assignees_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/tags","blobs_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/languages","stargazers_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/subscription","commits_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/merges","archive_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/downloads","issues_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/releases{/id}","deployments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/deployments","created_at":"2014-05-06T14:53:43Z","updated_at":"2016-12-11T16:29:56Z","pushed_at":"2016-12-15T21:10:07Z","git_url":"git://github.com/zooniverse/Panoptes-Front-End.git","ssh_url":"git@github.com:zooniverse/Panoptes-Front-End.git","clone_url":"https://github.com/zooniverse/Panoptes-Front-End.git","svn_url":"https://github.com/zooniverse/Panoptes-Front-End","homepage":"https://www.zooniverse.org","size":35332,"stargazers_count":33,"watchers_count":33,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":353,"forks":35,"open_issues":353,"watchers":33,"default_branch":"master"}},"base":{"label":"zooniverse:master","ref":"master","sha":"10aa2bf23d57af190883e6571ff471a3c73727c1","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":19498290,"name":"Panoptes-Front-End","full_name":"zooniverse/Panoptes-Front-End","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/Panoptes-Front-End","description":"Front end for zooniverse/Panoptes","fork":false,"url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End","forks_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/forks","keys_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/teams","hooks_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/events","assignees_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/tags","blobs_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/languages","stargazers_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/subscription","commits_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/merges","archive_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/downloads","issues_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/releases{/id}","deployments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/deployments","created_at":"2014-05-06T14:53:43Z","updated_at":"2016-12-11T16:29:56Z","pushed_at":"2016-12-15T21:10:07Z","git_url":"git://github.com/zooniverse/Panoptes-Front-End.git","ssh_url":"git@github.com:zooniverse/Panoptes-Front-End.git","clone_url":"https://github.com/zooniverse/Panoptes-Front-End.git","svn_url":"https://github.com/zooniverse/Panoptes-Front-End","homepage":"https://www.zooniverse.org","size":35332,"stargazers_count":33,"watchers_count":33,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":353,"forks":35,"open_issues":353,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330"},"html":{"href":"https://github.com/zooniverse/Panoptes-Front-End/pull/3330"},"issue":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3330"},"comments":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3330/comments"},"review_comments":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330/comments"},"review_comment":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3330/commits"},"statuses":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/statuses/de9cf9d37447892a2ed9bf6d0272deac1f12ff53"}}}}
{"actor":{"display_login":"mcbouslog"}}