{"action":"created","comment":{"url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/comments/256896198","pull_request_review_id":203824141,"id":256896198,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1Njg5NjE5OA==","diff_hunk":"@@ -96,39 +98,20 @@ function setCurrentVessel(tilesetId, seriesgroup, fromSearch) {\n   return (dispatch, getState) => {\n     const state = getState();\n     const token = state.user.token;\n-    let request;\n-\n-    if (typeof XMLHttpRequest !== 'undefined') {\n-      request = new XMLHttpRequest();\n-    } else {\n-      throw new Error('XMLHttpRequest is disabled');\n-    }\n-\n     const layer = state.layers.workspaceLayers.find(l =>\n       LAYER_TYPES_WITH_HEADER.indexOf(l.type) > -1 && l.tilesetId === tilesetId);\n \n-    request.open(\n-      'GET',\n-      buildEndpoint(layer.header.endpoints.info, { id: seriesgroup }),\n-      true\n-    );\n-    if (token) {\n-      request.setRequestHeader('Authorization', `Bearer ${token}`);\n-    }\n-    request.setRequestHeader('Accept', 'application/json');\n-    request.onreadystatechange = () => {\n-      if (request.readyState !== 4) {\n-        return;\n-      }\n-      if (request.status >= 500 || request.status === 404) {\n-        console.error('Error loading vessel info:', request.responseText);\n-        return;\n-      }\n-      const data = JSON.parse(request.responseText);\n+    const vesselInfoUrl = buildEndpoint(layer.header.endpoints.info, { id: seriesgroup });\n+    fetchEndpoint(vesselInfoUrl, token).then((data) => {","path":"app/src/vesselInfo/vesselInfoActions.js","position":50,"original_position":50,"commit_id":"2e828e6760f35e2cd30b0d50123c925f647d7438","original_commit_id":"80c0f7ddc4d7f8ef2ec850325aa4c31cd04cb240","user":{"login":"j8seangel","id":10500650,"node_id":"MDQ6VXNlcjEwNTAwNjUw","avatar_url":"https://avatars2.githubusercontent.com/u/10500650?v=4","gravatar_id":"","url":"https://api.github.com/users/j8seangel","html_url":"https://github.com/j8seangel","followers_url":"https://api.github.com/users/j8seangel/followers","following_url":"https://api.github.com/users/j8seangel/following{/other_user}","gists_url":"https://api.github.com/users/j8seangel/gists{/gist_id}","starred_url":"https://api.github.com/users/j8seangel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j8seangel/subscriptions","organizations_url":"https://api.github.com/users/j8seangel/orgs","repos_url":"https://api.github.com/users/j8seangel/repos","events_url":"https://api.github.com/users/j8seangel/events{/privacy}","received_events_url":"https://api.github.com/users/j8seangel/received_events","type":"User","site_admin":false},"body":"My pleasure","created_at":"2019-02-14T15:58:57Z","updated_at":"2019-02-14T15:58:58Z","html_url":"https://github.com/GlobalFishingWatch/map-client/pull/1013#discussion_r256896198","pull_request_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/comments/256896198"},"html":{"href":"https://github.com/GlobalFishingWatch/map-client/pull/1013#discussion_r256896198"},"pull_request":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013"}},"in_reply_to_id":256890582},"pull_request":{"url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013","id":253043925,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUzMDQzOTI1","html_url":"https://github.com/GlobalFishingWatch/map-client/pull/1013","diff_url":"https://github.com/GlobalFishingWatch/map-client/pull/1013.diff","patch_url":"https://github.com/GlobalFishingWatch/map-client/pull/1013.patch","issue_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/1013","number":1013,"state":"open","locked":false,"title":"Vessel warning notification","user":{"login":"j8seangel","id":10500650,"node_id":"MDQ6VXNlcjEwNTAwNjUw","avatar_url":"https://avatars2.githubusercontent.com/u/10500650?v=4","gravatar_id":"","url":"https://api.github.com/users/j8seangel","html_url":"https://github.com/j8seangel","followers_url":"https://api.github.com/users/j8seangel/followers","following_url":"https://api.github.com/users/j8seangel/following{/other_user}","gists_url":"https://api.github.com/users/j8seangel/gists{/gist_id}","starred_url":"https://api.github.com/users/j8seangel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j8seangel/subscriptions","organizations_url":"https://api.github.com/users/j8seangel/orgs","repos_url":"https://api.github.com/users/j8seangel/repos","events_url":"https://api.github.com/users/j8seangel/events{/privacy}","received_events_url":"https://api.github.com/users/j8seangel/received_events","type":"User","site_admin":false},"body":"- Move notification to a redux module to be able to dispatch notifications from any place of the app.\r\n- Add types to existing notifications and sort by priority\r\n- Show warning notification when a vessel Info contains `comment` in the response\r\n- Add warning icon in pinned and detailed vessel area.\r\n\r\n![image](https://user-images.githubusercontent.com/10500650/52782623-cd836200-304f-11e9-95ff-8c50ce9119c8.png)\r\n\r\n**TODO**: \r\n\r\n- [ ] [Remove mocking code](https://github.com/GlobalFishingWatch/map-client/compare/vessel-warning-notification?expand=1#diff-79c70c2d0b094b469b73c774b9c211beR109) when API ready\r\n\r\n**To Discuss**:\r\nI've created a jsx component in the container element to have:\r\n- Presentational component isolated.\r\n- Custom logic onCloseClick out of the presentational component.\r\n- ComponentDidMount lifecycle to dispatch the existing first notification. what are your thoughts [here](https://github.com/GlobalFishingWatch/map-client/compare/vessel-warning-notification?expand=1#diff-11101aec2a341228942e87fffdfd60f1R97) hopefully could be replaced with a simpler [hook API](https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect) after upgrade React version.\r\n","created_at":"2019-02-14T11:54:17Z","updated_at":"2019-02-14T15:58:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"058c98caa20ea801f0584d60ea9bf67a5796a7e4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013/commits","review_comments_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013/comments","review_comment_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/1013/comments","statuses_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/statuses/2e828e6760f35e2cd30b0d50123c925f647d7438","head":{"label":"GlobalFishingWatch:vessel-warning-notification","ref":"vessel-warning-notification","sha":"2e828e6760f35e2cd30b0d50123c925f647d7438","user":{"login":"GlobalFishingWatch","id":9467707,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0Njc3MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/9467707?v=4","gravatar_id":"","url":"https://api.github.com/users/GlobalFishingWatch","html_url":"https://github.com/GlobalFishingWatch","followers_url":"https://api.github.com/users/GlobalFishingWatch/followers","following_url":"https://api.github.com/users/GlobalFishingWatch/following{/other_user}","gists_url":"https://api.github.com/users/GlobalFishingWatch/gists{/gist_id}","starred_url":"https://api.github.com/users/GlobalFishingWatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlobalFishingWatch/subscriptions","organizations_url":"https://api.github.com/users/GlobalFishingWatch/orgs","repos_url":"https://api.github.com/users/GlobalFishingWatch/repos","events_url":"https://api.github.com/users/GlobalFishingWatch/events{/privacy}","received_events_url":"https://api.github.com/users/GlobalFishingWatch/received_events","type":"Organization","site_admin":false},"repo":{"id":59182220,"node_id":"MDEwOlJlcG9zaXRvcnk1OTE4MjIyMA==","name":"map-client","full_name":"GlobalFishingWatch/map-client","private":false,"owner":{"login":"GlobalFishingWatch","id":9467707,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0Njc3MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/9467707?v=4","gravatar_id":"","url":"https://api.github.com/users/GlobalFishingWatch","html_url":"https://github.com/GlobalFishingWatch","followers_url":"https://api.github.com/users/GlobalFishingWatch/followers","following_url":"https://api.github.com/users/GlobalFishingWatch/following{/other_user}","gists_url":"https://api.github.com/users/GlobalFishingWatch/gists{/gist_id}","starred_url":"https://api.github.com/users/GlobalFishingWatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlobalFishingWatch/subscriptions","organizations_url":"https://api.github.com/users/GlobalFishingWatch/orgs","repos_url":"https://api.github.com/users/GlobalFishingWatch/repos","events_url":"https://api.github.com/users/GlobalFishingWatch/events{/privacy}","received_events_url":"https://api.github.com/users/GlobalFishingWatch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GlobalFishingWatch/map-client","description":"Track commercial fishing activity worldwide on the free, user-friendly, interactive Global Fishing Watch map.","fork":false,"url":"https://api.github.com/repos/GlobalFishingWatch/map-client","forks_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/forks","keys_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/teams","hooks_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/hooks","issue_events_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/events{/number}","events_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/events","assignees_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/assignees{/user}","branches_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/branches{/branch}","tags_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/tags","blobs_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/statuses/{sha}","languages_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/languages","stargazers_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/stargazers","contributors_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/contributors","subscribers_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/subscribers","subscription_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/subscription","commits_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/contents/{+path}","compare_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/merges","archive_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/downloads","issues_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues{/number}","pulls_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls{/number}","milestones_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/milestones{/number}","notifications_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/labels{/name}","releases_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/releases{/id}","deployments_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/deployments","created_at":"2016-05-19T07:03:43Z","updated_at":"2019-02-04T16:55:32Z","pushed_at":"2019-02-14T15:22:07Z","git_url":"git://github.com/GlobalFishingWatch/map-client.git","ssh_url":"git@github.com:GlobalFishingWatch/map-client.git","clone_url":"https://github.com/GlobalFishingWatch/map-client.git","svn_url":"https://github.com/GlobalFishingWatch/map-client","homepage":"http://globalfishingwatch.org/","size":83013,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":40,"watchers":16,"default_branch":"develop"}},"base":{"label":"GlobalFishingWatch:develop","ref":"develop","sha":"6cb9e40ba3b5ae49bdd4d58a93824289b1226b23","user":{"login":"GlobalFishingWatch","id":9467707,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0Njc3MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/9467707?v=4","gravatar_id":"","url":"https://api.github.com/users/GlobalFishingWatch","html_url":"https://github.com/GlobalFishingWatch","followers_url":"https://api.github.com/users/GlobalFishingWatch/followers","following_url":"https://api.github.com/users/GlobalFishingWatch/following{/other_user}","gists_url":"https://api.github.com/users/GlobalFishingWatch/gists{/gist_id}","starred_url":"https://api.github.com/users/GlobalFishingWatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlobalFishingWatch/subscriptions","organizations_url":"https://api.github.com/users/GlobalFishingWatch/orgs","repos_url":"https://api.github.com/users/GlobalFishingWatch/repos","events_url":"https://api.github.com/users/GlobalFishingWatch/events{/privacy}","received_events_url":"https://api.github.com/users/GlobalFishingWatch/received_events","type":"Organization","site_admin":false},"repo":{"id":59182220,"node_id":"MDEwOlJlcG9zaXRvcnk1OTE4MjIyMA==","name":"map-client","full_name":"GlobalFishingWatch/map-client","private":false,"owner":{"login":"GlobalFishingWatch","id":9467707,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0Njc3MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/9467707?v=4","gravatar_id":"","url":"https://api.github.com/users/GlobalFishingWatch","html_url":"https://github.com/GlobalFishingWatch","followers_url":"https://api.github.com/users/GlobalFishingWatch/followers","following_url":"https://api.github.com/users/GlobalFishingWatch/following{/other_user}","gists_url":"https://api.github.com/users/GlobalFishingWatch/gists{/gist_id}","starred_url":"https://api.github.com/users/GlobalFishingWatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlobalFishingWatch/subscriptions","organizations_url":"https://api.github.com/users/GlobalFishingWatch/orgs","repos_url":"https://api.github.com/users/GlobalFishingWatch/repos","events_url":"https://api.github.com/users/GlobalFishingWatch/events{/privacy}","received_events_url":"https://api.github.com/users/GlobalFishingWatch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GlobalFishingWatch/map-client","description":"Track commercial fishing activity worldwide on the free, user-friendly, interactive Global Fishing Watch map.","fork":false,"url":"https://api.github.com/repos/GlobalFishingWatch/map-client","forks_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/forks","keys_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/teams","hooks_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/hooks","issue_events_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/events{/number}","events_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/events","assignees_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/assignees{/user}","branches_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/branches{/branch}","tags_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/tags","blobs_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/statuses/{sha}","languages_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/languages","stargazers_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/stargazers","contributors_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/contributors","subscribers_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/subscribers","subscription_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/subscription","commits_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/contents/{+path}","compare_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/merges","archive_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/downloads","issues_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues{/number}","pulls_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls{/number}","milestones_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/milestones{/number}","notifications_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/labels{/name}","releases_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/releases{/id}","deployments_url":"https://api.github.com/repos/GlobalFishingWatch/map-client/deployments","created_at":"2016-05-19T07:03:43Z","updated_at":"2019-02-04T16:55:32Z","pushed_at":"2019-02-14T15:22:07Z","git_url":"git://github.com/GlobalFishingWatch/map-client.git","ssh_url":"git@github.com:GlobalFishingWatch/map-client.git","clone_url":"https://github.com/GlobalFishingWatch/map-client.git","svn_url":"https://github.com/GlobalFishingWatch/map-client","homepage":"http://globalfishingwatch.org/","size":83013,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":40,"watchers":16,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013"},"html":{"href":"https://github.com/GlobalFishingWatch/map-client/pull/1013"},"issue":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/1013"},"comments":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/issues/1013/comments"},"review_comments":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013/comments"},"review_comment":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/pulls/1013/commits"},"statuses":{"href":"https://api.github.com/repos/GlobalFishingWatch/map-client/statuses/2e828e6760f35e2cd30b0d50123c925f647d7438"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"j8seangel"}}