{"action":"created","comment":{"url":"https://api.github.com/repos/concord-consortium/rigse/pulls/comments/30708285","id":30708285,"diff_hunk":"@@ -5,30 +5,64 @@ window.MaterialsBinClass = React.createClass\n     materials: React.PropTypes.array.isRequired\n \n   getInitialState: ->\n-    state = {\n-      # selectedCategories[2] returns value of row that is selected in column 2 (or falsy value if nothing is selected).\n-      # E.g. selectedCategories = [1, 3, 2] means that:\n-      # - the second row is selected (idx = 1) in the first column,\n-      # - the fourth row is selected (idx = 3) in the second column,\n-      # - the third row is selected (idx = 2) in the third column.\n-      selectedCategories: []\n-    }\n+    # selectedCategories[2] returns value of row that is selected in column 2 (or falsy value if nothing is selected).\n+    # E.g. selectedCategories = [1, 3, 2] means that:\n+    # - the second row is selected (idx = 1) in the first column,\n+    # - the fourth row is selected (idx = 3) in the second column,\n+    # - the third row is selected (idx = 2) in the third column.\n+    selectedCategories: []\n+\n+  componentWillMount: ->\n+    # map the category names to slugs so we have a quick lookup in #checkHash\n+    @columnSlugMap = {}\n+    mapSlugs = (list, column = 0) =>\n+      for item, row in list","path":"app/assets/javascripts/components/materials_bin/materials_bin.js.coffee","position":23,"original_position":23,"commit_id":"561b053867680e7f27a71db0e2d8e522e57b60cf","original_commit_id":"561b053867680e7f27a71db0e2d8e522e57b60cf","user":{"login":"pjanik","id":767857,"avatar_url":"https://avatars.githubusercontent.com/u/767857?v=3","gravatar_id":"","url":"https://api.github.com/users/pjanik","html_url":"https://github.com/pjanik","followers_url":"https://api.github.com/users/pjanik/followers","following_url":"https://api.github.com/users/pjanik/following{/other_user}","gists_url":"https://api.github.com/users/pjanik/gists{/gist_id}","starred_url":"https://api.github.com/users/pjanik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjanik/subscriptions","organizations_url":"https://api.github.com/users/pjanik/orgs","repos_url":"https://api.github.com/users/pjanik/repos","events_url":"https://api.github.com/users/pjanik/events{/privacy}","received_events_url":"https://api.github.com/users/pjanik/received_events","type":"User","site_admin":false},"body":"Probably `row` doesn't represent a real row index here (due to format of the JSON and nested categories). It will be row of the given list, but not the whole column. In `_getColumns()` I'm calculating it in a following way:\r\n`rowIdx = columns[columnIdx].length`.\r\nMaybe it can be useful to reuse part of the `_getColumns` logic and work with the flat structure instead of this nested one.","created_at":"2015-05-20T14:36:32Z","updated_at":"2015-05-20T14:36:32Z","html_url":"https://github.com/concord-consortium/rigse/pull/68#discussion_r30708285","pull_request_url":"https://api.github.com/repos/concord-consortium/rigse/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/concord-consortium/rigse/pulls/comments/30708285"},"html":{"href":"https://github.com/concord-consortium/rigse/pull/68#discussion_r30708285"},"pull_request":{"href":"https://api.github.com/repos/concord-consortium/rigse/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/concord-consortium/rigse/pulls/68","id":35761192,"html_url":"https://github.com/concord-consortium/rigse/pull/68","diff_url":"https://github.com/concord-consortium/rigse/pull/68.diff","patch_url":"https://github.com/concord-consortium/rigse/pull/68.patch","issue_url":"https://api.github.com/repos/concord-consortium/rigse/issues/68","number":68,"state":"open","locked":false,"title":"Add support for URL anchors in bin view [#94127336]","user":{"login":"dougmartin","id":112938,"avatar_url":"https://avatars.githubusercontent.com/u/112938?v=3","gravatar_id":"","url":"https://api.github.com/users/dougmartin","html_url":"https://github.com/dougmartin","followers_url":"https://api.github.com/users/dougmartin/followers","following_url":"https://api.github.com/users/dougmartin/following{/other_user}","gists_url":"https://api.github.com/users/dougmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/dougmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougmartin/subscriptions","organizations_url":"https://api.github.com/users/dougmartin/orgs","repos_url":"https://api.github.com/users/dougmartin/repos","events_url":"https://api.github.com/users/dougmartin/events{/privacy}","received_events_url":"https://api.github.com/users/dougmartin/received_events","type":"User","site_admin":false},"body":"This adds support for both setting the hash based on the bin selection and watching for hash changes based on the browser back/next button.  Each selected column is identified by a slug and delimited by the pipe character.","created_at":"2015-05-19T18:39:48Z","updated_at":"2015-05-20T14:36:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c36183e274715f31ee542b9e2a18f389ef90ee67","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/concord-consortium/rigse/pulls/68/commits","review_comments_url":"https://api.github.com/repos/concord-consortium/rigse/pulls/68/comments","review_comment_url":"https://api.github.com/repos/concord-consortium/rigse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/concord-consortium/rigse/issues/68/comments","statuses_url":"https://api.github.com/repos/concord-consortium/rigse/statuses/561b053867680e7f27a71db0e2d8e522e57b60cf","head":{"label":"concord-consortium:add-anchors-to-bin-view","ref":"add-anchors-to-bin-view","sha":"561b053867680e7f27a71db0e2d8e522e57b60cf","user":{"login":"concord-consortium","id":319219,"avatar_url":"https://avatars.githubusercontent.com/u/319219?v=3","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":2056634,"name":"rigse","full_name":"concord-consortium/rigse","owner":{"login":"concord-consortium","id":319219,"avatar_url":"https://avatars.githubusercontent.com/u/319219?v=3","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/concord-consortium/rigse","description":"Rails Activity Generator for RITES project","fork":true,"url":"https://api.github.com/repos/concord-consortium/rigse","forks_url":"https://api.github.com/repos/concord-consortium/rigse/forks","keys_url":"https://api.github.com/repos/concord-consortium/rigse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concord-consortium/rigse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concord-consortium/rigse/teams","hooks_url":"https://api.github.com/repos/concord-consortium/rigse/hooks","issue_events_url":"https://api.github.com/repos/concord-consortium/rigse/issues/events{/number}","events_url":"https://api.github.com/repos/concord-consortium/rigse/events","assignees_url":"https://api.github.com/repos/concord-consortium/rigse/assignees{/user}","branches_url":"https://api.github.com/repos/concord-consortium/rigse/branches{/branch}","tags_url":"https://api.github.com/repos/concord-consortium/rigse/tags","blobs_url":"https://api.github.com/repos/concord-consortium/rigse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concord-consortium/rigse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concord-consortium/rigse/git/refs{/sha}","trees_url":"https://api.github.com/repos/concord-consortium/rigse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concord-consortium/rigse/statuses/{sha}","languages_url":"https://api.github.com/repos/concord-consortium/rigse/languages","stargazers_url":"https://api.github.com/repos/concord-consortium/rigse/stargazers","contributors_url":"https://api.github.com/repos/concord-consortium/rigse/contributors","subscribers_url":"https://api.github.com/repos/concord-consortium/rigse/subscribers","subscription_url":"https://api.github.com/repos/concord-consortium/rigse/subscription","commits_url":"https://api.github.com/repos/concord-consortium/rigse/commits{/sha}","git_commits_url":"https://api.github.com/repos/concord-consortium/rigse/git/commits{/sha}","comments_url":"https://api.github.com/repos/concord-consortium/rigse/comments{/number}","issue_comment_url":"https://api.github.com/repos/concord-consortium/rigse/issues/comments{/number}","contents_url":"https://api.github.com/repos/concord-consortium/rigse/contents/{+path}","compare_url":"https://api.github.com/repos/concord-consortium/rigse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concord-consortium/rigse/merges","archive_url":"https://api.github.com/repos/concord-consortium/rigse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concord-consortium/rigse/downloads","issues_url":"https://api.github.com/repos/concord-consortium/rigse/issues{/number}","pulls_url":"https://api.github.com/repos/concord-consortium/rigse/pulls{/number}","milestones_url":"https://api.github.com/repos/concord-consortium/rigse/milestones{/number}","notifications_url":"https://api.github.com/repos/concord-consortium/rigse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concord-consortium/rigse/labels{/name}","releases_url":"https://api.github.com/repos/concord-consortium/rigse/releases{/id}","created_at":"2011-07-16T03:22:38Z","updated_at":"2015-05-08T13:20:15Z","pushed_at":"2015-05-20T13:58:20Z","git_url":"git://github.com/concord-consortium/rigse.git","ssh_url":"git@github.com:concord-consortium/rigse.git","clone_url":"https://github.com/concord-consortium/rigse.git","svn_url":"https://github.com/concord-consortium/rigse","homepage":"","size":79583,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"concord-consortium:master","ref":"master","sha":"a01ef369d0ef6ee91cddd2d54d73811fdad77d19","user":{"login":"concord-consortium","id":319219,"avatar_url":"https://avatars.githubusercontent.com/u/319219?v=3","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":2056634,"name":"rigse","full_name":"concord-consortium/rigse","owner":{"login":"concord-consortium","id":319219,"avatar_url":"https://avatars.githubusercontent.com/u/319219?v=3","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/concord-consortium/rigse","description":"Rails Activity Generator for RITES project","fork":true,"url":"https://api.github.com/repos/concord-consortium/rigse","forks_url":"https://api.github.com/repos/concord-consortium/rigse/forks","keys_url":"https://api.github.com/repos/concord-consortium/rigse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concord-consortium/rigse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concord-consortium/rigse/teams","hooks_url":"https://api.github.com/repos/concord-consortium/rigse/hooks","issue_events_url":"https://api.github.com/repos/concord-consortium/rigse/issues/events{/number}","events_url":"https://api.github.com/repos/concord-consortium/rigse/events","assignees_url":"https://api.github.com/repos/concord-consortium/rigse/assignees{/user}","branches_url":"https://api.github.com/repos/concord-consortium/rigse/branches{/branch}","tags_url":"https://api.github.com/repos/concord-consortium/rigse/tags","blobs_url":"https://api.github.com/repos/concord-consortium/rigse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concord-consortium/rigse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concord-consortium/rigse/git/refs{/sha}","trees_url":"https://api.github.com/repos/concord-consortium/rigse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concord-consortium/rigse/statuses/{sha}","languages_url":"https://api.github.com/repos/concord-consortium/rigse/languages","stargazers_url":"https://api.github.com/repos/concord-consortium/rigse/stargazers","contributors_url":"https://api.github.com/repos/concord-consortium/rigse/contributors","subscribers_url":"https://api.github.com/repos/concord-consortium/rigse/subscribers","subscription_url":"https://api.github.com/repos/concord-consortium/rigse/subscription","commits_url":"https://api.github.com/repos/concord-consortium/rigse/commits{/sha}","git_commits_url":"https://api.github.com/repos/concord-consortium/rigse/git/commits{/sha}","comments_url":"https://api.github.com/repos/concord-consortium/rigse/comments{/number}","issue_comment_url":"https://api.github.com/repos/concord-consortium/rigse/issues/comments{/number}","contents_url":"https://api.github.com/repos/concord-consortium/rigse/contents/{+path}","compare_url":"https://api.github.com/repos/concord-consortium/rigse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concord-consortium/rigse/merges","archive_url":"https://api.github.com/repos/concord-consortium/rigse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concord-consortium/rigse/downloads","issues_url":"https://api.github.com/repos/concord-consortium/rigse/issues{/number}","pulls_url":"https://api.github.com/repos/concord-consortium/rigse/pulls{/number}","milestones_url":"https://api.github.com/repos/concord-consortium/rigse/milestones{/number}","notifications_url":"https://api.github.com/repos/concord-consortium/rigse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concord-consortium/rigse/labels{/name}","releases_url":"https://api.github.com/repos/concord-consortium/rigse/releases{/id}","created_at":"2011-07-16T03:22:38Z","updated_at":"2015-05-08T13:20:15Z","pushed_at":"2015-05-20T13:58:20Z","git_url":"git://github.com/concord-consortium/rigse.git","ssh_url":"git@github.com:concord-consortium/rigse.git","clone_url":"https://github.com/concord-consortium/rigse.git","svn_url":"https://github.com/concord-consortium/rigse","homepage":"","size":79583,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/concord-consortium/rigse/pulls/68"},"html":{"href":"https://github.com/concord-consortium/rigse/pull/68"},"issue":{"href":"https://api.github.com/repos/concord-consortium/rigse/issues/68"},"comments":{"href":"https://api.github.com/repos/concord-consortium/rigse/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/concord-consortium/rigse/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/concord-consortium/rigse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/concord-consortium/rigse/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/concord-consortium/rigse/statuses/561b053867680e7f27a71db0e2d8e522e57b60cf"}}}}