{"action":"created","comment":{"url":"https://api.github.com/repos/cozy/cozy-ui/pulls/comments/232608919","pull_request_review_id":173840812,"id":232608919,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjYwODkxOQ==","diff_hunk":"@@ -7,16 +7,129 @@ import Icon from '../Icon'\n \n import appDefaultIcon from '../../assets/icons/ui/cube.svg'\n \n+let domain\n+const _getDomain = () => {\n+  if (domain) return domain\n+  const root = document.querySelector('[role=application]')\n+  if (!root) {\n+    throw new Error('Cannot find [role=application] element')\n+  }\n+  domain = root.dataset.cozyDomain\n+  if (!domain) {\n+    throw new Error(\n+      'Application element does not contain `data-cozy-domain` attribute'\n+    )\n+  }\n+  return domain\n+}","path":"react/AppIcon/index.jsx","position":18,"original_position":18,"commit_id":"81163edfb52756c0a345772047bfa1ea9bc88598","original_commit_id":"d6d2351923e99b34b77df0b990d0869b5bac9b46","user":{"login":"ptbrowne","id":465582,"node_id":"MDQ6VXNlcjQ2NTU4Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/465582?v=4","gravatar_id":"","url":"https://api.github.com/users/ptbrowne","html_url":"https://github.com/ptbrowne","followers_url":"https://api.github.com/users/ptbrowne/followers","following_url":"https://api.github.com/users/ptbrowne/following{/other_user}","gists_url":"https://api.github.com/users/ptbrowne/gists{/gist_id}","starred_url":"https://api.github.com/users/ptbrowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptbrowne/subscriptions","organizations_url":"https://api.github.com/users/ptbrowne/orgs","repos_url":"https://api.github.com/users/ptbrowne/repos","events_url":"https://api.github.com/users/ptbrowne/events{/privacy}","received_events_url":"https://api.github.com/users/ptbrowne/received_events","type":"User","site_admin":false},"body":"This won't work in mobile as we do not have the cozyDomain on the DOM node. To me, AppIcon should work in the context of a client. And the domain should be taken from the client.","created_at":"2018-11-12T10:44:58Z","updated_at":"2018-11-12T10:44:58Z","html_url":"https://github.com/cozy/cozy-ui/pull/678#discussion_r232608919","pull_request_url":"https://api.github.com/repos/cozy/cozy-ui/pulls/678","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-ui/pulls/comments/232608919"},"html":{"href":"https://github.com/cozy/cozy-ui/pull/678#discussion_r232608919"},"pull_request":{"href":"https://api.github.com/repos/cozy/cozy-ui/pulls/678"}},"in_reply_to_id":232577439},"pull_request":{"url":"https://api.github.com/repos/cozy/cozy-ui/pulls/678","id":229683102,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NjgzMTAy","html_url":"https://github.com/cozy/cozy-ui/pull/678","diff_url":"https://github.com/cozy/cozy-ui/pull/678.diff","patch_url":"https://github.com/cozy/cozy-ui/pull/678.patch","issue_url":"https://api.github.com/repos/cozy/cozy-ui/issues/678","number":678,"state":"open","locked":false,"title":"AppIcon: Prefer img element over fetchIcon method","user":{"login":"gregorylegarec","id":776764,"node_id":"MDQ6VXNlcjc3Njc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},"body":"This PR deprecates the fetchIcon prop for AppIcon to use directly\nan `<img />` tag, now that all icon served by the stack are accessible\nwithout permissions on doctype `io.cozy.apps`.","created_at":"2018-11-09T12:45:09Z","updated_at":"2018-11-12T10:44:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"808cbea75f1d06dca9f706515c35ed7b80198e15","assignee":{"login":"CPatchane","id":10224453,"node_id":"MDQ6VXNlcjEwMjI0NDUz","avatar_url":"https://avatars2.githubusercontent.com/u/10224453?v=4","gravatar_id":"","url":"https://api.github.com/users/CPatchane","html_url":"https://github.com/CPatchane","followers_url":"https://api.github.com/users/CPatchane/followers","following_url":"https://api.github.com/users/CPatchane/following{/other_user}","gists_url":"https://api.github.com/users/CPatchane/gists{/gist_id}","starred_url":"https://api.github.com/users/CPatchane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CPatchane/subscriptions","organizations_url":"https://api.github.com/users/CPatchane/orgs","repos_url":"https://api.github.com/users/CPatchane/repos","events_url":"https://api.github.com/users/CPatchane/events{/privacy}","received_events_url":"https://api.github.com/users/CPatchane/received_events","type":"User","site_admin":false},"assignees":[{"login":"CPatchane","id":10224453,"node_id":"MDQ6VXNlcjEwMjI0NDUz","avatar_url":"https://avatars2.githubusercontent.com/u/10224453?v=4","gravatar_id":"","url":"https://api.github.com/users/CPatchane","html_url":"https://github.com/CPatchane","followers_url":"https://api.github.com/users/CPatchane/followers","following_url":"https://api.github.com/users/CPatchane/following{/other_user}","gists_url":"https://api.github.com/users/CPatchane/gists{/gist_id}","starred_url":"https://api.github.com/users/CPatchane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CPatchane/subscriptions","organizations_url":"https://api.github.com/users/CPatchane/orgs","repos_url":"https://api.github.com/users/CPatchane/repos","events_url":"https://api.github.com/users/CPatchane/events{/privacy}","received_events_url":"https://api.github.com/users/CPatchane/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"GoOz","id":1280069,"node_id":"MDQ6VXNlcjEyODAwNjk=","avatar_url":"https://avatars2.githubusercontent.com/u/1280069?v=4","gravatar_id":"","url":"https://api.github.com/users/GoOz","html_url":"https://github.com/GoOz","followers_url":"https://api.github.com/users/GoOz/followers","following_url":"https://api.github.com/users/GoOz/following{/other_user}","gists_url":"https://api.github.com/users/GoOz/gists{/gist_id}","starred_url":"https://api.github.com/users/GoOz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoOz/subscriptions","organizations_url":"https://api.github.com/users/GoOz/orgs","repos_url":"https://api.github.com/users/GoOz/repos","events_url":"https://api.github.com/users/GoOz/events{/privacy}","received_events_url":"https://api.github.com/users/GoOz/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":163645942,"node_id":"MDU6TGFiZWwxNjM2NDU5NDI=","url":"https://api.github.com/repos/cozy/cozy-ui/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/cozy/cozy-ui/pulls/678/commits","review_comments_url":"https://api.github.com/repos/cozy/cozy-ui/pulls/678/comments","review_comment_url":"https://api.github.com/repos/cozy/cozy-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy/cozy-ui/issues/678/comments","statuses_url":"https://api.github.com/repos/cozy/cozy-ui/statuses/81163edfb52756c0a345772047bfa1ea9bc88598","head":{"label":"gregorylegarec:feat/appicon-img","ref":"feat/appicon-img","sha":"81163edfb52756c0a345772047bfa1ea9bc88598","user":{"login":"gregorylegarec","id":776764,"node_id":"MDQ6VXNlcjc3Njc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},"repo":{"id":78756897,"node_id":"MDEwOlJlcG9zaXRvcnk3ODc1Njg5Nw==","name":"cozy-ui","full_name":"gregorylegarec/cozy-ui","private":false,"owner":{"login":"gregorylegarec","id":776764,"node_id":"MDQ6VXNlcjc3Njc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gregorylegarec/cozy-ui","description":"A simple demo app for cozycloud that provides examples and guidelines for a pretty well Ui integration","fork":true,"url":"https://api.github.com/repos/gregorylegarec/cozy-ui","forks_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/forks","keys_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/teams","hooks_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/hooks","issue_events_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/issues/events{/number}","events_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/events","assignees_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/assignees{/user}","branches_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/branches{/branch}","tags_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/tags","blobs_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/languages","stargazers_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/stargazers","contributors_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/contributors","subscribers_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/subscribers","subscription_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/subscription","commits_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/contents/{+path}","compare_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/merges","archive_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/downloads","issues_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/issues{/number}","pulls_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/labels{/name}","releases_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/releases{/id}","deployments_url":"https://api.github.com/repos/gregorylegarec/cozy-ui/deployments","created_at":"2017-01-12T15:04:12Z","updated_at":"2018-10-22T12:27:37Z","pushed_at":"2018-11-12T09:37:25Z","git_url":"git://github.com/gregorylegarec/cozy-ui.git","ssh_url":"git@github.com:gregorylegarec/cozy-ui.git","clone_url":"https://github.com/gregorylegarec/cozy-ui.git","svn_url":"https://github.com/gregorylegarec/cozy-ui","homepage":"https://cozy.github.io/cozy-ui/","size":3649,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cozy:master","ref":"master","sha":"98f96bbca5f5dccd782cb1bd3a7b73f0f5b08eae","user":{"login":"cozy","id":7690525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2OTA1MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7690525?v=4","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"repo":{"id":28886566,"node_id":"MDEwOlJlcG9zaXRvcnkyODg4NjU2Ng==","name":"cozy-ui","full_name":"cozy/cozy-ui","private":false,"owner":{"login":"cozy","id":7690525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2OTA1MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7690525?v=4","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cozy/cozy-ui","description":"Stylus files and React components for Cozy apps","fork":false,"url":"https://api.github.com/repos/cozy/cozy-ui","forks_url":"https://api.github.com/repos/cozy/cozy-ui/forks","keys_url":"https://api.github.com/repos/cozy/cozy-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy/cozy-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy/cozy-ui/teams","hooks_url":"https://api.github.com/repos/cozy/cozy-ui/hooks","issue_events_url":"https://api.github.com/repos/cozy/cozy-ui/issues/events{/number}","events_url":"https://api.github.com/repos/cozy/cozy-ui/events","assignees_url":"https://api.github.com/repos/cozy/cozy-ui/assignees{/user}","branches_url":"https://api.github.com/repos/cozy/cozy-ui/branches{/branch}","tags_url":"https://api.github.com/repos/cozy/cozy-ui/tags","blobs_url":"https://api.github.com/repos/cozy/cozy-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy/cozy-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy/cozy-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy/cozy-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy/cozy-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy/cozy-ui/languages","stargazers_url":"https://api.github.com/repos/cozy/cozy-ui/stargazers","contributors_url":"https://api.github.com/repos/cozy/cozy-ui/contributors","subscribers_url":"https://api.github.com/repos/cozy/cozy-ui/subscribers","subscription_url":"https://api.github.com/repos/cozy/cozy-ui/subscription","commits_url":"https://api.github.com/repos/cozy/cozy-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy/cozy-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy/cozy-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy/cozy-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy/cozy-ui/contents/{+path}","compare_url":"https://api.github.com/repos/cozy/cozy-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy/cozy-ui/merges","archive_url":"https://api.github.com/repos/cozy/cozy-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy/cozy-ui/downloads","issues_url":"https://api.github.com/repos/cozy/cozy-ui/issues{/number}","pulls_url":"https://api.github.com/repos/cozy/cozy-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy/cozy-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy/cozy-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy/cozy-ui/labels{/name}","releases_url":"https://api.github.com/repos/cozy/cozy-ui/releases{/id}","deployments_url":"https://api.github.com/repos/cozy/cozy-ui/deployments","created_at":"2015-01-06T22:26:54Z","updated_at":"2018-11-12T09:20:11Z","pushed_at":"2018-11-12T09:37:26Z","git_url":"git://github.com/cozy/cozy-ui.git","ssh_url":"git@github.com:cozy/cozy-ui.git","clone_url":"https://github.com/cozy/cozy-ui.git","svn_url":"https://github.com/cozy/cozy-ui","homepage":"https://cozy.github.io/cozy-ui/react/","size":13775,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16,"open_issues":36,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-ui/pulls/678"},"html":{"href":"https://github.com/cozy/cozy-ui/pull/678"},"issue":{"href":"https://api.github.com/repos/cozy/cozy-ui/issues/678"},"comments":{"href":"https://api.github.com/repos/cozy/cozy-ui/issues/678/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy/cozy-ui/pulls/678/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy/cozy-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy/cozy-ui/pulls/678/commits"},"statuses":{"href":"https://api.github.com/repos/cozy/cozy-ui/statuses/81163edfb52756c0a345772047bfa1ea9bc88598"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ptbrowne"}}