{"action":"created","comment":{"url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/comments/45584379","id":45584379,"diff_hunk":"@@ -0,0 +1,80 @@\n+import React from 'react';\n+\n+import AdminStore from '../stores/AdminStore';\n+import CreateStudy from './CreateStudy';\n+\n+import AdminActions from '../actions/AdminActions';\n+\n+function getStateFromStores() {\n+  return {\n+    studies: AdminStore.get('studies'),\n+  };\n+}\n+\n+const StudyList = React.createClass({\n+  propTypes: {\n+    firebase: React.PropTypes.object.isRequired,\n+  },\n+\n+  getInitialState() {\n+    return {\n+      ...getStateFromStores(),\n+      loaded: false,\n+    };\n+  },\n+\n+  componentWillMount() {\n+    this.props.firebase.on('value', snapshot => {\n+      if (!snapshot.val()) {\n+        this.props.firebase.set({ studies: new Set() }, (err) => {\n+          this.setState({ loaded: true });\n+          console.log(err);\n+        });\n+      } else {\n+        this.setState({ loaded: true });\n+        const studies = snapshot.val().studies;\n+        if (studies) {\n+          AdminActions.setStudies(studies);\n+        }\n+      }\n+    });\n+\n+    AdminStore.listen(this._onChange);\n+  },\n+\n+  _onChange() {\n+    this.setState(getStateFromStores());\n+  },\n+\n+  _renderStudies() {\n+    if (!this.state.loaded || !this.state.studies) {\n+      return 'Loading';\n+    }\n+\n+    if (!this.state.studies.size) {\n+      return 'No Studies here!';\n+    }\n+\n+    return [...this.state.studies].map(study => {","path":"src/js/admin/components/StudyList.jsx","position":58,"original_position":58,"commit_id":"0efe910cf2f67d114a237d6e87a128f60b4a7bb2","original_commit_id":"0efe910cf2f67d114a237d6e87a128f60b4a7bb2","user":{"login":"charlesx2013","id":5563367,"avatar_url":"https://avatars.githubusercontent.com/u/5563367?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesx2013","html_url":"https://github.com/charlesx2013","followers_url":"https://api.github.com/users/charlesx2013/followers","following_url":"https://api.github.com/users/charlesx2013/following{/other_user}","gists_url":"https://api.github.com/users/charlesx2013/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesx2013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesx2013/subscriptions","organizations_url":"https://api.github.com/users/charlesx2013/orgs","repos_url":"https://api.github.com/users/charlesx2013/repos","events_url":"https://api.github.com/users/charlesx2013/events{/privacy}","received_events_url":"https://api.github.com/users/charlesx2013/received_events","type":"User","site_admin":false},"body":"no such thing for sets","created_at":"2015-11-23T09:39:24Z","updated_at":"2015-11-23T09:39:24Z","html_url":"https://github.com/SamLau95/pg-chat-room/pull/26#discussion_r45584379","pull_request_url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/comments/45584379"},"html":{"href":"https://github.com/SamLau95/pg-chat-room/pull/26#discussion_r45584379"},"pull_request":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26","id":51343209,"html_url":"https://github.com/SamLau95/pg-chat-room/pull/26","diff_url":"https://github.com/SamLau95/pg-chat-room/pull/26.diff","patch_url":"https://github.com/SamLau95/pg-chat-room/pull/26.patch","issue_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/26","number":26,"state":"open","locked":false,"title":"Add studies","user":{"login":"charlesx2013","id":5563367,"avatar_url":"https://avatars.githubusercontent.com/u/5563367?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesx2013","html_url":"https://github.com/charlesx2013","followers_url":"https://api.github.com/users/charlesx2013/followers","following_url":"https://api.github.com/users/charlesx2013/following{/other_user}","gists_url":"https://api.github.com/users/charlesx2013/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesx2013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesx2013/subscriptions","organizations_url":"https://api.github.com/users/charlesx2013/orgs","repos_url":"https://api.github.com/users/charlesx2013/repos","events_url":"https://api.github.com/users/charlesx2013/events{/privacy}","received_events_url":"https://api.github.com/users/charlesx2013/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-20T11:01:10Z","updated_at":"2015-11-23T09:39:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4727f6f1b524d5066f86bf38786f5c1685eb98cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26/commits","review_comments_url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26/comments","review_comment_url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/26/comments","statuses_url":"https://api.github.com/repos/SamLau95/pg-chat-room/statuses/0efe910cf2f67d114a237d6e87a128f60b4a7bb2","head":{"label":"SamLau95:addStudies","ref":"addStudies","sha":"0efe910cf2f67d114a237d6e87a128f60b4a7bb2","user":{"login":"SamLau95","id":2468904,"avatar_url":"https://avatars.githubusercontent.com/u/2468904?v=3","gravatar_id":"","url":"https://api.github.com/users/SamLau95","html_url":"https://github.com/SamLau95","followers_url":"https://api.github.com/users/SamLau95/followers","following_url":"https://api.github.com/users/SamLau95/following{/other_user}","gists_url":"https://api.github.com/users/SamLau95/gists{/gist_id}","starred_url":"https://api.github.com/users/SamLau95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamLau95/subscriptions","organizations_url":"https://api.github.com/users/SamLau95/orgs","repos_url":"https://api.github.com/users/SamLau95/repos","events_url":"https://api.github.com/users/SamLau95/events{/privacy}","received_events_url":"https://api.github.com/users/SamLau95/received_events","type":"User","site_admin":false},"repo":{"id":32767865,"name":"pg-chat-room","full_name":"SamLau95/pg-chat-room","owner":{"login":"SamLau95","id":2468904,"avatar_url":"https://avatars.githubusercontent.com/u/2468904?v=3","gravatar_id":"","url":"https://api.github.com/users/SamLau95","html_url":"https://github.com/SamLau95","followers_url":"https://api.github.com/users/SamLau95/followers","following_url":"https://api.github.com/users/SamLau95/following{/other_user}","gists_url":"https://api.github.com/users/SamLau95/gists{/gist_id}","starred_url":"https://api.github.com/users/SamLau95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamLau95/subscriptions","organizations_url":"https://api.github.com/users/SamLau95/orgs","repos_url":"https://api.github.com/users/SamLau95/repos","events_url":"https://api.github.com/users/SamLau95/events{/privacy}","received_events_url":"https://api.github.com/users/SamLau95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SamLau95/pg-chat-room","description":"Chat room for Leadership in Unusual Contexts research studies","fork":false,"url":"https://api.github.com/repos/SamLau95/pg-chat-room","forks_url":"https://api.github.com/repos/SamLau95/pg-chat-room/forks","keys_url":"https://api.github.com/repos/SamLau95/pg-chat-room/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SamLau95/pg-chat-room/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SamLau95/pg-chat-room/teams","hooks_url":"https://api.github.com/repos/SamLau95/pg-chat-room/hooks","issue_events_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/events{/number}","events_url":"https://api.github.com/repos/SamLau95/pg-chat-room/events","assignees_url":"https://api.github.com/repos/SamLau95/pg-chat-room/assignees{/user}","branches_url":"https://api.github.com/repos/SamLau95/pg-chat-room/branches{/branch}","tags_url":"https://api.github.com/repos/SamLau95/pg-chat-room/tags","blobs_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/refs{/sha}","trees_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SamLau95/pg-chat-room/statuses/{sha}","languages_url":"https://api.github.com/repos/SamLau95/pg-chat-room/languages","stargazers_url":"https://api.github.com/repos/SamLau95/pg-chat-room/stargazers","contributors_url":"https://api.github.com/repos/SamLau95/pg-chat-room/contributors","subscribers_url":"https://api.github.com/repos/SamLau95/pg-chat-room/subscribers","subscription_url":"https://api.github.com/repos/SamLau95/pg-chat-room/subscription","commits_url":"https://api.github.com/repos/SamLau95/pg-chat-room/commits{/sha}","git_commits_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/commits{/sha}","comments_url":"https://api.github.com/repos/SamLau95/pg-chat-room/comments{/number}","issue_comment_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/comments{/number}","contents_url":"https://api.github.com/repos/SamLau95/pg-chat-room/contents/{+path}","compare_url":"https://api.github.com/repos/SamLau95/pg-chat-room/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SamLau95/pg-chat-room/merges","archive_url":"https://api.github.com/repos/SamLau95/pg-chat-room/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SamLau95/pg-chat-room/downloads","issues_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues{/number}","pulls_url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls{/number}","milestones_url":"https://api.github.com/repos/SamLau95/pg-chat-room/milestones{/number}","notifications_url":"https://api.github.com/repos/SamLau95/pg-chat-room/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SamLau95/pg-chat-room/labels{/name}","releases_url":"https://api.github.com/repos/SamLau95/pg-chat-room/releases{/id}","created_at":"2015-03-24T01:06:50Z","updated_at":"2015-09-16T01:28:59Z","pushed_at":"2015-11-20T11:01:10Z","git_url":"git://github.com/SamLau95/pg-chat-room.git","ssh_url":"git@github.com:SamLau95/pg-chat-room.git","clone_url":"https://github.com/SamLau95/pg-chat-room.git","svn_url":"https://github.com/SamLau95/pg-chat-room","homepage":"","size":638,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":1,"default_branch":"gh-pages"}},"base":{"label":"SamLau95:gh-pages","ref":"gh-pages","sha":"5366c29869a932c019d679036483a2f6d0d043bb","user":{"login":"SamLau95","id":2468904,"avatar_url":"https://avatars.githubusercontent.com/u/2468904?v=3","gravatar_id":"","url":"https://api.github.com/users/SamLau95","html_url":"https://github.com/SamLau95","followers_url":"https://api.github.com/users/SamLau95/followers","following_url":"https://api.github.com/users/SamLau95/following{/other_user}","gists_url":"https://api.github.com/users/SamLau95/gists{/gist_id}","starred_url":"https://api.github.com/users/SamLau95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamLau95/subscriptions","organizations_url":"https://api.github.com/users/SamLau95/orgs","repos_url":"https://api.github.com/users/SamLau95/repos","events_url":"https://api.github.com/users/SamLau95/events{/privacy}","received_events_url":"https://api.github.com/users/SamLau95/received_events","type":"User","site_admin":false},"repo":{"id":32767865,"name":"pg-chat-room","full_name":"SamLau95/pg-chat-room","owner":{"login":"SamLau95","id":2468904,"avatar_url":"https://avatars.githubusercontent.com/u/2468904?v=3","gravatar_id":"","url":"https://api.github.com/users/SamLau95","html_url":"https://github.com/SamLau95","followers_url":"https://api.github.com/users/SamLau95/followers","following_url":"https://api.github.com/users/SamLau95/following{/other_user}","gists_url":"https://api.github.com/users/SamLau95/gists{/gist_id}","starred_url":"https://api.github.com/users/SamLau95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamLau95/subscriptions","organizations_url":"https://api.github.com/users/SamLau95/orgs","repos_url":"https://api.github.com/users/SamLau95/repos","events_url":"https://api.github.com/users/SamLau95/events{/privacy}","received_events_url":"https://api.github.com/users/SamLau95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SamLau95/pg-chat-room","description":"Chat room for Leadership in Unusual Contexts research studies","fork":false,"url":"https://api.github.com/repos/SamLau95/pg-chat-room","forks_url":"https://api.github.com/repos/SamLau95/pg-chat-room/forks","keys_url":"https://api.github.com/repos/SamLau95/pg-chat-room/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SamLau95/pg-chat-room/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SamLau95/pg-chat-room/teams","hooks_url":"https://api.github.com/repos/SamLau95/pg-chat-room/hooks","issue_events_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/events{/number}","events_url":"https://api.github.com/repos/SamLau95/pg-chat-room/events","assignees_url":"https://api.github.com/repos/SamLau95/pg-chat-room/assignees{/user}","branches_url":"https://api.github.com/repos/SamLau95/pg-chat-room/branches{/branch}","tags_url":"https://api.github.com/repos/SamLau95/pg-chat-room/tags","blobs_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/refs{/sha}","trees_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SamLau95/pg-chat-room/statuses/{sha}","languages_url":"https://api.github.com/repos/SamLau95/pg-chat-room/languages","stargazers_url":"https://api.github.com/repos/SamLau95/pg-chat-room/stargazers","contributors_url":"https://api.github.com/repos/SamLau95/pg-chat-room/contributors","subscribers_url":"https://api.github.com/repos/SamLau95/pg-chat-room/subscribers","subscription_url":"https://api.github.com/repos/SamLau95/pg-chat-room/subscription","commits_url":"https://api.github.com/repos/SamLau95/pg-chat-room/commits{/sha}","git_commits_url":"https://api.github.com/repos/SamLau95/pg-chat-room/git/commits{/sha}","comments_url":"https://api.github.com/repos/SamLau95/pg-chat-room/comments{/number}","issue_comment_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/comments{/number}","contents_url":"https://api.github.com/repos/SamLau95/pg-chat-room/contents/{+path}","compare_url":"https://api.github.com/repos/SamLau95/pg-chat-room/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SamLau95/pg-chat-room/merges","archive_url":"https://api.github.com/repos/SamLau95/pg-chat-room/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SamLau95/pg-chat-room/downloads","issues_url":"https://api.github.com/repos/SamLau95/pg-chat-room/issues{/number}","pulls_url":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls{/number}","milestones_url":"https://api.github.com/repos/SamLau95/pg-chat-room/milestones{/number}","notifications_url":"https://api.github.com/repos/SamLau95/pg-chat-room/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SamLau95/pg-chat-room/labels{/name}","releases_url":"https://api.github.com/repos/SamLau95/pg-chat-room/releases{/id}","created_at":"2015-03-24T01:06:50Z","updated_at":"2015-09-16T01:28:59Z","pushed_at":"2015-11-20T11:01:10Z","git_url":"git://github.com/SamLau95/pg-chat-room.git","ssh_url":"git@github.com:SamLau95/pg-chat-room.git","clone_url":"https://github.com/SamLau95/pg-chat-room.git","svn_url":"https://github.com/SamLau95/pg-chat-room","homepage":"","size":638,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":1,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26"},"html":{"href":"https://github.com/SamLau95/pg-chat-room/pull/26"},"issue":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/26"},"comments":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/SamLau95/pg-chat-room/statuses/0efe910cf2f67d114a237d6e87a128f60b4a7bb2"}}}}