{"action":"created","comment":{"url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/comments/41720097","id":41720097,"diff_hunk":"@@ -0,0 +1,57 @@\n+import React, {PropTypes} from 'react';\n+import DataTable from './DataTable';\n+\n+function getDonationSize(number) {\n+  switch (number) {\n+    case 0:\n+      return 'none';\n+\n+    case 1:\n+      return 'small';\n+\n+    case 2:\n+      return 'medium';\n+\n+    case 3:\n+      return 'large';\n+\n+    default:\n+      return 'unspecified';\n+  }\n+}\n+\n+export default class CoordinationTable extends React.Component {\n+  static propTypes = {\n+    donations: PropTypes.array,\n+    donors: PropTypes.array,\n+    locations: PropTypes.array\n+  }\n+\n+  _getRowData(location) {\n+    const {donors} = this.props;\n+    const donor = donors.find(donor => donor.id === location.user_id);\n+    const associatedDonations = this.props.donations.filter(donation => donation.location_id === location.id);\n+    associatedDonations.sort((a,b) => a.updated_at > b.updated_at ?  1 :\n+                                      a.updated_at < b.updated_at ? -1 : 0);\n+\n+    const latestDonation = associatedDonations[0] || {};\n+\n+    return {\n+      address: location.address,\n+      'contact email': donor.email,\n+      'donation confirmed?': latestDonation.size > 0 ? 'yes' : 'no',\n+      'donation size': getDonationSize(latestDonation.size),\n+      'donation comments': latestDonation.comments\n+    };\n+  }\n+\n+  render() {\n+    const {locations} = this.props;\n+    const data = locations.map(this._getRowData, this);\n+    console.log(data);","path":"lib/components/admin/CoordinationTable.js","position":51,"original_position":51,"commit_id":"bde7b44f9613c01a615d96a69dda5027f4e96f6a","original_commit_id":"bde7b44f9613c01a615d96a69dda5027f4e96f6a","user":{"login":"dviramontes","id":144226,"avatar_url":"https://avatars.githubusercontent.com/u/144226?v=3","gravatar_id":"","url":"https://api.github.com/users/dviramontes","html_url":"https://github.com/dviramontes","followers_url":"https://api.github.com/users/dviramontes/followers","following_url":"https://api.github.com/users/dviramontes/following{/other_user}","gists_url":"https://api.github.com/users/dviramontes/gists{/gist_id}","starred_url":"https://api.github.com/users/dviramontes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dviramontes/subscriptions","organizations_url":"https://api.github.com/users/dviramontes/orgs","repos_url":"https://api.github.com/users/dviramontes/repos","events_url":"https://api.github.com/users/dviramontes/events{/privacy}","received_events_url":"https://api.github.com/users/dviramontes/received_events","type":"User","site_admin":false},"body":":warning: console.log","created_at":"2015-10-12T02:45:30Z","updated_at":"2015-10-12T02:45:30Z","html_url":"https://github.com/codefordenver/fresh-food-connect/pull/191#discussion_r41720097","pull_request_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191","_links":{"self":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/comments/41720097"},"html":{"href":"https://github.com/codefordenver/fresh-food-connect/pull/191#discussion_r41720097"},"pull_request":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191"}}},"pull_request":{"url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191","id":47378866,"html_url":"https://github.com/codefordenver/fresh-food-connect/pull/191","diff_url":"https://github.com/codefordenver/fresh-food-connect/pull/191.diff","patch_url":"https://github.com/codefordenver/fresh-food-connect/pull/191.patch","issue_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/191","number":191,"state":"open","locked":false,"title":"Add basic admin join table for locations, donors, and donations","user":{"login":"wdoug","id":5432102,"avatar_url":"https://avatars.githubusercontent.com/u/5432102?v=3","gravatar_id":"","url":"https://api.github.com/users/wdoug","html_url":"https://github.com/wdoug","followers_url":"https://api.github.com/users/wdoug/followers","following_url":"https://api.github.com/users/wdoug/following{/other_user}","gists_url":"https://api.github.com/users/wdoug/gists{/gist_id}","starred_url":"https://api.github.com/users/wdoug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdoug/subscriptions","organizations_url":"https://api.github.com/users/wdoug/orgs","repos_url":"https://api.github.com/users/wdoug/repos","events_url":"https://api.github.com/users/wdoug/events{/privacy}","received_events_url":"https://api.github.com/users/wdoug/received_events","type":"User","site_admin":false},"body":"Connects to #187 ","created_at":"2015-10-12T00:06:25Z","updated_at":"2015-10-12T02:45:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"018fbb43eddf29f8a44bb85b2da885d2e9dbe5ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191/commits","review_comments_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191/comments","review_comment_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/191/comments","statuses_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/statuses/bde7b44f9613c01a615d96a69dda5027f4e96f6a","head":{"label":"codefordenver:admin-overview-table","ref":"admin-overview-table","sha":"bde7b44f9613c01a615d96a69dda5027f4e96f6a","user":{"login":"codefordenver","id":7472092,"avatar_url":"https://avatars.githubusercontent.com/u/7472092?v=3","gravatar_id":"","url":"https://api.github.com/users/codefordenver","html_url":"https://github.com/codefordenver","followers_url":"https://api.github.com/users/codefordenver/followers","following_url":"https://api.github.com/users/codefordenver/following{/other_user}","gists_url":"https://api.github.com/users/codefordenver/gists{/gist_id}","starred_url":"https://api.github.com/users/codefordenver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefordenver/subscriptions","organizations_url":"https://api.github.com/users/codefordenver/orgs","repos_url":"https://api.github.com/users/codefordenver/repos","events_url":"https://api.github.com/users/codefordenver/events{/privacy}","received_events_url":"https://api.github.com/users/codefordenver/received_events","type":"Organization","site_admin":false},"repo":{"id":39791105,"name":"fresh-food-connect","full_name":"codefordenver/fresh-food-connect","owner":{"login":"codefordenver","id":7472092,"avatar_url":"https://avatars.githubusercontent.com/u/7472092?v=3","gravatar_id":"","url":"https://api.github.com/users/codefordenver","html_url":"https://github.com/codefordenver","followers_url":"https://api.github.com/users/codefordenver/followers","following_url":"https://api.github.com/users/codefordenver/following{/other_user}","gists_url":"https://api.github.com/users/codefordenver/gists{/gist_id}","starred_url":"https://api.github.com/users/codefordenver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefordenver/subscriptions","organizations_url":"https://api.github.com/users/codefordenver/orgs","repos_url":"https://api.github.com/users/codefordenver/repos","events_url":"https://api.github.com/users/codefordenver/events{/privacy}","received_events_url":"https://api.github.com/users/codefordenver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefordenver/fresh-food-connect","description":"","fork":false,"url":"https://api.github.com/repos/codefordenver/fresh-food-connect","forks_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/forks","keys_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/teams","hooks_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/hooks","issue_events_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/events{/number}","events_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/events","assignees_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/assignees{/user}","branches_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/branches{/branch}","tags_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/tags","blobs_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/statuses/{sha}","languages_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/languages","stargazers_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/stargazers","contributors_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/contributors","subscribers_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/subscribers","subscription_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/subscription","commits_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/contents/{+path}","compare_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/merges","archive_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/downloads","issues_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues{/number}","pulls_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls{/number}","milestones_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/milestones{/number}","notifications_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/labels{/name}","releases_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/releases{/id}","created_at":"2015-07-27T18:32:05Z","updated_at":"2015-10-06T02:23:36Z","pushed_at":"2015-10-12T00:06:25Z","git_url":"git://github.com/codefordenver/fresh-food-connect.git","ssh_url":"git@github.com:codefordenver/fresh-food-connect.git","clone_url":"https://github.com/codefordenver/fresh-food-connect.git","svn_url":"https://github.com/codefordenver/fresh-food-connect","homepage":null,"size":9454,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":52,"forks":1,"open_issues":52,"watchers":5,"default_branch":"master"}},"base":{"label":"codefordenver:master","ref":"master","sha":"3ffcf0abc96b8ed0ec5e87b4e2d7fe69530b60dc","user":{"login":"codefordenver","id":7472092,"avatar_url":"https://avatars.githubusercontent.com/u/7472092?v=3","gravatar_id":"","url":"https://api.github.com/users/codefordenver","html_url":"https://github.com/codefordenver","followers_url":"https://api.github.com/users/codefordenver/followers","following_url":"https://api.github.com/users/codefordenver/following{/other_user}","gists_url":"https://api.github.com/users/codefordenver/gists{/gist_id}","starred_url":"https://api.github.com/users/codefordenver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefordenver/subscriptions","organizations_url":"https://api.github.com/users/codefordenver/orgs","repos_url":"https://api.github.com/users/codefordenver/repos","events_url":"https://api.github.com/users/codefordenver/events{/privacy}","received_events_url":"https://api.github.com/users/codefordenver/received_events","type":"Organization","site_admin":false},"repo":{"id":39791105,"name":"fresh-food-connect","full_name":"codefordenver/fresh-food-connect","owner":{"login":"codefordenver","id":7472092,"avatar_url":"https://avatars.githubusercontent.com/u/7472092?v=3","gravatar_id":"","url":"https://api.github.com/users/codefordenver","html_url":"https://github.com/codefordenver","followers_url":"https://api.github.com/users/codefordenver/followers","following_url":"https://api.github.com/users/codefordenver/following{/other_user}","gists_url":"https://api.github.com/users/codefordenver/gists{/gist_id}","starred_url":"https://api.github.com/users/codefordenver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefordenver/subscriptions","organizations_url":"https://api.github.com/users/codefordenver/orgs","repos_url":"https://api.github.com/users/codefordenver/repos","events_url":"https://api.github.com/users/codefordenver/events{/privacy}","received_events_url":"https://api.github.com/users/codefordenver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefordenver/fresh-food-connect","description":"","fork":false,"url":"https://api.github.com/repos/codefordenver/fresh-food-connect","forks_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/forks","keys_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/teams","hooks_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/hooks","issue_events_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/events{/number}","events_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/events","assignees_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/assignees{/user}","branches_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/branches{/branch}","tags_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/tags","blobs_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/statuses/{sha}","languages_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/languages","stargazers_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/stargazers","contributors_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/contributors","subscribers_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/subscribers","subscription_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/subscription","commits_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/contents/{+path}","compare_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/merges","archive_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/downloads","issues_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues{/number}","pulls_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls{/number}","milestones_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/milestones{/number}","notifications_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/labels{/name}","releases_url":"https://api.github.com/repos/codefordenver/fresh-food-connect/releases{/id}","created_at":"2015-07-27T18:32:05Z","updated_at":"2015-10-06T02:23:36Z","pushed_at":"2015-10-12T00:06:25Z","git_url":"git://github.com/codefordenver/fresh-food-connect.git","ssh_url":"git@github.com:codefordenver/fresh-food-connect.git","clone_url":"https://github.com/codefordenver/fresh-food-connect.git","svn_url":"https://github.com/codefordenver/fresh-food-connect","homepage":null,"size":9454,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":52,"forks":1,"open_issues":52,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191"},"html":{"href":"https://github.com/codefordenver/fresh-food-connect/pull/191"},"issue":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/191"},"comments":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/codefordenver/fresh-food-connect/statuses/bde7b44f9613c01a615d96a69dda5027f4e96f6a"}}}}