GitHub PullRequestReviewCommentEvent at 2014-11-03 02:29:33
Repository: module.user
Actor: Cellule
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/my-koop/module.user/pulls/comments/19717617","id":19717617,"diff_hunk":"@@ -118,15 +122,45 @@ var RegisterPage = React.createClass({\n     this.selectPanel(selectedKey);\n   },\n \n+  handleFieldChange: function(field, newValue) {\n+    var profile = this.state.formData;\n+    profile[field] = newValue;\n+    this.setState({formData: profile});\n+  },\n+\n+  makeValueLink: function(field) {\n+    return {\n+      value: this.state.formData[field],\n+      requestChange: this.handleFieldChange.bind(this, field)\n+    }\n+  },\n+\n   submitForm: function(){\n     var self = this;\n     return function(){\n       if( self.canSendRequest() && (self.pendingRequest = true) ){\n+        actions.user.register({\n+          data: {\n+              email:          self.state.formData[\"email\"],\n+              firstname:      self.state.formData[\"firstname\"],\n+              lastname:       self.state.formData[\"lastname\"],\n+              phone:          self.state.formData[\"phone\"],\n+              origin:         self.state.formData[\"origin\"],\n+              birthday:       self.state.formData[\"birthdate\"],\n+              usageNote:      self.state.formData[\"usageNote\"],\n+              usageFrequency: self.state.formData[\"usage\"],\n+              referral:       self.state.formData[\"referral\"],\n+              passwordToHash: self.state.formData[\"password\"],\n+              confPassword:   self.state.formData[\"confpassword\"]\n+            }\n+        },function (err, res) {\n+          if (err || res.registered !== 1) {\n+            console.error(err);\n+            self.state.success = 0;","path":"components/RegisterPage.jsx","position":59,"original_position":59,"commit_id":"62f8b8fdf1c08acf046c77ed839c0ec17b9723dd","original_commit_id":"62f8b8fdf1c08acf046c77ed839c0ec17b9723dd","user":{"login":"Cellule","id":4157103,"avatar_url":"https://avatars.githubusercontent.com/u/4157103?v=2","gravatar_id":"","url":"https://api.github.com/users/Cellule","html_url":"https://github.com/Cellule","followers_url":"https://api.github.com/users/Cellule/followers","following_url":"https://api.github.com/users/Cellule/following{/other_user}","gists_url":"https://api.github.com/users/Cellule/gists{/gist_id}","starred_url":"https://api.github.com/users/Cellule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cellule/subscriptions","organizations_url":"https://api.github.com/users/Cellule/orgs","repos_url":"https://api.github.com/users/Cellule/repos","events_url":"https://api.github.com/users/Cellule/events{/privacy}","received_events_url":"https://api.github.com/users/Cellule/received_events","type":"User","site_admin":false},"body":"you can't just modify the state and then read from it that way. You have to use `setState` in this particular case, since it's no longer a prototype with random value, simply set a variable to 0 or 1 depending if you had an error then use the same code as before\r\n```javascript\r\n        self.setState({\r\n          success: successStateVarDeclaredBefore\r\n        }, function(){\r\n           self.pendingRequest = false;\r\n           if(self.hasSentSuccessfully()){\r\n             // Redirect to homepage after 2 seconds\r\n             setTimeout(function(){\r\n               Router.transitionTo(routeData.public.name);\r\n             },2000);\r\n           }\r\n         });\r\n```","created_at":"2014-11-03T02:29:33Z","updated_at":"2014-11-03T02:29:33Z","html_url":"https://github.com/my-koop/module.user/pull/24#discussion_r19717617","pull_request_url":"https://api.github.com/repos/my-koop/module.user/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/my-koop/module.user/pulls/comments/19717617"},"html":{"href":"https://github.com/my-koop/module.user/pull/24#discussion_r19717617"},"pull_request":{"href":"https://api.github.com/repos/my-koop/module.user/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/my-koop/module.user/pulls/24","id":23738917,"html_url":"https://github.com/my-koop/module.user/pull/24","diff_url":"https://github.com/my-koop/module.user/pull/24.diff","patch_url":"https://github.com/my-koop/module.user/pull/24.patch","issue_url":"https://api.github.com/repos/my-koop/module.user/issues/24","number":24,"state":"open","locked":false,"title":"Register form with password encryption using node-pwd","user":{"login":"logiad","id":3430891,"avatar_url":"https://avatars.githubusercontent.com/u/3430891?v=2","gravatar_id":"","url":"https://api.github.com/users/logiad","html_url":"https://github.com/logiad","followers_url":"https://api.github.com/users/logiad/followers","following_url":"https://api.github.com/users/logiad/following{/other_user}","gists_url":"https://api.github.com/users/logiad/gists{/gist_id}","starred_url":"https://api.github.com/users/logiad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logiad/subscriptions","organizations_url":"https://api.github.com/users/logiad/orgs","repos_url":"https://api.github.com/users/logiad/repos","events_url":"https://api.github.com/users/logiad/events{/privacy}","received_events_url":"https://api.github.com/users/logiad/received_events","type":"User","site_admin":false},"body":"Adjusted register form to match db and fields we expect to need.\r\nAdjusted the user table to match the form\r\nCreate the request to insert a new user in the DB\r\nAdded password encyption","created_at":"2014-11-03T00:19:25Z","updated_at":"2014-11-03T02:29:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71d339d2b6fc28a8023ba436a371fbd72c63bcf8","assignee":{"login":"Cellule","id":4157103,"avatar_url":"https://avatars.githubusercontent.com/u/4157103?v=2","gravatar_id":"","url":"https://api.github.com/users/Cellule","html_url":"https://github.com/Cellule","followers_url":"https://api.github.com/users/Cellule/followers","following_url":"https://api.github.com/users/Cellule/following{/other_user}","gists_url":"https://api.github.com/users/Cellule/gists{/gist_id}","starred_url":"https://api.github.com/users/Cellule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cellule/subscriptions","organizations_url":"https://api.github.com/users/Cellule/orgs","repos_url":"https://api.github.com/users/Cellule/repos","events_url":"https://api.github.com/users/Cellule/events{/privacy}","received_events_url":"https://api.github.com/users/Cellule/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/my-koop/module.user/milestones/2","labels_url":"https://api.github.com/repos/my-koop/module.user/milestones/2/labels","id":848753,"number":2,"title":"1.0-beta","description":"Beta version of the initial stable release.","creator":{"login":"Cellule","id":4157103,"avatar_url":"https://avatars.githubusercontent.com/u/4157103?v=2","gravatar_id":"","url":"https://api.github.com/users/Cellule","html_url":"https://github.com/Cellule","followers_url":"https://api.github.com/users/Cellule/followers","following_url":"https://api.github.com/users/Cellule/following{/other_user}","gists_url":"https://api.github.com/users/Cellule/gists{/gist_id}","starred_url":"https://api.github.com/users/Cellule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cellule/subscriptions","organizations_url":"https://api.github.com/users/Cellule/orgs","repos_url":"https://api.github.com/users/Cellule/repos","events_url":"https://api.github.com/users/Cellule/events{/privacy}","received_events_url":"https://api.github.com/users/Cellule/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":2,"state":"open","created_at":"2014-10-31T18:14:17Z","updated_at":"2014-11-03T00:22:20Z","due_on":"2014-11-11T08:00:00Z"},"commits_url":"https://api.github.com/repos/my-koop/module.user/pulls/24/commits","review_comments_url":"https://api.github.com/repos/my-koop/module.user/pulls/24/comments","review_comment_url":"https://api.github.com/repos/my-koop/module.user/pulls/comments/{number}","comments_url":"https://api.github.com/repos/my-koop/module.user/issues/24/comments","statuses_url":"https://api.github.com/repos/my-koop/module.user/statuses/62f8b8fdf1c08acf046c77ed839c0ec17b9723dd","head":{"label":"my-koop:ad_register_form","ref":"ad_register_form","sha":"62f8b8fdf1c08acf046c77ed839c0ec17b9723dd","user":{"login":"my-koop","id":8674744,"avatar_url":"https://avatars.githubusercontent.com/u/8674744?v=2","gravatar_id":"","url":"https://api.github.com/users/my-koop","html_url":"https://github.com/my-koop","followers_url":"https://api.github.com/users/my-koop/followers","following_url":"https://api.github.com/users/my-koop/following{/other_user}","gists_url":"https://api.github.com/users/my-koop/gists{/gist_id}","starred_url":"https://api.github.com/users/my-koop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/my-koop/subscriptions","organizations_url":"https://api.github.com/users/my-koop/orgs","repos_url":"https://api.github.com/users/my-koop/repos","events_url":"https://api.github.com/users/my-koop/events{/privacy}","received_events_url":"https://api.github.com/users/my-koop/received_events","type":"Organization","site_admin":false},"repo":{"id":25272029,"name":"module.user","full_name":"my-koop/module.user","owner":{"login":"my-koop","id":8674744,"avatar_url":"https://avatars.githubusercontent.com/u/8674744?v=2","gravatar_id":"","url":"https://api.github.com/users/my-koop","html_url":"https://github.com/my-koop","followers_url":"https://api.github.com/users/my-koop/followers","following_url":"https://api.github.com/users/my-koop/following{/other_user}","gists_url":"https://api.github.com/users/my-koop/gists{/gist_id}","starred_url":"https://api.github.com/users/my-koop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/my-koop/subscriptions","organizations_url":"https://api.github.com/users/my-koop/orgs","repos_url":"https://api.github.com/users/my-koop/repos","events_url":"https://api.github.com/users/my-koop/events{/privacy}","received_events_url":"https://api.github.com/users/my-koop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/my-koop/module.user","description":"User module for My Koop responsible for user profiles","fork":false,"url":"https://api.github.com/repos/my-koop/module.user","forks_url":"https://api.github.com/repos/my-koop/module.user/forks","keys_url":"https://api.github.com/repos/my-koop/module.user/keys{/key_id}","collaborators_url":"https://api.github.com/repos/my-koop/module.user/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/my-koop/module.user/teams","hooks_url":"https://api.github.com/repos/my-koop/module.user/hooks","issue_events_url":"https://api.github.com/repos/my-koop/module.user/issues/events{/number}","events_url":"https://api.github.com/repos/my-koop/module.user/events","assignees_url":"https://api.github.com/repos/my-koop/module.user/assignees{/user}","branches_url":"https://api.github.com/repos/my-koop/module.user/branches{/branch}","tags_url":"https://api.github.com/repos/my-koop/module.user/tags","blobs_url":"https://api.github.com/repos/my-koop/module.user/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/my-koop/module.user/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/my-koop/module.user/git/refs{/sha}","trees_url":"https://api.github.com/repos/my-koop/module.user/git/trees{/sha}","statuses_url":"https://api.github.com/repos/my-koop/module.user/statuses/{sha}","languages_url":"https://api.github.com/repos/my-koop/module.user/languages","stargazers_url":"https://api.github.com/repos/my-koop/module.user/stargazers","contributors_url":"https://api.github.com/repos/my-koop/module.user/contributors","subscribers_url":"https://api.github.com/repos/my-koop/module.user/subscribers","subscription_url":"https://api.github.com/repos/my-koop/module.user/subscription","commits_url":"https://api.github.com/repos/my-koop/module.user/commits{/sha}","git_commits_url":"https://api.github.com/repos/my-koop/module.user/git/commits{/sha}","comments_url":"https://api.github.com/repos/my-koop/module.user/comments{/number}","issue_comment_url":"https://api.github.com/repos/my-koop/module.user/issues/comments/{number}","contents_url":"https://api.github.com/repos/my-koop/module.user/contents/{+path}","compare_url":"https://api.github.com/repos/my-koop/module.user/compare/{base}...{head}","merges_url":"https://api.github.com/repos/my-koop/module.user/merges","archive_url":"https://api.github.com/repos/my-koop/module.user/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/my-koop/module.user/downloads","issues_url":"https://api.github.com/repos/my-koop/module.user/issues{/number}","pulls_url":"https://api.github.com/repos/my-koop/module.user/pulls{/number}","milestones_url":"https://api.github.com/repos/my-koop/module.user/milestones{/number}","notifications_url":"https://api.github.com/repos/my-koop/module.user/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/my-koop/module.user/labels{/name}","releases_url":"https://api.github.com/repos/my-koop/module.user/releases{/id}","created_at":"2014-10-15T20:21:52Z","updated_at":"2014-10-18T20:57:26Z","pushed_at":"2014-11-03T02:25:59Z","git_url":"git://github.com/my-koop/module.user.git","ssh_url":"git@github.com:my-koop/module.user.git","clone_url":"https://github.com/my-koop/module.user.git","svn_url":"https://github.com/my-koop/module.user","homepage":null,"size":372,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":0,"default_branch":"beta"}},"base":{"label":"my-koop:beta","ref":"beta","sha":"f529b982c385cb22040973094b02110bd05a88bf","user":{"login":"my-koop","id":8674744,"avatar_url":"https://avatars.githubusercontent.com/u/8674744?v=2","gravatar_id":"","url":"https://api.github.com/users/my-koop","html_url":"https://github.com/my-koop","followers_url":"https://api.github.com/users/my-koop/followers","following_url":"https://api.github.com/users/my-koop/following{/other_user}","gists_url":"https://api.github.com/users/my-koop/gists{/gist_id}","starred_url":"https://api.github.com/users/my-koop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/my-koop/subscriptions","organizations_url":"https://api.github.com/users/my-koop/orgs","repos_url":"https://api.github.com/users/my-koop/repos","events_url":"https://api.github.com/users/my-koop/events{/privacy}","received_events_url":"https://api.github.com/users/my-koop/received_events","type":"Organization","site_admin":false},"repo":{"id":25272029,"name":"module.user","full_name":"my-koop/module.user","owner":{"login":"my-koop","id":8674744,"avatar_url":"https://avatars.githubusercontent.com/u/8674744?v=2","gravatar_id":"","url":"https://api.github.com/users/my-koop","html_url":"https://github.com/my-koop","followers_url":"https://api.github.com/users/my-koop/followers","following_url":"https://api.github.com/users/my-koop/following{/other_user}","gists_url":"https://api.github.com/users/my-koop/gists{/gist_id}","starred_url":"https://api.github.com/users/my-koop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/my-koop/subscriptions","organizations_url":"https://api.github.com/users/my-koop/orgs","repos_url":"https://api.github.com/users/my-koop/repos","events_url":"https://api.github.com/users/my-koop/events{/privacy}","received_events_url":"https://api.github.com/users/my-koop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/my-koop/module.user","description":"User module for My Koop responsible for user profiles","fork":false,"url":"https://api.github.com/repos/my-koop/module.user","forks_url":"https://api.github.com/repos/my-koop/module.user/forks","keys_url":"https://api.github.com/repos/my-koop/module.user/keys{/key_id}","collaborators_url":"https://api.github.com/repos/my-koop/module.user/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/my-koop/module.user/teams","hooks_url":"https://api.github.com/repos/my-koop/module.user/hooks","issue_events_url":"https://api.github.com/repos/my-koop/module.user/issues/events{/number}","events_url":"https://api.github.com/repos/my-koop/module.user/events","assignees_url":"https://api.github.com/repos/my-koop/module.user/assignees{/user}","branches_url":"https://api.github.com/repos/my-koop/module.user/branches{/branch}","tags_url":"https://api.github.com/repos/my-koop/module.user/tags","blobs_url":"https://api.github.com/repos/my-koop/module.user/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/my-koop/module.user/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/my-koop/module.user/git/refs{/sha}","trees_url":"https://api.github.com/repos/my-koop/module.user/git/trees{/sha}","statuses_url":"https://api.github.com/repos/my-koop/module.user/statuses/{sha}","languages_url":"https://api.github.com/repos/my-koop/module.user/languages","stargazers_url":"https://api.github.com/repos/my-koop/module.user/stargazers","contributors_url":"https://api.github.com/repos/my-koop/module.user/contributors","subscribers_url":"https://api.github.com/repos/my-koop/module.user/subscribers","subscription_url":"https://api.github.com/repos/my-koop/module.user/subscription","commits_url":"https://api.github.com/repos/my-koop/module.user/commits{/sha}","git_commits_url":"https://api.github.com/repos/my-koop/module.user/git/commits{/sha}","comments_url":"https://api.github.com/repos/my-koop/module.user/comments{/number}","issue_comment_url":"https://api.github.com/repos/my-koop/module.user/issues/comments/{number}","contents_url":"https://api.github.com/repos/my-koop/module.user/contents/{+path}","compare_url":"https://api.github.com/repos/my-koop/module.user/compare/{base}...{head}","merges_url":"https://api.github.com/repos/my-koop/module.user/merges","archive_url":"https://api.github.com/repos/my-koop/module.user/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/my-koop/module.user/downloads","issues_url":"https://api.github.com/repos/my-koop/module.user/issues{/number}","pulls_url":"https://api.github.com/repos/my-koop/module.user/pulls{/number}","milestones_url":"https://api.github.com/repos/my-koop/module.user/milestones{/number}","notifications_url":"https://api.github.com/repos/my-koop/module.user/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/my-koop/module.user/labels{/name}","releases_url":"https://api.github.com/repos/my-koop/module.user/releases{/id}","created_at":"2014-10-15T20:21:52Z","updated_at":"2014-10-18T20:57:26Z","pushed_at":"2014-11-03T02:25:59Z","git_url":"git://github.com/my-koop/module.user.git","ssh_url":"git@github.com:my-koop/module.user.git","clone_url":"https://github.com/my-koop/module.user.git","svn_url":"https://github.com/my-koop/module.user","homepage":null,"size":372,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":0,"default_branch":"beta"}},"_links":{"self":{"href":"https://api.github.com/repos/my-koop/module.user/pulls/24"},"html":{"href":"https://github.com/my-koop/module.user/pull/24"},"issue":{"href":"https://api.github.com/repos/my-koop/module.user/issues/24"},"comments":{"href":"https://api.github.com/repos/my-koop/module.user/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/my-koop/module.user/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/my-koop/module.user/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/my-koop/module.user/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/my-koop/module.user/statuses/62f8b8fdf1c08acf046c77ed839c0ec17b9723dd"}}}}