From eb8c1a57bad80d331e464214d26aa59c2e55bd1d Mon Sep 17 00:00:00 2001 From: ele828 Date: Wed, 16 Aug 2017 11:26:55 +0800 Subject: [PATCH 1/5] Add empty check for tab render in recent activity view --- src/components/RecentActivityView/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/RecentActivityView/index.js b/src/components/RecentActivityView/index.js index 2a5b367c08..4ab8545df4 100644 --- a/src/components/RecentActivityView/index.js +++ b/src/components/RecentActivityView/index.js @@ -31,7 +31,7 @@ export default class RecentActivityView extends PureComponent { onTabChanged = (tabName = this.props.defaultTab) => { const currentTab = this.getCurrentTab(tabName); - currentTab.getData(); + if (currentTab) currentTab.getData(); this.setState({ currentTab: tabName }); @@ -40,7 +40,7 @@ export default class RecentActivityView extends PureComponent { getCurrentTabPanel() { const currentTabPath = this.state.currentTab; const currentTab = this.getCurrentTab(currentTabPath); - return currentTab.view || null; + return currentTab ? currentTab.view : null; } getCurrentTab(currentTabPath) { From 8cd1ff70631ca0deee2e72ca0ea056550558874b Mon Sep 17 00:00:00 2001 From: ele828 Date: Wed, 16 Aug 2017 15:22:23 +0800 Subject: [PATCH 2/5] N11 check show customized message in telus brand --- src/components/CallAlert/i18n/en-US.js | 1 + src/components/CallAlert/index.js | 18 +++++++++++++++++- src/containers/AlertContainer/index.js | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/CallAlert/i18n/en-US.js b/src/components/CallAlert/i18n/en-US.js index e6a562288d..7674faa4c1 100644 --- a/src/components/CallAlert/i18n/en-US.js +++ b/src/components/CallAlert/i18n/en-US.js @@ -10,4 +10,5 @@ export default { [callErrors.networkError]: 'Cannot connect due to network issues. Please try again later.', [callErrors.noRingoutEnable]: 'Your extension is allowed to make calls with desktop app.\n If you wish to switch to other calling options\n please contact your account administrator for an upgrade.', areaCode: 'area code', + telus911: 'Emergency dialing is not supported.' }; diff --git a/src/components/CallAlert/index.js b/src/components/CallAlert/index.js index 51b32417c3..d1da81772c 100644 --- a/src/components/CallAlert/index.js +++ b/src/components/CallAlert/index.js @@ -4,13 +4,28 @@ import callErrors from 'ringcentral-integration/modules/Call/callErrors'; import FormattedMessage from '../FormattedMessage'; import i18n from './i18n'; +const TELUS_ID = '7310'; export default function CallAlert({ message: { message, + payload: { + phoneNumber + } }, + brand, onAreaCodeLinkClick, currentLocale, }) { + // If brand is Telus and special number is 911, + // show messages of its own version. + if ( + brand && + brand.id === TELUS_ID && + message === callErrors.specialNumber && + phoneNumber === '911' + ) { + return ({i18n.getString('telus911', currentLocale)}); + } if (message === callErrors.noAreaCode) { const areaCode = i18n.getString('areaCode', currentLocale); const areaCodeLink = onAreaCodeLinkClick ? @@ -40,10 +55,11 @@ CallAlert.propTypes = { message: PropTypes.shape({ message: PropTypes.string.isRequired, }).isRequired, + brand: PropTypes.object.isRequired, currentLocale: PropTypes.string.isRequired, }; CallAlert.defaultProps = { - onAreaCodeLinkClick: undefined, + onAreaCodeLinkClick: undefined }; CallAlert.handleMessage = ({ message }) => ( diff --git a/src/containers/AlertContainer/index.js b/src/containers/AlertContainer/index.js index 4c888aee15..5528584bd3 100644 --- a/src/containers/AlertContainer/index.js +++ b/src/containers/AlertContainer/index.js @@ -49,6 +49,7 @@ function getDefaultRenderer({ return props => ( ); From 78edf6388a4ec4cfdac2b466607320fda8397e80 Mon Sep 17 00:00:00 2001 From: ele828 Date: Wed, 16 Aug 2017 15:46:00 +0800 Subject: [PATCH 3/5] change label font-size on call-control --- src/components/ActiveCallPanel/styles.scss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ActiveCallPanel/styles.scss b/src/components/ActiveCallPanel/styles.scss index 7d0ccb3c39..7caeded9b6 100644 --- a/src/components/ActiveCallPanel/styles.scss +++ b/src/components/ActiveCallPanel/styles.scss @@ -16,8 +16,13 @@ $avatar-width: 60px; } .backButton { - font-size: $primary-font-size; color: $lightblack; + i { + font-size: $primary-font-size; + } + span { + font-size: 0.9em; + } &:hover { color: $lightblack; } From 9214504f64c8091818bba20458ff21cbd5e15ae5 Mon Sep 17 00:00:00 2001 From: ele828 Date: Wed, 16 Aug 2017 16:22:44 +0800 Subject: [PATCH 4/5] remove deconstructor --- src/components/CallAlert/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/CallAlert/index.js b/src/components/CallAlert/index.js index d1da81772c..f9d0a6765b 100644 --- a/src/components/CallAlert/index.js +++ b/src/components/CallAlert/index.js @@ -8,9 +8,7 @@ const TELUS_ID = '7310'; export default function CallAlert({ message: { message, - payload: { - phoneNumber - } + payload, }, brand, onAreaCodeLinkClick, @@ -19,10 +17,9 @@ export default function CallAlert({ // If brand is Telus and special number is 911, // show messages of its own version. if ( - brand && - brand.id === TELUS_ID && + brand && brand.id === TELUS_ID && message === callErrors.specialNumber && - phoneNumber === '911' + payload && payload.phoneNumber === '911' ) { return ({i18n.getString('telus911', currentLocale)}); } From 102be806681ad285a8cacf6ea25da2ff19244cc0 Mon Sep 17 00:00:00 2001 From: ele828 Date: Wed, 16 Aug 2017 17:07:44 +0800 Subject: [PATCH 5/5] upgrade commons --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 02cbb32942..9d9d9520c9 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "redux-thunk": "^2.2.0", "ringcentral": "^3.1.2", "ringcentral-client": "^1.0.0-rc1", - "ringcentral-integration": "^0.7.7", + "ringcentral-integration": "^0.7.9", "sass-loader": "^6.0.5", "source-map-loader": "^0.2.1", "style-loader": "^0.18.2", diff --git a/yarn.lock b/yarn.lock index 26629730aa..438093ca3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6626,9 +6626,9 @@ ringcentral-client@^1.0.0-rc1: form-data "^2.1.2" isomorphic-fetch "^2.2.1" -ringcentral-integration@^0.7.7: - version "0.7.7" - resolved "https://registry.yarnpkg.com/ringcentral-integration/-/ringcentral-integration-0.7.7.tgz#6740abefecafb95d2ffc94bb44ac0c1614190530" +ringcentral-integration@^0.7.9: + version "0.7.9" + resolved "https://registry.yarnpkg.com/ringcentral-integration/-/ringcentral-integration-0.7.9.tgz#78a97dc18c7af9572afc9919b919e7b5ffb11913" dependencies: file-loader "^0.11.2" json-mask "^0.3.8"