{"action":"created","comment":{"url":"https://api.github.com/repos/vtex-apps/product-summary/pulls/comments/180827614","pull_request_review_id":111318696,"id":180827614,"diff_hunk":"@@ -0,0 +1,51 @@\n+import React, { Component } from 'react'\n+import PropTypes from 'prop-types'\n+\n+/**\n+* The quantity selector component.\n+* It constrols how many products a client wants to buy.\n+*/\n+class QtdSelector extends Component {\n+  constructor(props) {\n+    super(props)\n+    this.handleChange = this.handleChange.bind(this)\n+  }\n+\n+  handleChange(event) {\n+    const qtdMax = this.props.qtdMax\n+    var quantity = event.target.value\n+    if (quantity > qtdMax) {\n+      quantity = qtdMax\n+      this.props.onMaxReached()\n+    } else if (quantity < 0) {\n+      quantity = 0\n+    }\n+    this.props.updateTotalPrice(quantity)\n+  }\n+\n+  render() {\n+    const {qtdMax, currentQtd} = this.props\n+    return (<input className=\"f4 dark-gray br2-l\" type=\"number\" name=\"quantity\"\n+      min=\"0\" max={qtdMax} value={currentQtd} onChange={this.handleChange} />)\n+  }\n+}\n+\n+QtdSelector.propTypes = {\n+  /** The product's maximum quantity that the client can buy */\n+  qtdMax: PropTypes.number.isRequired,\n+  /** This is the current quantity to be setted as the initial value */\n+  currentQtd: PropTypes.number,\n+  /** This function is called when the client set the quantity selector. It is useful to set the\n+  total price in the parent for exemple */","path":"react/QtdSelector.js","position":null,"original_position":39,"commit_id":"b69148368925a401eee7eb8b2a91c99c5387a176","original_commit_id":"984277090bd84c9d7cbaa00420171c092cc5fd9e","user":{"login":"vitoriaHeliane","id":12852518,"avatar_url":"https://avatars3.githubusercontent.com/u/12852518?v=4","gravatar_id":"","url":"https://api.github.com/users/vitoriaHeliane","html_url":"https://github.com/vitoriaHeliane","followers_url":"https://api.github.com/users/vitoriaHeliane/followers","following_url":"https://api.github.com/users/vitoriaHeliane/following{/other_user}","gists_url":"https://api.github.com/users/vitoriaHeliane/gists{/gist_id}","starred_url":"https://api.github.com/users/vitoriaHeliane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitoriaHeliane/subscriptions","organizations_url":"https://api.github.com/users/vitoriaHeliane/orgs","repos_url":"https://api.github.com/users/vitoriaHeliane/repos","events_url":"https://api.github.com/users/vitoriaHeliane/events{/privacy}","received_events_url":"https://api.github.com/users/vitoriaHeliane/received_events","type":"User","site_admin":false},"body":"Done!","created_at":"2018-04-11T17:01:12Z","updated_at":"2018-04-11T17:01:12Z","html_url":"https://github.com/vtex-apps/product-summary/pull/11#discussion_r180827614","pull_request_url":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vtex-apps/product-summary/pulls/comments/180827614"},"html":{"href":"https://github.com/vtex-apps/product-summary/pull/11#discussion_r180827614"},"pull_request":{"href":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11"}},"in_reply_to_id":180787611},"pull_request":{"url":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11","id":180923259,"html_url":"https://github.com/vtex-apps/product-summary/pull/11","diff_url":"https://github.com/vtex-apps/product-summary/pull/11.diff","patch_url":"https://github.com/vtex-apps/product-summary/pull/11.patch","issue_url":"https://api.github.com/repos/vtex-apps/product-summary/issues/11","number":11,"state":"open","locked":false,"title":"Add quantity selector component","user":{"login":"vitoriaHeliane","id":12852518,"avatar_url":"https://avatars3.githubusercontent.com/u/12852518?v=4","gravatar_id":"","url":"https://api.github.com/users/vitoriaHeliane","html_url":"https://github.com/vitoriaHeliane","followers_url":"https://api.github.com/users/vitoriaHeliane/followers","following_url":"https://api.github.com/users/vitoriaHeliane/following{/other_user}","gists_url":"https://api.github.com/users/vitoriaHeliane/gists{/gist_id}","starred_url":"https://api.github.com/users/vitoriaHeliane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitoriaHeliane/subscriptions","organizations_url":"https://api.github.com/users/vitoriaHeliane/orgs","repos_url":"https://api.github.com/users/vitoriaHeliane/repos","events_url":"https://api.github.com/users/vitoriaHeliane/events{/privacy}","received_events_url":"https://api.github.com/users/vitoriaHeliane/received_events","type":"User","site_admin":false},"body":"#### What is the purpose of this pull request?\r\nAdd the quantity selector component.\r\n\r\n#### What problem is this solving?\r\nAdd the first version of the quantity selector component.\r\n\r\n#### How should this be manually tested?\r\n\r\n#### Screenshots or example usage\r\nhttps://vitoria--storecomponents.myvtex.com/getting-started\r\n\r\n#### Types of changes\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n- [ ] Requires change to documentation, which has been updated accordingly.\r\n","created_at":"2018-04-11T14:29:34Z","updated_at":"2018-04-11T17:01:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e02b8336809fd3bdb15992aef521b2918dfb5d7b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11/commits","review_comments_url":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11/comments","review_comment_url":"https://api.github.com/repos/vtex-apps/product-summary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vtex-apps/product-summary/issues/11/comments","statuses_url":"https://api.github.com/repos/vtex-apps/product-summary/statuses/b69148368925a401eee7eb8b2a91c99c5387a176","head":{"label":"vtex-apps:feature/qtd-selector-component","ref":"feature/qtd-selector-component","sha":"b69148368925a401eee7eb8b2a91c99c5387a176","user":{"login":"vtex-apps","id":12614072,"avatar_url":"https://avatars0.githubusercontent.com/u/12614072?v=4","gravatar_id":"","url":"https://api.github.com/users/vtex-apps","html_url":"https://github.com/vtex-apps","followers_url":"https://api.github.com/users/vtex-apps/followers","following_url":"https://api.github.com/users/vtex-apps/following{/other_user}","gists_url":"https://api.github.com/users/vtex-apps/gists{/gist_id}","starred_url":"https://api.github.com/users/vtex-apps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtex-apps/subscriptions","organizations_url":"https://api.github.com/users/vtex-apps/orgs","repos_url":"https://api.github.com/users/vtex-apps/repos","events_url":"https://api.github.com/users/vtex-apps/events{/privacy}","received_events_url":"https://api.github.com/users/vtex-apps/received_events","type":"Organization","site_admin":false},"repo":{"id":127789323,"name":"product-summary","full_name":"vtex-apps/product-summary","owner":{"login":"vtex-apps","id":12614072,"avatar_url":"https://avatars0.githubusercontent.com/u/12614072?v=4","gravatar_id":"","url":"https://api.github.com/users/vtex-apps","html_url":"https://github.com/vtex-apps","followers_url":"https://api.github.com/users/vtex-apps/followers","following_url":"https://api.github.com/users/vtex-apps/following{/other_user}","gists_url":"https://api.github.com/users/vtex-apps/gists{/gist_id}","starred_url":"https://api.github.com/users/vtex-apps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtex-apps/subscriptions","organizations_url":"https://api.github.com/users/vtex-apps/orgs","repos_url":"https://api.github.com/users/vtex-apps/repos","events_url":"https://api.github.com/users/vtex-apps/events{/privacy}","received_events_url":"https://api.github.com/users/vtex-apps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vtex-apps/product-summary","description":"Product summary component","fork":false,"url":"https://api.github.com/repos/vtex-apps/product-summary","forks_url":"https://api.github.com/repos/vtex-apps/product-summary/forks","keys_url":"https://api.github.com/repos/vtex-apps/product-summary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vtex-apps/product-summary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vtex-apps/product-summary/teams","hooks_url":"https://api.github.com/repos/vtex-apps/product-summary/hooks","issue_events_url":"https://api.github.com/repos/vtex-apps/product-summary/issues/events{/number}","events_url":"https://api.github.com/repos/vtex-apps/product-summary/events","assignees_url":"https://api.github.com/repos/vtex-apps/product-summary/assignees{/user}","branches_url":"https://api.github.com/repos/vtex-apps/product-summary/branches{/branch}","tags_url":"https://api.github.com/repos/vtex-apps/product-summary/tags","blobs_url":"https://api.github.com/repos/vtex-apps/product-summary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vtex-apps/product-summary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vtex-apps/product-summary/git/refs{/sha}","trees_url":"https://api.github.com/repos/vtex-apps/product-summary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vtex-apps/product-summary/statuses/{sha}","languages_url":"https://api.github.com/repos/vtex-apps/product-summary/languages","stargazers_url":"https://api.github.com/repos/vtex-apps/product-summary/stargazers","contributors_url":"https://api.github.com/repos/vtex-apps/product-summary/contributors","subscribers_url":"https://api.github.com/repos/vtex-apps/product-summary/subscribers","subscription_url":"https://api.github.com/repos/vtex-apps/product-summary/subscription","commits_url":"https://api.github.com/repos/vtex-apps/product-summary/commits{/sha}","git_commits_url":"https://api.github.com/repos/vtex-apps/product-summary/git/commits{/sha}","comments_url":"https://api.github.com/repos/vtex-apps/product-summary/comments{/number}","issue_comment_url":"https://api.github.com/repos/vtex-apps/product-summary/issues/comments{/number}","contents_url":"https://api.github.com/repos/vtex-apps/product-summary/contents/{+path}","compare_url":"https://api.github.com/repos/vtex-apps/product-summary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vtex-apps/product-summary/merges","archive_url":"https://api.github.com/repos/vtex-apps/product-summary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vtex-apps/product-summary/downloads","issues_url":"https://api.github.com/repos/vtex-apps/product-summary/issues{/number}","pulls_url":"https://api.github.com/repos/vtex-apps/product-summary/pulls{/number}","milestones_url":"https://api.github.com/repos/vtex-apps/product-summary/milestones{/number}","notifications_url":"https://api.github.com/repos/vtex-apps/product-summary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vtex-apps/product-summary/labels{/name}","releases_url":"https://api.github.com/repos/vtex-apps/product-summary/releases{/id}","deployments_url":"https://api.github.com/repos/vtex-apps/product-summary/deployments","created_at":"2018-04-02T17:29:31Z","updated_at":"2018-04-09T15:03:44Z","pushed_at":"2018-04-11T17:01:00Z","git_url":"git://github.com/vtex-apps/product-summary.git","ssh_url":"git@github.com:vtex-apps/product-summary.git","clone_url":"https://github.com/vtex-apps/product-summary.git","svn_url":"https://github.com/vtex-apps/product-summary","homepage":null,"size":93,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"vtex-apps:master","ref":"master","sha":"f4677af8f2edc0c718451bf7d201239ce34e7646","user":{"login":"vtex-apps","id":12614072,"avatar_url":"https://avatars0.githubusercontent.com/u/12614072?v=4","gravatar_id":"","url":"https://api.github.com/users/vtex-apps","html_url":"https://github.com/vtex-apps","followers_url":"https://api.github.com/users/vtex-apps/followers","following_url":"https://api.github.com/users/vtex-apps/following{/other_user}","gists_url":"https://api.github.com/users/vtex-apps/gists{/gist_id}","starred_url":"https://api.github.com/users/vtex-apps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtex-apps/subscriptions","organizations_url":"https://api.github.com/users/vtex-apps/orgs","repos_url":"https://api.github.com/users/vtex-apps/repos","events_url":"https://api.github.com/users/vtex-apps/events{/privacy}","received_events_url":"https://api.github.com/users/vtex-apps/received_events","type":"Organization","site_admin":false},"repo":{"id":127789323,"name":"product-summary","full_name":"vtex-apps/product-summary","owner":{"login":"vtex-apps","id":12614072,"avatar_url":"https://avatars0.githubusercontent.com/u/12614072?v=4","gravatar_id":"","url":"https://api.github.com/users/vtex-apps","html_url":"https://github.com/vtex-apps","followers_url":"https://api.github.com/users/vtex-apps/followers","following_url":"https://api.github.com/users/vtex-apps/following{/other_user}","gists_url":"https://api.github.com/users/vtex-apps/gists{/gist_id}","starred_url":"https://api.github.com/users/vtex-apps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtex-apps/subscriptions","organizations_url":"https://api.github.com/users/vtex-apps/orgs","repos_url":"https://api.github.com/users/vtex-apps/repos","events_url":"https://api.github.com/users/vtex-apps/events{/privacy}","received_events_url":"https://api.github.com/users/vtex-apps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vtex-apps/product-summary","description":"Product summary component","fork":false,"url":"https://api.github.com/repos/vtex-apps/product-summary","forks_url":"https://api.github.com/repos/vtex-apps/product-summary/forks","keys_url":"https://api.github.com/repos/vtex-apps/product-summary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vtex-apps/product-summary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vtex-apps/product-summary/teams","hooks_url":"https://api.github.com/repos/vtex-apps/product-summary/hooks","issue_events_url":"https://api.github.com/repos/vtex-apps/product-summary/issues/events{/number}","events_url":"https://api.github.com/repos/vtex-apps/product-summary/events","assignees_url":"https://api.github.com/repos/vtex-apps/product-summary/assignees{/user}","branches_url":"https://api.github.com/repos/vtex-apps/product-summary/branches{/branch}","tags_url":"https://api.github.com/repos/vtex-apps/product-summary/tags","blobs_url":"https://api.github.com/repos/vtex-apps/product-summary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vtex-apps/product-summary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vtex-apps/product-summary/git/refs{/sha}","trees_url":"https://api.github.com/repos/vtex-apps/product-summary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vtex-apps/product-summary/statuses/{sha}","languages_url":"https://api.github.com/repos/vtex-apps/product-summary/languages","stargazers_url":"https://api.github.com/repos/vtex-apps/product-summary/stargazers","contributors_url":"https://api.github.com/repos/vtex-apps/product-summary/contributors","subscribers_url":"https://api.github.com/repos/vtex-apps/product-summary/subscribers","subscription_url":"https://api.github.com/repos/vtex-apps/product-summary/subscription","commits_url":"https://api.github.com/repos/vtex-apps/product-summary/commits{/sha}","git_commits_url":"https://api.github.com/repos/vtex-apps/product-summary/git/commits{/sha}","comments_url":"https://api.github.com/repos/vtex-apps/product-summary/comments{/number}","issue_comment_url":"https://api.github.com/repos/vtex-apps/product-summary/issues/comments{/number}","contents_url":"https://api.github.com/repos/vtex-apps/product-summary/contents/{+path}","compare_url":"https://api.github.com/repos/vtex-apps/product-summary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vtex-apps/product-summary/merges","archive_url":"https://api.github.com/repos/vtex-apps/product-summary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vtex-apps/product-summary/downloads","issues_url":"https://api.github.com/repos/vtex-apps/product-summary/issues{/number}","pulls_url":"https://api.github.com/repos/vtex-apps/product-summary/pulls{/number}","milestones_url":"https://api.github.com/repos/vtex-apps/product-summary/milestones{/number}","notifications_url":"https://api.github.com/repos/vtex-apps/product-summary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vtex-apps/product-summary/labels{/name}","releases_url":"https://api.github.com/repos/vtex-apps/product-summary/releases{/id}","deployments_url":"https://api.github.com/repos/vtex-apps/product-summary/deployments","created_at":"2018-04-02T17:29:31Z","updated_at":"2018-04-09T15:03:44Z","pushed_at":"2018-04-11T17:01:00Z","git_url":"git://github.com/vtex-apps/product-summary.git","ssh_url":"git@github.com:vtex-apps/product-summary.git","clone_url":"https://github.com/vtex-apps/product-summary.git","svn_url":"https://github.com/vtex-apps/product-summary","homepage":null,"size":93,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11"},"html":{"href":"https://github.com/vtex-apps/product-summary/pull/11"},"issue":{"href":"https://api.github.com/repos/vtex-apps/product-summary/issues/11"},"comments":{"href":"https://api.github.com/repos/vtex-apps/product-summary/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/vtex-apps/product-summary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vtex-apps/product-summary/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/vtex-apps/product-summary/statuses/b69148368925a401eee7eb8b2a91c99c5387a176"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vitoriaHeliane"}}