{"action":"created","comment":{"url":"https://api.github.com/repos/SparkPost/2web2ui/pulls/comments/169764611","pull_request_review_id":98344210,"id":169764611,"diff_hunk":"@@ -0,0 +1,93 @@\n+import React, { Component } from 'react';\n+import { connect } from 'react-redux';\n+import { withRouter } from 'react-router-dom';\n+import qs from 'query-string';\n+import cookie from 'js-cookie';\n+import _ from 'lodash';\n+import { Link } from 'react-router-dom';\n+\n+import { CenteredLogo } from 'src/components';\n+import { Panel, Error } from '@sparkpost/matchbox';\n+import JoinForm from './components/JoinForm';\n+import JoinError from './components/JoinError';\n+import config from 'src/config';\n+import { logout } from 'src/actions/auth';\n+import { authenticate } from 'src/actions/auth';\n+import { loadScript } from 'src/helpers/loadScript';\n+import { addEvent } from 'src/helpers/googleAnalytics';\n+import { register } from 'src/actions/account';\n+import { AFTER_JOIN_REDIRECT_ROUTE, LINKS } from 'src/constants';\n+const { attribution, salesforceDataParams } = config;\n+\n+export class JoinPage extends Component {\n+\n+  state = {\n+    formData: {}\n+  };\n+\n+  componentDidMount() {\n+    this.props.logout();\n+  }\n+\n+  getAndSetAttributionData = () => {\n+    const { params } = this.props;\n+\n+    let trackingData = cookie.getJSON(attribution.cookieName);\n+\n+    if (!trackingData) {\n+      const cookieOptions = {\n+        expires: attribution.cookieDuration,\n+        expirationUnit: 'seconds',\n+        path: '/',\n+        domain: attribution.cookieDomain\n+      };\n+\n+      trackingData = _.pick(params, salesforceDataParams);\n+      cookie.set(attribution.cookieName, trackingData, cookieOptions);\n+    }\n+    return trackingData;\n+  };\n+\n+  registerSubmit = (values) => {\n+    this.setState({ formData: values });\n+    const { register, authenticate } = this.props;\n+    const attributionData = this.getAndSetAttributionData();\n+\n+    const signupData = { ...values, salesforce_data: attributionData, sfdcid: attributionData.sfdcid };\n+\n+    return register(signupData)\n+      .then((accountData) => {\n+        addEvent('Completed form', 'create account', { form_type: 'create account' });\n+        return authenticate(accountData.username, values.password);\n+      })\n+      .then(() => this.props.history.push(AFTER_JOIN_REDIRECT_ROUTE));\n+    //.catch((e) => {});\n+  };\n+\n+  render() {\n+    const { createError } = this.props.account;\n+    const { formData } = this.state;\n+    return (\n+      <div>\n+        {loadScript({ url: LINKS.RECAPTCHA_LIB_URL })}\n+        <CenteredLogo />\n+\n+        <Panel sectioned accent title=\"Log In\">\n+          { createError && <Error error={<JoinError errors={createError} data={formData} />} /> }\n+\n+          <JoinForm onSubmit={this.registerSubmit} />\n+        </Panel>\n+        <small>Already have an account? <Link to={'/auth'}>Log In</Link>.</small>","path":"src/pages/join/JoinPage.js","position":80,"original_position":80,"commit_id":"f25804296dac2fc7dbea80dd39917484e31085df","original_commit_id":"f25804296dac2fc7dbea80dd39917484e31085df","user":{"login":"jonambas","id":3903325,"avatar_url":"https://avatars1.githubusercontent.com/u/3903325?v=4","gravatar_id":"","url":"https://api.github.com/users/jonambas","html_url":"https://github.com/jonambas","followers_url":"https://api.github.com/users/jonambas/followers","following_url":"https://api.github.com/users/jonambas/following{/other_user}","gists_url":"https://api.github.com/users/jonambas/gists{/gist_id}","starred_url":"https://api.github.com/users/jonambas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonambas/subscriptions","organizations_url":"https://api.github.com/users/jonambas/orgs","repos_url":"https://api.github.com/users/jonambas/repos","events_url":"https://api.github.com/users/jonambas/events{/privacy}","received_events_url":"https://api.github.com/users/jonambas/received_events","type":"User","site_admin":false},"body":"`UnstyledLink`","created_at":"2018-02-21T20:16:13Z","updated_at":"2018-02-21T20:22:39Z","html_url":"https://github.com/SparkPost/2web2ui/pull/294#discussion_r169764611","pull_request_url":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/SparkPost/2web2ui/pulls/comments/169764611"},"html":{"href":"https://github.com/SparkPost/2web2ui/pull/294#discussion_r169764611"},"pull_request":{"href":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294","id":169431106,"html_url":"https://github.com/SparkPost/2web2ui/pull/294","diff_url":"https://github.com/SparkPost/2web2ui/pull/294.diff","patch_url":"https://github.com/SparkPost/2web2ui/pull/294.patch","issue_url":"https://api.github.com/repos/SparkPost/2web2ui/issues/294","number":294,"state":"open","locked":false,"title":"FAD-5916 signup form","user":{"login":"rajumsys","id":14877079,"avatar_url":"https://avatars0.githubusercontent.com/u/14877079?v=4","gravatar_id":"","url":"https://api.github.com/users/rajumsys","html_url":"https://github.com/rajumsys","followers_url":"https://api.github.com/users/rajumsys/followers","following_url":"https://api.github.com/users/rajumsys/following{/other_user}","gists_url":"https://api.github.com/users/rajumsys/gists{/gist_id}","starred_url":"https://api.github.com/users/rajumsys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajumsys/subscriptions","organizations_url":"https://api.github.com/users/rajumsys/orgs","repos_url":"https://api.github.com/users/rajumsys/repos","events_url":"https://api.github.com/users/rajumsys/events{/privacy}","received_events_url":"https://api.github.com/users/rajumsys/received_events","type":"User","site_admin":false},"body":"To test join page, flip the value of `hasSignup` on `config/default.js` to `true`. \r\n\r\nTodos:\r\n- [x] retrieve salesforce_data\r\n- [x] retrieve sfdcid\r\n- [ ] ~retrieve analytics session id~\r\n- [x] handle and retrieve recaptcha\r\n- [x] track signup after signup is completed\r\n- [x] fix TOU checkbox alignment when validation error is shown (Jon allowed children for label in matchbox. so we don't need separate element for it)\r\n- [x] review recaptcha lib loading  (@bkemper is working with similar, so let's sync. Update: we both agreed to use `react-load-script`) \r\n- [x] Enable eslint\r\n- [x] expose this to `join` route but make it configurable and hidden for now\r\n- [x] Tests \r\n- [ ] Tests for `PublicRoute`\r\n- [ ] A-E/A-D changes \r\n","created_at":"2018-02-15T17:09:37Z","updated_at":"2018-02-21T20:22:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"917e9aca22cdf383b9c5a4901be42c123890533b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294/commits","review_comments_url":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294/comments","review_comment_url":"https://api.github.com/repos/SparkPost/2web2ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SparkPost/2web2ui/issues/294/comments","statuses_url":"https://api.github.com/repos/SparkPost/2web2ui/statuses/f25804296dac2fc7dbea80dd39917484e31085df","head":{"label":"SparkPost:feature/FAD-5916","ref":"feature/FAD-5916","sha":"f25804296dac2fc7dbea80dd39917484e31085df","user":{"login":"SparkPost","id":9406778,"avatar_url":"https://avatars0.githubusercontent.com/u/9406778?v=4","gravatar_id":"","url":"https://api.github.com/users/SparkPost","html_url":"https://github.com/SparkPost","followers_url":"https://api.github.com/users/SparkPost/followers","following_url":"https://api.github.com/users/SparkPost/following{/other_user}","gists_url":"https://api.github.com/users/SparkPost/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkPost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkPost/subscriptions","organizations_url":"https://api.github.com/users/SparkPost/orgs","repos_url":"https://api.github.com/users/SparkPost/repos","events_url":"https://api.github.com/users/SparkPost/events{/privacy}","received_events_url":"https://api.github.com/users/SparkPost/received_events","type":"Organization","site_admin":false},"repo":{"id":91982173,"name":"2web2ui","full_name":"SparkPost/2web2ui","owner":{"login":"SparkPost","id":9406778,"avatar_url":"https://avatars0.githubusercontent.com/u/9406778?v=4","gravatar_id":"","url":"https://api.github.com/users/SparkPost","html_url":"https://github.com/SparkPost","followers_url":"https://api.github.com/users/SparkPost/followers","following_url":"https://api.github.com/users/SparkPost/following{/other_user}","gists_url":"https://api.github.com/users/SparkPost/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkPost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkPost/subscriptions","organizations_url":"https://api.github.com/users/SparkPost/orgs","repos_url":"https://api.github.com/users/SparkPost/repos","events_url":"https://api.github.com/users/SparkPost/events{/privacy}","received_events_url":"https://api.github.com/users/SparkPost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SparkPost/2web2ui","description":null,"fork":false,"url":"https://api.github.com/repos/SparkPost/2web2ui","forks_url":"https://api.github.com/repos/SparkPost/2web2ui/forks","keys_url":"https://api.github.com/repos/SparkPost/2web2ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SparkPost/2web2ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SparkPost/2web2ui/teams","hooks_url":"https://api.github.com/repos/SparkPost/2web2ui/hooks","issue_events_url":"https://api.github.com/repos/SparkPost/2web2ui/issues/events{/number}","events_url":"https://api.github.com/repos/SparkPost/2web2ui/events","assignees_url":"https://api.github.com/repos/SparkPost/2web2ui/assignees{/user}","branches_url":"https://api.github.com/repos/SparkPost/2web2ui/branches{/branch}","tags_url":"https://api.github.com/repos/SparkPost/2web2ui/tags","blobs_url":"https://api.github.com/repos/SparkPost/2web2ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SparkPost/2web2ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SparkPost/2web2ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/SparkPost/2web2ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SparkPost/2web2ui/statuses/{sha}","languages_url":"https://api.github.com/repos/SparkPost/2web2ui/languages","stargazers_url":"https://api.github.com/repos/SparkPost/2web2ui/stargazers","contributors_url":"https://api.github.com/repos/SparkPost/2web2ui/contributors","subscribers_url":"https://api.github.com/repos/SparkPost/2web2ui/subscribers","subscription_url":"https://api.github.com/repos/SparkPost/2web2ui/subscription","commits_url":"https://api.github.com/repos/SparkPost/2web2ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/SparkPost/2web2ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/SparkPost/2web2ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/SparkPost/2web2ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/SparkPost/2web2ui/contents/{+path}","compare_url":"https://api.github.com/repos/SparkPost/2web2ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SparkPost/2web2ui/merges","archive_url":"https://api.github.com/repos/SparkPost/2web2ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SparkPost/2web2ui/downloads","issues_url":"https://api.github.com/repos/SparkPost/2web2ui/issues{/number}","pulls_url":"https://api.github.com/repos/SparkPost/2web2ui/pulls{/number}","milestones_url":"https://api.github.com/repos/SparkPost/2web2ui/milestones{/number}","notifications_url":"https://api.github.com/repos/SparkPost/2web2ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SparkPost/2web2ui/labels{/name}","releases_url":"https://api.github.com/repos/SparkPost/2web2ui/releases{/id}","deployments_url":"https://api.github.com/repos/SparkPost/2web2ui/deployments","created_at":"2017-05-21T19:31:03Z","updated_at":"2018-02-20T17:43:32Z","pushed_at":"2018-02-21T20:10:44Z","git_url":"git://github.com/SparkPost/2web2ui.git","ssh_url":"git@github.com:SparkPost/2web2ui.git","clone_url":"https://github.com/SparkPost/2web2ui.git","svn_url":"https://github.com/SparkPost/2web2ui","homepage":null,"size":15864,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":30,"license":null,"forks":0,"open_issues":30,"watchers":6,"default_branch":"master"}},"base":{"label":"SparkPost:develop","ref":"develop","sha":"1f58afa80f24b79c1b28cc7d82e7d912530fa2b9","user":{"login":"SparkPost","id":9406778,"avatar_url":"https://avatars0.githubusercontent.com/u/9406778?v=4","gravatar_id":"","url":"https://api.github.com/users/SparkPost","html_url":"https://github.com/SparkPost","followers_url":"https://api.github.com/users/SparkPost/followers","following_url":"https://api.github.com/users/SparkPost/following{/other_user}","gists_url":"https://api.github.com/users/SparkPost/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkPost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkPost/subscriptions","organizations_url":"https://api.github.com/users/SparkPost/orgs","repos_url":"https://api.github.com/users/SparkPost/repos","events_url":"https://api.github.com/users/SparkPost/events{/privacy}","received_events_url":"https://api.github.com/users/SparkPost/received_events","type":"Organization","site_admin":false},"repo":{"id":91982173,"name":"2web2ui","full_name":"SparkPost/2web2ui","owner":{"login":"SparkPost","id":9406778,"avatar_url":"https://avatars0.githubusercontent.com/u/9406778?v=4","gravatar_id":"","url":"https://api.github.com/users/SparkPost","html_url":"https://github.com/SparkPost","followers_url":"https://api.github.com/users/SparkPost/followers","following_url":"https://api.github.com/users/SparkPost/following{/other_user}","gists_url":"https://api.github.com/users/SparkPost/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkPost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkPost/subscriptions","organizations_url":"https://api.github.com/users/SparkPost/orgs","repos_url":"https://api.github.com/users/SparkPost/repos","events_url":"https://api.github.com/users/SparkPost/events{/privacy}","received_events_url":"https://api.github.com/users/SparkPost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SparkPost/2web2ui","description":null,"fork":false,"url":"https://api.github.com/repos/SparkPost/2web2ui","forks_url":"https://api.github.com/repos/SparkPost/2web2ui/forks","keys_url":"https://api.github.com/repos/SparkPost/2web2ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SparkPost/2web2ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SparkPost/2web2ui/teams","hooks_url":"https://api.github.com/repos/SparkPost/2web2ui/hooks","issue_events_url":"https://api.github.com/repos/SparkPost/2web2ui/issues/events{/number}","events_url":"https://api.github.com/repos/SparkPost/2web2ui/events","assignees_url":"https://api.github.com/repos/SparkPost/2web2ui/assignees{/user}","branches_url":"https://api.github.com/repos/SparkPost/2web2ui/branches{/branch}","tags_url":"https://api.github.com/repos/SparkPost/2web2ui/tags","blobs_url":"https://api.github.com/repos/SparkPost/2web2ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SparkPost/2web2ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SparkPost/2web2ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/SparkPost/2web2ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SparkPost/2web2ui/statuses/{sha}","languages_url":"https://api.github.com/repos/SparkPost/2web2ui/languages","stargazers_url":"https://api.github.com/repos/SparkPost/2web2ui/stargazers","contributors_url":"https://api.github.com/repos/SparkPost/2web2ui/contributors","subscribers_url":"https://api.github.com/repos/SparkPost/2web2ui/subscribers","subscription_url":"https://api.github.com/repos/SparkPost/2web2ui/subscription","commits_url":"https://api.github.com/repos/SparkPost/2web2ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/SparkPost/2web2ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/SparkPost/2web2ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/SparkPost/2web2ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/SparkPost/2web2ui/contents/{+path}","compare_url":"https://api.github.com/repos/SparkPost/2web2ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SparkPost/2web2ui/merges","archive_url":"https://api.github.com/repos/SparkPost/2web2ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SparkPost/2web2ui/downloads","issues_url":"https://api.github.com/repos/SparkPost/2web2ui/issues{/number}","pulls_url":"https://api.github.com/repos/SparkPost/2web2ui/pulls{/number}","milestones_url":"https://api.github.com/repos/SparkPost/2web2ui/milestones{/number}","notifications_url":"https://api.github.com/repos/SparkPost/2web2ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SparkPost/2web2ui/labels{/name}","releases_url":"https://api.github.com/repos/SparkPost/2web2ui/releases{/id}","deployments_url":"https://api.github.com/repos/SparkPost/2web2ui/deployments","created_at":"2017-05-21T19:31:03Z","updated_at":"2018-02-20T17:43:32Z","pushed_at":"2018-02-21T20:10:44Z","git_url":"git://github.com/SparkPost/2web2ui.git","ssh_url":"git@github.com:SparkPost/2web2ui.git","clone_url":"https://github.com/SparkPost/2web2ui.git","svn_url":"https://github.com/SparkPost/2web2ui","homepage":null,"size":15864,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":30,"license":null,"forks":0,"open_issues":30,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294"},"html":{"href":"https://github.com/SparkPost/2web2ui/pull/294"},"issue":{"href":"https://api.github.com/repos/SparkPost/2web2ui/issues/294"},"comments":{"href":"https://api.github.com/repos/SparkPost/2web2ui/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/SparkPost/2web2ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SparkPost/2web2ui/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/SparkPost/2web2ui/statuses/f25804296dac2fc7dbea80dd39917484e31085df"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jonambas"}}