itizawa пре 6 година
родитељ
комит
124ac41ba3
1 измењених фајлова са 15 додато и 1 уклоњено
  1. 15 1
      src/client/js/components/Admin/Security/LdapSecuritySetting.jsx

+ 15 - 1
src/client/js/components/Admin/Security/LdapSecuritySetting.jsx

@@ -4,7 +4,7 @@ import { withTranslation } from 'react-i18next';
 import loggerFactory from '@alias/logger';
 
 import { createSubscribedElement } from '../../UnstatedUtils';
-import { toastError } from '../../../util/apiNotification';
+import { toastSuccess, toastError } from '../../../util/apiNotification';
 
 import AppContainer from '../../../services/AppContainer';
 import AdminGeneralSecurityContainer from '../../../services/AdminGeneralSecurityContainer';
@@ -21,6 +21,7 @@ class LdapSecuritySetting extends React.Component {
       retrieveError: null,
     };
 
+    this.onClickSubmit = this.onClickSubmit.bind(this);
   }
 
   async componentDidMount() {
@@ -36,6 +37,19 @@ class LdapSecuritySetting extends React.Component {
     }
   }
 
+  async onClickSubmit() {
+    const { t, adminLdapSecurityContainer } = this.props;
+
+    try {
+      await adminLdapSecurityContainer.updateLdapSetting();
+      toastSuccess(t('security_setting.SAML.updated_saml'));
+    }
+    catch (err) {
+      toastError(err);
+      logger.error(err);
+    }
+  }
+
   render() {
     const { t, adminGeneralSecurityContainer, adminLdapSecurityContainer } = this.props;
     const { isLdapEnabled } = adminGeneralSecurityContainer.state;