forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
36 lines (28 loc) · 1.12 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators, Dispatch} from 'redux';
import {switchLdapToEmail} from 'mattermost-redux/actions/users';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from 'mattermost-redux/types/store';
import {GenericAction} from 'mattermost-redux/types/actions';
import {getPasswordConfig} from 'utils/utils.jsx';
import ClaimController from './claim_controller';
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);
const siteName = config.SiteName as string;
const ldapLoginFieldName = config.LdapLoginFieldName as string;
return {
siteName,
ldapLoginFieldName,
passwordConfig: getPasswordConfig(config),
};
}
function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
return {
actions: bindActionCreators({
switchLdapToEmail,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(ClaimController);