{"action":"created","comment":{"url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/comments/217248902","pull_request_review_id":154915291,"id":217248902,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzI0ODkwMg==","diff_hunk":"@@ -0,0 +1,142 @@\n+/**\n+ * @file simplify active call control page\n+ * detail: https://jira.ringcentral.com/browse/RCINT-8256\n+ */\n+\n+import { connect } from 'react-redux';\n+import React, { Component } from 'react';\n+import PropTypes from 'prop-types';\n+\n+import withPhone from '../../lib/withPhone';\n+\n+import CallCtrlPanel from '../../components/CallCtrlPanel';\n+import callCtrlLayouts from '../../enums/callCtrlLayouts';\n+import { ACTIONS_CTRL_MAP } from '../../components/ActiveCallPad';\n+import { CALL_CTRL_ALERT } from '../../components/CallControlAlert';\n+import i18n from './i18n';\n+import { pickEleByProps, pickFallBackName } from './utils';\n+\n+function mapToProps(_, { phone }) {\n+  const {\n+    activeCallControl, regionSettings, activeCalls, contactMatcher,\n+    alert, routerInteraction,\n+  } = phone;\n+  return {\n+    activeCallControl,\n+    regionSettings,\n+    activeCalls,\n+    contactMatcher,\n+    alert,\n+    routerInteraction,\n+  };\n+}\n+\n+function mapToFunctions(_, { phone }) {\n+  return {};\n+}\n+\n+class ActiveCallControl extends Component {\n+  async holdCall(sessionId) {\n+    const { activeCallControl } = this.props;\n+    const { activeSession } = activeCallControl;\n+    const { isOnHold } = activeSession;\n+    if (isOnHold) {\n+      this.props.alert.warning({ message: CALL_CTRL_ALERT.muteFail });\n+    }\n+    await activeCallControl.hold(sessionId);\n+  }\n+\n+  async muteCall(sessionId) {\n+    const { activeCallControl } = this.props;\n+    const { activeSession } = activeCallControl;\n+    const { isOnMute } = activeSession;\n+    if (isOnMute) {\n+      this.props.alert.warning({ message: CALL_CTRL_ALERT.holdFail });\n+    }\n+    await activeCallControl.mute(sessionId);\n+  }","path":"packages/ringcentral-widgets/containers/SimpleActiveCallCtrlPage/index.js","position":57,"original_position":57,"commit_id":"36f106315dbcea9e0fab41ad9bec4447a73d3ed4","original_commit_id":"36f106315dbcea9e0fab41ad9bec4447a73d3ed4","user":{"login":"tuluxmu","id":9250313,"node_id":"MDQ6VXNlcjkyNTAzMTM=","avatar_url":"https://avatars0.githubusercontent.com/u/9250313?v=4","gravatar_id":"","url":"https://api.github.com/users/tuluxmu","html_url":"https://github.com/tuluxmu","followers_url":"https://api.github.com/users/tuluxmu/followers","following_url":"https://api.github.com/users/tuluxmu/following{/other_user}","gists_url":"https://api.github.com/users/tuluxmu/gists{/gist_id}","starred_url":"https://api.github.com/users/tuluxmu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuluxmu/subscriptions","organizations_url":"https://api.github.com/users/tuluxmu/orgs","repos_url":"https://api.github.com/users/tuluxmu/repos","events_url":"https://api.github.com/users/tuluxmu/events{/privacy}","received_events_url":"https://api.github.com/users/tuluxmu/received_events","type":"User","site_admin":false},"body":"The logic here is not so properly.","created_at":"2018-09-13T03:10:28Z","updated_at":"2018-09-13T03:10:28Z","html_url":"https://github.com/ringcentral/ringcentral-js-widgets/pull/1225#discussion_r217248902","pull_request_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/comments/217248902"},"html":{"href":"https://github.com/ringcentral/ringcentral-js-widgets/pull/1225#discussion_r217248902"},"pull_request":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225"}}},"pull_request":{"url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225","id":215145702,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MTQ1NzAy","html_url":"https://github.com/ringcentral/ringcentral-js-widgets/pull/1225","diff_url":"https://github.com/ringcentral/ringcentral-js-widgets/pull/1225.diff","patch_url":"https://github.com/ringcentral/ringcentral-js-widgets/pull/1225.patch","issue_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues/1225","number":1225,"state":"open","locked":false,"title":"simplify call control","user":{"login":"MicleMing","id":6770547,"node_id":"MDQ6VXNlcjY3NzA1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/6770547?v=4","gravatar_id":"","url":"https://api.github.com/users/MicleMing","html_url":"https://github.com/MicleMing","followers_url":"https://api.github.com/users/MicleMing/followers","following_url":"https://api.github.com/users/MicleMing/following{/other_user}","gists_url":"https://api.github.com/users/MicleMing/gists{/gist_id}","starred_url":"https://api.github.com/users/MicleMing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicleMing/subscriptions","organizations_url":"https://api.github.com/users/MicleMing/orgs","repos_url":"https://api.github.com/users/MicleMing/repos","events_url":"https://api.github.com/users/MicleMing/events{/privacy}","received_events_url":"https://api.github.com/users/MicleMing/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-13T02:17:08Z","updated_at":"2018-09-13T03:10:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e1620dfff60a5a209cfca35aca9d25ab430f911","assignee":null,"assignees":[],"requested_reviewers":[{"login":"unadlib","id":18650460,"node_id":"MDQ6VXNlcjE4NjUwNDYw","avatar_url":"https://avatars0.githubusercontent.com/u/18650460?v=4","gravatar_id":"","url":"https://api.github.com/users/unadlib","html_url":"https://github.com/unadlib","followers_url":"https://api.github.com/users/unadlib/followers","following_url":"https://api.github.com/users/unadlib/following{/other_user}","gists_url":"https://api.github.com/users/unadlib/gists{/gist_id}","starred_url":"https://api.github.com/users/unadlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unadlib/subscriptions","organizations_url":"https://api.github.com/users/unadlib/orgs","repos_url":"https://api.github.com/users/unadlib/repos","events_url":"https://api.github.com/users/unadlib/events{/privacy}","received_events_url":"https://api.github.com/users/unadlib/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225/commits","review_comments_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225/comments","review_comment_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues/1225/comments","statuses_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/statuses/36f106315dbcea9e0fab41ad9bec4447a73d3ed4","head":{"label":"MicleMing:sf/call-control","ref":"sf/call-control","sha":"36f106315dbcea9e0fab41ad9bec4447a73d3ed4","user":{"login":"MicleMing","id":6770547,"node_id":"MDQ6VXNlcjY3NzA1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/6770547?v=4","gravatar_id":"","url":"https://api.github.com/users/MicleMing","html_url":"https://github.com/MicleMing","followers_url":"https://api.github.com/users/MicleMing/followers","following_url":"https://api.github.com/users/MicleMing/following{/other_user}","gists_url":"https://api.github.com/users/MicleMing/gists{/gist_id}","starred_url":"https://api.github.com/users/MicleMing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicleMing/subscriptions","organizations_url":"https://api.github.com/users/MicleMing/orgs","repos_url":"https://api.github.com/users/MicleMing/repos","events_url":"https://api.github.com/users/MicleMing/events{/privacy}","received_events_url":"https://api.github.com/users/MicleMing/received_events","type":"User","site_admin":false},"repo":{"id":143108900,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMxMDg5MDA=","name":"ringcentral-js-widgets","full_name":"MicleMing/ringcentral-js-widgets","owner":{"login":"MicleMing","id":6770547,"node_id":"MDQ6VXNlcjY3NzA1NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/6770547?v=4","gravatar_id":"","url":"https://api.github.com/users/MicleMing","html_url":"https://github.com/MicleMing","followers_url":"https://api.github.com/users/MicleMing/followers","following_url":"https://api.github.com/users/MicleMing/following{/other_user}","gists_url":"https://api.github.com/users/MicleMing/gists{/gist_id}","starred_url":"https://api.github.com/users/MicleMing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicleMing/subscriptions","organizations_url":"https://api.github.com/users/MicleMing/orgs","repos_url":"https://api.github.com/users/MicleMing/repos","events_url":"https://api.github.com/users/MicleMing/events{/privacy}","received_events_url":"https://api.github.com/users/MicleMing/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MicleMing/ringcentral-js-widgets","description":"RingCentral Integration Widget Library","fork":true,"url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets","forks_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/forks","keys_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/teams","hooks_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/hooks","issue_events_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/issues/events{/number}","events_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/events","assignees_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/assignees{/user}","branches_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/branches{/branch}","tags_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/tags","blobs_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/git/refs{/sha}","trees_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/statuses/{sha}","languages_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/languages","stargazers_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/stargazers","contributors_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/contributors","subscribers_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/subscribers","subscription_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/subscription","commits_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/commits{/sha}","git_commits_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/git/commits{/sha}","comments_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/comments{/number}","issue_comment_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/issues/comments{/number}","contents_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/contents/{+path}","compare_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/merges","archive_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/downloads","issues_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/issues{/number}","pulls_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/pulls{/number}","milestones_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/milestones{/number}","notifications_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/labels{/name}","releases_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/releases{/id}","deployments_url":"https://api.github.com/repos/MicleMing/ringcentral-js-widgets/deployments","created_at":"2018-08-01T05:40:39Z","updated_at":"2018-08-01T05:40:44Z","pushed_at":"2018-09-13T02:15:30Z","git_url":"git://github.com/MicleMing/ringcentral-js-widgets.git","ssh_url":"git@github.com:MicleMing/ringcentral-js-widgets.git","clone_url":"https://github.com/MicleMing/ringcentral-js-widgets.git","svn_url":"https://github.com/MicleMing/ringcentral-js-widgets","homepage":"https://ringcentral.github.io/ringcentral-js-widgets/","size":28566,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ringcentral:master","ref":"master","sha":"ede2c43b6db48edfecc43dba0396c29da7c8e92d","user":{"login":"ringcentral","id":6549285,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1NDkyODU=","avatar_url":"https://avatars3.githubusercontent.com/u/6549285?v=4","gravatar_id":"","url":"https://api.github.com/users/ringcentral","html_url":"https://github.com/ringcentral","followers_url":"https://api.github.com/users/ringcentral/followers","following_url":"https://api.github.com/users/ringcentral/following{/other_user}","gists_url":"https://api.github.com/users/ringcentral/gists{/gist_id}","starred_url":"https://api.github.com/users/ringcentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ringcentral/subscriptions","organizations_url":"https://api.github.com/users/ringcentral/orgs","repos_url":"https://api.github.com/users/ringcentral/repos","events_url":"https://api.github.com/users/ringcentral/events{/privacy}","received_events_url":"https://api.github.com/users/ringcentral/received_events","type":"Organization","site_admin":false},"repo":{"id":58172287,"node_id":"MDEwOlJlcG9zaXRvcnk1ODE3MjI4Nw==","name":"ringcentral-js-widgets","full_name":"ringcentral/ringcentral-js-widgets","owner":{"login":"ringcentral","id":6549285,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1NDkyODU=","avatar_url":"https://avatars3.githubusercontent.com/u/6549285?v=4","gravatar_id":"","url":"https://api.github.com/users/ringcentral","html_url":"https://github.com/ringcentral","followers_url":"https://api.github.com/users/ringcentral/followers","following_url":"https://api.github.com/users/ringcentral/following{/other_user}","gists_url":"https://api.github.com/users/ringcentral/gists{/gist_id}","starred_url":"https://api.github.com/users/ringcentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ringcentral/subscriptions","organizations_url":"https://api.github.com/users/ringcentral/orgs","repos_url":"https://api.github.com/users/ringcentral/repos","events_url":"https://api.github.com/users/ringcentral/events{/privacy}","received_events_url":"https://api.github.com/users/ringcentral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ringcentral/ringcentral-js-widgets","description":"RingCentral Integration Widget Library","fork":false,"url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets","forks_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/forks","keys_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/teams","hooks_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/hooks","issue_events_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues/events{/number}","events_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/events","assignees_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/assignees{/user}","branches_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/branches{/branch}","tags_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/tags","blobs_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/git/refs{/sha}","trees_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/statuses/{sha}","languages_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/languages","stargazers_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/stargazers","contributors_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/contributors","subscribers_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/subscribers","subscription_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/subscription","commits_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/commits{/sha}","git_commits_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/git/commits{/sha}","comments_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/comments{/number}","issue_comment_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues/comments{/number}","contents_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/contents/{+path}","compare_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/merges","archive_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/downloads","issues_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues{/number}","pulls_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls{/number}","milestones_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/milestones{/number}","notifications_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/labels{/name}","releases_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/releases{/id}","deployments_url":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/deployments","created_at":"2016-05-06T01:45:07Z","updated_at":"2018-09-13T02:43:53Z","pushed_at":"2018-09-13T02:56:38Z","git_url":"git://github.com/ringcentral/ringcentral-js-widgets.git","ssh_url":"git@github.com:ringcentral/ringcentral-js-widgets.git","clone_url":"https://github.com/ringcentral/ringcentral-js-widgets.git","svn_url":"https://github.com/ringcentral/ringcentral-js-widgets","homepage":"https://ringcentral.github.io/ringcentral-js-widgets/","size":30630,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":34,"open_issues":32,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225"},"html":{"href":"https://github.com/ringcentral/ringcentral-js-widgets/pull/1225"},"issue":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues/1225"},"comments":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/issues/1225/comments"},"review_comments":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225/comments"},"review_comment":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/pulls/1225/commits"},"statuses":{"href":"https://api.github.com/repos/ringcentral/ringcentral-js-widgets/statuses/36f106315dbcea9e0fab41ad9bec4447a73d3ed4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tuluxmu"}}