{"action":"created","comment":{"url":"https://api.github.com/repos/ndlib/usurper/pulls/comments/240332631","pull_request_review_id":183339091,"id":240332631,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDMzMjYzMQ==","diff_hunk":"@@ -0,0 +1,219 @@\n+import React, { Component } from 'react'\n+import PropTypes from 'prop-types'\n+import ReactModal from 'react-modal'\n+import { connect } from 'react-redux'\n+import { KIND } from '../../actions/personal/settings'\n+import * as statuses from '../../constants/APIStatuses'\n+\n+ReactModal.setAppElement('body')\n+\n+class CircOptIn extends Component {\n+  constructor (props) {\n+    super(props)\n+    this.confirmToggleStatus = this.confirmToggleStatus.bind(this)\n+    this.dismiss = this.dismiss.bind(this)\n+    this.state = {\n+      checkingStatus: true,\n+      statusShouldBeSaved: false,\n+      updated: false,\n+      modalOpen: false,\n+      error: '',\n+    }\n+  }\n+\n+  dismiss () {\n+    if (!this.props.updating) {\n+      this.setState({ modalOpen: false })\n+    }\n+  }\n+\n+  componentDidUpdate (prevProps, prevState) {\n+    // If opting out completed, dismiss the confirmation modal\n+    if (prevProps.updating && !this.props.updating && !this.state.statusShouldBeSaved) {\n+      this.dismiss()\n+    }\n+  }\n+\n+  async componentDidMount () {\n+    const status = await this.props.getCircStatus()\n+    if (status && status.json) {\n+      this.setState({\n+        checkingStatus: false,\n+        statusShouldBeSaved: status.json.saveHistory })\n+    } else {\n+      this.setState({ checkingStatus: false })\n+    }\n+  }\n+  toggleStatus = () => {\n+    this.setState({ updated: false })\n+    if (!this.state.statusShouldBeSaved) {\n+      // Opt-in happens immediately without confirmation modal\n+      this.confirmToggleStatus()\n+    } else {\n+      this.setState({ modalOpen: true })\n+    }\n+  }\n+\n+  confirmToggleStatus () {\n+    const newStatus = !this.state.statusShouldBeSaved\n+    this.props.setCircStatus(newStatus)\n+    this.setState({\n+      updated: true,\n+      statusShouldBeSaved: newStatus,\n+      error: '',\n+    })\n+  }\n+\n+  render () {\n+    if (this.state.checkingStatus) {\n+      return null\n+    }\n+    const visibility = this.state.updated ? 'visible' : 'hidden'\n+    return (\n+      <React.Fragment>\n+        <div className='col-md-12 col-xs-12'>\n+          <section className='group opt-in'>\n+            <h2>Checkout History</h2>\n+            <div className='section-box'>\n+              <div>\n+                <input\n+                  id='circ-opt-in'\n+                  type='checkbox'\n+                  checked={this.state.statusShouldBeSaved}\n+                  disabled\n+                />\n+                <label htmlFor='circ-opt-in'>\n+                  {this.state.statusShouldBeSaved\n+                    ? 'You have opted to save your checkout history.'\n+                    : 'Your checkout history is not being saved.'\n+                  }\n+                </label>\n+                <span style={{ float: 'right' }}>\n+                  <button onClick={this.toggleStatus}>\n+                    {this.state.statusShouldBeSaved\n+                      ? 'Opt-out and delete history'\n+                      : 'Opt-in to save history'\n+                    }\n+                  </button>\n+                </span>\n+              </div>\n+              <div\n+                className='success'\n+                style={{ display: 'inline', marginLeft: '2em', visibility: visibility }}\n+              >{this.state.error ? this.state.error : 'Your preference has been updated.'}</div>\n+            </div>\n+            <hr />\n+            <ul className='circ-policy'>\n+              <li>\n+                The Hesburgh Libraries values your privacy and the confidentiality of your borrowing records and\n+                checkout history.\n+              </li>\n+              <li>\n+                No borrower information is released to third parties including outside agencies or individuals\n+                without a court order.\n+              </li>\n+              <li>\n+                Please be aware that the library retains each item in your checkout history for 30 days after\n+                it is returned, in case there are any issues. The library will not be able to purge your individual\n+                records during th​at​ rolling 30​ day​ period.\n+              </li>\n+              <li>Interlibrary loan records are not able to be purged at any point.</li>\n+              <li>\n+                You may choose to have your checkout history retained and ​remain​ available to you ​as long as you\n+                are affiliated with the University​ by opting in on this page.​ After you opt in, you may choose to\n+                delete individual items, or opt out and delete your entire history.\n+              </li>\n+              <li>\n+                Please note that once you opt-in to save your checkout history, only currently checked-out items,\n+                items returned in the last 30 days, and any items you borrow in the future will be included in your\n+                saved checkout history. Items returned more than 30 days ago have already been purged.\n+              </li>\n+            </ul>\n+          </section>\n+        </div>\n+        <ReactModal\n+          isOpen={this.state.modalOpen}\n+          shouldCloseOnEsc\n+          onRequestClose={this.dismiss}\n+          contentLabel='Opt-out Checkout History Confirmation'\n+          style={{\n+            overlay: {\n+              backgroundColor: '#041F44aa',\n+              zIndex: '1000',\n+            },\n+            content: {\n+              top: '50%',\n+              bottom: 'auto',\n+              transform: 'translate(0, -50%)',\n+            },\n+          }}\n+          ariaHideApp\n+          aria={{\n+            labelledby: 'optOutModalTitle',\n+            describedby: 'optOutModalDesc',\n+          }}\n+          shouldFocusAfterRender\n+          shouldReturnFocusAfterClose\n+        >\n+          <h2 id='optOutModalTitle'>Opt-out of Checkout History?</h2>\n+          <div id='optOutModalDesc'>\n+            You are selecting that you no longer wish to have your checkout history saved.\n+            <ul>\n+              <li>\n+                Items in your history cannot be deleted until 30 days after they are returned.\n+              </li>\n+              <li>\n+                Interlibrary Loan records cannot be deleted.\n+              </li>\n+              <li>\n+                Deleted items are lost permanently and cannot be restored.\n+              </li>\n+              <li>\n+                If you want to save a copy of your checkout history before deleting it, please select cancel,\n+                and use the export button in your checkout history.\n+              </li>\n+            </ul>\n+            Do you still wish to proceed with opting out?\n+          </div>\n+          { this.props.updating && (\n+            <div className='Loading inline'>\n+              <div className='sk-three-bounce'>\n+                <div className='sk-child sk-bounce1' />\n+                <div className='sk-child sk-bounce2' />\n+                <div className='sk-child sk-bounce3' />\n+              </div>\n+            </div>\n+          )}\n+          <div className='pull-right-bottom modal-force-bottom'>\n+            <button className='danger' onClick={this.confirmToggleStatus} disabled={this.props.updating}>Confirm</button>","path":"src/components/Settings/CircOptIn.js","position":188,"original_position":188,"commit_id":"e34d050711f11faf6294bcc3d1c4a21975c2121e","original_commit_id":"e34d050711f11faf6294bcc3d1c4a21975c2121e","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","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":"Line 188 exceeds the maximum line length of 120        max-len","created_at":"2018-12-10T18:43:45Z","updated_at":"2018-12-10T18:43:46Z","html_url":"https://github.com/ndlib/usurper/pull/555#discussion_r240332631","pull_request_url":"https://api.github.com/repos/ndlib/usurper/pulls/555","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ndlib/usurper/pulls/comments/240332631"},"html":{"href":"https://github.com/ndlib/usurper/pull/555#discussion_r240332631"},"pull_request":{"href":"https://api.github.com/repos/ndlib/usurper/pulls/555"}}},"pull_request":{"url":"https://api.github.com/repos/ndlib/usurper/pulls/555","id":232353106,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMzUzMTA2","html_url":"https://github.com/ndlib/usurper/pull/555","diff_url":"https://github.com/ndlib/usurper/pull/555.diff","patch_url":"https://github.com/ndlib/usurper/pull/555.patch","issue_url":"https://api.github.com/repos/ndlib/usurper/issues/555","number":555,"state":"open","locked":false,"title":"Circulation opt-in","user":{"login":"mlkirkpatrick","id":43963628,"node_id":"MDQ6VXNlcjQzOTYzNjI4","avatar_url":"https://avatars1.githubusercontent.com/u/43963628?v=4","gravatar_id":"","url":"https://api.github.com/users/mlkirkpatrick","html_url":"https://github.com/mlkirkpatrick","followers_url":"https://api.github.com/users/mlkirkpatrick/followers","following_url":"https://api.github.com/users/mlkirkpatrick/following{/other_user}","gists_url":"https://api.github.com/users/mlkirkpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/mlkirkpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlkirkpatrick/subscriptions","organizations_url":"https://api.github.com/users/mlkirkpatrick/orgs","repos_url":"https://api.github.com/users/mlkirkpatrick/repos","events_url":"https://api.github.com/users/mlkirkpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/mlkirkpatrick/received_events","type":"User","site_admin":false},"body":"This includes changes from PR #510 and adds on to it.","created_at":"2018-11-20T15:13:56Z","updated_at":"2018-12-10T18:43:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25d4b61b66ead83a3d6bbc32a6fcf171e0bd81be","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ndlib/usurper/pulls/555/commits","review_comments_url":"https://api.github.com/repos/ndlib/usurper/pulls/555/comments","review_comment_url":"https://api.github.com/repos/ndlib/usurper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ndlib/usurper/issues/555/comments","statuses_url":"https://api.github.com/repos/ndlib/usurper/statuses/e34d050711f11faf6294bcc3d1c4a21975c2121e","head":{"label":"ndlib:circ-opt-in","ref":"circ-opt-in","sha":"e34d050711f11faf6294bcc3d1c4a21975c2121e","user":{"login":"ndlib","id":160943,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/160943?v=4","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":89357881,"node_id":"MDEwOlJlcG9zaXRvcnk4OTM1Nzg4MQ==","name":"usurper","full_name":"ndlib/usurper","private":false,"owner":{"login":"ndlib","id":160943,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/160943?v=4","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ndlib/usurper","description":"Library website frontend (React-Redux)","fork":false,"url":"https://api.github.com/repos/ndlib/usurper","forks_url":"https://api.github.com/repos/ndlib/usurper/forks","keys_url":"https://api.github.com/repos/ndlib/usurper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/usurper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/usurper/teams","hooks_url":"https://api.github.com/repos/ndlib/usurper/hooks","issue_events_url":"https://api.github.com/repos/ndlib/usurper/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/usurper/events","assignees_url":"https://api.github.com/repos/ndlib/usurper/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/usurper/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/usurper/tags","blobs_url":"https://api.github.com/repos/ndlib/usurper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/usurper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/usurper/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/usurper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/usurper/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/usurper/languages","stargazers_url":"https://api.github.com/repos/ndlib/usurper/stargazers","contributors_url":"https://api.github.com/repos/ndlib/usurper/contributors","subscribers_url":"https://api.github.com/repos/ndlib/usurper/subscribers","subscription_url":"https://api.github.com/repos/ndlib/usurper/subscription","commits_url":"https://api.github.com/repos/ndlib/usurper/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/usurper/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/usurper/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/usurper/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/usurper/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/usurper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/usurper/merges","archive_url":"https://api.github.com/repos/ndlib/usurper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/usurper/downloads","issues_url":"https://api.github.com/repos/ndlib/usurper/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/usurper/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/usurper/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/usurper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/usurper/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/usurper/releases{/id}","deployments_url":"https://api.github.com/repos/ndlib/usurper/deployments","created_at":"2017-04-25T12:27:04Z","updated_at":"2018-12-04T21:18:33Z","pushed_at":"2018-12-10T18:42:59Z","git_url":"git://github.com/ndlib/usurper.git","ssh_url":"git@github.com:ndlib/usurper.git","clone_url":"https://github.com/ndlib/usurper.git","svn_url":"https://github.com/ndlib/usurper","homepage":"","size":20210,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ndlib:master","ref":"master","sha":"c6e591ced82a10c3135bbb99c1851efaf30682ee","user":{"login":"ndlib","id":160943,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/160943?v=4","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":89357881,"node_id":"MDEwOlJlcG9zaXRvcnk4OTM1Nzg4MQ==","name":"usurper","full_name":"ndlib/usurper","private":false,"owner":{"login":"ndlib","id":160943,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDk0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/160943?v=4","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ndlib/usurper","description":"Library website frontend (React-Redux)","fork":false,"url":"https://api.github.com/repos/ndlib/usurper","forks_url":"https://api.github.com/repos/ndlib/usurper/forks","keys_url":"https://api.github.com/repos/ndlib/usurper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/usurper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/usurper/teams","hooks_url":"https://api.github.com/repos/ndlib/usurper/hooks","issue_events_url":"https://api.github.com/repos/ndlib/usurper/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/usurper/events","assignees_url":"https://api.github.com/repos/ndlib/usurper/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/usurper/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/usurper/tags","blobs_url":"https://api.github.com/repos/ndlib/usurper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/usurper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/usurper/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/usurper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/usurper/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/usurper/languages","stargazers_url":"https://api.github.com/repos/ndlib/usurper/stargazers","contributors_url":"https://api.github.com/repos/ndlib/usurper/contributors","subscribers_url":"https://api.github.com/repos/ndlib/usurper/subscribers","subscription_url":"https://api.github.com/repos/ndlib/usurper/subscription","commits_url":"https://api.github.com/repos/ndlib/usurper/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/usurper/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/usurper/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/usurper/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/usurper/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/usurper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/usurper/merges","archive_url":"https://api.github.com/repos/ndlib/usurper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/usurper/downloads","issues_url":"https://api.github.com/repos/ndlib/usurper/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/usurper/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/usurper/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/usurper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/usurper/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/usurper/releases{/id}","deployments_url":"https://api.github.com/repos/ndlib/usurper/deployments","created_at":"2017-04-25T12:27:04Z","updated_at":"2018-12-04T21:18:33Z","pushed_at":"2018-12-10T18:42:59Z","git_url":"git://github.com/ndlib/usurper.git","ssh_url":"git@github.com:ndlib/usurper.git","clone_url":"https://github.com/ndlib/usurper.git","svn_url":"https://github.com/ndlib/usurper","homepage":"","size":20210,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ndlib/usurper/pulls/555"},"html":{"href":"https://github.com/ndlib/usurper/pull/555"},"issue":{"href":"https://api.github.com/repos/ndlib/usurper/issues/555"},"comments":{"href":"https://api.github.com/repos/ndlib/usurper/issues/555/comments"},"review_comments":{"href":"https://api.github.com/repos/ndlib/usurper/pulls/555/comments"},"review_comment":{"href":"https://api.github.com/repos/ndlib/usurper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ndlib/usurper/pulls/555/commits"},"statuses":{"href":"https://api.github.com/repos/ndlib/usurper/statuses/e34d050711f11faf6294bcc3d1c4a21975c2121e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"houndci-bot"}}