{"action":"created","comment":{"url":"https://api.github.com/repos/markwain/educationPlatform/pulls/comments/70070982","id":70070982,"diff_hunk":"@@ -2,78 +2,86 @@ import React from 'react'\n import { connect } from 'react-redux'\n import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn, TextField } from 'material-ui'\n \n-import { fetchSubjectsList, fetchStudentsList, fetchScoresList } from 'actions/group'\n+import { fetchSubjectsList, fetchStudentsList, fetchScoresList, applyNewScore } from 'actions/group'\n \n \n class ScoresTable extends React.Component {\n   constructor(props) {\n     super(props)\n     this.state = {\n-      subjectsList: null,\n-      studentsList: null,\n-      scoresList: null,\n-      neededSubjects: null,\n-      rebuiltStudentsList: null,\n+      groupSubjectsList: null,\n+      rebuiltSubjectsList: null,\n     }\n-    this.handleInput = this.handleInput.bind(this)\n   }\n \n-  handleInput(event){\n+  handleInput(studentId, courseId, event){\n+    const { applyNewScore } = this.props\n     const inputValue = event.target.value\n-    console.log(`Got an input: ${inputValue}`)\n+    applyNewScore(studentId, courseId, inputValue)\n   }\n \n   componentWillMount() {\n-    const { fetchSubjectsList, fetchStudentsList, fetchScoresList, groupStore } = this.props\n+    const { fetchSubjectsList, fetchStudentsList, fetchScoresList } = this.props\n     const subjectsPromise = new Promise((resolve, reject) => { fetchSubjectsList(resolve, reject) }),\n           studentsPromise = new Promise((resolve, reject) => { fetchStudentsList(resolve, reject) }),\n           scoresPromise = new Promise((resolve, reject) => { fetchScoresList(resolve, reject) })\n \n     Promise.all([subjectsPromise, studentsPromise, scoresPromise]).then(() => {\n-      const subjectsList = this.props.groupStore.subjects.list,\n-            studentsList = this.props.groupStore.students.list,\n-            scoresList = this.props.groupStore.scores.list\n+      const { groupStore } = this.props\n+      const subjectsList = groupStore.subjects.list,\n+            studentsList = groupStore.students.list,\n+            scoresList = groupStore.scores.list\n+\n+      // Creating a list of all subjects, formatted like {subjectId: subjectName}\n+      const rebuiltSubjectsList = {}\n+      subjectsList.forEach(subject => {\n+        rebuiltSubjectsList[subject._id] = subject.name\n+      })\n \n       // Creating a list of needed subjects, formatted like {subjectId: subjectName}\n-      const neededSubjects = {}\n+      const groupSubjectsList = {}\n       studentsList.forEach((student) => {\n-        neededSubjects[student.course.subject] = subjectsList.filter(s => (s._id === student.course.subject))[0].name\n+        groupSubjectsList[student.course.subject] = rebuiltSubjectsList[student.course.subject]\n       })\n \n       // Flattering [{name: 'foo', _id: 'bar', scoreValue: 'baz'}] to {foo: {bar: 'baz'}}","path":"frontend/src/components/Dashboard/ScoresTableSection/index.jsx","position":61,"original_position":61,"commit_id":"b53cc94bf62fa1265c802f517b4184ed1fdd62c4","original_commit_id":"b53cc94bf62fa1265c802f517b4184ed1fdd62c4","user":{"login":"vlatri","id":10485298,"avatar_url":"https://avatars.githubusercontent.com/u/10485298?v=3","gravatar_id":"","url":"https://api.github.com/users/vlatri","html_url":"https://github.com/vlatri","followers_url":"https://api.github.com/users/vlatri/followers","following_url":"https://api.github.com/users/vlatri/following{/other_user}","gists_url":"https://api.github.com/users/vlatri/gists{/gist_id}","starred_url":"https://api.github.com/users/vlatri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlatri/subscriptions","organizations_url":"https://api.github.com/users/vlatri/orgs","repos_url":"https://api.github.com/users/vlatri/repos","events_url":"https://api.github.com/users/vlatri/events{/privacy}","received_events_url":"https://api.github.com/users/vlatri/received_events","type":"User","site_admin":false},"body":"While writing that comment I meant 'foo', 'bar' and 'baz' to be meta-variables that represent the essences, not specific data types.","created_at":"2016-07-08T13:12:21Z","updated_at":"2016-07-08T13:12:21Z","html_url":"https://github.com/markwain/educationPlatform/pull/1#discussion_r70070982","pull_request_url":"https://api.github.com/repos/markwain/educationPlatform/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/markwain/educationPlatform/pulls/comments/70070982"},"html":{"href":"https://github.com/markwain/educationPlatform/pull/1#discussion_r70070982"},"pull_request":{"href":"https://api.github.com/repos/markwain/educationPlatform/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/markwain/educationPlatform/pulls/1","id":76443990,"html_url":"https://github.com/markwain/educationPlatform/pull/1","diff_url":"https://github.com/markwain/educationPlatform/pull/1.diff","patch_url":"https://github.com/markwain/educationPlatform/pull/1.patch","issue_url":"https://api.github.com/repos/markwain/educationPlatform/issues/1","number":1,"state":"open","locked":false,"title":"Frontend","user":{"login":"vlatri","id":10485298,"avatar_url":"https://avatars.githubusercontent.com/u/10485298?v=3","gravatar_id":"","url":"https://api.github.com/users/vlatri","html_url":"https://github.com/vlatri","followers_url":"https://api.github.com/users/vlatri/followers","following_url":"https://api.github.com/users/vlatri/following{/other_user}","gists_url":"https://api.github.com/users/vlatri/gists{/gist_id}","starred_url":"https://api.github.com/users/vlatri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlatri/subscriptions","organizations_url":"https://api.github.com/users/vlatri/orgs","repos_url":"https://api.github.com/users/vlatri/repos","events_url":"https://api.github.com/users/vlatri/events{/privacy}","received_events_url":"https://api.github.com/users/vlatri/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-06T14:42:44Z","updated_at":"2016-07-08T13:12:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd518dd8ce2c6f4bf29af64f95027800540ee3cb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/markwain/educationPlatform/pulls/1/commits","review_comments_url":"https://api.github.com/repos/markwain/educationPlatform/pulls/1/comments","review_comment_url":"https://api.github.com/repos/markwain/educationPlatform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/markwain/educationPlatform/issues/1/comments","statuses_url":"https://api.github.com/repos/markwain/educationPlatform/statuses/b53cc94bf62fa1265c802f517b4184ed1fdd62c4","head":{"label":"markwain:frontend","ref":"frontend","sha":"b53cc94bf62fa1265c802f517b4184ed1fdd62c4","user":{"login":"markwain","id":10371324,"avatar_url":"https://avatars.githubusercontent.com/u/10371324?v=3","gravatar_id":"","url":"https://api.github.com/users/markwain","html_url":"https://github.com/markwain","followers_url":"https://api.github.com/users/markwain/followers","following_url":"https://api.github.com/users/markwain/following{/other_user}","gists_url":"https://api.github.com/users/markwain/gists{/gist_id}","starred_url":"https://api.github.com/users/markwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markwain/subscriptions","organizations_url":"https://api.github.com/users/markwain/orgs","repos_url":"https://api.github.com/users/markwain/repos","events_url":"https://api.github.com/users/markwain/events{/privacy}","received_events_url":"https://api.github.com/users/markwain/received_events","type":"User","site_admin":false},"repo":{"id":60903123,"name":"educationPlatform","full_name":"markwain/educationPlatform","owner":{"login":"markwain","id":10371324,"avatar_url":"https://avatars.githubusercontent.com/u/10371324?v=3","gravatar_id":"","url":"https://api.github.com/users/markwain","html_url":"https://github.com/markwain","followers_url":"https://api.github.com/users/markwain/followers","following_url":"https://api.github.com/users/markwain/following{/other_user}","gists_url":"https://api.github.com/users/markwain/gists{/gist_id}","starred_url":"https://api.github.com/users/markwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markwain/subscriptions","organizations_url":"https://api.github.com/users/markwain/orgs","repos_url":"https://api.github.com/users/markwain/repos","events_url":"https://api.github.com/users/markwain/events{/privacy}","received_events_url":"https://api.github.com/users/markwain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markwain/educationPlatform","description":"","fork":false,"url":"https://api.github.com/repos/markwain/educationPlatform","forks_url":"https://api.github.com/repos/markwain/educationPlatform/forks","keys_url":"https://api.github.com/repos/markwain/educationPlatform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markwain/educationPlatform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markwain/educationPlatform/teams","hooks_url":"https://api.github.com/repos/markwain/educationPlatform/hooks","issue_events_url":"https://api.github.com/repos/markwain/educationPlatform/issues/events{/number}","events_url":"https://api.github.com/repos/markwain/educationPlatform/events","assignees_url":"https://api.github.com/repos/markwain/educationPlatform/assignees{/user}","branches_url":"https://api.github.com/repos/markwain/educationPlatform/branches{/branch}","tags_url":"https://api.github.com/repos/markwain/educationPlatform/tags","blobs_url":"https://api.github.com/repos/markwain/educationPlatform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markwain/educationPlatform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markwain/educationPlatform/git/refs{/sha}","trees_url":"https://api.github.com/repos/markwain/educationPlatform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markwain/educationPlatform/statuses/{sha}","languages_url":"https://api.github.com/repos/markwain/educationPlatform/languages","stargazers_url":"https://api.github.com/repos/markwain/educationPlatform/stargazers","contributors_url":"https://api.github.com/repos/markwain/educationPlatform/contributors","subscribers_url":"https://api.github.com/repos/markwain/educationPlatform/subscribers","subscription_url":"https://api.github.com/repos/markwain/educationPlatform/subscription","commits_url":"https://api.github.com/repos/markwain/educationPlatform/commits{/sha}","git_commits_url":"https://api.github.com/repos/markwain/educationPlatform/git/commits{/sha}","comments_url":"https://api.github.com/repos/markwain/educationPlatform/comments{/number}","issue_comment_url":"https://api.github.com/repos/markwain/educationPlatform/issues/comments{/number}","contents_url":"https://api.github.com/repos/markwain/educationPlatform/contents/{+path}","compare_url":"https://api.github.com/repos/markwain/educationPlatform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markwain/educationPlatform/merges","archive_url":"https://api.github.com/repos/markwain/educationPlatform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markwain/educationPlatform/downloads","issues_url":"https://api.github.com/repos/markwain/educationPlatform/issues{/number}","pulls_url":"https://api.github.com/repos/markwain/educationPlatform/pulls{/number}","milestones_url":"https://api.github.com/repos/markwain/educationPlatform/milestones{/number}","notifications_url":"https://api.github.com/repos/markwain/educationPlatform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markwain/educationPlatform/labels{/name}","releases_url":"https://api.github.com/repos/markwain/educationPlatform/releases{/id}","deployments_url":"https://api.github.com/repos/markwain/educationPlatform/deployments","created_at":"2016-06-11T10:58:41Z","updated_at":"2016-06-24T10:48:17Z","pushed_at":"2016-07-07T19:56:11Z","git_url":"git://github.com/markwain/educationPlatform.git","ssh_url":"git@github.com:markwain/educationPlatform.git","clone_url":"https://github.com/markwain/educationPlatform.git","svn_url":"https://github.com/markwain/educationPlatform","homepage":null,"size":3217,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"markwain:master","ref":"master","sha":"988e669b48fdac73d1fee1ef7e29eaad37217a7c","user":{"login":"markwain","id":10371324,"avatar_url":"https://avatars.githubusercontent.com/u/10371324?v=3","gravatar_id":"","url":"https://api.github.com/users/markwain","html_url":"https://github.com/markwain","followers_url":"https://api.github.com/users/markwain/followers","following_url":"https://api.github.com/users/markwain/following{/other_user}","gists_url":"https://api.github.com/users/markwain/gists{/gist_id}","starred_url":"https://api.github.com/users/markwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markwain/subscriptions","organizations_url":"https://api.github.com/users/markwain/orgs","repos_url":"https://api.github.com/users/markwain/repos","events_url":"https://api.github.com/users/markwain/events{/privacy}","received_events_url":"https://api.github.com/users/markwain/received_events","type":"User","site_admin":false},"repo":{"id":60903123,"name":"educationPlatform","full_name":"markwain/educationPlatform","owner":{"login":"markwain","id":10371324,"avatar_url":"https://avatars.githubusercontent.com/u/10371324?v=3","gravatar_id":"","url":"https://api.github.com/users/markwain","html_url":"https://github.com/markwain","followers_url":"https://api.github.com/users/markwain/followers","following_url":"https://api.github.com/users/markwain/following{/other_user}","gists_url":"https://api.github.com/users/markwain/gists{/gist_id}","starred_url":"https://api.github.com/users/markwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markwain/subscriptions","organizations_url":"https://api.github.com/users/markwain/orgs","repos_url":"https://api.github.com/users/markwain/repos","events_url":"https://api.github.com/users/markwain/events{/privacy}","received_events_url":"https://api.github.com/users/markwain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markwain/educationPlatform","description":"","fork":false,"url":"https://api.github.com/repos/markwain/educationPlatform","forks_url":"https://api.github.com/repos/markwain/educationPlatform/forks","keys_url":"https://api.github.com/repos/markwain/educationPlatform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markwain/educationPlatform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markwain/educationPlatform/teams","hooks_url":"https://api.github.com/repos/markwain/educationPlatform/hooks","issue_events_url":"https://api.github.com/repos/markwain/educationPlatform/issues/events{/number}","events_url":"https://api.github.com/repos/markwain/educationPlatform/events","assignees_url":"https://api.github.com/repos/markwain/educationPlatform/assignees{/user}","branches_url":"https://api.github.com/repos/markwain/educationPlatform/branches{/branch}","tags_url":"https://api.github.com/repos/markwain/educationPlatform/tags","blobs_url":"https://api.github.com/repos/markwain/educationPlatform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markwain/educationPlatform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markwain/educationPlatform/git/refs{/sha}","trees_url":"https://api.github.com/repos/markwain/educationPlatform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markwain/educationPlatform/statuses/{sha}","languages_url":"https://api.github.com/repos/markwain/educationPlatform/languages","stargazers_url":"https://api.github.com/repos/markwain/educationPlatform/stargazers","contributors_url":"https://api.github.com/repos/markwain/educationPlatform/contributors","subscribers_url":"https://api.github.com/repos/markwain/educationPlatform/subscribers","subscription_url":"https://api.github.com/repos/markwain/educationPlatform/subscription","commits_url":"https://api.github.com/repos/markwain/educationPlatform/commits{/sha}","git_commits_url":"https://api.github.com/repos/markwain/educationPlatform/git/commits{/sha}","comments_url":"https://api.github.com/repos/markwain/educationPlatform/comments{/number}","issue_comment_url":"https://api.github.com/repos/markwain/educationPlatform/issues/comments{/number}","contents_url":"https://api.github.com/repos/markwain/educationPlatform/contents/{+path}","compare_url":"https://api.github.com/repos/markwain/educationPlatform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markwain/educationPlatform/merges","archive_url":"https://api.github.com/repos/markwain/educationPlatform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markwain/educationPlatform/downloads","issues_url":"https://api.github.com/repos/markwain/educationPlatform/issues{/number}","pulls_url":"https://api.github.com/repos/markwain/educationPlatform/pulls{/number}","milestones_url":"https://api.github.com/repos/markwain/educationPlatform/milestones{/number}","notifications_url":"https://api.github.com/repos/markwain/educationPlatform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markwain/educationPlatform/labels{/name}","releases_url":"https://api.github.com/repos/markwain/educationPlatform/releases{/id}","deployments_url":"https://api.github.com/repos/markwain/educationPlatform/deployments","created_at":"2016-06-11T10:58:41Z","updated_at":"2016-06-24T10:48:17Z","pushed_at":"2016-07-07T19:56:11Z","git_url":"git://github.com/markwain/educationPlatform.git","ssh_url":"git@github.com:markwain/educationPlatform.git","clone_url":"https://github.com/markwain/educationPlatform.git","svn_url":"https://github.com/markwain/educationPlatform","homepage":null,"size":3217,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/markwain/educationPlatform/pulls/1"},"html":{"href":"https://github.com/markwain/educationPlatform/pull/1"},"issue":{"href":"https://api.github.com/repos/markwain/educationPlatform/issues/1"},"comments":{"href":"https://api.github.com/repos/markwain/educationPlatform/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/markwain/educationPlatform/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/markwain/educationPlatform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/markwain/educationPlatform/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/markwain/educationPlatform/statuses/b53cc94bf62fa1265c802f517b4184ed1fdd62c4"}}}}
{"actor":{"display_login":"vlatri"}}