|
@@ -9,6 +9,7 @@ import { toastSuccess, toastError } from '../../../util/apiNotification';
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
import AdminGeneralSecurityContainer from '../../../services/AdminGeneralSecurityContainer';
|
|
import AdminGeneralSecurityContainer from '../../../services/AdminGeneralSecurityContainer';
|
|
|
import AdminLdapSecurityContainer from '../../../services/AdminLdapSecurityContainer';
|
|
import AdminLdapSecurityContainer from '../../../services/AdminLdapSecurityContainer';
|
|
|
|
|
+import LdapAuthTestModal from './LdapAuthTestModal';
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:security:AdminLdapSecurityContainer');
|
|
const logger = loggerFactory('growi:security:AdminLdapSecurityContainer');
|
|
|
|
|
|
|
@@ -19,9 +20,12 @@ class LdapSecuritySetting extends React.Component {
|
|
|
|
|
|
|
|
this.state = {
|
|
this.state = {
|
|
|
retrieveError: null,
|
|
retrieveError: null,
|
|
|
|
|
+ isLdapAuthTestModalShown: false,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
this.onClickSubmit = this.onClickSubmit.bind(this);
|
|
this.onClickSubmit = this.onClickSubmit.bind(this);
|
|
|
|
|
+ this.openLdapAuthTestModal = this.openLdapAuthTestModal.bind(this);
|
|
|
|
|
+ this.closeLdapAuthTestModal = this.closeLdapAuthTestModal.bind(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async componentDidMount() {
|
|
async componentDidMount() {
|
|
@@ -50,6 +54,14 @@ class LdapSecuritySetting extends React.Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ openLdapAuthTestModal() {
|
|
|
|
|
+ this.setState({ isLdapAuthTestModalShown: true });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ closeLdapAuthTestModal() {
|
|
|
|
|
+ this.setState({ isLdapAuthTestModalShown: false });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const { t, adminGeneralSecurityContainer, adminLdapSecurityContainer } = this.props;
|
|
const { t, adminGeneralSecurityContainer, adminLdapSecurityContainer } = this.props;
|
|
|
const { isLdapEnabled } = adminGeneralSecurityContainer.state;
|
|
const { isLdapEnabled } = adminGeneralSecurityContainer.state;
|
|
@@ -379,11 +391,13 @@ class LdapSecuritySetting extends React.Component {
|
|
|
<div className="col-xs-offset-3 col-xs-5">
|
|
<div className="col-xs-offset-3 col-xs-5">
|
|
|
<button type="button" className="btn btn-primary" disabled={this.state.retrieveError != null} onClick={this.onClickSubmit}>{t('Update')}</button>
|
|
<button type="button" className="btn btn-primary" disabled={this.state.retrieveError != null} onClick={this.onClickSubmit}>{t('Update')}</button>
|
|
|
{adminGeneralSecurityContainer.state.isLdapEnabled
|
|
{adminGeneralSecurityContainer.state.isLdapEnabled
|
|
|
- && <button type="button" className="btn btn-default ml-2">{t('security_setting.ldap.test_config')}</button>
|
|
|
|
|
|
|
+ && <button type="button" className="btn btn-default ml-2" onClick={this.openLdapAuthTestModal}>{t('security_setting.ldap.test_config')}</button>
|
|
|
}
|
|
}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <LdapAuthTestModal isOpen={this.state.isLdapAuthTestModalShown} onClose={this.closeLdapAuthTestModal} />
|
|
|
|
|
+
|
|
|
</React.Fragment>
|
|
</React.Fragment>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|