{"action":"opened","number":528,"pull_request":{"url":"https://api.github.com/repos/studentinsights/studentinsights/pulls/528","id":70953559,"html_url":"https://github.com/studentinsights/studentinsights/pull/528","diff_url":"https://github.com/studentinsights/studentinsights/pull/528.diff","patch_url":"https://github.com/studentinsights/studentinsights/pull/528.patch","issue_url":"https://api.github.com/repos/studentinsights/studentinsights/issues/528","number":528,"state":"open","locked":false,"title":"Add ability to edit event notes","user":{"login":"kbweaver","id":195892,"avatar_url":"https://avatars.githubusercontent.com/u/195892?v=3","gravatar_id":"","url":"https://api.github.com/users/kbweaver","html_url":"https://github.com/kbweaver","followers_url":"https://api.github.com/users/kbweaver/followers","following_url":"https://api.github.com/users/kbweaver/following{/other_user}","gists_url":"https://api.github.com/users/kbweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/kbweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbweaver/subscriptions","organizations_url":"https://api.github.com/users/kbweaver/orgs","repos_url":"https://api.github.com/users/kbweaver/repos","events_url":"https://api.github.com/users/kbweaver/events{/privacy}","received_events_url":"https://api.github.com/users/kbweaver/received_events","type":"User","site_admin":false},"body":"The next part of #228 and building off of the API added in #349, this adds the ability to edit event notes on the student profile page.\r\n\r\nIn this iteration, the notes appear read-only until you hover over them, at which point a border appears and the cursor changes to afford clicking and selecting text. The user can begin modifying the text inline immediately, without any additional clicks to enter a separate mode. The note is saved on blur.\r\n\r\nIn addition to running the automated tests, the following test cases should be covered manually, particularly in IE 11:\r\n- Enter all sorts of nonsense into the note. HTML-meaningful characters, high-bit characters, etc. In particular, try copying and pasting content from this site or other websites into the note, and verify that unnecessary HTML is stripped.\r\n- Reload the page and verify that the note remains unchanged visually (the HTML itself may be normalized).\r\n- Inject some HTML into the `event_note` table directly and verify that it is escaped when you load the note.\r\n\r\nA summary of the code changes in this PR:\r\n- Hooked up the student profile API to the endpoints added in #349.\r\n- Added the `rails-sanitize-js` gem to provide HTML sanitization.\r\n- Factored the `NoteCard` React class into it's own file, mainly to facilitate unit testing.\r\n- Replaced the `NoteCard`'s text with a `contenteditable` div. Added listeners and styles to support inline editing. Added unit tests for `NoteCard` as well as an additional integration test to the `PageContainer` spec to cover these changes.\r\n- Changed `PageContainer`'s `state.requests.saveNotes` from a string to an object, so that it can track requests by event note ID (or `undefined` if there is no ID yet).","created_at":"2016-05-21T16:23:20Z","updated_at":"2016-05-21T16:23:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/studentinsights/studentinsights/pulls/528/commits","review_comments_url":"https://api.github.com/repos/studentinsights/studentinsights/pulls/528/comments","review_comment_url":"https://api.github.com/repos/studentinsights/studentinsights/pulls/comments{/number}","comments_url":"https://api.github.com/repos/studentinsights/studentinsights/issues/528/comments","statuses_url":"https://api.github.com/repos/studentinsights/studentinsights/statuses/0a06703ae9bbd341894876c0e860f9f567dffbee","head":{"label":"kbweaver:feature/event-notes-edit-ui","ref":"feature/event-notes-edit-ui","sha":"0a06703ae9bbd341894876c0e860f9f567dffbee","user":{"login":"kbweaver","id":195892,"avatar_url":"https://avatars.githubusercontent.com/u/195892?v=3","gravatar_id":"","url":"https://api.github.com/users/kbweaver","html_url":"https://github.com/kbweaver","followers_url":"https://api.github.com/users/kbweaver/followers","following_url":"https://api.github.com/users/kbweaver/following{/other_user}","gists_url":"https://api.github.com/users/kbweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/kbweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbweaver/subscriptions","organizations_url":"https://api.github.com/users/kbweaver/orgs","repos_url":"https://api.github.com/users/kbweaver/repos","events_url":"https://api.github.com/users/kbweaver/events{/privacy}","received_events_url":"https://api.github.com/users/kbweaver/received_events","type":"User","site_admin":false},"repo":{"id":55931931,"name":"studentinsights","full_name":"kbweaver/studentinsights","owner":{"login":"kbweaver","id":195892,"avatar_url":"https://avatars.githubusercontent.com/u/195892?v=3","gravatar_id":"","url":"https://api.github.com/users/kbweaver","html_url":"https://github.com/kbweaver","followers_url":"https://api.github.com/users/kbweaver/followers","following_url":"https://api.github.com/users/kbweaver/following{/other_user}","gists_url":"https://api.github.com/users/kbweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/kbweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbweaver/subscriptions","organizations_url":"https://api.github.com/users/kbweaver/orgs","repos_url":"https://api.github.com/users/kbweaver/repos","events_url":"https://api.github.com/users/kbweaver/events{/privacy}","received_events_url":"https://api.github.com/users/kbweaver/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbweaver/studentinsights","description":"Student Insights for Somerville educators","fork":true,"url":"https://api.github.com/repos/kbweaver/studentinsights","forks_url":"https://api.github.com/repos/kbweaver/studentinsights/forks","keys_url":"https://api.github.com/repos/kbweaver/studentinsights/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbweaver/studentinsights/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbweaver/studentinsights/teams","hooks_url":"https://api.github.com/repos/kbweaver/studentinsights/hooks","issue_events_url":"https://api.github.com/repos/kbweaver/studentinsights/issues/events{/number}","events_url":"https://api.github.com/repos/kbweaver/studentinsights/events","assignees_url":"https://api.github.com/repos/kbweaver/studentinsights/assignees{/user}","branches_url":"https://api.github.com/repos/kbweaver/studentinsights/branches{/branch}","tags_url":"https://api.github.com/repos/kbweaver/studentinsights/tags","blobs_url":"https://api.github.com/repos/kbweaver/studentinsights/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbweaver/studentinsights/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbweaver/studentinsights/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbweaver/studentinsights/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbweaver/studentinsights/statuses/{sha}","languages_url":"https://api.github.com/repos/kbweaver/studentinsights/languages","stargazers_url":"https://api.github.com/repos/kbweaver/studentinsights/stargazers","contributors_url":"https://api.github.com/repos/kbweaver/studentinsights/contributors","subscribers_url":"https://api.github.com/repos/kbweaver/studentinsights/subscribers","subscription_url":"https://api.github.com/repos/kbweaver/studentinsights/subscription","commits_url":"https://api.github.com/repos/kbweaver/studentinsights/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbweaver/studentinsights/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbweaver/studentinsights/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbweaver/studentinsights/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbweaver/studentinsights/contents/{+path}","compare_url":"https://api.github.com/repos/kbweaver/studentinsights/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbweaver/studentinsights/merges","archive_url":"https://api.github.com/repos/kbweaver/studentinsights/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbweaver/studentinsights/downloads","issues_url":"https://api.github.com/repos/kbweaver/studentinsights/issues{/number}","pulls_url":"https://api.github.com/repos/kbweaver/studentinsights/pulls{/number}","milestones_url":"https://api.github.com/repos/kbweaver/studentinsights/milestones{/number}","notifications_url":"https://api.github.com/repos/kbweaver/studentinsights/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbweaver/studentinsights/labels{/name}","releases_url":"https://api.github.com/repos/kbweaver/studentinsights/releases{/id}","deployments_url":"https://api.github.com/repos/kbweaver/studentinsights/deployments","created_at":"2016-04-11T01:18:59Z","updated_at":"2016-04-11T01:19:00Z","pushed_at":"2016-05-21T16:14:31Z","git_url":"git://github.com/kbweaver/studentinsights.git","ssh_url":"git@github.com:kbweaver/studentinsights.git","clone_url":"https://github.com/kbweaver/studentinsights.git","svn_url":"https://github.com/kbweaver/studentinsights","homepage":null,"size":11077,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"master"}},"base":{"label":"studentinsights:master","ref":"master","sha":"b28987da4ab2898dad796d3597de511e2b94ab68","user":{"login":"studentinsights","id":17129837,"avatar_url":"https://avatars.githubusercontent.com/u/17129837?v=3","gravatar_id":"","url":"https://api.github.com/users/studentinsights","html_url":"https://github.com/studentinsights","followers_url":"https://api.github.com/users/studentinsights/followers","following_url":"https://api.github.com/users/studentinsights/following{/other_user}","gists_url":"https://api.github.com/users/studentinsights/gists{/gist_id}","starred_url":"https://api.github.com/users/studentinsights/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/studentinsights/subscriptions","organizations_url":"https://api.github.com/users/studentinsights/orgs","repos_url":"https://api.github.com/users/studentinsights/repos","events_url":"https://api.github.com/users/studentinsights/events{/privacy}","received_events_url":"https://api.github.com/users/studentinsights/received_events","type":"Organization","site_admin":false},"repo":{"id":51324046,"name":"studentinsights","full_name":"studentinsights/studentinsights","owner":{"login":"studentinsights","id":17129837,"avatar_url":"https://avatars.githubusercontent.com/u/17129837?v=3","gravatar_id":"","url":"https://api.github.com/users/studentinsights","html_url":"https://github.com/studentinsights","followers_url":"https://api.github.com/users/studentinsights/followers","following_url":"https://api.github.com/users/studentinsights/following{/other_user}","gists_url":"https://api.github.com/users/studentinsights/gists{/gist_id}","starred_url":"https://api.github.com/users/studentinsights/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/studentinsights/subscriptions","organizations_url":"https://api.github.com/users/studentinsights/orgs","repos_url":"https://api.github.com/users/studentinsights/repos","events_url":"https://api.github.com/users/studentinsights/events{/privacy}","received_events_url":"https://api.github.com/users/studentinsights/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/studentinsights/studentinsights","description":"Student Insights for Somerville educators","fork":false,"url":"https://api.github.com/repos/studentinsights/studentinsights","forks_url":"https://api.github.com/repos/studentinsights/studentinsights/forks","keys_url":"https://api.github.com/repos/studentinsights/studentinsights/keys{/key_id}","collaborators_url":"https://api.github.com/repos/studentinsights/studentinsights/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/studentinsights/studentinsights/teams","hooks_url":"https://api.github.com/repos/studentinsights/studentinsights/hooks","issue_events_url":"https://api.github.com/repos/studentinsights/studentinsights/issues/events{/number}","events_url":"https://api.github.com/repos/studentinsights/studentinsights/events","assignees_url":"https://api.github.com/repos/studentinsights/studentinsights/assignees{/user}","branches_url":"https://api.github.com/repos/studentinsights/studentinsights/branches{/branch}","tags_url":"https://api.github.com/repos/studentinsights/studentinsights/tags","blobs_url":"https://api.github.com/repos/studentinsights/studentinsights/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/studentinsights/studentinsights/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/studentinsights/studentinsights/git/refs{/sha}","trees_url":"https://api.github.com/repos/studentinsights/studentinsights/git/trees{/sha}","statuses_url":"https://api.github.com/repos/studentinsights/studentinsights/statuses/{sha}","languages_url":"https://api.github.com/repos/studentinsights/studentinsights/languages","stargazers_url":"https://api.github.com/repos/studentinsights/studentinsights/stargazers","contributors_url":"https://api.github.com/repos/studentinsights/studentinsights/contributors","subscribers_url":"https://api.github.com/repos/studentinsights/studentinsights/subscribers","subscription_url":"https://api.github.com/repos/studentinsights/studentinsights/subscription","commits_url":"https://api.github.com/repos/studentinsights/studentinsights/commits{/sha}","git_commits_url":"https://api.github.com/repos/studentinsights/studentinsights/git/commits{/sha}","comments_url":"https://api.github.com/repos/studentinsights/studentinsights/comments{/number}","issue_comment_url":"https://api.github.com/repos/studentinsights/studentinsights/issues/comments{/number}","contents_url":"https://api.github.com/repos/studentinsights/studentinsights/contents/{+path}","compare_url":"https://api.github.com/repos/studentinsights/studentinsights/compare/{base}...{head}","merges_url":"https://api.github.com/repos/studentinsights/studentinsights/merges","archive_url":"https://api.github.com/repos/studentinsights/studentinsights/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/studentinsights/studentinsights/downloads","issues_url":"https://api.github.com/repos/studentinsights/studentinsights/issues{/number}","pulls_url":"https://api.github.com/repos/studentinsights/studentinsights/pulls{/number}","milestones_url":"https://api.github.com/repos/studentinsights/studentinsights/milestones{/number}","notifications_url":"https://api.github.com/repos/studentinsights/studentinsights/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/studentinsights/studentinsights/labels{/name}","releases_url":"https://api.github.com/repos/studentinsights/studentinsights/releases{/id}","deployments_url":"https://api.github.com/repos/studentinsights/studentinsights/deployments","created_at":"2016-02-08T20:15:35Z","updated_at":"2016-05-17T22:01:30Z","pushed_at":"2016-05-21T12:30:28Z","git_url":"git://github.com/studentinsights/studentinsights.git","ssh_url":"git@github.com:studentinsights/studentinsights.git","clone_url":"https://github.com/studentinsights/studentinsights.git","svn_url":"https://github.com/studentinsights/studentinsights","homepage":null,"size":11105,"stargazers_count":37,"watchers_count":37,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":84,"forks":20,"open_issues":84,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/studentinsights/studentinsights/pulls/528"},"html":{"href":"https://github.com/studentinsights/studentinsights/pull/528"},"issue":{"href":"https://api.github.com/repos/studentinsights/studentinsights/issues/528"},"comments":{"href":"https://api.github.com/repos/studentinsights/studentinsights/issues/528/comments"},"review_comments":{"href":"https://api.github.com/repos/studentinsights/studentinsights/pulls/528/comments"},"review_comment":{"href":"https://api.github.com/repos/studentinsights/studentinsights/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/studentinsights/studentinsights/pulls/528/commits"},"statuses":{"href":"https://api.github.com/repos/studentinsights/studentinsights/statuses/0a06703ae9bbd341894876c0e860f9f567dffbee"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":16,"additions":429,"deletions":68,"changed_files":13}}
{"actor":{"display_login":"kbweaver"}}