{"action":"created","comment":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments/50499806","id":50499806,"diff_hunk":"@@ -476,20 +489,47 @@\n           });\n         });\n \n-        createdItem.hasReforgeNode = !_.isEmpty(reforgeNodes);\n-      }\n+        // lets just see only the activated nodes for this item instance.\n+        var activated = _.filter(item.nodes, function(node) {\n+          return node.isActivated;\n+        });\n \n-      _.each(createdItem.perks, function(perk) {\n-        var perkDef = perkDefs.data[perk.perkHash];\n-        if (perkDef) {\n-          _.each(['displayName', 'displayDescription'], function(attr) {\n-            if (perkDef[attr]) {\n-              perk[attr] = perkDef[attr];\n+        // loop over the exclusive set talents grid for that weapon type\n+        _.each(talents.exclusiveSets, function(set) {\n+          _.each(activated, function(active) {\n+            if(set.nodeIndexes.indexOf(active.nodeHash) > -1) {\n+\n+              var node = talents.nodes[active.nodeHash].steps[active.stepIndex];\n+              if(!_.contains(activePerks, node.nodeStepName)) {\n+                createdItem.perks.push({\n+                  'displayName': node.nodeStepName,\n+                  'displayDescription': node.nodeStepDescription,\n+                  'iconPath': node.icon,\n+                  'isActive': true,\n+                  'order': active.nodeHash\n+                });\n+              } else {\n+                var perk = _.findIndex(createdItem.perks, {displayName: node.nodeStepName});\n+\n+                createdItem.perks[perk].order = active.nodeHash;\n+              }\n             }\n           });\n-        }\n+        });\n+        // other useful information about the item (this has info about reforge/etc)\n+        // _.each(talents.independentNodeIndexes, function(set) {\n+\n+        createdItem.hasReforgeNode = !_.isEmpty(reforgeNodes);\n+      }\n+\n+      // remove inactive perks, with this we actually lose passive perks (like exotic perks)\n+      createdItem.perks = _.filter(createdItem.perks, function(perk) {\n+        return perk.isActive;","path":"app/scripts/services/dimStoreService.factory.js","position":71,"original_position":71,"commit_id":"5d6924fb73dcc0f72b935133fa3f99abc7dcd586","original_commit_id":"5d6924fb73dcc0f72b935133fa3f99abc7dcd586","user":{"login":"bhollis","id":313208,"avatar_url":"https://avatars.githubusercontent.com/u/313208?v=3","gravatar_id":"","url":"https://api.github.com/users/bhollis","html_url":"https://github.com/bhollis","followers_url":"https://api.github.com/users/bhollis/followers","following_url":"https://api.github.com/users/bhollis/following{/other_user}","gists_url":"https://api.github.com/users/bhollis/gists{/gist_id}","starred_url":"https://api.github.com/users/bhollis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhollis/subscriptions","organizations_url":"https://api.github.com/users/bhollis/orgs","repos_url":"https://api.github.com/users/bhollis/repos","events_url":"https://api.github.com/users/bhollis/events{/privacy}","received_events_url":"https://api.github.com/users/bhollis/received_events","type":"User","site_admin":false},"body":"Tip for later: I think you could write this as:\r\n\r\n```javascript\r\ncreatedItems.perks = _.filter(createdItem.perks, 'isActive');\r\n```\r\n\r\nIf you want to keep using the full function predicate, built-in `filter` might be nicer:\r\n\r\n```javascript\r\ncreatedItem.perks = createdItem.perks.filter(function(perk) { return perk.isActive; });\r\n```\r\n\r\nSame for `_.each`, etc. Modern JS has a lot of Underscore built-in.","created_at":"2016-01-22T03:53:29Z","updated_at":"2016-01-22T03:53:29Z","html_url":"https://github.com/DestinyItemManager/DIM/pull/346#discussion_r50499806","pull_request_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346","_links":{"self":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments/50499806"},"html":{"href":"https://github.com/DestinyItemManager/DIM/pull/346#discussion_r50499806"},"pull_request":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346"}}},"pull_request":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346","id":53485634,"html_url":"https://github.com/DestinyItemManager/DIM/pull/346","diff_url":"https://github.com/DestinyItemManager/DIM/pull/346.diff","patch_url":"https://github.com/DestinyItemManager/DIM/pull/346.patch","issue_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/346","number":346,"state":"open","locked":false,"title":"push talent grid info to perks on item","user":{"login":"kyleshay","id":424158,"avatar_url":"https://avatars.githubusercontent.com/u/424158?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleshay","html_url":"https://github.com/kyleshay","followers_url":"https://api.github.com/users/kyleshay/followers","following_url":"https://api.github.com/users/kyleshay/following{/other_user}","gists_url":"https://api.github.com/users/kyleshay/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleshay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleshay/subscriptions","organizations_url":"https://api.github.com/users/kyleshay/orgs","repos_url":"https://api.github.com/users/kyleshay/repos","events_url":"https://api.github.com/users/kyleshay/events{/privacy}","received_events_url":"https://api.github.com/users/kyleshay/received_events","type":"User","site_admin":false},"body":"just started playing around with the talent grid stuff since i kept forgetting what things i had on each item.\r\n\r\nit would be cool to show the full grid (including nodes that aren't chosen) but we need more screen real-estate for that.\r\n\r\nbut now we could at least see things like the scope: \r\n\r\n<img width=\"452\" alt=\"screen shot 2015-12-12 at 4 10 59 pm\" src=\"https://cloud.githubusercontent.com/assets/424158/11763891/007a508a-a0eb-11e5-832d-21477f00e5f3.png\">\r\n\r\nand items selected in columns\r\n\r\n<img width=\"598\" alt=\"screen shot 2015-12-12 at 4 04 18 pm\" src=\"https://cloud.githubusercontent.com/assets/424158/11763885/af661882-a0ea-11e5-8b6d-c7484c95d171.png\">","created_at":"2015-12-12T21:11:42Z","updated_at":"2016-01-22T03:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4121409651c1e1d33d543027aa290ea4acabc60","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346/commits","review_comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346/comments","review_comment_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/346/comments","statuses_url":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/5d6924fb73dcc0f72b935133fa3f99abc7dcd586","head":{"label":"DestinyItemManager:talentgrid","ref":"talentgrid","sha":"5d6924fb73dcc0f72b935133fa3f99abc7dcd586","user":{"login":"DestinyItemManager","id":12777189,"avatar_url":"https://avatars.githubusercontent.com/u/12777189?v=3","gravatar_id":"","url":"https://api.github.com/users/DestinyItemManager","html_url":"https://github.com/DestinyItemManager","followers_url":"https://api.github.com/users/DestinyItemManager/followers","following_url":"https://api.github.com/users/DestinyItemManager/following{/other_user}","gists_url":"https://api.github.com/users/DestinyItemManager/gists{/gist_id}","starred_url":"https://api.github.com/users/DestinyItemManager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DestinyItemManager/subscriptions","organizations_url":"https://api.github.com/users/DestinyItemManager/orgs","repos_url":"https://api.github.com/users/DestinyItemManager/repos","events_url":"https://api.github.com/users/DestinyItemManager/events{/privacy}","received_events_url":"https://api.github.com/users/DestinyItemManager/received_events","type":"Organization","site_admin":false},"repo":{"id":31681575,"name":"DIM","full_name":"DestinyItemManager/DIM","owner":{"login":"DestinyItemManager","id":12777189,"avatar_url":"https://avatars.githubusercontent.com/u/12777189?v=3","gravatar_id":"","url":"https://api.github.com/users/DestinyItemManager","html_url":"https://github.com/DestinyItemManager","followers_url":"https://api.github.com/users/DestinyItemManager/followers","following_url":"https://api.github.com/users/DestinyItemManager/following{/other_user}","gists_url":"https://api.github.com/users/DestinyItemManager/gists{/gist_id}","starred_url":"https://api.github.com/users/DestinyItemManager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DestinyItemManager/subscriptions","organizations_url":"https://api.github.com/users/DestinyItemManager/orgs","repos_url":"https://api.github.com/users/DestinyItemManager/repos","events_url":"https://api.github.com/users/DestinyItemManager/events{/privacy}","received_events_url":"https://api.github.com/users/DestinyItemManager/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DestinyItemManager/DIM","description":"Destiny Item Manager","fork":false,"url":"https://api.github.com/repos/DestinyItemManager/DIM","forks_url":"https://api.github.com/repos/DestinyItemManager/DIM/forks","keys_url":"https://api.github.com/repos/DestinyItemManager/DIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DestinyItemManager/DIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DestinyItemManager/DIM/teams","hooks_url":"https://api.github.com/repos/DestinyItemManager/DIM/hooks","issue_events_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/events{/number}","events_url":"https://api.github.com/repos/DestinyItemManager/DIM/events","assignees_url":"https://api.github.com/repos/DestinyItemManager/DIM/assignees{/user}","branches_url":"https://api.github.com/repos/DestinyItemManager/DIM/branches{/branch}","tags_url":"https://api.github.com/repos/DestinyItemManager/DIM/tags","blobs_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/{sha}","languages_url":"https://api.github.com/repos/DestinyItemManager/DIM/languages","stargazers_url":"https://api.github.com/repos/DestinyItemManager/DIM/stargazers","contributors_url":"https://api.github.com/repos/DestinyItemManager/DIM/contributors","subscribers_url":"https://api.github.com/repos/DestinyItemManager/DIM/subscribers","subscription_url":"https://api.github.com/repos/DestinyItemManager/DIM/subscription","commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/DestinyItemManager/DIM/contents/{+path}","compare_url":"https://api.github.com/repos/DestinyItemManager/DIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DestinyItemManager/DIM/merges","archive_url":"https://api.github.com/repos/DestinyItemManager/DIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DestinyItemManager/DIM/downloads","issues_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues{/number}","pulls_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls{/number}","milestones_url":"https://api.github.com/repos/DestinyItemManager/DIM/milestones{/number}","notifications_url":"https://api.github.com/repos/DestinyItemManager/DIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DestinyItemManager/DIM/labels{/name}","releases_url":"https://api.github.com/repos/DestinyItemManager/DIM/releases{/id}","deployments_url":"https://api.github.com/repos/DestinyItemManager/DIM/deployments","created_at":"2015-03-04T21:46:50Z","updated_at":"2016-01-20T22:57:32Z","pushed_at":"2016-01-21T18:24:08Z","git_url":"git://github.com/DestinyItemManager/DIM.git","ssh_url":"git@github.com:DestinyItemManager/DIM.git","clone_url":"https://github.com/DestinyItemManager/DIM.git","svn_url":"https://github.com/DestinyItemManager/DIM","homepage":"https://chrome.google.com/webstore/detail/destiny-item-manager/apghicjnekejhfancbkahkhdckhdagna","size":156455,"stargazers_count":264,"watchers_count":264,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":136,"mirror_url":null,"open_issues_count":89,"forks":136,"open_issues":89,"watchers":264,"default_branch":"dev"}},"base":{"label":"DestinyItemManager:dev","ref":"dev","sha":"0f6d1c1dabfa47357e29fc4e02124e651a885a53","user":{"login":"DestinyItemManager","id":12777189,"avatar_url":"https://avatars.githubusercontent.com/u/12777189?v=3","gravatar_id":"","url":"https://api.github.com/users/DestinyItemManager","html_url":"https://github.com/DestinyItemManager","followers_url":"https://api.github.com/users/DestinyItemManager/followers","following_url":"https://api.github.com/users/DestinyItemManager/following{/other_user}","gists_url":"https://api.github.com/users/DestinyItemManager/gists{/gist_id}","starred_url":"https://api.github.com/users/DestinyItemManager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DestinyItemManager/subscriptions","organizations_url":"https://api.github.com/users/DestinyItemManager/orgs","repos_url":"https://api.github.com/users/DestinyItemManager/repos","events_url":"https://api.github.com/users/DestinyItemManager/events{/privacy}","received_events_url":"https://api.github.com/users/DestinyItemManager/received_events","type":"Organization","site_admin":false},"repo":{"id":31681575,"name":"DIM","full_name":"DestinyItemManager/DIM","owner":{"login":"DestinyItemManager","id":12777189,"avatar_url":"https://avatars.githubusercontent.com/u/12777189?v=3","gravatar_id":"","url":"https://api.github.com/users/DestinyItemManager","html_url":"https://github.com/DestinyItemManager","followers_url":"https://api.github.com/users/DestinyItemManager/followers","following_url":"https://api.github.com/users/DestinyItemManager/following{/other_user}","gists_url":"https://api.github.com/users/DestinyItemManager/gists{/gist_id}","starred_url":"https://api.github.com/users/DestinyItemManager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DestinyItemManager/subscriptions","organizations_url":"https://api.github.com/users/DestinyItemManager/orgs","repos_url":"https://api.github.com/users/DestinyItemManager/repos","events_url":"https://api.github.com/users/DestinyItemManager/events{/privacy}","received_events_url":"https://api.github.com/users/DestinyItemManager/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DestinyItemManager/DIM","description":"Destiny Item Manager","fork":false,"url":"https://api.github.com/repos/DestinyItemManager/DIM","forks_url":"https://api.github.com/repos/DestinyItemManager/DIM/forks","keys_url":"https://api.github.com/repos/DestinyItemManager/DIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DestinyItemManager/DIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DestinyItemManager/DIM/teams","hooks_url":"https://api.github.com/repos/DestinyItemManager/DIM/hooks","issue_events_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/events{/number}","events_url":"https://api.github.com/repos/DestinyItemManager/DIM/events","assignees_url":"https://api.github.com/repos/DestinyItemManager/DIM/assignees{/user}","branches_url":"https://api.github.com/repos/DestinyItemManager/DIM/branches{/branch}","tags_url":"https://api.github.com/repos/DestinyItemManager/DIM/tags","blobs_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/{sha}","languages_url":"https://api.github.com/repos/DestinyItemManager/DIM/languages","stargazers_url":"https://api.github.com/repos/DestinyItemManager/DIM/stargazers","contributors_url":"https://api.github.com/repos/DestinyItemManager/DIM/contributors","subscribers_url":"https://api.github.com/repos/DestinyItemManager/DIM/subscribers","subscription_url":"https://api.github.com/repos/DestinyItemManager/DIM/subscription","commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/DestinyItemManager/DIM/contents/{+path}","compare_url":"https://api.github.com/repos/DestinyItemManager/DIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DestinyItemManager/DIM/merges","archive_url":"https://api.github.com/repos/DestinyItemManager/DIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DestinyItemManager/DIM/downloads","issues_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues{/number}","pulls_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls{/number}","milestones_url":"https://api.github.com/repos/DestinyItemManager/DIM/milestones{/number}","notifications_url":"https://api.github.com/repos/DestinyItemManager/DIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DestinyItemManager/DIM/labels{/name}","releases_url":"https://api.github.com/repos/DestinyItemManager/DIM/releases{/id}","deployments_url":"https://api.github.com/repos/DestinyItemManager/DIM/deployments","created_at":"2015-03-04T21:46:50Z","updated_at":"2016-01-20T22:57:32Z","pushed_at":"2016-01-21T18:24:08Z","git_url":"git://github.com/DestinyItemManager/DIM.git","ssh_url":"git@github.com:DestinyItemManager/DIM.git","clone_url":"https://github.com/DestinyItemManager/DIM.git","svn_url":"https://github.com/DestinyItemManager/DIM","homepage":"https://chrome.google.com/webstore/detail/destiny-item-manager/apghicjnekejhfancbkahkhdckhdagna","size":156455,"stargazers_count":264,"watchers_count":264,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":136,"mirror_url":null,"open_issues_count":89,"forks":136,"open_issues":89,"watchers":264,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346"},"html":{"href":"https://github.com/DestinyItemManager/DIM/pull/346"},"issue":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/issues/346"},"comments":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/issues/346/comments"},"review_comments":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346/comments"},"review_comment":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/346/commits"},"statuses":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/5d6924fb73dcc0f72b935133fa3f99abc7dcd586"}}}}