{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/docs-tools/pulls/comments/233158190","pull_request_review_id":174505105,"id":233158190,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzE1ODE5MA==","diff_hunk":"@@ -0,0 +1,75 @@\n+import Constants from './Constants';\n+import Deluge from './deluge/deluge';\n+import PropTypes from 'prop-types';\n+import Suggestion from './suggestion/Suggestion';\n+import preact from 'preact';\n+\n+class Widgets extends preact.Component {\n+    constructor(props) {\n+        super(props);\n+        this.isSuggestionPage = this.isSuggestionPage(this.props.path);\n+        this.handleOpenDrawer = this.handleOpenDrawer.bind(this);\n+        this.handleCloseDrawer = this.handleCloseDrawer.bind(this);\n+\n+        this.state = {\n+            'drawerIsOpen': false,\n+            'drawerHasOpened': false\n+        };\n+    }\n+\n+    isSuggestionPage(path) {\n+        return Constants.SUGGESTION_WHITELIST.includes(path);","path":"themes/mongodb/src/widgets/widgets.js","position":21,"original_position":21,"commit_id":"97a2eb7b4b720c157b26736b5258e65d6daf8381","original_commit_id":"97a2eb7b4b720c157b26736b5258e65d6daf8381","user":{"login":"i80and","id":334192,"node_id":"MDQ6VXNlcjMzNDE5Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/334192?v=4","gravatar_id":"","url":"https://api.github.com/users/i80and","html_url":"https://github.com/i80and","followers_url":"https://api.github.com/users/i80and/followers","following_url":"https://api.github.com/users/i80and/following{/other_user}","gists_url":"https://api.github.com/users/i80and/gists{/gist_id}","starred_url":"https://api.github.com/users/i80and/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i80and/subscriptions","organizations_url":"https://api.github.com/users/i80and/orgs","repos_url":"https://api.github.com/users/i80and/repos","events_url":"https://api.github.com/users/i80and/events{/privacy}","received_events_url":"https://api.github.com/users/i80and/received_events","type":"User","site_admin":false},"body":"I, uh, might have been unclear :D\r\n\r\nThis is okay, but I actually just meant it's better to use a global variable within this module rather than an unchanging instance variable","created_at":"2018-11-13T18:00:04Z","updated_at":"2018-11-13T18:00:39Z","html_url":"https://github.com/mongodb/docs-tools/pull/239#discussion_r233158190","pull_request_url":"https://api.github.com/repos/mongodb/docs-tools/pulls/239","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mongodb/docs-tools/pulls/comments/233158190"},"html":{"href":"https://github.com/mongodb/docs-tools/pull/239#discussion_r233158190"},"pull_request":{"href":"https://api.github.com/repos/mongodb/docs-tools/pulls/239"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/docs-tools/pulls/239","id":226697641,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2Njk3NjQx","html_url":"https://github.com/mongodb/docs-tools/pull/239","diff_url":"https://github.com/mongodb/docs-tools/pull/239.diff","patch_url":"https://github.com/mongodb/docs-tools/pull/239.patch","issue_url":"https://api.github.com/repos/mongodb/docs-tools/issues/239","number":239,"state":"open","locked":false,"title":"DOCSP-3546: Create UI for Content Suggestion","user":{"login":"sophstad","id":9298431,"node_id":"MDQ6VXNlcjkyOTg0MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/9298431?v=4","gravatar_id":"","url":"https://api.github.com/users/sophstad","html_url":"https://github.com/sophstad","followers_url":"https://api.github.com/users/sophstad/followers","following_url":"https://api.github.com/users/sophstad/following{/other_user}","gists_url":"https://api.github.com/users/sophstad/gists{/gist_id}","starred_url":"https://api.github.com/users/sophstad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophstad/subscriptions","organizations_url":"https://api.github.com/users/sophstad/orgs","repos_url":"https://api.github.com/users/sophstad/repos","events_url":"https://api.github.com/users/sophstad/events{/privacy}","received_events_url":"https://api.github.com/users/sophstad/received_events","type":"User","site_admin":false},"body":"**Note:** not ready to merge until we have identified the docs pages on which to deploy.\r\n\r\n[[JIRA](https://jira.mongodb.org/browse/DOCSP-3546)] Adds UI for suggesting content via Stitch function calls. This PR moves our feedback widget to a new directory called `widgets/`, which also houses the suggestion frontend's Preact code, because the two pass data to one another when a user interacts with the feedback form.\r\n\r\nUser behavior data is sent to Google Analytics via events (when a modal is dismissed) or query parameters (when a suggested link clicked).\r\n\r\nUser flow:\r\n1. User lands on a page that we have targeted for suggested content\r\n2. User clicks on the \"Was this page helpful?\" widget\r\n3. User selects \"No\"\r\n4. Content suggestion drawer slides out from the right side of the page\r\n5. Users click on a suggested link or dismiss the modal\r\n\r\n<img width=\"1506\" alt=\"screen shot 2018-10-29 at 4 02 58 pm\" src=\"https://user-images.githubusercontent.com/9298431/47677304-1e507700-db95-11e8-8196-2cf254a779c1.png\">","created_at":"2018-10-29T20:12:05Z","updated_at":"2018-11-13T18:00:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e72156b513b2d35962e1bc25680090373f1c205b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/docs-tools/pulls/239/commits","review_comments_url":"https://api.github.com/repos/mongodb/docs-tools/pulls/239/comments","review_comment_url":"https://api.github.com/repos/mongodb/docs-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/docs-tools/issues/239/comments","statuses_url":"https://api.github.com/repos/mongodb/docs-tools/statuses/97a2eb7b4b720c157b26736b5258e65d6daf8381","head":{"label":"sophstad:ss-suggestion-prototypes","ref":"ss-suggestion-prototypes","sha":"97a2eb7b4b720c157b26736b5258e65d6daf8381","user":{"login":"sophstad","id":9298431,"node_id":"MDQ6VXNlcjkyOTg0MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/9298431?v=4","gravatar_id":"","url":"https://api.github.com/users/sophstad","html_url":"https://github.com/sophstad","followers_url":"https://api.github.com/users/sophstad/followers","following_url":"https://api.github.com/users/sophstad/following{/other_user}","gists_url":"https://api.github.com/users/sophstad/gists{/gist_id}","starred_url":"https://api.github.com/users/sophstad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophstad/subscriptions","organizations_url":"https://api.github.com/users/sophstad/orgs","repos_url":"https://api.github.com/users/sophstad/repos","events_url":"https://api.github.com/users/sophstad/events{/privacy}","received_events_url":"https://api.github.com/users/sophstad/received_events","type":"User","site_admin":false},"repo":{"id":153181837,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMxODE4Mzc=","name":"docs-tools","full_name":"sophstad/docs-tools","private":false,"owner":{"login":"sophstad","id":9298431,"node_id":"MDQ6VXNlcjkyOTg0MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/9298431?v=4","gravatar_id":"","url":"https://api.github.com/users/sophstad","html_url":"https://github.com/sophstad","followers_url":"https://api.github.com/users/sophstad/followers","following_url":"https://api.github.com/users/sophstad/following{/other_user}","gists_url":"https://api.github.com/users/sophstad/gists{/gist_id}","starred_url":"https://api.github.com/users/sophstad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophstad/subscriptions","organizations_url":"https://api.github.com/users/sophstad/orgs","repos_url":"https://api.github.com/users/sophstad/repos","events_url":"https://api.github.com/users/sophstad/events{/privacy}","received_events_url":"https://api.github.com/users/sophstad/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sophstad/docs-tools","description":"Common tools and content for MongoDB documentation projects.","fork":true,"url":"https://api.github.com/repos/sophstad/docs-tools","forks_url":"https://api.github.com/repos/sophstad/docs-tools/forks","keys_url":"https://api.github.com/repos/sophstad/docs-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sophstad/docs-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sophstad/docs-tools/teams","hooks_url":"https://api.github.com/repos/sophstad/docs-tools/hooks","issue_events_url":"https://api.github.com/repos/sophstad/docs-tools/issues/events{/number}","events_url":"https://api.github.com/repos/sophstad/docs-tools/events","assignees_url":"https://api.github.com/repos/sophstad/docs-tools/assignees{/user}","branches_url":"https://api.github.com/repos/sophstad/docs-tools/branches{/branch}","tags_url":"https://api.github.com/repos/sophstad/docs-tools/tags","blobs_url":"https://api.github.com/repos/sophstad/docs-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sophstad/docs-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sophstad/docs-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/sophstad/docs-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sophstad/docs-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/sophstad/docs-tools/languages","stargazers_url":"https://api.github.com/repos/sophstad/docs-tools/stargazers","contributors_url":"https://api.github.com/repos/sophstad/docs-tools/contributors","subscribers_url":"https://api.github.com/repos/sophstad/docs-tools/subscribers","subscription_url":"https://api.github.com/repos/sophstad/docs-tools/subscription","commits_url":"https://api.github.com/repos/sophstad/docs-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/sophstad/docs-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/sophstad/docs-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/sophstad/docs-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/sophstad/docs-tools/contents/{+path}","compare_url":"https://api.github.com/repos/sophstad/docs-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sophstad/docs-tools/merges","archive_url":"https://api.github.com/repos/sophstad/docs-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sophstad/docs-tools/downloads","issues_url":"https://api.github.com/repos/sophstad/docs-tools/issues{/number}","pulls_url":"https://api.github.com/repos/sophstad/docs-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/sophstad/docs-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/sophstad/docs-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sophstad/docs-tools/labels{/name}","releases_url":"https://api.github.com/repos/sophstad/docs-tools/releases{/id}","deployments_url":"https://api.github.com/repos/sophstad/docs-tools/deployments","created_at":"2018-10-15T21:07:53Z","updated_at":"2018-10-15T21:07:57Z","pushed_at":"2018-11-13T16:17:49Z","git_url":"git://github.com/sophstad/docs-tools.git","ssh_url":"git@github.com:sophstad/docs-tools.git","clone_url":"https://github.com/sophstad/docs-tools.git","svn_url":"https://github.com/sophstad/docs-tools","homepage":null,"size":10274,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mongodb:master","ref":"master","sha":"3cf92c0b01b1de4eba1e2b77995295295f1b9b34","user":{"login":"mongodb","id":45120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45120?v=4","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":10223615,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIyMzYxNQ==","name":"docs-tools","full_name":"mongodb/docs-tools","private":false,"owner":{"login":"mongodb","id":45120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/45120?v=4","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mongodb/docs-tools","description":"Common tools and content for MongoDB documentation projects.","fork":false,"url":"https://api.github.com/repos/mongodb/docs-tools","forks_url":"https://api.github.com/repos/mongodb/docs-tools/forks","keys_url":"https://api.github.com/repos/mongodb/docs-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/docs-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/docs-tools/teams","hooks_url":"https://api.github.com/repos/mongodb/docs-tools/hooks","issue_events_url":"https://api.github.com/repos/mongodb/docs-tools/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/docs-tools/events","assignees_url":"https://api.github.com/repos/mongodb/docs-tools/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/docs-tools/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/docs-tools/tags","blobs_url":"https://api.github.com/repos/mongodb/docs-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/docs-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/docs-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/docs-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/docs-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/docs-tools/languages","stargazers_url":"https://api.github.com/repos/mongodb/docs-tools/stargazers","contributors_url":"https://api.github.com/repos/mongodb/docs-tools/contributors","subscribers_url":"https://api.github.com/repos/mongodb/docs-tools/subscribers","subscription_url":"https://api.github.com/repos/mongodb/docs-tools/subscription","commits_url":"https://api.github.com/repos/mongodb/docs-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/docs-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/docs-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/docs-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/docs-tools/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/docs-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/docs-tools/merges","archive_url":"https://api.github.com/repos/mongodb/docs-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/docs-tools/downloads","issues_url":"https://api.github.com/repos/mongodb/docs-tools/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/docs-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/docs-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/docs-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/docs-tools/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/docs-tools/releases{/id}","deployments_url":"https://api.github.com/repos/mongodb/docs-tools/deployments","created_at":"2013-05-22T15:47:12Z","updated_at":"2018-11-12T18:24:28Z","pushed_at":"2018-11-13T16:17:50Z","git_url":"git://github.com/mongodb/docs-tools.git","ssh_url":"git@github.com:mongodb/docs-tools.git","clone_url":"https://github.com/mongodb/docs-tools.git","svn_url":"https://github.com/mongodb/docs-tools","homepage":null,"size":9823,"stargazers_count":31,"watchers_count":31,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":54,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":54,"open_issues":5,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/docs-tools/pulls/239"},"html":{"href":"https://github.com/mongodb/docs-tools/pull/239"},"issue":{"href":"https://api.github.com/repos/mongodb/docs-tools/issues/239"},"comments":{"href":"https://api.github.com/repos/mongodb/docs-tools/issues/239/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/docs-tools/pulls/239/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/docs-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/docs-tools/pulls/239/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/docs-tools/statuses/97a2eb7b4b720c157b26736b5258e65d6daf8381"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"i80and"}}