{"action":"created","comment":{"url":"https://api.github.com/repos/teamdigitale/italia-app/pulls/comments/225135900","pull_request_review_id":164668094,"id":225135900,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTEzNTkwMA==","diff_hunk":"@@ -0,0 +1,191 @@\n+import { Button, Content, Text, View } from \"native-base\";\n+import * as React from \"react\";\n+import { Modal, StatusBar } from \"react-native\";\n+import { connect } from \"react-redux\";\n+\n+import Pinpad from \"./components/Pinpad\";\n+import BaseScreenComponent from \"./components/screens/BaseScreenComponent\";\n+import IconFont from \"./components/ui/IconFont\";\n+import TextWithIcon from \"./components/ui/TextWithIcon\";\n+import I18n from \"./i18n\";\n+import {\n+  identificationCancel,\n+  identificationFailure,\n+  identificationPinReset,\n+  identificationSuccess\n+} from \"./store/actions/identification\";\n+import { ReduxProps } from \"./store/actions/types\";\n+import { IdentificationState } from \"./store/reducers/identification\";\n+import { GlobalState } from \"./store/reducers/types\";\n+\n+type MapStateToProps = {\n+  identification: IdentificationState;\n+};\n+\n+type Props = MapStateToProps & ReduxProps;\n+\n+type IdentificationByPinState = \"unstarted\" | \"failure\";\n+\n+type State = {\n+  identificationByPinState: IdentificationByPinState;\n+};\n+\n+const contextualHelp = {\n+  title: I18n.t(\"pin_login.unlock_screen.help.title\"),\n+  body: () => I18n.t(\"pin_login.unlock_screen.help.content\")\n+};\n+\n+const onRequestCloseHandler = () => undefined;\n+\n+const renderIdentificationByPinState = (\n+  identificationByPinState: IdentificationByPinState\n+) => {\n+  if (identificationByPinState === \"failure\") {\n+    return (\n+      <React.Fragment>\n+        <View spacer={true} extralarge={true} />\n+        <TextWithIcon danger={true}>\n+          <IconFont name=\"io-close\" color={\"white\"} />\n+          <Text white={true}>{I18n.t(\"pin_login.pin.confirmInvalid\")}</Text>\n+        </TextWithIcon>\n+      </React.Fragment>\n+    );\n+  }\n+\n+  return null;\n+};\n+\n+class IdentificationModal extends React.PureComponent<Props, State> {\n+  constructor(props: Props) {\n+    super(props);\n+\n+    this.state = {\n+      identificationByPinState: \"unstarted\"\n+    };\n+  }\n+\n+  public render() {\n+    const { identification, dispatch } = this.props;\n+\n+    // If the identification state is started we need to show the modal\n+    if (identification.kind === \"started\") {\n+      const {\n+        pin,\n+        identificationCancelData,\n+        identificationSuccessData\n+      } = identification;\n+\n+      const { identificationByPinState } = this.state;\n+\n+      /**\n+       * Create handlers merging default internal actions (to manage the identification state)\n+       * with, if available, custom actions passed as props.\n+       */\n+      const onIdentificationCancelHandler = () => {\n+        if (identificationCancelData) {\n+          dispatch(identificationCancelData.action);\n+        }\n+        dispatch(identificationCancel());\n+      };\n+\n+      const onIdentificationSuccessHandler = () => {\n+        if (identificationSuccessData) {\n+          dispatch(identificationSuccessData.action);\n+        }\n+        dispatch(identificationSuccess());\n+      };\n+\n+      const onIdentificationFailureHandler = () => {\n+        dispatch(identificationFailure());\n+      };\n+\n+      const onPinResetHandler = () => {\n+        dispatch(identificationPinReset());\n+      };\n+\n+      return (\n+        <Modal","path":"ts/IdentificationModal.tsx","position":107,"original_position":107,"commit_id":"ac3379883ff28d89d46e5509f92157e39bbf7611","original_commit_id":"ac3379883ff28d89d46e5509f92157e39bbf7611","user":{"login":"fpersico","id":30595520,"node_id":"MDQ6VXNlcjMwNTk1NTIw","avatar_url":"https://avatars3.githubusercontent.com/u/30595520?v=4","gravatar_id":"","url":"https://api.github.com/users/fpersico","html_url":"https://github.com/fpersico","followers_url":"https://api.github.com/users/fpersico/followers","following_url":"https://api.github.com/users/fpersico/following{/other_user}","gists_url":"https://api.github.com/users/fpersico/gists{/gist_id}","starred_url":"https://api.github.com/users/fpersico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpersico/subscriptions","organizations_url":"https://api.github.com/users/fpersico/orgs","repos_url":"https://api.github.com/users/fpersico/repos","events_url":"https://api.github.com/users/fpersico/events{/privacy}","received_events_url":"https://api.github.com/users/fpersico/received_events","type":"User","site_admin":false},"body":"A screen? You mean a react-navigation screen or something else? The purpose is to leave the AppNavigator untouched and just display something that force the user to identify. ","created_at":"2018-10-15T11:52:18Z","updated_at":"2018-10-15T11:52:18Z","html_url":"https://github.com/teamdigitale/italia-app/pull/658#discussion_r225135900","pull_request_url":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/italia-app/pulls/comments/225135900"},"html":{"href":"https://github.com/teamdigitale/italia-app/pull/658#discussion_r225135900"},"pull_request":{"href":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658"}},"in_reply_to_id":225125717},"pull_request":{"url":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658","id":222828687,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyODI4Njg3","html_url":"https://github.com/teamdigitale/italia-app/pull/658","diff_url":"https://github.com/teamdigitale/italia-app/pull/658.diff","patch_url":"https://github.com/teamdigitale/italia-app/pull/658.patch","issue_url":"https://api.github.com/repos/teamdigitale/italia-app/issues/658","number":658,"state":"open","locked":false,"title":"[WIP] Refactor light identification","user":{"login":"fpersico","id":30595520,"node_id":"MDQ6VXNlcjMwNTk1NTIw","avatar_url":"https://avatars3.githubusercontent.com/u/30595520?v=4","gravatar_id":"","url":"https://api.github.com/users/fpersico","html_url":"https://github.com/fpersico","followers_url":"https://api.github.com/users/fpersico/followers","following_url":"https://api.github.com/users/fpersico/following{/other_user}","gists_url":"https://api.github.com/users/fpersico/gists{/gist_id}","starred_url":"https://api.github.com/users/fpersico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpersico/subscriptions","organizations_url":"https://api.github.com/users/fpersico/orgs","repos_url":"https://api.github.com/users/fpersico/repos","events_url":"https://api.github.com/users/fpersico/events{/privacy}","received_events_url":"https://api.github.com/users/fpersico/received_events","type":"User","site_admin":false},"body":"In the PR:\r\n\r\nA IdentificationModal that allow the user to do a light identification. The modal is rendered by the RootContainer and outside the navigation. For the moment the identification is only by PIN. When going in background the identification is started by the react-native-background-timer module so we don't need the BackgroundScreen anymore.\r\n\r\nThe identification process can be started:\r\n\r\n-  Calling a saga method directly and synchronously waiting for the identification result: this method is used by the startup saga\r\n- Dispatching and action: in this case you can pass Actions that the internal process will dispatch on success and cancel.\r\n\r\nWIP:\r\n\r\n- [ ] Test if background-timer fire on iOS.\r\n- [x] Attach the new identification to the payment process (already done locally, need to review the code after the latest payment refactor)\r\n- [ ] Remove old unused code/files","created_at":"2018-10-15T08:55:54Z","updated_at":"2018-10-15T11:52:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6226265b8ec611caae82ba7d6a3b3f0d7f51bb67","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658/commits","review_comments_url":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658/comments","review_comment_url":"https://api.github.com/repos/teamdigitale/italia-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teamdigitale/italia-app/issues/658/comments","statuses_url":"https://api.github.com/repos/teamdigitale/italia-app/statuses/ac3379883ff28d89d46e5509f92157e39bbf7611","head":{"label":"teamdigitale:light-identification","ref":"light-identification","sha":"ac3379883ff28d89d46e5509f92157e39bbf7611","user":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":87916228,"node_id":"MDEwOlJlcG9zaXRvcnk4NzkxNjIyOA==","name":"italia-app","full_name":"teamdigitale/italia-app","private":false,"owner":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/teamdigitale/italia-app","description":"App IO","fork":false,"url":"https://api.github.com/repos/teamdigitale/italia-app","forks_url":"https://api.github.com/repos/teamdigitale/italia-app/forks","keys_url":"https://api.github.com/repos/teamdigitale/italia-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/italia-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/italia-app/teams","hooks_url":"https://api.github.com/repos/teamdigitale/italia-app/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/italia-app/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/italia-app/events","assignees_url":"https://api.github.com/repos/teamdigitale/italia-app/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/italia-app/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/italia-app/tags","blobs_url":"https://api.github.com/repos/teamdigitale/italia-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/italia-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/italia-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/italia-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/italia-app/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/italia-app/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/italia-app/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/italia-app/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/italia-app/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/italia-app/subscription","commits_url":"https://api.github.com/repos/teamdigitale/italia-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/italia-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/italia-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/italia-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/italia-app/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/italia-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/italia-app/merges","archive_url":"https://api.github.com/repos/teamdigitale/italia-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/italia-app/downloads","issues_url":"https://api.github.com/repos/teamdigitale/italia-app/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/italia-app/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/italia-app/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/italia-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/italia-app/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/italia-app/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/italia-app/deployments","created_at":"2017-04-11T09:34:46Z","updated_at":"2018-10-14T19:31:40Z","pushed_at":"2018-10-15T10:15:03Z","git_url":"git://github.com/teamdigitale/italia-app.git","ssh_url":"git@github.com:teamdigitale/italia-app.git","clone_url":"https://github.com/teamdigitale/italia-app.git","svn_url":"https://github.com/teamdigitale/italia-app","homepage":"https://io.italia.it","size":29439,"stargazers_count":59,"watchers_count":59,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":10,"open_issues":41,"watchers":59,"default_branch":"master"}},"base":{"label":"teamdigitale:master","ref":"master","sha":"5a55447581ddd8c673b5326816dd5a46330b32ab","user":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":87916228,"node_id":"MDEwOlJlcG9zaXRvcnk4NzkxNjIyOA==","name":"italia-app","full_name":"teamdigitale/italia-app","private":false,"owner":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/teamdigitale/italia-app","description":"App IO","fork":false,"url":"https://api.github.com/repos/teamdigitale/italia-app","forks_url":"https://api.github.com/repos/teamdigitale/italia-app/forks","keys_url":"https://api.github.com/repos/teamdigitale/italia-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/italia-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/italia-app/teams","hooks_url":"https://api.github.com/repos/teamdigitale/italia-app/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/italia-app/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/italia-app/events","assignees_url":"https://api.github.com/repos/teamdigitale/italia-app/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/italia-app/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/italia-app/tags","blobs_url":"https://api.github.com/repos/teamdigitale/italia-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/italia-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/italia-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/italia-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/italia-app/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/italia-app/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/italia-app/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/italia-app/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/italia-app/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/italia-app/subscription","commits_url":"https://api.github.com/repos/teamdigitale/italia-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/italia-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/italia-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/italia-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/italia-app/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/italia-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/italia-app/merges","archive_url":"https://api.github.com/repos/teamdigitale/italia-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/italia-app/downloads","issues_url":"https://api.github.com/repos/teamdigitale/italia-app/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/italia-app/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/italia-app/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/italia-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/italia-app/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/italia-app/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/italia-app/deployments","created_at":"2017-04-11T09:34:46Z","updated_at":"2018-10-14T19:31:40Z","pushed_at":"2018-10-15T10:15:03Z","git_url":"git://github.com/teamdigitale/italia-app.git","ssh_url":"git@github.com:teamdigitale/italia-app.git","clone_url":"https://github.com/teamdigitale/italia-app.git","svn_url":"https://github.com/teamdigitale/italia-app","homepage":"https://io.italia.it","size":29439,"stargazers_count":59,"watchers_count":59,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":10,"open_issues":41,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658"},"html":{"href":"https://github.com/teamdigitale/italia-app/pull/658"},"issue":{"href":"https://api.github.com/repos/teamdigitale/italia-app/issues/658"},"comments":{"href":"https://api.github.com/repos/teamdigitale/italia-app/issues/658/comments"},"review_comments":{"href":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658/comments"},"review_comment":{"href":"https://api.github.com/repos/teamdigitale/italia-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teamdigitale/italia-app/pulls/658/commits"},"statuses":{"href":"https://api.github.com/repos/teamdigitale/italia-app/statuses/ac3379883ff28d89d46e5509f92157e39bbf7611"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"fpersico"}}