Skip to content

Commit c37bafb

Browse files
Eric Huangembbnux
authored andcommitted
Add empty check & N11 message customization (#352)
* Add empty check for tab render in recent activity view * N11 check show customized message in telus brand * change label font-size on call-control * remove deconstructor * upgrade commons
1 parent 8b903a4 commit c37bafb

File tree

7 files changed

+28
-8
lines changed

7 files changed

+28
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"redux-thunk": "^2.2.0",
8888
"ringcentral": "^3.1.2",
8989
"ringcentral-client": "^1.0.0-rc1",
90-
"ringcentral-integration": "^0.7.7",
90+
"ringcentral-integration": "^0.7.9",
9191
"sass-loader": "^6.0.5",
9292
"source-map-loader": "^0.2.1",
9393
"style-loader": "^0.18.2",

src/components/ActiveCallPanel/styles.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ $avatar-width: 60px;
1616
}
1717

1818
.backButton {
19-
font-size: $primary-font-size;
2019
color: $lightblack;
20+
i {
21+
font-size: $primary-font-size;
22+
}
23+
span {
24+
font-size: 0.9em;
25+
}
2126
&:hover {
2227
color: $lightblack;
2328
}

src/components/CallAlert/i18n/en-US.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export default {
1010
[callErrors.networkError]: 'Cannot connect due to network issues. Please try again later.',
1111
[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.',
1212
areaCode: 'area code',
13+
telus911: 'Emergency dialing is not supported.'
1314
};

src/components/CallAlert/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ import callErrors from 'ringcentral-integration/modules/Call/callErrors';
44
import FormattedMessage from '../FormattedMessage';
55
import i18n from './i18n';
66

7+
const TELUS_ID = '7310';
78
export default function CallAlert({
89
message: {
910
message,
11+
payload,
1012
},
13+
brand,
1114
onAreaCodeLinkClick,
1215
currentLocale,
1316
}) {
17+
// If brand is Telus and special number is 911,
18+
// show messages of its own version.
19+
if (
20+
brand && brand.id === TELUS_ID &&
21+
message === callErrors.specialNumber &&
22+
payload && payload.phoneNumber === '911'
23+
) {
24+
return (<span>{i18n.getString('telus911', currentLocale)}</span>);
25+
}
1426
if (message === callErrors.noAreaCode) {
1527
const areaCode = i18n.getString('areaCode', currentLocale);
1628
const areaCodeLink = onAreaCodeLinkClick ?
@@ -40,10 +52,11 @@ CallAlert.propTypes = {
4052
message: PropTypes.shape({
4153
message: PropTypes.string.isRequired,
4254
}).isRequired,
55+
brand: PropTypes.object.isRequired,
4356
currentLocale: PropTypes.string.isRequired,
4457
};
4558
CallAlert.defaultProps = {
46-
onAreaCodeLinkClick: undefined,
59+
onAreaCodeLinkClick: undefined
4760
};
4861

4962
CallAlert.handleMessage = ({ message }) => (

src/components/RecentActivityView/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class RecentActivityView extends PureComponent {
3131

3232
onTabChanged = (tabName = this.props.defaultTab) => {
3333
const currentTab = this.getCurrentTab(tabName);
34-
currentTab.getData();
34+
if (currentTab) currentTab.getData();
3535
this.setState({
3636
currentTab: tabName
3737
});
@@ -40,7 +40,7 @@ export default class RecentActivityView extends PureComponent {
4040
getCurrentTabPanel() {
4141
const currentTabPath = this.state.currentTab;
4242
const currentTab = this.getCurrentTab(currentTabPath);
43-
return currentTab.view || null;
43+
return currentTab ? currentTab.view : null;
4444
}
4545

4646
getCurrentTab(currentTabPath) {

src/containers/AlertContainer/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function getDefaultRenderer({
4949
return props => (
5050
<CallAlert
5151
{...props}
52+
brand={brand}
5253
onAreaCodeLinkClick={onRegionSettingsLinkClick}
5354
/>
5455
);

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6626,9 +6626,9 @@ ringcentral-client@^1.0.0-rc1:
66266626
form-data "^2.1.2"
66276627
isomorphic-fetch "^2.2.1"
66286628

6629-
ringcentral-integration@^0.7.7:
6630-
version "0.7.7"
6631-
resolved "https://registry.yarnpkg.com/ringcentral-integration/-/ringcentral-integration-0.7.7.tgz#6740abefecafb95d2ffc94bb44ac0c1614190530"
6629+
ringcentral-integration@^0.7.9:
6630+
version "0.7.9"
6631+
resolved "https://registry.yarnpkg.com/ringcentral-integration/-/ringcentral-integration-0.7.9.tgz#78a97dc18c7af9572afc9919b919e7b5ffb11913"
66326632
dependencies:
66336633
file-loader "^0.11.2"
66346634
json-mask "^0.3.8"

0 commit comments

Comments
 (0)