Skip to content

Commit 34fde95

Browse files
sophiewu2333embbnux
authored andcommitted
fix bug(RCINT3766) -- The dropdown list should show all matching entities (#145)
* fix bug -- recipientheader is null * fix bug -- recipientheader is null * add type to recipientHeader * change name * change name * add spaces * add spaces
1 parent 039d63a commit 34fde95

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

dev-server/Phone.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import CallLog from 'ringcentral-integration/modules/CallLog';
4343
import CallMonitor from 'ringcentral-integration/modules/CallMonitor';
4444
import CallHistory from 'ringcentral-integration/modules/CallHistory';
4545

46+
import ContactMatcher from 'ringcentral-integration/modules/ContactMatcher';
47+
4648
import RouterInteraction from '../src/modules/RouterInteraction';
4749

4850
export default class Phone extends RcModule {
@@ -366,7 +368,11 @@ export default class Phone extends RcModule {
366368
contactMatcher: this.contactMatcher,
367369
getState: () => this.state.callHistory,
368370
}));
369-
371+
this.addModule('contactMatcher', new ContactMatcher({
372+
...options,
373+
storage: this.storage,
374+
getState: () => this.state.contactMatcher,
375+
}));
370376
this._reducer = combineReducers({
371377
accountExtension: this.accountExtension.reducer,
372378
accountInfo: this.accountInfo.reducer,
@@ -409,6 +415,7 @@ export default class Phone extends RcModule {
409415
callLog: this.callLog.reducer,
410416
callMonitor: this.callMonitor.reducer,
411417
callHistory: this.callHistory.reducer,
418+
contactMatcher: this.contactMatcher.reducer,
412419
lastAction: (state = null, action) => {
413420
console.log(action);
414421
return action;

dev-server/containers/App/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export default function App({
195195
conversation={phone.conversation}
196196
messageStore={phone.messageStore}
197197
dateTimeFormat={phone.dateTimeFormat}
198-
// contactMatcher={phone.contactMatcher}
198+
contactMatcher={phone.contactMatcher}
199199
/>
200200
)} />
201201
<Route
@@ -211,7 +211,6 @@ export default function App({
211211
regionSettings={phone.regionSettings}
212212
contactMatcher={phone.contactMatcher}
213213
dateTimeFormat={phone.dateTimeFormat}
214-
// contactMatcher={phone.contactMatcher}
215214
/>
216215
)} />
217216
</Route>

src/components/RecipientHeader/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ function MatchedNameList(props) {
3030
return (
3131
<div className={props.className}>
3232
{
33-
this.props.isSelected ?
33+
props.isSelected ?
3434
<RecipientName
35-
name={i18n.getString('selectMatchedName', this.props.currentLocale)}
35+
name={i18n.getString('selectMatchedName', props.currentLocale)}
3636
className={styles.noClick}
3737
onClick={
3838
() => null
@@ -111,7 +111,7 @@ class RecipientHeader extends Component {
111111
const phoneNumber = recipient.phoneNumber || recipient.extensionNumber;
112112
let matchedNames = this.context.getMatcherContactList(phoneNumber);
113113
let defaultRecipient = matchedNames.join('&');
114-
// if it have old data
114+
// if it has old data
115115
let isSelected = false;
116116
if (recipient.matchedNames && recipient.matchedNames[0]) {
117117
const firstMatchedName = recipient.matchedNames[0];

src/components/RecipientHeader/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
.recipient {
1414
display: block;
15-
width: 100%;
15+
max-width: 100%;
1616
padding: 0 2px;
1717
line-height: 25px;
1818
height: 25px;

src/components/RecipientsHeader/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.container {
2+
position: relative;
23
display: inline-block;
34
text-align: center;
45
max-width: 250px;
56
min-width: 100px;
6-
position: relative;
77
margin: 0 auto;
88
font-family: Helvetica;
99
font-size: 14px;

src/containers/ConversationPage/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ function mapDispatchToProps(dispatch, props) {
115115
getMatcherContactList = (phoneNumber) => {
116116
const matcherNames = props.contactMatcher.dataMapping[phoneNumber];
117117
if (matcherNames && matcherNames.length > 0) {
118-
return matcherNames.map(matcher => matcher.name);
118+
return matcherNames.map(matcher =>
119+
`${matcher.name}|${matcher.phoneNumbers[0].phoneType}`
120+
);
119121
}
120122
return [];
121123
};

0 commit comments

Comments
 (0)