|
@@ -14,6 +14,8 @@ import { invitePeople, searchPeople } from '../functions';
|
14
|
14
|
|
15
|
15
|
declare var interfaceConfig: Object;
|
16
|
16
|
|
|
17
|
+const { PropTypes } = React;
|
|
18
|
+
|
17
|
19
|
/**
|
18
|
20
|
* The dialog that allows to invite people to the call.
|
19
|
21
|
*/
|
|
@@ -27,32 +29,37 @@ class AddPeopleDialog extends Component {
|
27
|
29
|
/**
|
28
|
30
|
* The URL pointing to the service allowing for people invite.
|
29
|
31
|
*/
|
30
|
|
- _inviteServiceUrl: React.PropTypes.string,
|
|
32
|
+ _inviteServiceUrl: PropTypes.string,
|
31
|
33
|
|
32
|
34
|
/**
|
33
|
35
|
* The url of the conference to invite people to.
|
34
|
36
|
*/
|
35
|
|
- _inviteUrl: React.PropTypes.string,
|
|
37
|
+ _inviteUrl: PropTypes.string,
|
36
|
38
|
|
37
|
39
|
/**
|
38
|
40
|
* The JWT token.
|
39
|
41
|
*/
|
40
|
|
- _jwt: React.PropTypes.string,
|
|
42
|
+ _jwt: PropTypes.string,
|
|
43
|
+
|
|
44
|
+ /**
|
|
45
|
+ * The query types used when searching people.
|
|
46
|
+ */
|
|
47
|
+ _peopleSearchQueryTypes: PropTypes.arrayOf(PropTypes.string),
|
41
|
48
|
|
42
|
49
|
/**
|
43
|
50
|
* The URL pointing to the service allowing for people search.
|
44
|
51
|
*/
|
45
|
|
- _peopleSearchUrl: React.PropTypes.string,
|
|
52
|
+ _peopleSearchUrl: PropTypes.string,
|
46
|
53
|
|
47
|
54
|
/**
|
48
|
55
|
* The function closing the dialog.
|
49
|
56
|
*/
|
50
|
|
- hideDialog: React.PropTypes.func,
|
|
57
|
+ hideDialog: PropTypes.func,
|
51
|
58
|
|
52
|
59
|
/**
|
53
|
60
|
* Invoked to obtain translated strings.
|
54
|
61
|
*/
|
55
|
|
- t: React.PropTypes.func
|
|
62
|
+ t: PropTypes.func
|
56
|
63
|
};
|
57
|
64
|
|
58
|
65
|
/**
|
|
@@ -84,8 +91,20 @@ class AddPeopleDialog extends Component {
|
84
|
91
|
|
85
|
92
|
this._multiselect = null;
|
86
|
93
|
this._resourceClient = {
|
87
|
|
- makeQuery: text => searchPeople(
|
88
|
|
- this.props._peopleSearchUrl, this.props._jwt, text),
|
|
94
|
+ makeQuery: text => {
|
|
95
|
+ const {
|
|
96
|
+ _jwt,
|
|
97
|
+ _peopleSearchQueryTypes,
|
|
98
|
+ _peopleSearchUrl
|
|
99
|
+ } = this.props;
|
|
100
|
+
|
|
101
|
+ return searchPeople(
|
|
102
|
+ _peopleSearchUrl,
|
|
103
|
+ _jwt,
|
|
104
|
+ text,
|
|
105
|
+ _peopleSearchQueryTypes
|
|
106
|
+ );
|
|
107
|
+ },
|
89
|
108
|
parseResults: response => response.map(user => {
|
90
|
109
|
const avatar = ( // eslint-disable-line no-extra-parens
|
91
|
110
|
<Avatar
|
|
@@ -299,12 +318,17 @@ class AddPeopleDialog extends Component {
|
299
|
318
|
* }}
|
300
|
319
|
*/
|
301
|
320
|
function _mapStateToProps(state) {
|
302
|
|
- const { peopleSearchUrl, inviteServiceUrl } = state['features/base/config'];
|
|
321
|
+ const {
|
|
322
|
+ inviteServiceUrl,
|
|
323
|
+ peopleSearchQueryTypes,
|
|
324
|
+ peopleSearchUrl
|
|
325
|
+ } = state['features/base/config'];
|
303
|
326
|
|
304
|
327
|
return {
|
305
|
328
|
_jwt: state['features/jwt'].jwt,
|
306
|
329
|
_inviteUrl: getInviteURL(state),
|
307
|
330
|
_inviteServiceUrl: inviteServiceUrl,
|
|
331
|
+ _peopleSearchQueryTypes: peopleSearchQueryTypes,
|
308
|
332
|
_peopleSearchUrl: peopleSearchUrl
|
309
|
333
|
};
|
310
|
334
|
}
|