{"action":"created","comment":{"url":"https://api.github.com/repos/andela/trime/pulls/comments/77484397","id":77484397,"diff_hunk":"@@ -0,0 +1,185 @@\n+var React = require('react'),\n+  classNames = require('classnames'),\n+  createFragment = require('react-addons-create-fragment'),\n+  PageView = require('./PageView'),\n+  BreakView = require('./BreakView');\n+\n+var PaginationBoxView = React.createClass({\n+  getDefaultProps: function() {\n+    return {\n+      pageRangeDisplayed   : 2,\n+      marginPagesDisplayed : 3,\n+      activeClassName      : 'selected',\n+      previousClassName    : 'previous',\n+      nextClassName        : 'next',\n+      previousLabel        : 'Previous',\n+      nextLabel            : 'Next',\n+      breakLabel           : '...',\n+      disabledClassName    : 'disabled'\n+    };\n+  },\n+\n+  getInitialState: function() {\n+    return {\n+      selected: this.props.initialSelected ? this.props.initialSelected :\n+                this.props.forceSelected ? this.props.forceSelected : 0\n+    };\n+  },\n+\n+  componentDidMount: function() {\n+    if (typeof(this.props.initialSelected) !== undefined) {\n+      this.callCallBack(this.props.initialSelected);\n+    }\n+  },\n+\n+  componentWillReceiveProps: function(nextProps) {\n+    if (typeof(nextProps.forceSelected) !== 'undefined' && this.props.forceSelected !== nextProps.forceSelected) {\n+      this.setState({selected: nextProps.forceSelected});\n+    }\n+  },\n+\n+  callCallBack: function(selectedItem) {\n+    if (typeof(this.props.clickCallback) !== 'undefined' &&\n+      typeof(this.props.clickCallback) === 'function') {\n+      this.props.clickCallback({selected: selectedItem});\n+    }\n+  },\n+\n+  handlePreviousPage: function(evt) {\n+    evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false);\n+    if (this.state.selected > 0) {\n+      this.handlePageSelected(this.state.selected - 1, evt);\n+    }\n+  },\n+\n+  handleNextPage: function(evt) {\n+    evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false);\n+    if (this.state.selected < this.props.numberOfPages - 1) {\n+      this.handlePageSelected(this.state.selected + 1, evt);\n+    }\n+  },\n+\n+  handlePageSelected: function(selected, evt) {\n+    evt.preventDefault ? evt.preventDefault() : (evt.returnValue = false);\n+\n+    if (this.state.selected === selected) return;\n+\n+    this.setState({selected: selected});\n+\n+    // Call the callback with the new selected item:\n+    this.callCallBack(selected);\n+    this.pageChangeFactory(selected + 1);\n+  },\n+\n+  pageChangeFactory: function(page) {\n+      this.props.onPageChange(page);\n+  },\n+\n+  pagination: function() {\n+    var items = {};\n+\n+    if (this.props.numberOfPages <= this.props.pageRangeDisplayed) {\n+      for (var index = 0; index < this.props.numberOfPages; index++) {\n+        items['key' + index] = (\n+        <PageView\n+            activeClassName={this.props.activeClassName}\n+            onClick={this.handlePageSelected.bind(null, index)} // eslint-disable-line\n+            page={index + 1}\n+            pageClassName={this.props.pageClassName}\n+            pageLinkClassName={this.props.pageLinkClassName}\n+            selected={this.state.selected === index}\n+        />);\n+      }\n+    } else {\n+\n+      var leftSide  = (this.props.pageRangeDisplayed / 2);\n+      var rightSide = (this.props.pageRangeDisplayed - leftSide);\n+\n+      if (this.state.selected > this.props.numberOfPages - this.props.pageRangeDisplayed / 2) {\n+        rightSide = this.props.numberOfPages - this.state.selected;\n+        leftSide  = this.props.pageRangeDisplayed - rightSide;\n+      }\n+      else if (this.state.selected < this.props.pageRangeDisplayed / 2) {\n+        leftSide  = this.state.selected;\n+        rightSide = this.props.pageRangeDisplayed - leftSide;\n+      }\n+\n+      var index;","path":"app/scripts/components/Pagination/PaginationBoxView.js","position":107,"original_position":107,"commit_id":"523bcc6df56f4ed81f5f36ab195df63d47aaeb3b","original_commit_id":"523bcc6df56f4ed81f5f36ab195df63d47aaeb3b","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'index' is already defined  no-redeclare","created_at":"2016-09-05T08:16:36Z","updated_at":"2016-09-05T08:16:36Z","html_url":"https://github.com/andela/trime/pull/162#discussion_r77484397","pull_request_url":"https://api.github.com/repos/andela/trime/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/andela/trime/pulls/comments/77484397"},"html":{"href":"https://github.com/andela/trime/pull/162#discussion_r77484397"},"pull_request":{"href":"https://api.github.com/repos/andela/trime/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/andela/trime/pulls/162","id":83964871,"html_url":"https://github.com/andela/trime/pull/162","diff_url":"https://github.com/andela/trime/pull/162.diff","patch_url":"https://github.com/andela/trime/pull/162.patch","issue_url":"https://api.github.com/repos/andela/trime/issues/162","number":162,"state":"open","locked":false,"title":"Feature/improve pagination","user":{"login":"andela-jobala","id":12011447,"avatar_url":"https://avatars.githubusercontent.com/u/12011447?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jobala","html_url":"https://github.com/andela-jobala","followers_url":"https://api.github.com/users/andela-jobala/followers","following_url":"https://api.github.com/users/andela-jobala/following{/other_user}","gists_url":"https://api.github.com/users/andela-jobala/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jobala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jobala/subscriptions","organizations_url":"https://api.github.com/users/andela-jobala/orgs","repos_url":"https://api.github.com/users/andela-jobala/repos","events_url":"https://api.github.com/users/andela-jobala/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jobala/received_events","type":"User","site_admin":false},"body":"## What does this PR do\r\nImproves the implementation of the pagination by not showing the total number of pages\r\ninstead showing only a fragment of all pages.\r\n\r\n## Description of task to be completed\r\n  A user should not see all pages in the pagination component but only a fragment of the pages\r\n  A user  should only see the pagination component if they have more than ten trimes\r\n\r\n## What are the relevant Pivotal Tracker stories\r\n[#128309595](https://www.pivotaltracker.com/story/show/128309595)","created_at":"2016-09-05T08:15:55Z","updated_at":"2016-09-05T08:16:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/trime/pulls/162/commits","review_comments_url":"https://api.github.com/repos/andela/trime/pulls/162/comments","review_comment_url":"https://api.github.com/repos/andela/trime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/trime/issues/162/comments","statuses_url":"https://api.github.com/repos/andela/trime/statuses/523bcc6df56f4ed81f5f36ab195df63d47aaeb3b","head":{"label":"andela:feature/improve-pagination","ref":"feature/improve-pagination","sha":"523bcc6df56f4ed81f5f36ab195df63d47aaeb3b","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":44667251,"name":"trime","full_name":"andela/trime","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/trime","description":"Staging - https://trime-staging.herokuapp.com/, Production - https://trime-prod.herokuapp.com/","fork":false,"url":"https://api.github.com/repos/andela/trime","forks_url":"https://api.github.com/repos/andela/trime/forks","keys_url":"https://api.github.com/repos/andela/trime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/trime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/trime/teams","hooks_url":"https://api.github.com/repos/andela/trime/hooks","issue_events_url":"https://api.github.com/repos/andela/trime/issues/events{/number}","events_url":"https://api.github.com/repos/andela/trime/events","assignees_url":"https://api.github.com/repos/andela/trime/assignees{/user}","branches_url":"https://api.github.com/repos/andela/trime/branches{/branch}","tags_url":"https://api.github.com/repos/andela/trime/tags","blobs_url":"https://api.github.com/repos/andela/trime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/trime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/trime/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/trime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/trime/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/trime/languages","stargazers_url":"https://api.github.com/repos/andela/trime/stargazers","contributors_url":"https://api.github.com/repos/andela/trime/contributors","subscribers_url":"https://api.github.com/repos/andela/trime/subscribers","subscription_url":"https://api.github.com/repos/andela/trime/subscription","commits_url":"https://api.github.com/repos/andela/trime/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/trime/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/trime/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/trime/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/trime/contents/{+path}","compare_url":"https://api.github.com/repos/andela/trime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/trime/merges","archive_url":"https://api.github.com/repos/andela/trime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/trime/downloads","issues_url":"https://api.github.com/repos/andela/trime/issues{/number}","pulls_url":"https://api.github.com/repos/andela/trime/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/trime/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/trime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/trime/labels{/name}","releases_url":"https://api.github.com/repos/andela/trime/releases{/id}","deployments_url":"https://api.github.com/repos/andela/trime/deployments","created_at":"2015-10-21T09:53:41Z","updated_at":"2016-01-26T14:16:27Z","pushed_at":"2016-09-05T08:15:55Z","git_url":"git://github.com/andela/trime.git","ssh_url":"git@github.com:andela/trime.git","clone_url":"https://github.com/andela/trime.git","svn_url":"https://github.com/andela/trime","homepage":"","size":13096,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"andela:develop","ref":"develop","sha":"7e3a01543f3f4fe5d4aedda20c67fde89eb01e95","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":44667251,"name":"trime","full_name":"andela/trime","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/trime","description":"Staging - https://trime-staging.herokuapp.com/, Production - https://trime-prod.herokuapp.com/","fork":false,"url":"https://api.github.com/repos/andela/trime","forks_url":"https://api.github.com/repos/andela/trime/forks","keys_url":"https://api.github.com/repos/andela/trime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/trime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/trime/teams","hooks_url":"https://api.github.com/repos/andela/trime/hooks","issue_events_url":"https://api.github.com/repos/andela/trime/issues/events{/number}","events_url":"https://api.github.com/repos/andela/trime/events","assignees_url":"https://api.github.com/repos/andela/trime/assignees{/user}","branches_url":"https://api.github.com/repos/andela/trime/branches{/branch}","tags_url":"https://api.github.com/repos/andela/trime/tags","blobs_url":"https://api.github.com/repos/andela/trime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/trime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/trime/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/trime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/trime/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/trime/languages","stargazers_url":"https://api.github.com/repos/andela/trime/stargazers","contributors_url":"https://api.github.com/repos/andela/trime/contributors","subscribers_url":"https://api.github.com/repos/andela/trime/subscribers","subscription_url":"https://api.github.com/repos/andela/trime/subscription","commits_url":"https://api.github.com/repos/andela/trime/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/trime/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/trime/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/trime/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/trime/contents/{+path}","compare_url":"https://api.github.com/repos/andela/trime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/trime/merges","archive_url":"https://api.github.com/repos/andela/trime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/trime/downloads","issues_url":"https://api.github.com/repos/andela/trime/issues{/number}","pulls_url":"https://api.github.com/repos/andela/trime/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/trime/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/trime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/trime/labels{/name}","releases_url":"https://api.github.com/repos/andela/trime/releases{/id}","deployments_url":"https://api.github.com/repos/andela/trime/deployments","created_at":"2015-10-21T09:53:41Z","updated_at":"2016-01-26T14:16:27Z","pushed_at":"2016-09-05T08:15:55Z","git_url":"git://github.com/andela/trime.git","ssh_url":"git@github.com:andela/trime.git","clone_url":"https://github.com/andela/trime.git","svn_url":"https://github.com/andela/trime","homepage":"","size":13096,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/trime/pulls/162"},"html":{"href":"https://github.com/andela/trime/pull/162"},"issue":{"href":"https://api.github.com/repos/andela/trime/issues/162"},"comments":{"href":"https://api.github.com/repos/andela/trime/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/trime/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/trime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/trime/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/andela/trime/statuses/523bcc6df56f4ed81f5f36ab195df63d47aaeb3b"}}}}
{"actor":{"display_login":"houndci-bot"}}