{"action":"created","comment":{"url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments/91007520","pull_request_review_id":11518420,"id":91007520,"diff_hunk":"@@ -0,0 +1,98 @@\n+import Ember from 'ember';\n+\n+const {\n+  Component,\n+  computed,\n+  get,\n+  isPresent\n+} = Ember;\n+\n+/**\n+  The `volunteer-headshot` component presents a thumbnail of a volunteer, their\n+  name and randomly selects one of their roles.\n+\n+  ## Default Usage\n+\n+  ```handlebars\n+  {{volunteer-headshot volunteer=user}}\n+  ```\n+\n+  @class volunteer-headshot\n+  @module Component\n+  @extends Ember.Component\n+ */\n+export default Component.extend({\n+  attributeBindings: ['data-test-selector'],\n+  classNames: ['volunteer-headshot'],\n+\n+  /**\n+    A computed array of the volunteer's user roles.\n+\n+    @property userRoles\n+    @type Ember.Array\n+   */\n+  userRoles: computed('volunteer.userRoles.[]',\n+      'volunteer.userRoles.@each.role',\n+      'volunteer.userRoles.@each.user',\n+    function() {\n+      return this.get('volunteer.userRoles');\n+    }),\n+\n+  /**\n+    A randomly selected role from the `userRoles` property.\n+\n+    @property userRole\n+    @type Ember.Model\n+   */\n+  userRole: computed('userRoles', function() {\n+    let userRoles = get(this, 'userRoles');\n+\n+    if (isPresent(userRoles)) {\n+      let randomIndex = Math.floor(Math.random() * get(userRoles, 'length'));\n+\n+      return userRoles.objectAt(randomIndex);\n+    }\n+  }),\n+\n+  /**\n+    Returns the volunteer's name. If the `name` property is not defined, it\n+    computes a name from the volunteer's `firstName` & `lastName`. If neither\n+    are defined it returns an empty string.\n+\n+    @property volunteerName\n+    @type String\n+   */\n+  volunteerName: computed('volunteer.{name,firstName,lastName}', function() {\n+    let name = get(this, 'volunteer.name');\n+    let firstName = get(this, 'volunteer.firstName');\n+    let lastName = get(this, 'volunteer.lastName');\n+\n+    if (isPresent(name)) {\n+      return name;\n+    } else if (isPresent(firstName) && isPresent(lastName)) {\n+      return `${firstName} ${lastName}`;\n+    } else {\n+      return '';","path":"app/components/volunteer-headshot.js","position":75,"original_position":75,"commit_id":"0ce82e8a4d9abb744a589bb952bc567a3adfa177","original_commit_id":"0ce82e8a4d9abb744a589bb952bc567a3adfa177","user":{"login":"JoshSmith","id":321667,"avatar_url":"https://avatars.githubusercontent.com/u/321667?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshSmith","html_url":"https://github.com/JoshSmith","followers_url":"https://api.github.com/users/JoshSmith/followers","following_url":"https://api.github.com/users/JoshSmith/following{/other_user}","gists_url":"https://api.github.com/users/JoshSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshSmith/subscriptions","organizations_url":"https://api.github.com/users/JoshSmith/orgs","repos_url":"https://api.github.com/users/JoshSmith/repos","events_url":"https://api.github.com/users/JoshSmith/events{/privacy}","received_events_url":"https://api.github.com/users/JoshSmith/received_events","type":"User","site_admin":false},"body":"In the `else` would fallback to their username, which we know must be set.","created_at":"2016-12-06T03:48:52Z","updated_at":"2016-12-06T03:50:58Z","html_url":"https://github.com/code-corps/code-corps-ember/pull/788#discussion_r91007520","pull_request_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788","_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments/91007520"},"html":{"href":"https://github.com/code-corps/code-corps-ember/pull/788#discussion_r91007520"},"pull_request":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788"}}},"pull_request":{"url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788","id":95412788,"html_url":"https://github.com/code-corps/code-corps-ember/pull/788","diff_url":"https://github.com/code-corps/code-corps-ember/pull/788.diff","patch_url":"https://github.com/code-corps/code-corps-ember/pull/788.patch","issue_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/788","number":788,"state":"open","locked":false,"title":"create volunteer-headshot component","user":{"login":"WenInCode","id":5448834,"avatar_url":"https://avatars.githubusercontent.com/u/5448834?v=3","gravatar_id":"","url":"https://api.github.com/users/WenInCode","html_url":"https://github.com/WenInCode","followers_url":"https://api.github.com/users/WenInCode/followers","following_url":"https://api.github.com/users/WenInCode/following{/other_user}","gists_url":"https://api.github.com/users/WenInCode/gists{/gist_id}","starred_url":"https://api.github.com/users/WenInCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WenInCode/subscriptions","organizations_url":"https://api.github.com/users/WenInCode/orgs","repos_url":"https://api.github.com/users/WenInCode/repos","events_url":"https://api.github.com/users/WenInCode/events{/privacy}","received_events_url":"https://api.github.com/users/WenInCode/received_events","type":"User","site_admin":false},"body":"# What's in this PR?\r\n## Changes\r\n- Created `volunteer-headshot` component\r\n- Created `volunteer-headshot` page-object\r\n- Added tests \r\n\r\n## Todo\r\n- add styling\r\n- use the component in the thankyou page.\r\n\r\n## References\r\nFixes #678 ","created_at":"2016-11-27T19:17:49Z","updated_at":"2016-12-06T03:50:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60d259e16784cea4ae9d5421b2cf1e2c971f1fdf","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/code-corps/code-corps-ember/milestones/4","html_url":"https://github.com/code-corps/code-corps-ember/milestones/Improve%20Donations","labels_url":"https://api.github.com/repos/code-corps/code-corps-ember/milestones/4/labels","id":2165186,"number":4,"title":"Improve Donations","description":"Tasks around improving the donation flow based on bugs and feedback.","creator":{"login":"JoshSmith","id":321667,"avatar_url":"https://avatars.githubusercontent.com/u/321667?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshSmith","html_url":"https://github.com/JoshSmith","followers_url":"https://api.github.com/users/JoshSmith/followers","following_url":"https://api.github.com/users/JoshSmith/following{/other_user}","gists_url":"https://api.github.com/users/JoshSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshSmith/subscriptions","organizations_url":"https://api.github.com/users/JoshSmith/orgs","repos_url":"https://api.github.com/users/JoshSmith/repos","events_url":"https://api.github.com/users/JoshSmith/events{/privacy}","received_events_url":"https://api.github.com/users/JoshSmith/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":13,"state":"open","created_at":"2016-11-30T00:51:11Z","updated_at":"2016-12-06T03:40:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788/commits","review_comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788/comments","review_comment_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/788/comments","statuses_url":"https://api.github.com/repos/code-corps/code-corps-ember/statuses/0ce82e8a4d9abb744a589bb952bc567a3adfa177","head":{"label":"WenInCode:add-volunteer-headshot-component","ref":"add-volunteer-headshot-component","sha":"0ce82e8a4d9abb744a589bb952bc567a3adfa177","user":{"login":"WenInCode","id":5448834,"avatar_url":"https://avatars.githubusercontent.com/u/5448834?v=3","gravatar_id":"","url":"https://api.github.com/users/WenInCode","html_url":"https://github.com/WenInCode","followers_url":"https://api.github.com/users/WenInCode/followers","following_url":"https://api.github.com/users/WenInCode/following{/other_user}","gists_url":"https://api.github.com/users/WenInCode/gists{/gist_id}","starred_url":"https://api.github.com/users/WenInCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WenInCode/subscriptions","organizations_url":"https://api.github.com/users/WenInCode/orgs","repos_url":"https://api.github.com/users/WenInCode/repos","events_url":"https://api.github.com/users/WenInCode/events{/privacy}","received_events_url":"https://api.github.com/users/WenInCode/received_events","type":"User","site_admin":false},"repo":{"id":62817933,"name":"code-corps-ember","full_name":"WenInCode/code-corps-ember","owner":{"login":"WenInCode","id":5448834,"avatar_url":"https://avatars.githubusercontent.com/u/5448834?v=3","gravatar_id":"","url":"https://api.github.com/users/WenInCode","html_url":"https://github.com/WenInCode","followers_url":"https://api.github.com/users/WenInCode/followers","following_url":"https://api.github.com/users/WenInCode/following{/other_user}","gists_url":"https://api.github.com/users/WenInCode/gists{/gist_id}","starred_url":"https://api.github.com/users/WenInCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WenInCode/subscriptions","organizations_url":"https://api.github.com/users/WenInCode/orgs","repos_url":"https://api.github.com/users/WenInCode/repos","events_url":"https://api.github.com/users/WenInCode/events{/privacy}","received_events_url":"https://api.github.com/users/WenInCode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WenInCode/code-corps-ember","description":"Ember front-end for Code Corps.","fork":true,"url":"https://api.github.com/repos/WenInCode/code-corps-ember","forks_url":"https://api.github.com/repos/WenInCode/code-corps-ember/forks","keys_url":"https://api.github.com/repos/WenInCode/code-corps-ember/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WenInCode/code-corps-ember/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WenInCode/code-corps-ember/teams","hooks_url":"https://api.github.com/repos/WenInCode/code-corps-ember/hooks","issue_events_url":"https://api.github.com/repos/WenInCode/code-corps-ember/issues/events{/number}","events_url":"https://api.github.com/repos/WenInCode/code-corps-ember/events","assignees_url":"https://api.github.com/repos/WenInCode/code-corps-ember/assignees{/user}","branches_url":"https://api.github.com/repos/WenInCode/code-corps-ember/branches{/branch}","tags_url":"https://api.github.com/repos/WenInCode/code-corps-ember/tags","blobs_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/refs{/sha}","trees_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WenInCode/code-corps-ember/statuses/{sha}","languages_url":"https://api.github.com/repos/WenInCode/code-corps-ember/languages","stargazers_url":"https://api.github.com/repos/WenInCode/code-corps-ember/stargazers","contributors_url":"https://api.github.com/repos/WenInCode/code-corps-ember/contributors","subscribers_url":"https://api.github.com/repos/WenInCode/code-corps-ember/subscribers","subscription_url":"https://api.github.com/repos/WenInCode/code-corps-ember/subscription","commits_url":"https://api.github.com/repos/WenInCode/code-corps-ember/commits{/sha}","git_commits_url":"https://api.github.com/repos/WenInCode/code-corps-ember/git/commits{/sha}","comments_url":"https://api.github.com/repos/WenInCode/code-corps-ember/comments{/number}","issue_comment_url":"https://api.github.com/repos/WenInCode/code-corps-ember/issues/comments{/number}","contents_url":"https://api.github.com/repos/WenInCode/code-corps-ember/contents/{+path}","compare_url":"https://api.github.com/repos/WenInCode/code-corps-ember/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WenInCode/code-corps-ember/merges","archive_url":"https://api.github.com/repos/WenInCode/code-corps-ember/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WenInCode/code-corps-ember/downloads","issues_url":"https://api.github.com/repos/WenInCode/code-corps-ember/issues{/number}","pulls_url":"https://api.github.com/repos/WenInCode/code-corps-ember/pulls{/number}","milestones_url":"https://api.github.com/repos/WenInCode/code-corps-ember/milestones{/number}","notifications_url":"https://api.github.com/repos/WenInCode/code-corps-ember/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WenInCode/code-corps-ember/labels{/name}","releases_url":"https://api.github.com/repos/WenInCode/code-corps-ember/releases{/id}","deployments_url":"https://api.github.com/repos/WenInCode/code-corps-ember/deployments","created_at":"2016-07-07T15:30:55Z","updated_at":"2016-07-07T15:30:58Z","pushed_at":"2016-12-05T04:38:25Z","git_url":"git://github.com/WenInCode/code-corps-ember.git","ssh_url":"git@github.com:WenInCode/code-corps-ember.git","clone_url":"https://github.com/WenInCode/code-corps-ember.git","svn_url":"https://github.com/WenInCode/code-corps-ember","homepage":"https://codecorps.org","size":2802,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"code-corps:develop","ref":"develop","sha":"b26a779b96273f86a544abedf81528adda0a3e11","user":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":37887675,"name":"code-corps-ember","full_name":"code-corps/code-corps-ember","owner":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-corps/code-corps-ember","description":"Ember web application for Code Corps.","fork":false,"url":"https://api.github.com/repos/code-corps/code-corps-ember","forks_url":"https://api.github.com/repos/code-corps/code-corps-ember/forks","keys_url":"https://api.github.com/repos/code-corps/code-corps-ember/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/code-corps-ember/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/code-corps-ember/teams","hooks_url":"https://api.github.com/repos/code-corps/code-corps-ember/hooks","issue_events_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/code-corps-ember/events","assignees_url":"https://api.github.com/repos/code-corps/code-corps-ember/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/code-corps-ember/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/code-corps-ember/tags","blobs_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/code-corps-ember/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/code-corps-ember/languages","stargazers_url":"https://api.github.com/repos/code-corps/code-corps-ember/stargazers","contributors_url":"https://api.github.com/repos/code-corps/code-corps-ember/contributors","subscribers_url":"https://api.github.com/repos/code-corps/code-corps-ember/subscribers","subscription_url":"https://api.github.com/repos/code-corps/code-corps-ember/subscription","commits_url":"https://api.github.com/repos/code-corps/code-corps-ember/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/code-corps-ember/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/code-corps-ember/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/code-corps-ember/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/code-corps-ember/merges","archive_url":"https://api.github.com/repos/code-corps/code-corps-ember/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/code-corps-ember/downloads","issues_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/code-corps-ember/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/code-corps-ember/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/code-corps-ember/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/code-corps-ember/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/code-corps-ember/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/code-corps-ember/deployments","created_at":"2015-06-23T00:18:45Z","updated_at":"2016-12-04T06:23:24Z","pushed_at":"2016-12-06T03:02:57Z","git_url":"git://github.com/code-corps/code-corps-ember.git","ssh_url":"git@github.com:code-corps/code-corps-ember.git","clone_url":"https://github.com/code-corps/code-corps-ember.git","svn_url":"https://github.com/code-corps/code-corps-ember","homepage":"https://www.codecorps.org","size":3145,"stargazers_count":68,"watchers_count":68,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":158,"forks":54,"open_issues":158,"watchers":68,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788"},"html":{"href":"https://github.com/code-corps/code-corps-ember/pull/788"},"issue":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/issues/788"},"comments":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/issues/788/comments"},"review_comments":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788/comments"},"review_comment":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/pulls/788/commits"},"statuses":{"href":"https://api.github.com/repos/code-corps/code-corps-ember/statuses/0ce82e8a4d9abb744a589bb952bc567a3adfa177"}}}}
{"actor":{"display_login":"JoshSmith"}}