{"action":"created","comment":{"url":"https://api.github.com/repos/box/box-ui-elements/pulls/comments/223847651","pull_request_review_id":163077197,"id":223847651,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzg0NzY1MQ==","diff_hunk":"@@ -0,0 +1,64 @@\n+/**\n+ * @flow\n+ * @file Allows react to render a component in an arbitrary DOM node, in this case in a new window.\n+ * @author Box\n+ */\n+\n+import { PureComponent } from 'react';\n+import { createPortal } from 'react-dom';\n+\n+type Props = {\n+    children: any,\n+    integrationWindowRef: any,\n+};\n+class IntegrationPortal extends PureComponent<Props> {\n+    containerEl: ?HTMLElement;\n+\n+    /**\n+     * [constructor]\n+     *\n+     * @private\n+     * @return {IntegrationPortal}\n+     */\n+    constructor(props: Props) {\n+        super(props);\n+        this.containerEl = document.createElement('div');\n+    }\n+\n+    /**\n+     * Setup UI in the new window.\n+     *\n+     * @private\n+     * @inheritdoc\n+     * @return {void}\n+     */\n+    componentDidMount() {\n+        const { integrationWindowRef }: Props = this.props;\n+        this.copyStyles();\n+        integrationWindowRef.document.body.appendChild(this.containerEl);\n+    }\n+\n+    /**\n+     * Copies stylesheets to the new window.\n+     *\n+     * @private\n+     * @return {void}\n+     */\n+    copyStyles() {\n+        const { integrationWindowRef }: Props = this.props;\n+        // The new window will have no CSS, so we copy all style sheets as a safe way\n+        // of ensuring required styles are present\n+        Array.from(document.styleSheets).forEach(styleSheet => {\n+            const copiedStyleSheet = document.createElement('link');\n+            copiedStyleSheet.rel = 'stylesheet';\n+            copiedStyleSheet.href = styleSheet.href;\n+            integrationWindowRef.document.head.appendChild(copiedStyleSheet);\n+        });\n+    }\n+\n+    render() {\n+        return createPortal(this.props.children, this.containerEl);","path":"src/components/ContentOpenWith/IntegrationPortal.js","position":60,"original_position":60,"commit_id":"fb3d806a579c2ab008dbe63d245c7fef68c8cd94","original_commit_id":"fb3d806a579c2ab008dbe63d245c7fef68c8cd94","user":{"login":"jeremypress","id":2474027,"node_id":"MDQ6VXNlcjI0NzQwMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/2474027?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremypress","html_url":"https://github.com/jeremypress","followers_url":"https://api.github.com/users/jeremypress/followers","following_url":"https://api.github.com/users/jeremypress/following{/other_user}","gists_url":"https://api.github.com/users/jeremypress/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremypress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremypress/subscriptions","organizations_url":"https://api.github.com/users/jeremypress/orgs","repos_url":"https://api.github.com/users/jeremypress/repos","events_url":"https://api.github.com/users/jeremypress/events{/privacy}","received_events_url":"https://api.github.com/users/jeremypress/received_events","type":"User","site_admin":false},"body":"After my BRUI change goes in we may be able to use their Portal component. ","created_at":"2018-10-09T20:17:18Z","updated_at":"2018-10-09T20:17:44Z","html_url":"https://github.com/box/box-ui-elements/pull/588#discussion_r223847651","pull_request_url":"https://api.github.com/repos/box/box-ui-elements/pulls/588","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/box/box-ui-elements/pulls/comments/223847651"},"html":{"href":"https://github.com/box/box-ui-elements/pull/588#discussion_r223847651"},"pull_request":{"href":"https://api.github.com/repos/box/box-ui-elements/pulls/588"}}},"pull_request":{"url":"https://api.github.com/repos/box/box-ui-elements/pulls/588","id":221571369,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNTcxMzY5","html_url":"https://github.com/box/box-ui-elements/pull/588","diff_url":"https://github.com/box/box-ui-elements/pull/588.diff","patch_url":"https://github.com/box/box-ui-elements/pull/588.patch","issue_url":"https://api.github.com/repos/box/box-ui-elements/issues/588","number":588,"state":"open","locked":false,"title":"New: Add loading UI when integrations are opened","user":{"login":"jeremypress","id":2474027,"node_id":"MDQ6VXNlcjI0NzQwMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/2474027?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremypress","html_url":"https://github.com/jeremypress","followers_url":"https://api.github.com/users/jeremypress/followers","following_url":"https://api.github.com/users/jeremypress/following{/other_user}","gists_url":"https://api.github.com/users/jeremypress/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremypress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremypress/subscriptions","organizations_url":"https://api.github.com/users/jeremypress/orgs","repos_url":"https://api.github.com/users/jeremypress/repos","events_url":"https://api.github.com/users/jeremypress/events{/privacy}","received_events_url":"https://api.github.com/users/jeremypress/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-09T20:16:51Z","updated_at":"2018-10-09T20:17:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31dcaf3e7db39059ad0b787f9c08359f1a83c752","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/box/box-ui-elements/pulls/588/commits","review_comments_url":"https://api.github.com/repos/box/box-ui-elements/pulls/588/comments","review_comment_url":"https://api.github.com/repos/box/box-ui-elements/pulls/comments{/number}","comments_url":"https://api.github.com/repos/box/box-ui-elements/issues/588/comments","statuses_url":"https://api.github.com/repos/box/box-ui-elements/statuses/fb3d806a579c2ab008dbe63d245c7fef68c8cd94","head":{"label":"jeremypress:open-with","ref":"open-with","sha":"fb3d806a579c2ab008dbe63d245c7fef68c8cd94","user":{"login":"jeremypress","id":2474027,"node_id":"MDQ6VXNlcjI0NzQwMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/2474027?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremypress","html_url":"https://github.com/jeremypress","followers_url":"https://api.github.com/users/jeremypress/followers","following_url":"https://api.github.com/users/jeremypress/following{/other_user}","gists_url":"https://api.github.com/users/jeremypress/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremypress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremypress/subscriptions","organizations_url":"https://api.github.com/users/jeremypress/orgs","repos_url":"https://api.github.com/users/jeremypress/repos","events_url":"https://api.github.com/users/jeremypress/events{/privacy}","received_events_url":"https://api.github.com/users/jeremypress/received_events","type":"User","site_admin":false},"repo":{"id":120837397,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA4MzczOTc=","name":"box-ui-elements","full_name":"jeremypress/box-ui-elements","private":false,"owner":{"login":"jeremypress","id":2474027,"node_id":"MDQ6VXNlcjI0NzQwMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/2474027?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremypress","html_url":"https://github.com/jeremypress","followers_url":"https://api.github.com/users/jeremypress/followers","following_url":"https://api.github.com/users/jeremypress/following{/other_user}","gists_url":"https://api.github.com/users/jeremypress/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremypress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremypress/subscriptions","organizations_url":"https://api.github.com/users/jeremypress/orgs","repos_url":"https://api.github.com/users/jeremypress/repos","events_url":"https://api.github.com/users/jeremypress/events{/privacy}","received_events_url":"https://api.github.com/users/jeremypress/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jeremypress/box-ui-elements","description":"Box UI Elements","fork":true,"url":"https://api.github.com/repos/jeremypress/box-ui-elements","forks_url":"https://api.github.com/repos/jeremypress/box-ui-elements/forks","keys_url":"https://api.github.com/repos/jeremypress/box-ui-elements/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeremypress/box-ui-elements/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeremypress/box-ui-elements/teams","hooks_url":"https://api.github.com/repos/jeremypress/box-ui-elements/hooks","issue_events_url":"https://api.github.com/repos/jeremypress/box-ui-elements/issues/events{/number}","events_url":"https://api.github.com/repos/jeremypress/box-ui-elements/events","assignees_url":"https://api.github.com/repos/jeremypress/box-ui-elements/assignees{/user}","branches_url":"https://api.github.com/repos/jeremypress/box-ui-elements/branches{/branch}","tags_url":"https://api.github.com/repos/jeremypress/box-ui-elements/tags","blobs_url":"https://api.github.com/repos/jeremypress/box-ui-elements/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeremypress/box-ui-elements/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeremypress/box-ui-elements/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeremypress/box-ui-elements/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeremypress/box-ui-elements/statuses/{sha}","languages_url":"https://api.github.com/repos/jeremypress/box-ui-elements/languages","stargazers_url":"https://api.github.com/repos/jeremypress/box-ui-elements/stargazers","contributors_url":"https://api.github.com/repos/jeremypress/box-ui-elements/contributors","subscribers_url":"https://api.github.com/repos/jeremypress/box-ui-elements/subscribers","subscription_url":"https://api.github.com/repos/jeremypress/box-ui-elements/subscription","commits_url":"https://api.github.com/repos/jeremypress/box-ui-elements/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeremypress/box-ui-elements/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeremypress/box-ui-elements/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeremypress/box-ui-elements/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeremypress/box-ui-elements/contents/{+path}","compare_url":"https://api.github.com/repos/jeremypress/box-ui-elements/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeremypress/box-ui-elements/merges","archive_url":"https://api.github.com/repos/jeremypress/box-ui-elements/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeremypress/box-ui-elements/downloads","issues_url":"https://api.github.com/repos/jeremypress/box-ui-elements/issues{/number}","pulls_url":"https://api.github.com/repos/jeremypress/box-ui-elements/pulls{/number}","milestones_url":"https://api.github.com/repos/jeremypress/box-ui-elements/milestones{/number}","notifications_url":"https://api.github.com/repos/jeremypress/box-ui-elements/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeremypress/box-ui-elements/labels{/name}","releases_url":"https://api.github.com/repos/jeremypress/box-ui-elements/releases{/id}","deployments_url":"https://api.github.com/repos/jeremypress/box-ui-elements/deployments","created_at":"2018-02-09T00:54:24Z","updated_at":"2018-10-02T21:19:26Z","pushed_at":"2018-10-09T20:16:19Z","git_url":"git://github.com/jeremypress/box-ui-elements.git","ssh_url":"git@github.com:jeremypress/box-ui-elements.git","clone_url":"https://github.com/jeremypress/box-ui-elements.git","svn_url":"https://github.com/jeremypress/box-ui-elements","homepage":"https://developer.box.com/docs/box-ui-elements","size":5427,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"box:master","ref":"master","sha":"7b49681e538cdc4eac9831eafa94289a41e8f5e3","user":{"login":"box","id":23900,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzOTAw","avatar_url":"https://avatars0.githubusercontent.com/u/23900?v=4","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":95743138,"node_id":"MDEwOlJlcG9zaXRvcnk5NTc0MzEzOA==","name":"box-ui-elements","full_name":"box/box-ui-elements","private":false,"owner":{"login":"box","id":23900,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzOTAw","avatar_url":"https://avatars0.githubusercontent.com/u/23900?v=4","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/box/box-ui-elements","description":"Box UI Elements","fork":false,"url":"https://api.github.com/repos/box/box-ui-elements","forks_url":"https://api.github.com/repos/box/box-ui-elements/forks","keys_url":"https://api.github.com/repos/box/box-ui-elements/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/box-ui-elements/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/box-ui-elements/teams","hooks_url":"https://api.github.com/repos/box/box-ui-elements/hooks","issue_events_url":"https://api.github.com/repos/box/box-ui-elements/issues/events{/number}","events_url":"https://api.github.com/repos/box/box-ui-elements/events","assignees_url":"https://api.github.com/repos/box/box-ui-elements/assignees{/user}","branches_url":"https://api.github.com/repos/box/box-ui-elements/branches{/branch}","tags_url":"https://api.github.com/repos/box/box-ui-elements/tags","blobs_url":"https://api.github.com/repos/box/box-ui-elements/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/box-ui-elements/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/box-ui-elements/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/box-ui-elements/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/box-ui-elements/statuses/{sha}","languages_url":"https://api.github.com/repos/box/box-ui-elements/languages","stargazers_url":"https://api.github.com/repos/box/box-ui-elements/stargazers","contributors_url":"https://api.github.com/repos/box/box-ui-elements/contributors","subscribers_url":"https://api.github.com/repos/box/box-ui-elements/subscribers","subscription_url":"https://api.github.com/repos/box/box-ui-elements/subscription","commits_url":"https://api.github.com/repos/box/box-ui-elements/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/box-ui-elements/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/box-ui-elements/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/box-ui-elements/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/box-ui-elements/contents/{+path}","compare_url":"https://api.github.com/repos/box/box-ui-elements/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/box-ui-elements/merges","archive_url":"https://api.github.com/repos/box/box-ui-elements/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/box-ui-elements/downloads","issues_url":"https://api.github.com/repos/box/box-ui-elements/issues{/number}","pulls_url":"https://api.github.com/repos/box/box-ui-elements/pulls{/number}","milestones_url":"https://api.github.com/repos/box/box-ui-elements/milestones{/number}","notifications_url":"https://api.github.com/repos/box/box-ui-elements/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/box-ui-elements/labels{/name}","releases_url":"https://api.github.com/repos/box/box-ui-elements/releases{/id}","deployments_url":"https://api.github.com/repos/box/box-ui-elements/deployments","created_at":"2017-06-29T05:49:51Z","updated_at":"2018-10-08T21:27:10Z","pushed_at":"2018-10-09T20:16:52Z","git_url":"git://github.com/box/box-ui-elements.git","ssh_url":"git@github.com:box/box-ui-elements.git","clone_url":"https://github.com/box/box-ui-elements.git","svn_url":"https://github.com/box/box-ui-elements","homepage":"https://developer.box.com/docs/box-ui-elements","size":7545,"stargazers_count":54,"watchers_count":54,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":27,"open_issues":29,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/box/box-ui-elements/pulls/588"},"html":{"href":"https://github.com/box/box-ui-elements/pull/588"},"issue":{"href":"https://api.github.com/repos/box/box-ui-elements/issues/588"},"comments":{"href":"https://api.github.com/repos/box/box-ui-elements/issues/588/comments"},"review_comments":{"href":"https://api.github.com/repos/box/box-ui-elements/pulls/588/comments"},"review_comment":{"href":"https://api.github.com/repos/box/box-ui-elements/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/box/box-ui-elements/pulls/588/commits"},"statuses":{"href":"https://api.github.com/repos/box/box-ui-elements/statuses/fb3d806a579c2ab008dbe63d245c7fef68c8cd94"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jeremypress"}}