Skip to content

Commit 39f2f0b

Browse files
embbnuxalvita
authored andcommitted
show tooltip on calling setting page (#266)
* show tooltip on calling setting page * remove unused style
1 parent 0852607 commit 39f2f0b

File tree

8 files changed

+151
-25
lines changed

8 files changed

+151
-25
lines changed

dev-server/Phone.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Call from 'ringcentral-integration/modules/Call';
1313
import CallingSettings from 'ringcentral-integration/modules/CallingSettings';
1414
import ConnectivityMonitor from 'ringcentral-integration/modules/ConnectivityMonitor';
1515
import DialingPlan from 'ringcentral-integration/modules/DialingPlan';
16+
import ExtensionDevice from 'ringcentral-integration/modules/ExtensionDevice';
1617
import Environment from 'ringcentral-integration/modules/Environment';
1718
import ExtensionInfo from 'ringcentral-integration/modules/ExtensionInfo';
1819
import ExtensionPhoneNumber from 'ringcentral-integration/modules/ExtensionPhoneNumber';
@@ -185,6 +186,14 @@ export default class Phone extends RcModule {
185186
getState: () => this.state.accountInfo,
186187
}));
187188
reducers.accountInfo = this.accountInfo.reducer;
189+
this.addModule('extensionDevice', new ExtensionDevice({
190+
auth: this.auth,
191+
client: this.client,
192+
storage: this.storage,
193+
tabManager: this.tabManager,
194+
getState: () => this.state.extensionDevice,
195+
}));
196+
reducers.extensionDevice = this.extensionDevice.reducer;
188197
this.addModule('extensionInfo', new ExtensionInfo({
189198
...options,
190199
auth: this.auth,
@@ -239,6 +248,8 @@ export default class Phone extends RcModule {
239248
client: this.client,
240249
storage: this.storage,
241250
rolesAndPermissions: this.rolesAndPermissions,
251+
webphoneLogLevel: 3,
252+
extensionDevice: this.extensionDevice,
242253
getState: () => this.state.webphone,
243254
}));
244255
reducers.webphone = this.webphone.reducer;

dev-server/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const base = {
6666
},
6767
{
6868
test: /\.ogg$/,
69-
use: 'url-loader?publicPath=./&name=audio/[name]_[hash].[ext]',
69+
use: 'file-loader?publicPath=./&name=audio/[name]_[hash].[ext]',
7070
},
7171
],
7272
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"redux-thunk": "^2.1.0",
8484
"ringcentral": "^3.1.1",
8585
"ringcentral-client": "^1.0.0-rc1",
86-
"ringcentral-integration": "^0.7.0-rc1",
86+
"ringcentral-integration": "^0.7.0-rc3",
8787
"sass-loader": "^6.0.5",
8888
"source-map-loader": "^0.2.1",
8989
"style-loader": "^0.18.2",
@@ -100,6 +100,7 @@
100100
"font-awesome": "^4.7.0",
101101
"normalize-css": "^2.3.1",
102102
"prop-types": "^15.5.10",
103+
"rc-tooltip": "^3.4.6",
103104
"react-svg-loader": "^1.1.1",
104105
"through2": "^2.0.3"
105106
}

src/components/ActiveCallButton/styles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import '../../lib/commonStyles/colors.scss';
2+
@import '../../lib/commonStyles/fonts.scss';
23

34
.root {
45
text-align: center;
@@ -20,8 +21,7 @@
2021
}
2122

2223
.buttonTitle {
24+
@include secondary-font;
2325
font-size: 12px;
2426
padding: 5px 0;
25-
color: #797979;
26-
font-family: HelveticaNeue;
2727
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,15 @@ export default {
1111
ringoutHint: 'Ring me at my location first, then connect the called party',
1212
myLocationLabel: 'My Location',
1313
press1ToStartCallLabel: 'Prompt me to dial 1 before connecting the call',
14+
[`${callingOptions.browser}Tooltip`]: `Use this option to make and receive calls
15+
using your computer’s microphone and speaker.`,
16+
[`${callingOptions.softphone}Tooltip`]: `Use this option to make and receive calls
17+
using your {brand} for Desktop app.`,
18+
[`${callingOptions.myphone}Tooltip`]: 'Use this option to make calls using your {brand} phone.',
19+
[`${callingOptions.otherphone}Tooltip`]: `Use this option to make calls using your other phones
20+
such as home or cell phones that you have added in your {brand} Extension.
21+
For the call you make, this phone will ring first then the party you called.`,
22+
[`${callingOptions.customphone}Tooltip`]: `Use this option to make calls using any phone of
23+
your choice by entering a valid phone number in the field below.
24+
For the call you make, this phone will ring first then the party you called.`,
1425
};

src/components/CallingSettingsPanel/index.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import formatMessage from 'format-message';
55

66
import callingOptions from 'ringcentral-integration/modules/CallingSettings/callingOptions';
77
import 'font-awesome/css/font-awesome.css';
8+
import Tooltip from 'rc-tooltip';
9+
import 'rc-tooltip/assets/bootstrap_white.css';
10+
import dynamicsFont from '../../assets/DynamicsFont/DynamicsFont.scss';
811
import styles from './styles.scss';
912
import i18n from './i18n';
1013

@@ -170,6 +173,16 @@ export default class CallingSettingsPanel extends Component {
170173
</div>
171174
) : null;
172175

176+
const toolTip = (
177+
<div style={{ width: 150 }}>
178+
{
179+
formatMessage(
180+
i18n.getString(`${this.state.callWith}Tooltip`, currentLocale),
181+
{ brand: this.props.brand }
182+
)
183+
}
184+
</div>
185+
);
173186
return (
174187
<div className={classnames(styles.root, className)}>
175188
<BackHeader
@@ -181,7 +194,21 @@ export default class CallingSettingsPanel extends Component {
181194
<Panel className={styles.content}>
182195
<InputField
183196
className={styles.inputField}
184-
label={i18n.getString('makeCallsWith', currentLocale)} noBorder>
197+
label={
198+
<span>
199+
{i18n.getString('makeCallsWith', currentLocale)}
200+
<Tooltip
201+
placement="bottom"
202+
trigger="click"
203+
overlay={toolTip}
204+
arrowContent={<div className="rc-tooltip-arrow-inner" />}
205+
>
206+
<i className={classnames(dynamicsFont.information, styles.infoIcon)} />
207+
</Tooltip>
208+
</span>
209+
}
210+
noBorder
211+
>
185212
<Select
186213
className={styles.select}
187214
value={this.state.callWith}

src/components/CallingSettingsPanel/styles.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@
2424
@include primary-font;
2525
}
2626

27+
.infoIcon {
28+
margin-left: 6px;
29+
font-size: 14px;
30+
color: #848484;
31+
}
32+
2733
.ringoutHint {
2834
padding: 15px 0px;
2935
@include primary-font;
3036
}
37+
3138
.select {
3239
border: 1px solid #a6a6a6;
3340
border-radius: 2px;

yarn.lock

Lines changed: 89 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ acorn@^5.0.0, acorn@^5.0.1, acorn@^5.0.3:
5454
version "5.0.3"
5555
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d"
5656

57+
58+
version "1.0.2"
59+
resolved "https://registry.yarnpkg.com/add-dom-event-listener/-/add-dom-event-listener-1.0.2.tgz#8faed2c41008721cf111da1d30d995b85be42bed"
60+
dependencies:
61+
object-assign "4.x"
62+
5763
agent-base@2:
5864
version "2.1.1"
5965
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7"
@@ -1095,7 +1101,7 @@ babel-register@^6.24.1, babel-register@^6.9.0:
10951101
mkdirp "^0.5.1"
10961102
source-map-support "^0.4.2"
10971103

1098-
babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.20.0, babel-runtime@^6.22.0, babel-runtime@^6.9.1, babel-runtime@^6.9.2:
1104+
babel-runtime@6.x, babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.20.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.9.1, babel-runtime@^6.9.2:
10991105
version "6.23.0"
11001106
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
11011107
dependencies:
@@ -1580,10 +1586,20 @@ commondir@^1.0.1:
15801586
version "1.0.1"
15811587
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
15821588

1589+
component-classes@^1.2.5:
1590+
version "1.2.6"
1591+
resolved "https://registry.yarnpkg.com/component-classes/-/component-classes-1.2.6.tgz#c642394c3618a4d8b0b8919efccbbd930e5cd691"
1592+
dependencies:
1593+
component-indexof "0.0.3"
1594+
15831595
component-emitter@^1.2.0:
15841596
version "1.2.1"
15851597
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
15861598

1599+
1600+
version "0.0.3"
1601+
resolved "https://registry.yarnpkg.com/component-indexof/-/component-indexof-0.0.3.tgz#11d091312239eb8f32c8f25ae9cb002ffe8d3c24"
1602+
15871603
compressible@~2.0.8:
15881604
version "2.0.10"
15891605
resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.10.tgz#feda1c7f7617912732b29bf8cf26252a20b9eecd"
@@ -1720,7 +1736,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
17201736
safe-buffer "^5.0.1"
17211737
sha.js "^2.4.8"
17221738

1723-
create-react-class@^15.5.1, create-react-class@^15.5.3:
1739+
create-react-class@15.x, create-react-class@^15.5.1, create-react-class@^15.5.3:
17241740
version "15.5.3"
17251741
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.5.3.tgz#fb0f7cae79339e9a179e194ef466efa3923820fe"
17261742
dependencies:
@@ -1763,6 +1779,12 @@ crypto-browserify@^3.11.0:
17631779
public-encrypt "^4.0.0"
17641780
randombytes "^2.0.0"
17651781

1782+
1783+
version "1.3.2"
1784+
resolved "https://registry.yarnpkg.com/css-animation/-/css-animation-1.3.2.tgz#df515820ef5903733ad2db0999403b3037b8b880"
1785+
dependencies:
1786+
component-classes "^1.2.5"
1787+
17661788
17671789
version "0.0.4"
17681790
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0"
@@ -2082,6 +2104,10 @@ doctrine@^2.0.0:
20822104
esutils "^2.0.2"
20832105
isarray "^1.0.0"
20842106

2107+
2108+
version "1.6.2"
2109+
resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.6.2.tgz#b14e64917c25de6b4055227339b4d64f4b7db885"
2110+
20852111
dom-serializer@0, dom-serializer@~0.1.0:
20862112
version "0.1.0"
20872113
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
@@ -2630,12 +2656,6 @@ file-entry-cache@^2.0.0:
26302656
flat-cache "^1.2.1"
26312657
object-assign "^4.0.1"
26322658

2633-
file-loader@^0.10.1:
2634-
version "0.10.1"
2635-
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.10.1.tgz#815034119891fc6441fb5a64c11bc93c22ddd842"
2636-
dependencies:
2637-
loader-utils "^1.0.2"
2638-
26392659
file-loader@^0.11.2:
26402660
version "0.11.2"
26412661
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.11.2.tgz#4ff1df28af38719a6098093b88c82c71d1794a34"
@@ -4204,7 +4224,7 @@ lodash.isstring@^4.0.1:
42044224
version "4.0.1"
42054225
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
42064226

4207-
lodash.keys@^3.0.0:
4227+
lodash.keys@^3.0.0, lodash.keys@^3.1.2:
42084228
version "3.1.2"
42094229
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
42104230
dependencies:
@@ -4748,14 +4768,14 @@ [email protected]:
47484768
version "4.1.0"
47494769
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0"
47504770

4771+
[email protected], object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
4772+
version "4.1.1"
4773+
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
4774+
47514775
object-assign@^3.0.0:
47524776
version "3.0.0"
47534777
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2"
47544778

4755-
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
4756-
version "4.1.1"
4757-
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
4758-
47594779
object-is@^1.0.1:
47604780
version "1.0.1"
47614781
resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6"
@@ -5446,7 +5466,7 @@ promise@^7.1.1:
54465466
dependencies:
54475467
asap "~2.0.3"
54485468

5449-
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@~15.5.7:
5469+
prop-types@15.x, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@~15.5.7:
54505470
version "15.5.10"
54515471
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
54525472
dependencies:
@@ -5568,6 +5588,49 @@ raw-body@2:
55685588
iconv-lite "0.4.15"
55695589
unpipe "1.0.0"
55705590

5591+
5592+
version "2.3.4"
5593+
resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-2.3.4.tgz#d83bdab7560f0142e72a3de1d495dab6ba225249"
5594+
dependencies:
5595+
dom-align "1.x"
5596+
prop-types "^15.5.8"
5597+
rc-util "4.x"
5598+
5599+
5600+
version "2.4.0"
5601+
resolved "https://registry.yarnpkg.com/rc-animate/-/rc-animate-2.4.0.tgz#a51b47dadf8ad9af08cddfb5b0217bfa81aee803"
5602+
dependencies:
5603+
babel-runtime "6.x"
5604+
css-animation "1.x"
5605+
prop-types "15.x"
5606+
5607+
rc-tooltip@^3.4.6:
5608+
version "3.4.6"
5609+
resolved "https://registry.yarnpkg.com/rc-tooltip/-/rc-tooltip-3.4.6.tgz#ed98de2a7b412e527c6bd8a2a97dddf0babd2f21"
5610+
dependencies:
5611+
babel-runtime "^6.23.0"
5612+
prop-types "^15.5.8"
5613+
rc-trigger "1.x"
5614+
5615+
5616+
version "1.11.2"
5617+
resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-1.11.2.tgz#5c75a1928814a0595e3d912e0a15ca853df5464d"
5618+
dependencies:
5619+
babel-runtime "6.x"
5620+
create-react-class "15.x"
5621+
prop-types "15.x"
5622+
rc-align "2.x"
5623+
rc-animate "2.x"
5624+
rc-util "4.x"
5625+
5626+
5627+
version "4.0.4"
5628+
resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-4.0.4.tgz#99813dd90aee7e29b64939a70ac176ead3f4ff39"
5629+
dependencies:
5630+
add-dom-event-listener "1.x"
5631+
babel-runtime "6.x"
5632+
shallowequal "^0.2.2"
5633+
55715634
rc@^1.1.7:
55725635
version "1.2.1"
55735636
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95"
@@ -5941,7 +6004,7 @@ [email protected], [email protected]:
59416004
version "1.0.0"
59426005
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
59436006

5944-
reselect@^2.5.4:
6007+
59456008
version "2.5.4"
59466009
resolved "https://registry.yarnpkg.com/reselect/-/reselect-2.5.4.tgz#b7d23fdf00b83fa7ad0279546f8dbbbd765c7047"
59476010

@@ -6004,16 +6067,16 @@ ringcentral-client@^1.0.0-rc1:
60046067
form-data "^2.1.2"
60056068
isomorphic-fetch "^2.2.1"
60066069

6007-
ringcentral-integration@^0.7.0-rc1:
6008-
version "0.7.0-rc1"
6009-
resolved "https://registry.yarnpkg.com/ringcentral-integration/-/ringcentral-integration-0.7.0-rc1.tgz#c37b38d3afee18866a06b4467afa233d3c4d8cc4"
6070+
ringcentral-integration@^0.7.0-rc3:
6071+
version "0.7.0-rc3"
6072+
resolved "https://registry.yarnpkg.com/ringcentral-integration/-/ringcentral-integration-0.7.0-rc3.tgz#34d74eef92187b8f381d1bd58db9d0ad235e9f5c"
60106073
dependencies:
6011-
file-loader "^0.10.1"
6074+
file-loader "^0.11.2"
60126075
json-mask "^0.3.8"
60136076
loganberry "^0.9.1"
60146077
phoneformat.js "^1.0.3"
60156078
redux "^3.5.2"
6016-
reselect "^2.5.4"
6079+
reselect "2.5.4"
60176080
ringcentral-web-phone "^0.4.1"
60186081
url-loader "^0.5.8"
60196082
uuid "^3.0.1"
@@ -6186,6 +6249,12 @@ shallow-clone@^0.1.2:
61866249
lazy-cache "^0.2.3"
61876250
mixin-object "^2.0.1"
61886251

6252+
shallowequal@^0.2.2:
6253+
version "0.2.2"
6254+
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-0.2.2.tgz#1e32fd5bcab6ad688a4812cb0cc04efc75c7014e"
6255+
dependencies:
6256+
lodash.keys "^3.1.2"
6257+
61896258
shebang-regex@^1.0.0:
61906259
version "1.0.0"
61916260
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"

0 commit comments

Comments
 (0)