|
@@ -6,12 +6,16 @@ import {
|
|
|
ModalHeader,
|
|
ModalHeader,
|
|
|
ModalBody,
|
|
ModalBody,
|
|
|
ModalFooter,
|
|
ModalFooter,
|
|
|
|
|
+ Nav,
|
|
|
|
|
+ NavLink,
|
|
|
|
|
+ TabContent,
|
|
|
|
|
+ TabPane,
|
|
|
} from 'reactstrap';
|
|
} from 'reactstrap';
|
|
|
|
|
|
|
|
import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
|
import { usePersonalSettings, useSWRxPersonalExternalAccounts } from '~/stores/personal-settings';
|
|
import { usePersonalSettings, useSWRxPersonalExternalAccounts } from '~/stores/personal-settings';
|
|
|
|
|
|
|
|
-import LdapAuthTest from '../Admin/Security/LdapAuthTest';
|
|
|
|
|
|
|
+import { LdapAuthTest } from '../Admin/Security/LdapAuthTest';
|
|
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
|
isOpen: boolean,
|
|
isOpen: boolean,
|
|
@@ -22,6 +26,7 @@ const AssociateModal = (props: Props): JSX.Element => {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
const { mutate: mutatePersonalExternalAccounts } = useSWRxPersonalExternalAccounts();
|
|
const { mutate: mutatePersonalExternalAccounts } = useSWRxPersonalExternalAccounts();
|
|
|
const { associateLdapAccount } = usePersonalSettings();
|
|
const { associateLdapAccount } = usePersonalSettings();
|
|
|
|
|
+ const [activeTab, setActiveTab] = useState(1);
|
|
|
const { isOpen, onClose } = props;
|
|
const { isOpen, onClose } = props;
|
|
|
|
|
|
|
|
const [username, setUsername] = useState('');
|
|
const [username, setUsername] = useState('');
|
|
@@ -55,46 +60,61 @@ const AssociateModal = (props: Props): JSX.Element => {
|
|
|
{ t('admin:user_management.create_external_account') }
|
|
{ t('admin:user_management.create_external_account') }
|
|
|
</ModalHeader>
|
|
</ModalHeader>
|
|
|
<ModalBody>
|
|
<ModalBody>
|
|
|
- <ul className="nav nav-tabs passport-settings mb-2" role="tablist">
|
|
|
|
|
- <li className="nav-item active">
|
|
|
|
|
- <a href="#passport-ldap" className="nav-link active" data-toggle="tab" role="tab">
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <Nav tabs className='mb-2'>
|
|
|
|
|
+ <NavLink
|
|
|
|
|
+ className={activeTab === 1 ? 'active' : ''}
|
|
|
|
|
+ onClick={() => setActiveTab(1)}
|
|
|
|
|
+ >
|
|
|
<i className="fa fa-sitemap"></i> LDAP
|
|
<i className="fa fa-sitemap"></i> LDAP
|
|
|
- </a>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li className="nav-item">
|
|
|
|
|
- <a href="#github-tbd" className="nav-link" data-toggle="tab" role="tab">
|
|
|
|
|
|
|
+ </NavLink>
|
|
|
|
|
+ <NavLink
|
|
|
|
|
+ className={activeTab === 2 ? 'active' : ''}
|
|
|
|
|
+ onClick={() => setActiveTab(2)}
|
|
|
|
|
+ >
|
|
|
<i className="fa fa-github"></i> (TBD) GitHub
|
|
<i className="fa fa-github"></i> (TBD) GitHub
|
|
|
- </a>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li className="nav-item">
|
|
|
|
|
- <a href="#google-tbd" className="nav-link" data-toggle="tab" role="tab">
|
|
|
|
|
|
|
+ </NavLink>
|
|
|
|
|
+ <NavLink
|
|
|
|
|
+ className={activeTab === 3 ? 'active' : ''}
|
|
|
|
|
+ onClick={() => setActiveTab(3)}
|
|
|
|
|
+ >
|
|
|
<i className="fa fa-google"></i> (TBD) Google OAuth
|
|
<i className="fa fa-google"></i> (TBD) Google OAuth
|
|
|
- </a>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li className="nav-item">
|
|
|
|
|
- <a href="#facebook-tbd" className="nav-link" data-toggle="tab" role="tab">
|
|
|
|
|
|
|
+ </NavLink>
|
|
|
|
|
+ <NavLink
|
|
|
|
|
+ className={activeTab === 4 ? 'active' : ''}
|
|
|
|
|
+ onClick={() => setActiveTab(4)}
|
|
|
|
|
+ >
|
|
|
<i className="fa fa-facebook"></i> (TBD) Facebook
|
|
<i className="fa fa-facebook"></i> (TBD) Facebook
|
|
|
- </a>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li className="nav-item">
|
|
|
|
|
- <a href="#twitter-tbd" className="nav-link" data-toggle="tab" role="tab">
|
|
|
|
|
|
|
+ </NavLink>
|
|
|
|
|
+ <NavLink
|
|
|
|
|
+ className={activeTab === 5 ? 'active' : ''}
|
|
|
|
|
+ onClick={() => setActiveTab(5)}
|
|
|
|
|
+ >
|
|
|
<i className="fa fa-twitter"></i> (TBD) Twitter
|
|
<i className="fa fa-twitter"></i> (TBD) Twitter
|
|
|
- </a>
|
|
|
|
|
- </li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <div className="tab-content">
|
|
|
|
|
- <div id="passport-ldap" className="tab-pane active">
|
|
|
|
|
- <LdapAuthTest
|
|
|
|
|
- username={username}
|
|
|
|
|
- password={password}
|
|
|
|
|
- onChangeUsername={username => setUsername(username)}
|
|
|
|
|
- onChangePassword={password => setPassword(password)}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div id="github-tbd" className="tab-pane" role="tabpanel">TBD</div>
|
|
|
|
|
- <div id="google-tbd" className="tab-pane" role="tabpanel">TBD</div>
|
|
|
|
|
- <div id="facebook-tbd" className="tab-pane" role="tabpanel">TBD</div>
|
|
|
|
|
- <div id="twitter-tbd" className="tab-pane" role="tabpanel">TBD</div>
|
|
|
|
|
|
|
+ </NavLink>
|
|
|
|
|
+ </Nav>
|
|
|
|
|
+ <TabContent activeTab={activeTab}>
|
|
|
|
|
+ <TabPane tabId={1}>
|
|
|
|
|
+ <LdapAuthTest
|
|
|
|
|
+ username={username}
|
|
|
|
|
+ password={password}
|
|
|
|
|
+ onChangeUsername={username => setUsername(username)}
|
|
|
|
|
+ onChangePassword={password => setPassword(password)}
|
|
|
|
|
+ />
|
|
|
|
|
+ </TabPane>
|
|
|
|
|
+ <TabPane tabId={2}>
|
|
|
|
|
+ TBD
|
|
|
|
|
+ </TabPane>
|
|
|
|
|
+ <TabPane tabId={3}>
|
|
|
|
|
+ TBD
|
|
|
|
|
+ </TabPane>
|
|
|
|
|
+ <TabPane tabId={4}>
|
|
|
|
|
+ TBD
|
|
|
|
|
+ </TabPane>
|
|
|
|
|
+ <TabPane tabId={5}>
|
|
|
|
|
+ TBD
|
|
|
|
|
+ </TabPane>
|
|
|
|
|
+ </TabContent>
|
|
|
</div>
|
|
</div>
|
|
|
</ModalBody>
|
|
</ModalBody>
|
|
|
<ModalFooter className="border-top-0">
|
|
<ModalFooter className="border-top-0">
|