{"action":"created","comment":{"url":"https://api.github.com/repos/best-charity-project/charity-website/pulls/comments/177779307","pull_request_review_id":107714708,"id":177779307,"diff_hunk":"@@ -1,6 +1,362 @@\n import React from 'react';\n+import PropTypes from 'prop-types';\n+import InputMask from 'react-input-mask';\n+import Select, { Option } from 'rc-select';\n+import 'rc-select/assets/index.css';\n+import { getLocations, addEducation } from '../../educationCalls';\n+import InvalidInputMessage from './InvalidInputMessage/InvalidInputMessage';\n+import './EducationRoute.css';\n+import './SelectStyles.css';\n \n-export default () => (\n-  <div className='indent'>образовательный маршрут\n-  </div>\n-);\n+export default class EducationRoute extends React.Component {\n+  constructor(props) {\n+    super(props);\n+    this.state = {\n+      locations: [],\n+      districts: [],\n+      name: '',\n+      phone: '',\n+      email: '',\n+      region: null,\n+      regionIndex: -1,\n+      regionDistricts: [],\n+      city: '',\n+      educationalInstitution: '',\n+      year: '',\n+      program: '',\n+      isOpen: false,\n+    };\n+    this.addEducationRoute = this.addEducationRoute.bind(this);\n+    this.setName = this.setName.bind(this);\n+    this.setPhone = this.setPhone.bind(this);\n+    this.setEmail = this.setEmail.bind(this);\n+    this.setRegion = this.setRegion.bind(this);\n+    this.setRegionDistricts = this.setRegionDistricts.bind(this);\n+    this.setCity = this.setCity.bind(this);\n+    this.setEducationalInstitution = this.setEducationalInstitution.bind(this);\n+    this.setYear = this.setYear.bind(this);\n+    this.setProgram = this.setProgram.bind(this);\n+    this.isRegionDistricts = this.isRegionDistricts.bind(this);\n+    this.toggleMessageisOpen = this.toggleMessageIsOpen.bind(this);\n+  }\n+\n+  componentDidMount() {\n+    this.setCategories();\n+  }\n+\n+  setCategories() {\n+    getLocations().then((locations) => {\n+      this.setState({ locations });\n+    });\n+  }\n+\n+  setName(event) {\n+    this.setState({\n+      name: event.target.value,\n+    });\n+  }\n+\n+  setPhone(event) {\n+    this.setState({\n+      phone: event.target.value,\n+    });\n+  }\n+\n+  setEmail(event) {\n+    this.setState({\n+      email: event.target.value,\n+    });\n+  }\n+\n+  setRegion(event) {\n+    event.persist();\n+    this.setState({ regionIndex: event.target.value });\n+    this.setState({ districts: [] });\n+    this.setState({\n+      region: this.state.locations[0].name,\n+    }, () => {\n+      if (!(event.target.value === '')) {\n+        this.state.locations[event.target.value]\n+          .district.map(district =>\n+            this.state.districts\n+              .push(<Option key={district} title={district}>{district} </Option>));\n+      }\n+    });\n+    if (event.target.value === '6') {\n+      this.setState({ city: 'Минск' });\n+    } else {\n+      this.setState({ city: '' });\n+    }\n+  }\n+\n+  setRegionDistricts(event) {\n+    this.setState({\n+      regionDistricts: event,\n+    });\n+  }\n+\n+  setCity(event) {\n+    this.setState({\n+      city: event.target.value,\n+    });\n+  }\n+\n+  setEducationalInstitution(event) {\n+    this.setState({\n+      educationalInstitution: event.target.value,\n+    });\n+  }\n+\n+  setYear(event) {\n+    this.setState({\n+      year: event.target.value,\n+    });\n+  }\n+\n+  setProgram(event) {\n+    this.setState({\n+      program: event.target.value,\n+    });\n+  }\n+\n+  toggleMessageIsOpen() {\n+    this.setState({\n+      isOpen: !this.state.isOpen,\n+    });\n+  }\n+\n+  isRegionDistricts() {\n+    if ((this.state.regionDistricts.length === 0)\n+      && (this.state.name !== '')\n+      && (this.state.email !== '')\n+      && (this.state.region !== null)\n+    ) {\n+      this.toggleMessageIsOpen();\n+    }\n+  }\n+\n+  addEducationRoute(event) {\n+    event.preventDefault();\n+    const {\n+      name, phone, email, region, regionDistricts,\n+      city, educationalInstitution, year, program,\n+    } = this.state;\n+    const { userId } = this.props.userInfo;\n+    addEducation({\n+      name,\n+      phone,\n+      email,\n+      region,\n+      regionDistricts,\n+      city,\n+      educationalInstitution,\n+      year,\n+      program,\n+      userId,\n+    });\n+    this.setState({\n+      name: '',\n+      phone: '',\n+      email: '',\n+      region: '',\n+      regionDistricts: null,\n+      city: '',\n+      year: '',\n+      program: '',\n+      regionIndex: -1,\n+    });\n+  }\n+\n+  render() {\n+    const dropdownMenuStyle = {","path":"src/Components/EducationRoute/EducationRoute.jsx","position":175,"original_position":175,"commit_id":"f4561d9ee7703682e22f5a22bd8c56b67b8e7ff2","original_commit_id":"f4561d9ee7703682e22f5a22bd8c56b67b8e7ff2","user":{"login":"a-husak","id":36631698,"avatar_url":"https://avatars0.githubusercontent.com/u/36631698?v=4","gravatar_id":"","url":"https://api.github.com/users/a-husak","html_url":"https://github.com/a-husak","followers_url":"https://api.github.com/users/a-husak/followers","following_url":"https://api.github.com/users/a-husak/following{/other_user}","gists_url":"https://api.github.com/users/a-husak/gists{/gist_id}","starred_url":"https://api.github.com/users/a-husak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-husak/subscriptions","organizations_url":"https://api.github.com/users/a-husak/orgs","repos_url":"https://api.github.com/users/a-husak/repos","events_url":"https://api.github.com/users/a-husak/events{/privacy}","received_events_url":"https://api.github.com/users/a-husak/received_events","type":"User","site_admin":false},"body":"yes, there is, now i use class","created_at":"2018-03-28T14:55:42Z","updated_at":"2018-03-28T14:55:42Z","html_url":"https://github.com/best-charity-project/charity-website/pull/33#discussion_r177779307","pull_request_url":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/best-charity-project/charity-website/pulls/comments/177779307"},"html":{"href":"https://github.com/best-charity-project/charity-website/pull/33#discussion_r177779307"},"pull_request":{"href":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33"}},"in_reply_to_id":177776881},"pull_request":{"url":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33","id":175284781,"html_url":"https://github.com/best-charity-project/charity-website/pull/33","diff_url":"https://github.com/best-charity-project/charity-website/pull/33.diff","patch_url":"https://github.com/best-charity-project/charity-website/pull/33.patch","issue_url":"https://api.github.com/repos/best-charity-project/charity-website/issues/33","number":33,"state":"open","locked":false,"title":"created education route form, replaced all fonts to Roboto, minimized buttons","user":{"login":"a-husak","id":36631698,"avatar_url":"https://avatars0.githubusercontent.com/u/36631698?v=4","gravatar_id":"","url":"https://api.github.com/users/a-husak","html_url":"https://github.com/a-husak","followers_url":"https://api.github.com/users/a-husak/followers","following_url":"https://api.github.com/users/a-husak/following{/other_user}","gists_url":"https://api.github.com/users/a-husak/gists{/gist_id}","starred_url":"https://api.github.com/users/a-husak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-husak/subscriptions","organizations_url":"https://api.github.com/users/a-husak/orgs","repos_url":"https://api.github.com/users/a-husak/repos","events_url":"https://api.github.com/users/a-husak/events{/privacy}","received_events_url":"https://api.github.com/users/a-husak/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-15T15:19:19Z","updated_at":"2018-03-28T14:55:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9927115ae2d71a5c9cb019aba7853fbc536c1f91","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33/commits","review_comments_url":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33/comments","review_comment_url":"https://api.github.com/repos/best-charity-project/charity-website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/best-charity-project/charity-website/issues/33/comments","statuses_url":"https://api.github.com/repos/best-charity-project/charity-website/statuses/f4561d9ee7703682e22f5a22bd8c56b67b8e7ff2","head":{"label":"best-charity-project:aduc-rout","ref":"aduc-rout","sha":"f4561d9ee7703682e22f5a22bd8c56b67b8e7ff2","user":{"login":"best-charity-project","id":36631848,"avatar_url":"https://avatars3.githubusercontent.com/u/36631848?v=4","gravatar_id":"","url":"https://api.github.com/users/best-charity-project","html_url":"https://github.com/best-charity-project","followers_url":"https://api.github.com/users/best-charity-project/followers","following_url":"https://api.github.com/users/best-charity-project/following{/other_user}","gists_url":"https://api.github.com/users/best-charity-project/gists{/gist_id}","starred_url":"https://api.github.com/users/best-charity-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/best-charity-project/subscriptions","organizations_url":"https://api.github.com/users/best-charity-project/orgs","repos_url":"https://api.github.com/users/best-charity-project/repos","events_url":"https://api.github.com/users/best-charity-project/events{/privacy}","received_events_url":"https://api.github.com/users/best-charity-project/received_events","type":"Organization","site_admin":false},"repo":{"id":122078003,"name":"charity-website","full_name":"best-charity-project/charity-website","owner":{"login":"best-charity-project","id":36631848,"avatar_url":"https://avatars3.githubusercontent.com/u/36631848?v=4","gravatar_id":"","url":"https://api.github.com/users/best-charity-project","html_url":"https://github.com/best-charity-project","followers_url":"https://api.github.com/users/best-charity-project/followers","following_url":"https://api.github.com/users/best-charity-project/following{/other_user}","gists_url":"https://api.github.com/users/best-charity-project/gists{/gist_id}","starred_url":"https://api.github.com/users/best-charity-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/best-charity-project/subscriptions","organizations_url":"https://api.github.com/users/best-charity-project/orgs","repos_url":"https://api.github.com/users/best-charity-project/repos","events_url":"https://api.github.com/users/best-charity-project/events{/privacy}","received_events_url":"https://api.github.com/users/best-charity-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/best-charity-project/charity-website","description":null,"fork":false,"url":"https://api.github.com/repos/best-charity-project/charity-website","forks_url":"https://api.github.com/repos/best-charity-project/charity-website/forks","keys_url":"https://api.github.com/repos/best-charity-project/charity-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/best-charity-project/charity-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/best-charity-project/charity-website/teams","hooks_url":"https://api.github.com/repos/best-charity-project/charity-website/hooks","issue_events_url":"https://api.github.com/repos/best-charity-project/charity-website/issues/events{/number}","events_url":"https://api.github.com/repos/best-charity-project/charity-website/events","assignees_url":"https://api.github.com/repos/best-charity-project/charity-website/assignees{/user}","branches_url":"https://api.github.com/repos/best-charity-project/charity-website/branches{/branch}","tags_url":"https://api.github.com/repos/best-charity-project/charity-website/tags","blobs_url":"https://api.github.com/repos/best-charity-project/charity-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/best-charity-project/charity-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/best-charity-project/charity-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/best-charity-project/charity-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/best-charity-project/charity-website/statuses/{sha}","languages_url":"https://api.github.com/repos/best-charity-project/charity-website/languages","stargazers_url":"https://api.github.com/repos/best-charity-project/charity-website/stargazers","contributors_url":"https://api.github.com/repos/best-charity-project/charity-website/contributors","subscribers_url":"https://api.github.com/repos/best-charity-project/charity-website/subscribers","subscription_url":"https://api.github.com/repos/best-charity-project/charity-website/subscription","commits_url":"https://api.github.com/repos/best-charity-project/charity-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/best-charity-project/charity-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/best-charity-project/charity-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/best-charity-project/charity-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/best-charity-project/charity-website/contents/{+path}","compare_url":"https://api.github.com/repos/best-charity-project/charity-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/best-charity-project/charity-website/merges","archive_url":"https://api.github.com/repos/best-charity-project/charity-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/best-charity-project/charity-website/downloads","issues_url":"https://api.github.com/repos/best-charity-project/charity-website/issues{/number}","pulls_url":"https://api.github.com/repos/best-charity-project/charity-website/pulls{/number}","milestones_url":"https://api.github.com/repos/best-charity-project/charity-website/milestones{/number}","notifications_url":"https://api.github.com/repos/best-charity-project/charity-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/best-charity-project/charity-website/labels{/name}","releases_url":"https://api.github.com/repos/best-charity-project/charity-website/releases{/id}","deployments_url":"https://api.github.com/repos/best-charity-project/charity-website/deployments","created_at":"2018-02-19T14:58:05Z","updated_at":"2018-03-27T16:44:28Z","pushed_at":"2018-03-28T14:32:50Z","git_url":"git://github.com/best-charity-project/charity-website.git","ssh_url":"git@github.com:best-charity-project/charity-website.git","clone_url":"https://github.com/best-charity-project/charity-website.git","svn_url":"https://github.com/best-charity-project/charity-website","homepage":null,"size":9617,"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":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"best-charity-project:master","ref":"master","sha":"92c169b0c2321f06fc1222b770abe6c232ca6210","user":{"login":"best-charity-project","id":36631848,"avatar_url":"https://avatars3.githubusercontent.com/u/36631848?v=4","gravatar_id":"","url":"https://api.github.com/users/best-charity-project","html_url":"https://github.com/best-charity-project","followers_url":"https://api.github.com/users/best-charity-project/followers","following_url":"https://api.github.com/users/best-charity-project/following{/other_user}","gists_url":"https://api.github.com/users/best-charity-project/gists{/gist_id}","starred_url":"https://api.github.com/users/best-charity-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/best-charity-project/subscriptions","organizations_url":"https://api.github.com/users/best-charity-project/orgs","repos_url":"https://api.github.com/users/best-charity-project/repos","events_url":"https://api.github.com/users/best-charity-project/events{/privacy}","received_events_url":"https://api.github.com/users/best-charity-project/received_events","type":"Organization","site_admin":false},"repo":{"id":122078003,"name":"charity-website","full_name":"best-charity-project/charity-website","owner":{"login":"best-charity-project","id":36631848,"avatar_url":"https://avatars3.githubusercontent.com/u/36631848?v=4","gravatar_id":"","url":"https://api.github.com/users/best-charity-project","html_url":"https://github.com/best-charity-project","followers_url":"https://api.github.com/users/best-charity-project/followers","following_url":"https://api.github.com/users/best-charity-project/following{/other_user}","gists_url":"https://api.github.com/users/best-charity-project/gists{/gist_id}","starred_url":"https://api.github.com/users/best-charity-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/best-charity-project/subscriptions","organizations_url":"https://api.github.com/users/best-charity-project/orgs","repos_url":"https://api.github.com/users/best-charity-project/repos","events_url":"https://api.github.com/users/best-charity-project/events{/privacy}","received_events_url":"https://api.github.com/users/best-charity-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/best-charity-project/charity-website","description":null,"fork":false,"url":"https://api.github.com/repos/best-charity-project/charity-website","forks_url":"https://api.github.com/repos/best-charity-project/charity-website/forks","keys_url":"https://api.github.com/repos/best-charity-project/charity-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/best-charity-project/charity-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/best-charity-project/charity-website/teams","hooks_url":"https://api.github.com/repos/best-charity-project/charity-website/hooks","issue_events_url":"https://api.github.com/repos/best-charity-project/charity-website/issues/events{/number}","events_url":"https://api.github.com/repos/best-charity-project/charity-website/events","assignees_url":"https://api.github.com/repos/best-charity-project/charity-website/assignees{/user}","branches_url":"https://api.github.com/repos/best-charity-project/charity-website/branches{/branch}","tags_url":"https://api.github.com/repos/best-charity-project/charity-website/tags","blobs_url":"https://api.github.com/repos/best-charity-project/charity-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/best-charity-project/charity-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/best-charity-project/charity-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/best-charity-project/charity-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/best-charity-project/charity-website/statuses/{sha}","languages_url":"https://api.github.com/repos/best-charity-project/charity-website/languages","stargazers_url":"https://api.github.com/repos/best-charity-project/charity-website/stargazers","contributors_url":"https://api.github.com/repos/best-charity-project/charity-website/contributors","subscribers_url":"https://api.github.com/repos/best-charity-project/charity-website/subscribers","subscription_url":"https://api.github.com/repos/best-charity-project/charity-website/subscription","commits_url":"https://api.github.com/repos/best-charity-project/charity-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/best-charity-project/charity-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/best-charity-project/charity-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/best-charity-project/charity-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/best-charity-project/charity-website/contents/{+path}","compare_url":"https://api.github.com/repos/best-charity-project/charity-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/best-charity-project/charity-website/merges","archive_url":"https://api.github.com/repos/best-charity-project/charity-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/best-charity-project/charity-website/downloads","issues_url":"https://api.github.com/repos/best-charity-project/charity-website/issues{/number}","pulls_url":"https://api.github.com/repos/best-charity-project/charity-website/pulls{/number}","milestones_url":"https://api.github.com/repos/best-charity-project/charity-website/milestones{/number}","notifications_url":"https://api.github.com/repos/best-charity-project/charity-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/best-charity-project/charity-website/labels{/name}","releases_url":"https://api.github.com/repos/best-charity-project/charity-website/releases{/id}","deployments_url":"https://api.github.com/repos/best-charity-project/charity-website/deployments","created_at":"2018-02-19T14:58:05Z","updated_at":"2018-03-27T16:44:28Z","pushed_at":"2018-03-28T14:32:50Z","git_url":"git://github.com/best-charity-project/charity-website.git","ssh_url":"git@github.com:best-charity-project/charity-website.git","clone_url":"https://github.com/best-charity-project/charity-website.git","svn_url":"https://github.com/best-charity-project/charity-website","homepage":null,"size":9617,"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":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33"},"html":{"href":"https://github.com/best-charity-project/charity-website/pull/33"},"issue":{"href":"https://api.github.com/repos/best-charity-project/charity-website/issues/33"},"comments":{"href":"https://api.github.com/repos/best-charity-project/charity-website/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/best-charity-project/charity-website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/best-charity-project/charity-website/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/best-charity-project/charity-website/statuses/f4561d9ee7703682e22f5a22bd8c56b67b8e7ff2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"a-husak"}}