{"action":"created","issue":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/727","labels_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/727/labels{/name}","comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/727/comments","events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/727/events","html_url":"https://github.com/react-bootstrap/react-bootstrap/pull/727","id":80198956,"number":727,"title":"Refactor duplication-removing logic for CollapsibleNav.","user":{"login":"AlexKVal","id":847572,"avatar_url":"https://avatars.githubusercontent.com/u/847572?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKVal","html_url":"https://github.com/AlexKVal","followers_url":"https://api.github.com/users/AlexKVal/followers","following_url":"https://api.github.com/users/AlexKVal/following{/other_user}","gists_url":"https://api.github.com/users/AlexKVal/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKVal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKVal/subscriptions","organizations_url":"https://api.github.com/users/AlexKVal/orgs","repos_url":"https://api.github.com/users/AlexKVal/repos","events_url":"https://api.github.com/users/AlexKVal/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKVal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-24T16:10:50Z","updated_at":"2015-05-25T20:21:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/727","html_url":"https://github.com/react-bootstrap/react-bootstrap/pull/727","diff_url":"https://github.com/react-bootstrap/react-bootstrap/pull/727.diff","patch_url":"https://github.com/react-bootstrap/react-bootstrap/pull/727.patch"},"body":"Because of `-2` this code `indexOf('navbar-collapse') === -2` hasn't been working anyway.\r\nBut tests were green because the resulted logic was right someway.\r\n\r\nThis commit refactors it to clarify deduplication logic\r\nby using `classnames'` [Alternate `dedupe` version](https://github.com/JedWatson/classnames/commit/9acbd433ee)\r\n\r\n`classes['navbar-collapse'] = collapsible`\r\n=>\r\n`let classes = collapsible ? this.getCollapsibleClassSet('navbar-collapse')`\r\n\r\n`getDOMNode()` => `React.findDOMNode()`\r\n\r\nAnd test was refactored too.\r\nWe can count class occurrences much simpler as\r\n```js\r\nlet occurrences = (classDOM.match(/navbar-collapse/g) || []).length\r\n```"},"comment":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/comments/105305866","html_url":"https://github.com/react-bootstrap/react-bootstrap/pull/727#issuecomment-105305866","issue_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/727","id":105305866,"user":{"login":"AlexKVal","id":847572,"avatar_url":"https://avatars.githubusercontent.com/u/847572?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKVal","html_url":"https://github.com/AlexKVal","followers_url":"https://api.github.com/users/AlexKVal/followers","following_url":"https://api.github.com/users/AlexKVal/following{/other_user}","gists_url":"https://api.github.com/users/AlexKVal/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKVal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKVal/subscriptions","organizations_url":"https://api.github.com/users/AlexKVal/orgs","repos_url":"https://api.github.com/users/AlexKVal/repos","events_url":"https://api.github.com/users/AlexKVal/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKVal/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T20:21:55Z","updated_at":"2015-05-25T20:21:55Z","body":"Done :tada: \r\n- [x] Used general `classnames`\r\n- [x] Removed unnecessary test."}}