WESEEK Kaito 6 лет назад
Родитель
Сommit
e16e1ac95f

+ 1 - 1
src/client/js/app.jsx

@@ -40,7 +40,7 @@ import CustomScriptEditor from './components/Admin/CustomScriptEditor';
 import CustomHeaderEditor from './components/Admin/CustomHeaderEditor';
 import MarkdownSetting from './components/Admin/MarkdownSetting/MarkDownSetting';
 import UserManagement from './components/Admin/UserManagement';
-import ManageExternalAccount from './components/Admin/Users/ManageExternalAccount';
+import ManageExternalAccount from './components/Admin/ManageExternalAccount';
 import UserGroupPage from './components/Admin/UserGroup/UserGroupPage';
 import Customize from './components/Admin/Customize/Customize';
 import ImportDataPage from './components/Admin/ImportDataPage';

+ 6 - 18
src/client/js/components/Admin/Users/ManageExternalAccount.jsx → src/client/js/components/Admin/ManageExternalAccount.jsx

@@ -2,13 +2,13 @@ import React, { Fragment } from 'react';
 import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
 
-import PaginationWrapper from '../../PaginationWrapper';
+import PaginationWrapper from '../PaginationWrapper';
 
-import { createSubscribedElement } from '../../UnstatedUtils';
-import AppContainer from '../../../services/AppContainer';
-import AdminExternalAccountsContainer from '../../../services/AdminExternalAccountsContainer';
-import ExternalAccountTable from './ExternalAccountTable';
-import { toastSuccess, toastError } from '../../../util/apiNotification';
+import { createSubscribedElement } from '../UnstatedUtils';
+import AppContainer from '../../services/AppContainer';
+import AdminExternalAccountsContainer from '../../services/AdminExternalAccountsContainer';
+import ExternalAccountTable from './Users/ExternalAccountTable';
+import { toastError } from '../../util/apiNotification';
 
 
 class ManageExternalAccount extends React.Component {
@@ -17,7 +17,6 @@ class ManageExternalAccount extends React.Component {
     super(props);
     this.xss = window.xss;
     this.handlePage = this.handlePage.bind(this);
-    this.removeExtenalAccount = this.removeExtenalAccount.bind(this);
   }
 
   componentWillMount() {
@@ -33,17 +32,6 @@ class ManageExternalAccount extends React.Component {
     }
   }
 
-  // remove external-account
-  async removeExtenalAccount(externalAccountId) {
-    try {
-      await this.props.adminExternalAccountsContainer.removeExternal(externalAccountId);
-      toastSuccess(`Removed "${this.xss.process(externalAccountId)}"`);
-    }
-    catch (err) {
-      toastError(new Error(`Unable to remove "${this.xss.process(externalAccountId)}"`));
-    }
-  }
-
   render() {
     const { t, adminExternalAccountsContainer } = this.props;
 

+ 14 - 0
src/client/js/components/Admin/Users/ExternalAccountTable.jsx

@@ -7,6 +7,8 @@ import { createSubscribedElement } from '../../UnstatedUtils';
 import AppContainer from '../../../services/AppContainer';
 import AdminExternalAccountsContainer from '../../../services/AdminExternalAccountsContainer';
 
+import { toastSuccess, toastError } from '../../../util/apiNotification';
+
 class ExternalAccountTable extends React.Component {
 
   constructor(props) {
@@ -17,6 +19,18 @@ class ExternalAccountTable extends React.Component {
     };
 
     this.getUserStatusLabel = this.getUserStatusLabel.bind(this);
+    this.removeExtenalAccount = this.removeExtenalAccount.bind(this);
+  }
+
+  // remove external-account
+  async removeExtenalAccount(externalAccountId) {
+    try {
+      await this.props.adminExternalAccountsContainer.removeExternal(externalAccountId);
+      toastSuccess(`Removed "${this.xss.process(externalAccountId)}"`);
+    }
+    catch (err) {
+      toastError(new Error(`Unable to remove "${this.xss.process(externalAccountId)}"`));
+    }
   }
 
   /**