{"action":"created","comment":{"url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/comments/104422351","pull_request_review_id":25258428,"id":104422351,"diff_hunk":"@@ -0,0 +1,179 @@\n+import { Markdown } from 'markdownz';\n+import React from 'react';\n+import GenericTask from '../generic';\n+import SliderTaskEditor from './editor';\n+\n+const NOOP = Function.prototype;\n+\n+class Summary extends React.Component {\n+  render() {\n+    let answer = 'No answer';\n+    if (this.props.annotation.value !== null) {\n+      answer = this.props.annotation.value;\n+    }\n+    return (\n+      <div>\n+        <div className=\"question\">\n+          <Markdown tag=\"span\" inline={true}>\n+            {this.props.task.instruction}\n+          </Markdown>\n+        </div>\n+        <div className=\"answer\">\n+          {answer}\n+        </div>\n+      </div>\n+    );\n+  }\n+}\n+Summary.displayName = 'SliderSummary';\n+\n+Summary.propTypes = {\n+  task: React.PropTypes.shape(\n+    {\n+      instruction: React.PropTypes.string\n+    }\n+  ).isRequired,\n+  annotation: React.PropTypes.shape(\n+    {\n+      value: React.PropTypes.string\n+    }\n+  ).isRequired\n+};\n+\n+class SliderTask extends React.Component {\n+  constructor(props) {\n+    super(props);\n+    let value = this.props.task.defaultValue;\n+    if (this.props.annotation.value !== null) {\n+      value = this.props.annotation.value;\n+    }\n+    this.state = { value };\n+    this.handleChange = this.handleChange.bind(this);\n+  }\n+\n+  componentDidMount() {\n+    const newAnnotation = Object.assign({}, this.props.annotation, { value: this.props.task.defaultValue });\n+    this.props.onChange(newAnnotation);\n+  }\n+\n+  handleChange(e) {\n+    let value = e.target.value;\n+    if (parseFloat(value, 10) > parseFloat(this.props.task.max, 10)) {\n+      value = this.props.task.max;\n+    } else if (parseFloat(value, 10) < parseFloat(this.props.task.min, 10)) {\n+      value = this.props.task.min;\n+    }\n+    this.setState({ value });\n+    const newAnnotation = Object.assign({}, this.props.annotation, { value });\n+    this.props.onChange(newAnnotation);\n+  }\n+\n+  render() {\n+    return (\n+      <div>\n+        <GenericTask\n+          question={this.props.task.instruction}\n+          help={this.props.task.help}\n+          required={this.props.task.required}\n+        >\n+          <div className=\"standard-input full slider-task-container\">\n+            <div className=\"slider-task-range\">\n+              <label htmlFor=\"sliderInput\" className=\"answer\">\n+                <div>\n+                  <input\n+                    type=\"range\"\n+                    autoFocus={this.props.autoFocus}\n+                    onChange={this.handleChange}\n+                    max={this.props.task.max}\n+                    min={this.props.task.min}\n+                    step={this.props.task.step}\n+                    value={this.state.value}\n+                    id=\"sliderInput\"","path":"app/classifier/tasks/slider/index.jsx","position":91,"original_position":91,"commit_id":"03f3acdc72f2e90496526de01693e09f521f512e","original_commit_id":"03f3acdc72f2e90496526de01693e09f521f512e","user":{"login":"CKrawczyk","id":6557526,"avatar_url":"https://avatars1.githubusercontent.com/u/6557526?v=3","gravatar_id":"","url":"https://api.github.com/users/CKrawczyk","html_url":"https://github.com/CKrawczyk","followers_url":"https://api.github.com/users/CKrawczyk/followers","following_url":"https://api.github.com/users/CKrawczyk/following{/other_user}","gists_url":"https://api.github.com/users/CKrawczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/CKrawczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CKrawczyk/subscriptions","organizations_url":"https://api.github.com/users/CKrawczyk/orgs","repos_url":"https://api.github.com/users/CKrawczyk/repos","events_url":"https://api.github.com/users/CKrawczyk/events{/privacy}","received_events_url":"https://api.github.com/users/CKrawczyk/received_events","type":"User","site_admin":false},"body":"This `id` is not needed at all if `htmlFor` does not need to be specified in the `<label>`.","created_at":"2017-03-06T14:16:46Z","updated_at":"2017-03-06T14:16:46Z","html_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3502#discussion_r104422351","pull_request_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502","_links":{"self":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/comments/104422351"},"html":{"href":"https://github.com/zooniverse/Panoptes-Front-End/pull/3502#discussion_r104422351"},"pull_request":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502"}}},"pull_request":{"url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502","id":107010433,"html_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3502","diff_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3502.diff","patch_url":"https://github.com/zooniverse/Panoptes-Front-End/pull/3502.patch","issue_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3502","number":3502,"state":"open","locked":false,"title":"[WIP] Added sliderTask, a slider input with a linked numeric input.","user":{"login":"tingard","id":11770176,"avatar_url":"https://avatars0.githubusercontent.com/u/11770176?v=3","gravatar_id":"","url":"https://api.github.com/users/tingard","html_url":"https://github.com/tingard","followers_url":"https://api.github.com/users/tingard/followers","following_url":"https://api.github.com/users/tingard/following{/other_user}","gists_url":"https://api.github.com/users/tingard/gists{/gist_id}","starred_url":"https://api.github.com/users/tingard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tingard/subscriptions","organizations_url":"https://api.github.com/users/tingard/orgs","repos_url":"https://api.github.com/users/tingard/repos","events_url":"https://api.github.com/users/tingard/events{/privacy}","received_events_url":"https://api.github.com/users/tingard/received_events","type":"User","site_admin":false},"body":"Added sliderTask, a slider input with a linked numeric input.\r\nIt has a generic task editor which could be switched for an editor allowing min/max/step/numeric multiplier tweaking. Also does not have a test yet.\r\nRequesting Pull before completing this to enable demonstration of galaxy-modelling project.\r\n\r\nDescribe your changes.\r\n\r\n# Review Checklist\r\n\r\n- [x] Does it work in all major browsers: Firefox, Chrome, Edge, Safari?\r\n- [x] Does it work on mobile?\r\n- [x] Can you `rm -rf node_modules/ && npm install` and app works as expected?\r\n- [x] Did you deploy a staging branch? https://galaxy-modelling.pfe-preview.zooniverse.org/\r\n- [x] 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- [ ] Have you replaced any `ChangeListener` or `PromiseRenderer` components with code that updates component state?\r\n- [x] 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)?","created_at":"2017-02-20T13:56:08Z","updated_at":"2017-03-06T14:16:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26e61a807f088dd657d83bbe1b59ec53e3c37ec4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502/commits","review_comments_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502/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/3502/comments","statuses_url":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/statuses/03f3acdc72f2e90496526de01693e09f521f512e","head":{"label":"tingard:galaxy-modelling","ref":"galaxy-modelling","sha":"03f3acdc72f2e90496526de01693e09f521f512e","user":{"login":"tingard","id":11770176,"avatar_url":"https://avatars0.githubusercontent.com/u/11770176?v=3","gravatar_id":"","url":"https://api.github.com/users/tingard","html_url":"https://github.com/tingard","followers_url":"https://api.github.com/users/tingard/followers","following_url":"https://api.github.com/users/tingard/following{/other_user}","gists_url":"https://api.github.com/users/tingard/gists{/gist_id}","starred_url":"https://api.github.com/users/tingard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tingard/subscriptions","organizations_url":"https://api.github.com/users/tingard/orgs","repos_url":"https://api.github.com/users/tingard/repos","events_url":"https://api.github.com/users/tingard/events{/privacy}","received_events_url":"https://api.github.com/users/tingard/received_events","type":"User","site_admin":false},"repo":{"id":75091719,"name":"Panoptes-Front-End","full_name":"tingard/Panoptes-Front-End","owner":{"login":"tingard","id":11770176,"avatar_url":"https://avatars0.githubusercontent.com/u/11770176?v=3","gravatar_id":"","url":"https://api.github.com/users/tingard","html_url":"https://github.com/tingard","followers_url":"https://api.github.com/users/tingard/followers","following_url":"https://api.github.com/users/tingard/following{/other_user}","gists_url":"https://api.github.com/users/tingard/gists{/gist_id}","starred_url":"https://api.github.com/users/tingard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tingard/subscriptions","organizations_url":"https://api.github.com/users/tingard/orgs","repos_url":"https://api.github.com/users/tingard/repos","events_url":"https://api.github.com/users/tingard/events{/privacy}","received_events_url":"https://api.github.com/users/tingard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tingard/Panoptes-Front-End","description":"Front end for zooniverse/Panoptes","fork":true,"url":"https://api.github.com/repos/tingard/Panoptes-Front-End","forks_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/forks","keys_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/teams","hooks_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/hooks","issue_events_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/issues/events{/number}","events_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/events","assignees_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/assignees{/user}","branches_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/branches{/branch}","tags_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/tags","blobs_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/git/refs{/sha}","trees_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/statuses/{sha}","languages_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/languages","stargazers_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/stargazers","contributors_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/contributors","subscribers_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/subscribers","subscription_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/subscription","commits_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/commits{/sha}","git_commits_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/git/commits{/sha}","comments_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/comments{/number}","issue_comment_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/issues/comments{/number}","contents_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/contents/{+path}","compare_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/merges","archive_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/downloads","issues_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/issues{/number}","pulls_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/pulls{/number}","milestones_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/milestones{/number}","notifications_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/labels{/name}","releases_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/releases{/id}","deployments_url":"https://api.github.com/repos/tingard/Panoptes-Front-End/deployments","created_at":"2016-11-29T14:57:17Z","updated_at":"2017-02-13T13:03:57Z","pushed_at":"2017-03-01T13:12:06Z","git_url":"git://github.com/tingard/Panoptes-Front-End.git","ssh_url":"git@github.com:tingard/Panoptes-Front-End.git","clone_url":"https://github.com/tingard/Panoptes-Front-End.git","svn_url":"https://github.com/tingard/Panoptes-Front-End","homepage":"https://www.zooniverse.org","size":35801,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zooniverse:master","ref":"master","sha":"9ae8f422db65ed1e8d9e2420708183e95a0e7e47","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars1.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://avatars1.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":"2017-02-16T11:30:54Z","pushed_at":"2017-03-06T13:29:46Z","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":35796,"stargazers_count":34,"watchers_count":34,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":316,"forks":35,"open_issues":316,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502"},"html":{"href":"https://github.com/zooniverse/Panoptes-Front-End/pull/3502"},"issue":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3502"},"comments":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/issues/3502/comments"},"review_comments":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/pulls/3502/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/3502/commits"},"statuses":{"href":"https://api.github.com/repos/zooniverse/Panoptes-Front-End/statuses/03f3acdc72f2e90496526de01693e09f521f512e"}}}}
{"actor":{"display_login":"CKrawczyk"}}