2017-11-27 02:09:55 +00:00
|
|
|
// @flow
|
2018-05-05 23:16:08 +00:00
|
|
|
import * as React from 'react';
|
2017-11-27 02:09:55 +00:00
|
|
|
import { observer, inject } from 'mobx-react';
|
2019-08-09 06:09:09 +00:00
|
|
|
import type { RouterHistory } from 'react-router-dom';
|
2018-05-23 06:01:49 +00:00
|
|
|
import {
|
2018-06-21 04:33:21 +00:00
|
|
|
DocumentIcon,
|
2018-12-05 06:24:30 +00:00
|
|
|
EmailIcon,
|
2018-05-23 06:01:49 +00:00
|
|
|
ProfileIcon,
|
2018-08-19 23:06:39 +00:00
|
|
|
PadlockIcon,
|
2018-05-23 06:01:49 +00:00
|
|
|
CodeIcon,
|
|
|
|
UserIcon,
|
|
|
|
LinkIcon,
|
2018-06-01 22:00:48 +00:00
|
|
|
TeamIcon,
|
2019-08-06 03:38:31 +00:00
|
|
|
BulletedListIcon,
|
2018-05-23 06:01:49 +00:00
|
|
|
} from 'outline-icons';
|
2018-10-01 00:56:20 +00:00
|
|
|
import ZapierIcon from './icons/Zapier';
|
|
|
|
import SlackIcon from './icons/Slack';
|
2017-11-27 02:09:55 +00:00
|
|
|
|
2018-05-03 04:51:39 +00:00
|
|
|
import Flex from 'shared/components/Flex';
|
2019-01-07 00:12:07 +00:00
|
|
|
import Sidebar from './Sidebar';
|
2017-11-27 02:09:55 +00:00
|
|
|
import Scrollable from 'components/Scrollable';
|
2019-01-07 00:12:07 +00:00
|
|
|
import Section from './components/Section';
|
2017-11-27 02:09:55 +00:00
|
|
|
import Header from './components/Header';
|
|
|
|
import SidebarLink from './components/SidebarLink';
|
|
|
|
import HeaderBlock from './components/HeaderBlock';
|
|
|
|
import AuthStore from 'stores/AuthStore';
|
|
|
|
|
|
|
|
type Props = {
|
2019-08-09 06:09:09 +00:00
|
|
|
history: RouterHistory,
|
2017-11-27 02:09:55 +00:00
|
|
|
auth: AuthStore,
|
|
|
|
};
|
|
|
|
|
|
|
|
@observer
|
2018-05-05 23:16:08 +00:00
|
|
|
class SettingsSidebar extends React.Component<Props> {
|
2017-11-27 02:09:55 +00:00
|
|
|
returnToDashboard = () => {
|
|
|
|
this.props.history.push('/');
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2018-05-31 19:52:03 +00:00
|
|
|
const { team, user } = this.props.auth;
|
2018-12-05 06:24:30 +00:00
|
|
|
if (!team || !user) return null;
|
2017-11-27 02:09:55 +00:00
|
|
|
|
|
|
|
return (
|
2018-02-11 07:24:12 +00:00
|
|
|
<Sidebar>
|
2017-11-27 02:09:55 +00:00
|
|
|
<HeaderBlock
|
2018-05-21 03:21:39 +00:00
|
|
|
subheading="◄ Return to App"
|
2017-11-27 02:09:55 +00:00
|
|
|
teamName={team.name}
|
|
|
|
logoUrl={team.avatarUrl}
|
|
|
|
onClick={this.returnToDashboard}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Flex auto column>
|
2018-05-06 19:46:52 +00:00
|
|
|
<Scrollable shadow>
|
2017-11-27 02:09:55 +00:00
|
|
|
<Section>
|
|
|
|
<Header>Account</Header>
|
2019-01-07 00:12:07 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings"
|
|
|
|
icon={<ProfileIcon />}
|
|
|
|
label="Profile"
|
|
|
|
/>
|
|
|
|
<SidebarLink
|
|
|
|
to="/settings/notifications"
|
|
|
|
icon={<EmailIcon />}
|
|
|
|
label="Notifications"
|
|
|
|
/>
|
|
|
|
<SidebarLink
|
|
|
|
to="/settings/tokens"
|
|
|
|
icon={<CodeIcon />}
|
|
|
|
label="API Tokens"
|
|
|
|
/>
|
2017-11-27 02:09:55 +00:00
|
|
|
</Section>
|
|
|
|
<Section>
|
|
|
|
<Header>Team</Header>
|
2018-05-31 19:52:03 +00:00
|
|
|
{user.isAdmin && (
|
2019-01-07 00:12:07 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/details"
|
|
|
|
icon={<TeamIcon />}
|
|
|
|
label="Details"
|
|
|
|
/>
|
2018-05-31 19:52:03 +00:00
|
|
|
)}
|
2018-08-19 23:06:39 +00:00
|
|
|
{user.isAdmin && (
|
2019-01-07 00:12:07 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/security"
|
|
|
|
icon={<PadlockIcon />}
|
|
|
|
label="Security"
|
|
|
|
/>
|
2018-08-19 23:06:39 +00:00
|
|
|
)}
|
2018-11-18 02:43:46 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/people"
|
|
|
|
icon={<UserIcon />}
|
|
|
|
exact={false}
|
2019-01-07 00:12:07 +00:00
|
|
|
label="People"
|
|
|
|
/>
|
|
|
|
<SidebarLink
|
|
|
|
to="/settings/shares"
|
|
|
|
icon={<LinkIcon />}
|
|
|
|
label="Share Links"
|
|
|
|
/>
|
2019-08-06 03:38:31 +00:00
|
|
|
{user.isAdmin && (
|
|
|
|
<SidebarLink
|
|
|
|
to="/settings/events"
|
|
|
|
icon={<BulletedListIcon />}
|
|
|
|
label="Audit Log"
|
|
|
|
/>
|
|
|
|
)}
|
2018-06-21 04:33:21 +00:00
|
|
|
{user.isAdmin && (
|
2019-01-07 00:12:07 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/export"
|
|
|
|
icon={<DocumentIcon />}
|
|
|
|
label="Export Data"
|
|
|
|
/>
|
2018-06-21 04:33:21 +00:00
|
|
|
)}
|
2017-11-27 02:09:55 +00:00
|
|
|
</Section>
|
2018-09-30 15:51:14 +00:00
|
|
|
{user.isAdmin && (
|
|
|
|
<Section>
|
|
|
|
<Header>Integrations</Header>
|
2018-10-01 00:56:20 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/integrations/slack"
|
|
|
|
icon={<SlackIcon />}
|
2019-01-07 00:12:07 +00:00
|
|
|
label="Slack"
|
|
|
|
/>
|
2018-10-01 00:56:20 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/integrations/zapier"
|
|
|
|
icon={<ZapierIcon />}
|
2019-01-07 00:12:07 +00:00
|
|
|
label="Zapier"
|
|
|
|
/>
|
2018-09-30 15:51:14 +00:00
|
|
|
</Section>
|
|
|
|
)}
|
2017-11-27 02:09:55 +00:00
|
|
|
</Scrollable>
|
|
|
|
</Flex>
|
2018-02-11 07:24:12 +00:00
|
|
|
</Sidebar>
|
2017-11-27 02:09:55 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-11 07:24:12 +00:00
|
|
|
export default inject('auth')(SettingsSidebar);
|