{"action":"created","comment":{"url":"https://api.github.com/repos/Amsterdam/atlas/pulls/comments/219155493","pull_request_review_id":157260193,"id":219155493,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTE1NTQ5Mw==","diff_hunk":"@@ -0,0 +1,45 @@\n+import stateUrlConverter from './state-url-converter';\n+import queryStringParser from '../query-string-parser/query-string-parser';\n+\n+export const paramsToQuery = (params) => (params ? Object.keys(params)\n+  .map((param) => `${param}=${params[param]}`)\n+  .join('&') : '');\n+\n+const getSanitizedHash = (params) => {\n+  const regex = new RegExp('%3A', 'g');\n+  const result = `#?${paramsToQuery(params)}`.replace(regex, ':');\n+  const regexSlash = new RegExp('/', 'g');\n+  return result.replace(regexSlash, '%2F');\n+};\n+\n+const isHashChanged = (locationHash, hash) => {\n+  if (locationHash === hash) return false;\n+  const params = queryStringParser(locationHash.slice(1));\n+  const testHash = getSanitizedHash(params);\n+  return (testHash !== hash);\n+};\n+\n+const stateToUrl = {\n+  update: (state, useReplace) => {\n+    const history = window.globalHistory;\n+    const location = history.location;\n+\n+    const params = stateUrlConverter.state2params(state);\n+    const hash = getSanitizedHash(params);\n+\n+    if (!isHashChanged(location.hash, hash)) return;\n+\n+    // eslint-disable-next-line no-console\n+    // console.log('updating url hash (location.hash and hash are different)');\n+    if (useReplace) {\n+      console.log('replace', hash); // eslint-disable-line no-console","path":"src/shared/services/routing/state-to-url.js","position":35,"original_position":35,"commit_id":"41459bdf0928ccf99cb46349bc8b8a0cb0ca6545","original_commit_id":"41459bdf0928ccf99cb46349bc8b8a0cb0ca6545","user":{"login":"aditudorache","id":24289432,"node_id":"MDQ6VXNlcjI0Mjg5NDMy","avatar_url":"https://avatars2.githubusercontent.com/u/24289432?v=4","gravatar_id":"","url":"https://api.github.com/users/aditudorache","html_url":"https://github.com/aditudorache","followers_url":"https://api.github.com/users/aditudorache/followers","following_url":"https://api.github.com/users/aditudorache/following{/other_user}","gists_url":"https://api.github.com/users/aditudorache/gists{/gist_id}","starred_url":"https://api.github.com/users/aditudorache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aditudorache/subscriptions","organizations_url":"https://api.github.com/users/aditudorache/orgs","repos_url":"https://api.github.com/users/aditudorache/repos","events_url":"https://api.github.com/users/aditudorache/events{/privacy}","received_events_url":"https://api.github.com/users/aditudorache/received_events","type":"User","site_admin":false},"body":"removed","created_at":"2018-09-20T13:07:42Z","updated_at":"2018-09-20T13:07:43Z","html_url":"https://github.com/Amsterdam/atlas/pull/1307#discussion_r219155493","pull_request_url":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Amsterdam/atlas/pulls/comments/219155493"},"html":{"href":"https://github.com/Amsterdam/atlas/pull/1307#discussion_r219155493"},"pull_request":{"href":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307"}},"in_reply_to_id":219145531},"pull_request":{"url":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307","id":216927617,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2OTI3NjE3","html_url":"https://github.com/Amsterdam/atlas/pull/1307","diff_url":"https://github.com/Amsterdam/atlas/pull/1307.diff","patch_url":"https://github.com/Amsterdam/atlas/pull/1307.patch","issue_url":"https://api.github.com/repos/Amsterdam/atlas/issues/1307","number":1307,"state":"open","locked":false,"title":"Feature/dp 5861 state2url","user":{"login":"aditudorache","id":24289432,"node_id":"MDQ6VXNlcjI0Mjg5NDMy","avatar_url":"https://avatars2.githubusercontent.com/u/24289432?v=4","gravatar_id":"","url":"https://api.github.com/users/aditudorache","html_url":"https://github.com/aditudorache","followers_url":"https://api.github.com/users/aditudorache/followers","following_url":"https://api.github.com/users/aditudorache/following{/other_user}","gists_url":"https://api.github.com/users/aditudorache/gists{/gist_id}","starred_url":"https://api.github.com/users/aditudorache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aditudorache/subscriptions","organizations_url":"https://api.github.com/users/aditudorache/orgs","repos_url":"https://api.github.com/users/aditudorache/repos","events_url":"https://api.github.com/users/aditudorache/events{/privacy}","received_events_url":"https://api.github.com/users/aditudorache/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-20T10:52:20Z","updated_at":"2018-09-20T13:07:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dce9e1fbf9d93fa3651ab4a6de1fdf9e9eba3878","assignee":null,"assignees":[],"requested_reviewers":[{"login":"RRMoelker","id":205326,"node_id":"MDQ6VXNlcjIwNTMyNg==","avatar_url":"https://avatars0.githubusercontent.com/u/205326?v=4","gravatar_id":"","url":"https://api.github.com/users/RRMoelker","html_url":"https://github.com/RRMoelker","followers_url":"https://api.github.com/users/RRMoelker/followers","following_url":"https://api.github.com/users/RRMoelker/following{/other_user}","gists_url":"https://api.github.com/users/RRMoelker/gists{/gist_id}","starred_url":"https://api.github.com/users/RRMoelker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RRMoelker/subscriptions","organizations_url":"https://api.github.com/users/RRMoelker/orgs","repos_url":"https://api.github.com/users/RRMoelker/repos","events_url":"https://api.github.com/users/RRMoelker/events{/privacy}","received_events_url":"https://api.github.com/users/RRMoelker/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307/commits","review_comments_url":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307/comments","review_comment_url":"https://api.github.com/repos/Amsterdam/atlas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Amsterdam/atlas/issues/1307/comments","statuses_url":"https://api.github.com/repos/Amsterdam/atlas/statuses/41459bdf0928ccf99cb46349bc8b8a0cb0ca6545","head":{"label":"Amsterdam:feature/DP-5861-state2url","ref":"feature/DP-5861-state2url","sha":"41459bdf0928ccf99cb46349bc8b8a0cb0ca6545","user":{"login":"Amsterdam","id":14022058,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDIyMDU4","avatar_url":"https://avatars0.githubusercontent.com/u/14022058?v=4","gravatar_id":"","url":"https://api.github.com/users/Amsterdam","html_url":"https://github.com/Amsterdam","followers_url":"https://api.github.com/users/Amsterdam/followers","following_url":"https://api.github.com/users/Amsterdam/following{/other_user}","gists_url":"https://api.github.com/users/Amsterdam/gists{/gist_id}","starred_url":"https://api.github.com/users/Amsterdam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amsterdam/subscriptions","organizations_url":"https://api.github.com/users/Amsterdam/orgs","repos_url":"https://api.github.com/users/Amsterdam/repos","events_url":"https://api.github.com/users/Amsterdam/events{/privacy}","received_events_url":"https://api.github.com/users/Amsterdam/received_events","type":"Organization","site_admin":false},"repo":{"id":60016458,"node_id":"MDEwOlJlcG9zaXRvcnk2MDAxNjQ1OA==","name":"atlas","full_name":"Amsterdam/atlas","private":false,"owner":{"login":"Amsterdam","id":14022058,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDIyMDU4","avatar_url":"https://avatars0.githubusercontent.com/u/14022058?v=4","gravatar_id":"","url":"https://api.github.com/users/Amsterdam","html_url":"https://github.com/Amsterdam","followers_url":"https://api.github.com/users/Amsterdam/followers","following_url":"https://api.github.com/users/Amsterdam/following{/other_user}","gists_url":"https://api.github.com/users/Amsterdam/gists{/gist_id}","starred_url":"https://api.github.com/users/Amsterdam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amsterdam/subscriptions","organizations_url":"https://api.github.com/users/Amsterdam/orgs","repos_url":"https://api.github.com/users/Amsterdam/repos","events_url":"https://api.github.com/users/Amsterdam/events{/privacy}","received_events_url":"https://api.github.com/users/Amsterdam/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Amsterdam/atlas","description":null,"fork":false,"url":"https://api.github.com/repos/Amsterdam/atlas","forks_url":"https://api.github.com/repos/Amsterdam/atlas/forks","keys_url":"https://api.github.com/repos/Amsterdam/atlas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Amsterdam/atlas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Amsterdam/atlas/teams","hooks_url":"https://api.github.com/repos/Amsterdam/atlas/hooks","issue_events_url":"https://api.github.com/repos/Amsterdam/atlas/issues/events{/number}","events_url":"https://api.github.com/repos/Amsterdam/atlas/events","assignees_url":"https://api.github.com/repos/Amsterdam/atlas/assignees{/user}","branches_url":"https://api.github.com/repos/Amsterdam/atlas/branches{/branch}","tags_url":"https://api.github.com/repos/Amsterdam/atlas/tags","blobs_url":"https://api.github.com/repos/Amsterdam/atlas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Amsterdam/atlas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Amsterdam/atlas/git/refs{/sha}","trees_url":"https://api.github.com/repos/Amsterdam/atlas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Amsterdam/atlas/statuses/{sha}","languages_url":"https://api.github.com/repos/Amsterdam/atlas/languages","stargazers_url":"https://api.github.com/repos/Amsterdam/atlas/stargazers","contributors_url":"https://api.github.com/repos/Amsterdam/atlas/contributors","subscribers_url":"https://api.github.com/repos/Amsterdam/atlas/subscribers","subscription_url":"https://api.github.com/repos/Amsterdam/atlas/subscription","commits_url":"https://api.github.com/repos/Amsterdam/atlas/commits{/sha}","git_commits_url":"https://api.github.com/repos/Amsterdam/atlas/git/commits{/sha}","comments_url":"https://api.github.com/repos/Amsterdam/atlas/comments{/number}","issue_comment_url":"https://api.github.com/repos/Amsterdam/atlas/issues/comments{/number}","contents_url":"https://api.github.com/repos/Amsterdam/atlas/contents/{+path}","compare_url":"https://api.github.com/repos/Amsterdam/atlas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Amsterdam/atlas/merges","archive_url":"https://api.github.com/repos/Amsterdam/atlas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Amsterdam/atlas/downloads","issues_url":"https://api.github.com/repos/Amsterdam/atlas/issues{/number}","pulls_url":"https://api.github.com/repos/Amsterdam/atlas/pulls{/number}","milestones_url":"https://api.github.com/repos/Amsterdam/atlas/milestones{/number}","notifications_url":"https://api.github.com/repos/Amsterdam/atlas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Amsterdam/atlas/labels{/name}","releases_url":"https://api.github.com/repos/Amsterdam/atlas/releases{/id}","deployments_url":"https://api.github.com/repos/Amsterdam/atlas/deployments","created_at":"2016-05-30T14:31:42Z","updated_at":"2018-09-20T07:17:14Z","pushed_at":"2018-09-20T13:05:17Z","git_url":"git://github.com/Amsterdam/atlas.git","ssh_url":"git@github.com:Amsterdam/atlas.git","clone_url":"https://github.com/Amsterdam/atlas.git","svn_url":"https://github.com/Amsterdam/atlas","homepage":"","size":29334,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":4,"open_issues":6,"watchers":9,"default_branch":"develop"}},"base":{"label":"Amsterdam:DP-5861-redux-refactor","ref":"DP-5861-redux-refactor","sha":"c8c7c07a6a056561cdcde524621312122319ff44","user":{"login":"Amsterdam","id":14022058,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDIyMDU4","avatar_url":"https://avatars0.githubusercontent.com/u/14022058?v=4","gravatar_id":"","url":"https://api.github.com/users/Amsterdam","html_url":"https://github.com/Amsterdam","followers_url":"https://api.github.com/users/Amsterdam/followers","following_url":"https://api.github.com/users/Amsterdam/following{/other_user}","gists_url":"https://api.github.com/users/Amsterdam/gists{/gist_id}","starred_url":"https://api.github.com/users/Amsterdam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amsterdam/subscriptions","organizations_url":"https://api.github.com/users/Amsterdam/orgs","repos_url":"https://api.github.com/users/Amsterdam/repos","events_url":"https://api.github.com/users/Amsterdam/events{/privacy}","received_events_url":"https://api.github.com/users/Amsterdam/received_events","type":"Organization","site_admin":false},"repo":{"id":60016458,"node_id":"MDEwOlJlcG9zaXRvcnk2MDAxNjQ1OA==","name":"atlas","full_name":"Amsterdam/atlas","private":false,"owner":{"login":"Amsterdam","id":14022058,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDIyMDU4","avatar_url":"https://avatars0.githubusercontent.com/u/14022058?v=4","gravatar_id":"","url":"https://api.github.com/users/Amsterdam","html_url":"https://github.com/Amsterdam","followers_url":"https://api.github.com/users/Amsterdam/followers","following_url":"https://api.github.com/users/Amsterdam/following{/other_user}","gists_url":"https://api.github.com/users/Amsterdam/gists{/gist_id}","starred_url":"https://api.github.com/users/Amsterdam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amsterdam/subscriptions","organizations_url":"https://api.github.com/users/Amsterdam/orgs","repos_url":"https://api.github.com/users/Amsterdam/repos","events_url":"https://api.github.com/users/Amsterdam/events{/privacy}","received_events_url":"https://api.github.com/users/Amsterdam/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Amsterdam/atlas","description":null,"fork":false,"url":"https://api.github.com/repos/Amsterdam/atlas","forks_url":"https://api.github.com/repos/Amsterdam/atlas/forks","keys_url":"https://api.github.com/repos/Amsterdam/atlas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Amsterdam/atlas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Amsterdam/atlas/teams","hooks_url":"https://api.github.com/repos/Amsterdam/atlas/hooks","issue_events_url":"https://api.github.com/repos/Amsterdam/atlas/issues/events{/number}","events_url":"https://api.github.com/repos/Amsterdam/atlas/events","assignees_url":"https://api.github.com/repos/Amsterdam/atlas/assignees{/user}","branches_url":"https://api.github.com/repos/Amsterdam/atlas/branches{/branch}","tags_url":"https://api.github.com/repos/Amsterdam/atlas/tags","blobs_url":"https://api.github.com/repos/Amsterdam/atlas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Amsterdam/atlas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Amsterdam/atlas/git/refs{/sha}","trees_url":"https://api.github.com/repos/Amsterdam/atlas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Amsterdam/atlas/statuses/{sha}","languages_url":"https://api.github.com/repos/Amsterdam/atlas/languages","stargazers_url":"https://api.github.com/repos/Amsterdam/atlas/stargazers","contributors_url":"https://api.github.com/repos/Amsterdam/atlas/contributors","subscribers_url":"https://api.github.com/repos/Amsterdam/atlas/subscribers","subscription_url":"https://api.github.com/repos/Amsterdam/atlas/subscription","commits_url":"https://api.github.com/repos/Amsterdam/atlas/commits{/sha}","git_commits_url":"https://api.github.com/repos/Amsterdam/atlas/git/commits{/sha}","comments_url":"https://api.github.com/repos/Amsterdam/atlas/comments{/number}","issue_comment_url":"https://api.github.com/repos/Amsterdam/atlas/issues/comments{/number}","contents_url":"https://api.github.com/repos/Amsterdam/atlas/contents/{+path}","compare_url":"https://api.github.com/repos/Amsterdam/atlas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Amsterdam/atlas/merges","archive_url":"https://api.github.com/repos/Amsterdam/atlas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Amsterdam/atlas/downloads","issues_url":"https://api.github.com/repos/Amsterdam/atlas/issues{/number}","pulls_url":"https://api.github.com/repos/Amsterdam/atlas/pulls{/number}","milestones_url":"https://api.github.com/repos/Amsterdam/atlas/milestones{/number}","notifications_url":"https://api.github.com/repos/Amsterdam/atlas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Amsterdam/atlas/labels{/name}","releases_url":"https://api.github.com/repos/Amsterdam/atlas/releases{/id}","deployments_url":"https://api.github.com/repos/Amsterdam/atlas/deployments","created_at":"2016-05-30T14:31:42Z","updated_at":"2018-09-20T07:17:14Z","pushed_at":"2018-09-20T13:05:17Z","git_url":"git://github.com/Amsterdam/atlas.git","ssh_url":"git@github.com:Amsterdam/atlas.git","clone_url":"https://github.com/Amsterdam/atlas.git","svn_url":"https://github.com/Amsterdam/atlas","homepage":"","size":29334,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":4,"open_issues":6,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307"},"html":{"href":"https://github.com/Amsterdam/atlas/pull/1307"},"issue":{"href":"https://api.github.com/repos/Amsterdam/atlas/issues/1307"},"comments":{"href":"https://api.github.com/repos/Amsterdam/atlas/issues/1307/comments"},"review_comments":{"href":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307/comments"},"review_comment":{"href":"https://api.github.com/repos/Amsterdam/atlas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Amsterdam/atlas/pulls/1307/commits"},"statuses":{"href":"https://api.github.com/repos/Amsterdam/atlas/statuses/41459bdf0928ccf99cb46349bc8b8a0cb0ca6545"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aditudorache"}}