{"action":"created","comment":{"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments/92403003","pull_request_review_id":12908936,"id":92403003,"diff_hunk":"@@ -0,0 +1,241 @@\n+import React, { PropTypes } from 'react';\n+import ApiUtil from '../../util/ApiUtil';\n+\n+import Modal from '../../components/Modal';\n+import Button from '../../components/Button';\n+import TextareaField from '../../components/TextareaField';\n+import { FormField, handleFieldChange, getFormValues } from '../../util/FormField';\n+import requiredValidator from '../../util/validators/RequiredValidator';\n+import * as Review from './EstablishClaimReview';\n+import * as Form from './EstablishClaimForm';\n+\n+export const REVIEW_PAGE = 0;\n+export const FORM_PAGE = 1;\n+\n+export default class EstablishClaim extends React.Component {\n+  constructor(props) {\n+    super(props);\n+\n+    this.handleFieldChange = handleFieldChange.bind(this);\n+\n+    // Set initial state on page render\n+    this.state = {\n+      cancelModal: false,\n+      form: {\n+        allowPoa: new FormField(false),\n+        claimLabel: new FormField(Form.CLAIM_LABEL_OPTIONS[0]),\n+        gulfWar: new FormField(false),\n+        modifier: new FormField(Form.MODIFIER_OPTIONS[0]),\n+        poa: new FormField(Form.POA[0]),\n+        poaCode: new FormField(''),\n+        segmentedLane: new FormField(Form.SEGMENTED_LANE_OPTIONS[0]),\n+        suppressAcknowledgement: new FormField(false)\n+      },\n+      loading: false,\n+      modal: {\n+        cancelFeedback: new FormField('',\n+          requiredValidator('Please enter an Explanation.'))\n+      },\n+      modalSubmitLoading: false,\n+      page: REVIEW_PAGE\n+    };\n+  }\n+\n+  handleSubmit = (event) => {\n+    this.setState({\n+      loading: true\n+    });\n+\n+    let { id } = this.props.task;\n+    let { handleAlert, handleAlertClear } = this.props;\n+\n+    event.preventDefault();\n+    handleAlertClear();\n+\n+    let data = {\n+      claim: ApiUtil.convertToSnakeCase(getFormValues(this.state.form))\n+    };\n+\n+    return ApiUtil.post(`/dispatch/establish-claim/${id}/perform`, { data }).then(() => {\n+      window.location.href = `/dispatch/establish-claim/${id}/complete`;\n+    }, () => {\n+      this.setState({\n+        loading: false\n+      });\n+      handleAlert(\n+        'error',\n+        'Error',\n+        'There was an error while submitting the current claim. Please try again later'\n+      );\n+    });\n+  }\n+\n+  handleFinishCancelTask = () => {\n+    let { id } = this.props.task;\n+    let { handleAlert, handleAlertClear } = this.props;\n+    let data = {\n+      feedback: this.state.modal.cancelFeedback.value\n+    };\n+\n+    handleAlertClear();\n+\n+    let allValid = true;","path":"client/app/containers/EstablishClaimPage/EstablishClaim.jsx","position":82,"original_position":82,"commit_id":"ad0c365ee1232574706eb5c04e0f646c127f0b45","original_commit_id":"ad0c365ee1232574706eb5c04e0f646c127f0b45","user":{"login":"shanear","id":1596259,"avatar_url":"https://avatars.githubusercontent.com/u/1596259?v=3","gravatar_id":"","url":"https://api.github.com/users/shanear","html_url":"https://github.com/shanear","followers_url":"https://api.github.com/users/shanear/followers","following_url":"https://api.github.com/users/shanear/following{/other_user}","gists_url":"https://api.github.com/users/shanear/gists{/gist_id}","starred_url":"https://api.github.com/users/shanear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanear/subscriptions","organizations_url":"https://api.github.com/users/shanear/orgs","repos_url":"https://api.github.com/users/shanear/repos","events_url":"https://api.github.com/users/shanear/events{/privacy}","received_events_url":"https://api.github.com/users/shanear/received_events","type":"User","site_admin":false},"body":"this to line 99 is probably the most logic intensive part of this function. would it be possible to make a `validateForm` method that encapsulates a lot of this?","created_at":"2016-12-14T14:28:47Z","updated_at":"2016-12-14T14:28:47Z","html_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/561#discussion_r92403003","pull_request_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561","_links":{"self":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments/92403003"},"html":{"href":"https://github.com/department-of-veterans-affairs/caseflow/pull/561#discussion_r92403003"},"pull_request":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561"}}},"pull_request":{"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561","id":97856757,"html_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/561","diff_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/561.diff","patch_url":"https://github.com/department-of-veterans-affairs/caseflow/pull/561.patch","issue_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/561","number":561,"state":"open","locked":false,"title":"Mdbenjam cancel modal","user":{"login":"mdbenjam","id":3885236,"avatar_url":"https://avatars.githubusercontent.com/u/3885236?v=3","gravatar_id":"","url":"https://api.github.com/users/mdbenjam","html_url":"https://github.com/mdbenjam","followers_url":"https://api.github.com/users/mdbenjam/followers","following_url":"https://api.github.com/users/mdbenjam/following{/other_user}","gists_url":"https://api.github.com/users/mdbenjam/gists{/gist_id}","starred_url":"https://api.github.com/users/mdbenjam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdbenjam/subscriptions","organizations_url":"https://api.github.com/users/mdbenjam/orgs","repos_url":"https://api.github.com/users/mdbenjam/repos","events_url":"https://api.github.com/users/mdbenjam/events{/privacy}","received_events_url":"https://api.github.com/users/mdbenjam/received_events","type":"User","site_admin":false},"body":"Adding a modal to enter a cancel reason.\r\n\r\nFixes: #518 \r\n\r\n**Test Plan**\r\n- [ ] Manually\r\n- [ ] Add tests\r\n- [ ] Run suite\r\n<img width=\"1074\" alt=\"screen shot 2016-12-13 at 6 19 13 pm\" src=\"https://cloud.githubusercontent.com/assets/3885236/21163361/adee282c-c160-11e6-9e79-d7d71ead32a6.png\">\r\n","created_at":"2016-12-13T23:19:31Z","updated_at":"2016-12-14T14:32:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"shanear","id":1596259,"avatar_url":"https://avatars.githubusercontent.com/u/1596259?v=3","gravatar_id":"","url":"https://api.github.com/users/shanear","html_url":"https://github.com/shanear","followers_url":"https://api.github.com/users/shanear/followers","following_url":"https://api.github.com/users/shanear/following{/other_user}","gists_url":"https://api.github.com/users/shanear/gists{/gist_id}","starred_url":"https://api.github.com/users/shanear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanear/subscriptions","organizations_url":"https://api.github.com/users/shanear/orgs","repos_url":"https://api.github.com/users/shanear/repos","events_url":"https://api.github.com/users/shanear/events{/privacy}","received_events_url":"https://api.github.com/users/shanear/received_events","type":"User","site_admin":false},"assignees":[{"login":"shanear","id":1596259,"avatar_url":"https://avatars.githubusercontent.com/u/1596259?v=3","gravatar_id":"","url":"https://api.github.com/users/shanear","html_url":"https://github.com/shanear","followers_url":"https://api.github.com/users/shanear/followers","following_url":"https://api.github.com/users/shanear/following{/other_user}","gists_url":"https://api.github.com/users/shanear/gists{/gist_id}","starred_url":"https://api.github.com/users/shanear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanear/subscriptions","organizations_url":"https://api.github.com/users/shanear/orgs","repos_url":"https://api.github.com/users/shanear/repos","events_url":"https://api.github.com/users/shanear/events{/privacy}","received_events_url":"https://api.github.com/users/shanear/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561/commits","review_comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561/comments","review_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/561/comments","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/ad0c365ee1232574706eb5c04e0f646c127f0b45","head":{"label":"department-of-veterans-affairs:mdbenjam-cancel-modal","ref":"mdbenjam-cancel-modal","sha":"ad0c365ee1232574706eb5c04e0f646c127f0b45","user":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars.githubusercontent.com/u/5421563?v=3","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"repo":{"id":51449239,"name":"caseflow","full_name":"department-of-veterans-affairs/caseflow","owner":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars.githubusercontent.com/u/5421563?v=3","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/department-of-veterans-affairs/caseflow","description":"Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans Appeals","fork":false,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow","forks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/forks","keys_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/teams","hooks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/hooks","issue_events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/events{/number}","events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/events","assignees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/assignees{/user}","branches_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/branches{/branch}","tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/tags","blobs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/{sha}","languages_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/languages","stargazers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/stargazers","contributors_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contributors","subscribers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscribers","subscription_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscription","commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contents/{+path}","compare_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/merges","archive_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/downloads","issues_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues{/number}","pulls_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls{/number}","milestones_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/milestones{/number}","notifications_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels{/name}","releases_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/releases{/id}","deployments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/deployments","created_at":"2016-02-10T15:20:50Z","updated_at":"2016-12-08T16:54:58Z","pushed_at":"2016-12-14T12:53:48Z","git_url":"git://github.com/department-of-veterans-affairs/caseflow.git","ssh_url":"git@github.com:department-of-veterans-affairs/caseflow.git","clone_url":"https://github.com/department-of-veterans-affairs/caseflow.git","svn_url":"https://github.com/department-of-veterans-affairs/caseflow","homepage":"","size":5971,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":86,"forks":8,"open_issues":86,"watchers":2,"default_branch":"master"}},"base":{"label":"department-of-veterans-affairs:master","ref":"master","sha":"19a5c2644ef6d8a392b6e9ee7f5222d5f96e4761","user":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars.githubusercontent.com/u/5421563?v=3","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"repo":{"id":51449239,"name":"caseflow","full_name":"department-of-veterans-affairs/caseflow","owner":{"login":"department-of-veterans-affairs","id":5421563,"avatar_url":"https://avatars.githubusercontent.com/u/5421563?v=3","gravatar_id":"","url":"https://api.github.com/users/department-of-veterans-affairs","html_url":"https://github.com/department-of-veterans-affairs","followers_url":"https://api.github.com/users/department-of-veterans-affairs/followers","following_url":"https://api.github.com/users/department-of-veterans-affairs/following{/other_user}","gists_url":"https://api.github.com/users/department-of-veterans-affairs/gists{/gist_id}","starred_url":"https://api.github.com/users/department-of-veterans-affairs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/department-of-veterans-affairs/subscriptions","organizations_url":"https://api.github.com/users/department-of-veterans-affairs/orgs","repos_url":"https://api.github.com/users/department-of-veterans-affairs/repos","events_url":"https://api.github.com/users/department-of-veterans-affairs/events{/privacy}","received_events_url":"https://api.github.com/users/department-of-veterans-affairs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/department-of-veterans-affairs/caseflow","description":"Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans Appeals","fork":false,"url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow","forks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/forks","keys_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/teams","hooks_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/hooks","issue_events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/events{/number}","events_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/events","assignees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/assignees{/user}","branches_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/branches{/branch}","tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/tags","blobs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/{sha}","languages_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/languages","stargazers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/stargazers","contributors_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contributors","subscribers_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscribers","subscription_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/subscription","commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/contents/{+path}","compare_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/merges","archive_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/downloads","issues_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues{/number}","pulls_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls{/number}","milestones_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/milestones{/number}","notifications_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/labels{/name}","releases_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/releases{/id}","deployments_url":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/deployments","created_at":"2016-02-10T15:20:50Z","updated_at":"2016-12-08T16:54:58Z","pushed_at":"2016-12-14T12:53:48Z","git_url":"git://github.com/department-of-veterans-affairs/caseflow.git","ssh_url":"git@github.com:department-of-veterans-affairs/caseflow.git","clone_url":"https://github.com/department-of-veterans-affairs/caseflow.git","svn_url":"https://github.com/department-of-veterans-affairs/caseflow","homepage":"","size":5971,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":86,"forks":8,"open_issues":86,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561"},"html":{"href":"https://github.com/department-of-veterans-affairs/caseflow/pull/561"},"issue":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/561"},"comments":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/issues/561/comments"},"review_comments":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561/comments"},"review_comment":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/pulls/561/commits"},"statuses":{"href":"https://api.github.com/repos/department-of-veterans-affairs/caseflow/statuses/ad0c365ee1232574706eb5c04e0f646c127f0b45"}}}}
{"actor":{"display_login":"shanear"}}