{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/209101319","pull_request_review_id":145053159,"id":209101319,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTEwMTMxOQ==","diff_hunk":"@@ -0,0 +1,66 @@\n+import React, {PropTypes} from 'react';\n+import {Button} from 'react-bootstrap';\n+import ConfirmationDialog from '../components/confirmation_dialog';\n+\n+export default class EnrollmentCancelButton extends React.Component {\n+  static propTypes = {\n+    enrollmentCode: PropTypes.string.isRequired,\n+    workshopFriendlyName: PropTypes.string.isRequired\n+  };\n+\n+  constructor(props) {\n+    super(props);\n+\n+    this.state = {\n+      showConfirmation: false,\n+      canceled: false\n+    };\n+  }\n+\n+  componentWillUnmount() {\n+    if (this.cancelEnrollmentRequest) {\n+      this.cancelEnrollmentRequest.abort();\n+    }\n+  }\n+\n+  handleCancelClick = () => {\n+    this.setState({showConfirmation: true});\n+  };\n+\n+  handleCancelConfirmed = () => {\n+    this.cancelEnrollmentRequest = $.ajax({\n+      method: 'DELETE',\n+      url: `/api/v1/pd/enrollments/${this.props.enrollmentCode}`,\n+      dataType: \"json\"\n+    }).done(() => {\n+      window.location.reload(true);\n+      // this.setState({canceled: true});\n+    });\n+  };\n+\n+  handleCancelAborted = () => {\n+    this.setState({showConfirmation: false});\n+  };\n+\n+  render() {\n+    return (\n+      <div>\n+        <p>Click below to cancel your registration in the {this.props.workshopFriendlyName}.</p>","path":"apps/src/code-studio/pd/workshop_enrollment/enrollmentCancelButton.jsx","position":48,"original_position":48,"commit_id":"3df39703a22a0d75dd9524dc411a9e2833c6c256","original_commit_id":"3df39703a22a0d75dd9524dc411a9e2833c6c256","user":{"login":"aoby","id":8405316,"node_id":"MDQ6VXNlcjg0MDUzMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/8405316?v=4","gravatar_id":"","url":"https://api.github.com/users/aoby","html_url":"https://github.com/aoby","followers_url":"https://api.github.com/users/aoby/followers","following_url":"https://api.github.com/users/aoby/following{/other_user}","gists_url":"https://api.github.com/users/aoby/gists{/gist_id}","starred_url":"https://api.github.com/users/aoby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoby/subscriptions","organizations_url":"https://api.github.com/users/aoby/orgs","repos_url":"https://api.github.com/users/aoby/repos","events_url":"https://api.github.com/users/aoby/events{/privacy}","received_events_url":"https://api.github.com/users/aoby/received_events","type":"User","site_admin":false},"body":"Yes. See https://github.com/code-dot-org/code-dot-org/blob/staging/dashboard/app/models/pd/workshop.rb#L257","created_at":"2018-08-09T22:45:03Z","updated_at":"2018-08-09T22:45:03Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/24193#discussion_r209101319","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/209101319"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/24193#discussion_r209101319"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193"}},"in_reply_to_id":209100427},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193","id":207442710,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NDQyNzEw","html_url":"https://github.com/code-dot-org/code-dot-org/pull/24193","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/24193.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/24193.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/24193","number":24193,"state":"open","locked":false,"title":"Add button and confirmation dialog for canceling a workshop enrollment","user":{"login":"aoby","id":8405316,"node_id":"MDQ6VXNlcjg0MDUzMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/8405316?v=4","gravatar_id":"","url":"https://api.github.com/users/aoby","html_url":"https://github.com/aoby","followers_url":"https://api.github.com/users/aoby/followers","following_url":"https://api.github.com/users/aoby/following{/other_user}","gists_url":"https://api.github.com/users/aoby/gists{/gist_id}","starred_url":"https://api.github.com/users/aoby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoby/subscriptions","organizations_url":"https://api.github.com/users/aoby/orgs","repos_url":"https://api.github.com/users/aoby/repos","events_url":"https://api.github.com/users/aoby/events{/privacy}","received_events_url":"https://api.github.com/users/aoby/received_events","type":"User","site_admin":false},"body":"# Before\r\n\r\n![image](https://user-images.githubusercontent.com/8405316/43925311-c93103dc-9bdb-11e8-911a-9236586ea87b.png)\r\n\r\nClicking that long url, which is also emailed, instantly deletes the enrollment:\r\n![image](https://user-images.githubusercontent.com/8405316/43925350-df8d1e22-9bdb-11e8-8fb0-de86d164c3bc.png)\r\n\r\n----------------------\r\n# After\r\n![image](https://user-images.githubusercontent.com/8405316/43925167-63ee5e48-9bdb-11e8-8355-b72c39eb1547.png)\r\n\r\nClicking \"here\" brings up:\r\n\r\n![image](https://user-images.githubusercontent.com/8405316/43925876-6b9b9708-9bdd-11e8-8702-def00a4c7992.png)\r\n\r\nClicking \"Cancel\" brings up:\r\n\r\n![image](https://user-images.githubusercontent.com/8405316/43925193-76028c08-9bdb-11e8-9dc2-dbd2d4303d84.png)\r\n\r\nConfirming then goes to:\r\n\r\n![image](https://user-images.githubusercontent.com/8405316/43925666-b32bb14e-9bdc-11e8-8a67-eb377715de1c.png)\r\n","created_at":"2018-08-09T21:01:42Z","updated_at":"2018-08-09T22:45:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5af51f1f62eba36a70fd301b9aa9dd88c25c1c76","assignee":null,"assignees":[],"requested_reviewers":[{"login":"clareconstantine","id":224089,"node_id":"MDQ6VXNlcjIyNDA4OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/224089?v=4","gravatar_id":"","url":"https://api.github.com/users/clareconstantine","html_url":"https://github.com/clareconstantine","followers_url":"https://api.github.com/users/clareconstantine/followers","following_url":"https://api.github.com/users/clareconstantine/following{/other_user}","gists_url":"https://api.github.com/users/clareconstantine/gists{/gist_id}","starred_url":"https://api.github.com/users/clareconstantine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clareconstantine/subscriptions","organizations_url":"https://api.github.com/users/clareconstantine/orgs","repos_url":"https://api.github.com/users/clareconstantine/repos","events_url":"https://api.github.com/users/clareconstantine/events{/privacy}","received_events_url":"https://api.github.com/users/clareconstantine/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":399355794,"node_id":"MDU6TGFiZWwzOTkzNTU3OTQ=","url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels/professional-learning","name":"professional-learning","color":"0094ca","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/24193/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/3df39703a22a0d75dd9524dc411a9e2833c6c256","head":{"label":"code-dot-org:pd-workshop-cancellation","ref":"pd-workshop-cancellation","sha":"3df39703a22a0d75dd9524dc411a9e2833c6c256","user":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"node_id":"MDEwOlJlcG9zaXRvcnkyNDI1MDAwOQ==","name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2018-08-09T21:32:49Z","pushed_at":"2018-08-09T22:25:19Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":8082602,"stargazers_count":333,"watchers_count":333,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":192,"mirror_url":null,"archived":false,"open_issues_count":124,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":192,"open_issues":124,"watchers":333,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"5ddf725e6da321ce9278744f6048dddec71a6138","user":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"node_id":"MDEwOlJlcG9zaXRvcnkyNDI1MDAwOQ==","name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2018-08-09T21:32:49Z","pushed_at":"2018-08-09T22:25:19Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":8082602,"stargazers_count":333,"watchers_count":333,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":192,"mirror_url":null,"archived":false,"open_issues_count":124,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":192,"open_issues":124,"watchers":333,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/24193"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/24193"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/24193/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/24193/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/3df39703a22a0d75dd9524dc411a9e2833c6c256"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aoby"}}