Merge branch 'next-routes' into 'next'
Next: routes See merge request soapbox-pub/soapbox-fe!1281
This commit is contained in:
commit
999d5bd9f4
|
@ -73,7 +73,7 @@ const SidebarNavigation = () => {
|
||||||
|
|
||||||
if (account.staff) {
|
if (account.staff) {
|
||||||
menu.push({
|
menu.push({
|
||||||
to: '/admin',
|
to: '/soapbox/admin',
|
||||||
icon: require('@tabler/icons/icons/dashboard.svg'),
|
icon: require('@tabler/icons/icons/dashboard.svg'),
|
||||||
text: <FormattedMessage id='tabs_bar.dashboard' defaultMessage='Dashboard' />,
|
text: <FormattedMessage id='tabs_bar.dashboard' defaultMessage='Dashboard' />,
|
||||||
count: dashboardCount,
|
count: dashboardCount,
|
||||||
|
@ -106,6 +106,32 @@ const SidebarNavigation = () => {
|
||||||
|
|
||||||
const menu = makeMenu();
|
const menu = makeMenu();
|
||||||
|
|
||||||
|
/** Conditionally render the supported messages link */
|
||||||
|
const renderMessagesLink = (): React.ReactNode => {
|
||||||
|
if (features.chats) {
|
||||||
|
return (
|
||||||
|
<SidebarNavigationLink
|
||||||
|
to='/chats'
|
||||||
|
icon={require('@tabler/icons/icons/messages.svg')}
|
||||||
|
count={chatsCount}
|
||||||
|
text={<FormattedMessage id='tabs_bar.chats' defaultMessage='Chats' />}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (features.directTimeline || features.conversations) {
|
||||||
|
return (
|
||||||
|
<SidebarNavigationLink
|
||||||
|
to='/messages'
|
||||||
|
icon={require('icons/mail.svg')}
|
||||||
|
text={<FormattedMessage id='navigation.direct_messages' defaultMessage='Messages' />}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className='flex flex-col space-y-2'>
|
<div className='flex flex-col space-y-2'>
|
||||||
|
@ -138,22 +164,7 @@ const SidebarNavigation = () => {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{account && (
|
{account && renderMessagesLink()}
|
||||||
features.chats ? (
|
|
||||||
<SidebarNavigationLink
|
|
||||||
to='/chats'
|
|
||||||
icon={require('@tabler/icons/icons/messages.svg')}
|
|
||||||
count={chatsCount}
|
|
||||||
text={<FormattedMessage id='tabs_bar.chats' defaultMessage='Chats' />}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<SidebarNavigationLink
|
|
||||||
to='/messages'
|
|
||||||
icon={require('icons/mail.svg')}
|
|
||||||
text={<FormattedMessage id='navigation.direct_messages' defaultMessage='Messages' />}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
|
|
||||||
{menu.length > 0 && (
|
{menu.length > 0 && (
|
||||||
<DropdownMenu items={menu}>
|
<DropdownMenu items={menu}>
|
||||||
|
|
|
@ -12,6 +12,34 @@ const ThumbNavigation: React.FC = (): JSX.Element => {
|
||||||
const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count());
|
const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count());
|
||||||
const features = getFeatures(useAppSelector((state) => state.instance));
|
const features = getFeatures(useAppSelector((state) => state.instance));
|
||||||
|
|
||||||
|
/** Conditionally render the supported messages link */
|
||||||
|
const renderMessagesLink = (): React.ReactNode => {
|
||||||
|
if (features.chats) {
|
||||||
|
return (
|
||||||
|
<ThumbNavigationLink
|
||||||
|
src={require('@tabler/icons/icons/messages.svg')}
|
||||||
|
text={<FormattedMessage id='navigation.chats' defaultMessage='Chats' />}
|
||||||
|
to='/chats'
|
||||||
|
exact
|
||||||
|
count={chatsCount}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (features.directTimeline || features.conversations) {
|
||||||
|
return (
|
||||||
|
<ThumbNavigationLink
|
||||||
|
src={require('@tabler/icons/icons/mail.svg')}
|
||||||
|
text={<FormattedMessage id='navigation.direct_messages' defaultMessage='Messages' />}
|
||||||
|
to='/messages'
|
||||||
|
paths={['/messages', '/conversations']}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='thumb-navigation'>
|
<div className='thumb-navigation'>
|
||||||
<ThumbNavigationLink
|
<ThumbNavigationLink
|
||||||
|
@ -38,30 +66,13 @@ const ThumbNavigation: React.FC = (): JSX.Element => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{account && (
|
{account && renderMessagesLink()}
|
||||||
features.chats ? (
|
|
||||||
<ThumbNavigationLink
|
|
||||||
src={require('@tabler/icons/icons/messages.svg')}
|
|
||||||
text={<FormattedMessage id='navigation.chats' defaultMessage='Chats' />}
|
|
||||||
to='/chats'
|
|
||||||
exact
|
|
||||||
count={chatsCount}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<ThumbNavigationLink
|
|
||||||
src={require('@tabler/icons/icons/mail.svg')}
|
|
||||||
text={<FormattedMessage id='navigation.direct_messages' defaultMessage='Messages' />}
|
|
||||||
to='/messages'
|
|
||||||
paths={['/messages', '/conversations']}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
|
|
||||||
{(account && account.staff) && (
|
{(account && account.staff) && (
|
||||||
<ThumbNavigationLink
|
<ThumbNavigationLink
|
||||||
src={require('@tabler/icons/icons/dashboard.svg')}
|
src={require('@tabler/icons/icons/dashboard.svg')}
|
||||||
text={<FormattedMessage id='navigation.dashboard' defaultMessage='Dashboard' />}
|
text={<FormattedMessage id='navigation.dashboard' defaultMessage='Dashboard' />}
|
||||||
to='/admin'
|
to='/soapbox/admin'
|
||||||
count={dashboardCount}
|
count={dashboardCount}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import PublicLayout from 'soapbox/features/public_layout';
|
||||||
import NotificationsContainer from 'soapbox/features/ui/containers/notifications_container';
|
import NotificationsContainer from 'soapbox/features/ui/containers/notifications_container';
|
||||||
import WaitlistPage from 'soapbox/features/verification/waitlist_page';
|
import WaitlistPage from 'soapbox/features/verification/waitlist_page';
|
||||||
import { createGlobals } from 'soapbox/globals';
|
import { createGlobals } from 'soapbox/globals';
|
||||||
import { useAppSelector, useAppDispatch, useOwnAccount, useSoapboxConfig, useSettings } from 'soapbox/hooks';
|
import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures, useSoapboxConfig, useSettings } from 'soapbox/hooks';
|
||||||
import MESSAGES from 'soapbox/locales/messages';
|
import MESSAGES from 'soapbox/locales/messages';
|
||||||
import { getFeatures } from 'soapbox/utils/features';
|
import { getFeatures } from 'soapbox/utils/features';
|
||||||
import { generateThemeCss } from 'soapbox/utils/theme';
|
import { generateThemeCss } from 'soapbox/utils/theme';
|
||||||
|
@ -68,9 +68,11 @@ const SoapboxMount = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const me = useAppSelector(state => state.me);
|
const me = useAppSelector(state => state.me);
|
||||||
|
const instance = useAppSelector(state => state.instance);
|
||||||
const account = useOwnAccount();
|
const account = useOwnAccount();
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
const soapboxConfig = useSoapboxConfig();
|
const soapboxConfig = useSoapboxConfig();
|
||||||
|
const features = useFeatures();
|
||||||
|
|
||||||
const locale = validLocale(settings.get('locale')) ? settings.get('locale') : 'en';
|
const locale = validLocale(settings.get('locale')) ? settings.get('locale') : 'en';
|
||||||
|
|
||||||
|
@ -157,7 +159,7 @@ const SoapboxMount = () => {
|
||||||
<>
|
<>
|
||||||
<ScrollContext shouldUpdateScroll={shouldUpdateScroll}>
|
<ScrollContext shouldUpdateScroll={shouldUpdateScroll}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Redirect from='/v1/verify_email/:token' to='/auth/verify/email/:token' />
|
<Redirect from='/v1/verify_email/:token' to='/verify/email/:token' />
|
||||||
|
|
||||||
{waitlisted && <Route render={(props) => <WaitlistPage {...props} account={account} />} />}
|
{waitlisted && <Route render={(props) => <WaitlistPage {...props} account={account} />} />}
|
||||||
|
|
||||||
|
@ -170,7 +172,10 @@ const SoapboxMount = () => {
|
||||||
<Route exact path='/beta/:slug?' component={PublicLayout} />
|
<Route exact path='/beta/:slug?' component={PublicLayout} />
|
||||||
<Route exact path='/mobile/:slug?' component={PublicLayout} />
|
<Route exact path='/mobile/:slug?' component={PublicLayout} />
|
||||||
<Route exact path='/login' component={AuthLayout} />
|
<Route exact path='/login' component={AuthLayout} />
|
||||||
<Route path='/auth/verify' component={AuthLayout} />
|
{(features.accountCreation && instance.registrations) && (
|
||||||
|
<Route exact path='/signup' component={AuthLayout} />
|
||||||
|
)}
|
||||||
|
<Route path='/verify' component={AuthLayout} />
|
||||||
<Route path='/reset-password' component={AuthLayout} />
|
<Route path='/reset-password' component={AuthLayout} />
|
||||||
<Route path='/edit-password' component={AuthLayout} />
|
<Route path='/edit-password' component={AuthLayout} />
|
||||||
|
|
||||||
|
|
|
@ -19,18 +19,18 @@ const AdminTabs: React.FC = () => {
|
||||||
const reportsCount = useAppSelector(state => state.admin.openReports.count());
|
const reportsCount = useAppSelector(state => state.admin.openReports.count());
|
||||||
|
|
||||||
const tabs = [{
|
const tabs = [{
|
||||||
name: '/admin',
|
name: '/soapbox/admin',
|
||||||
text: intl.formatMessage(messages.dashboard),
|
text: intl.formatMessage(messages.dashboard),
|
||||||
to: '/admin',
|
to: '/soapbox/admin',
|
||||||
}, {
|
}, {
|
||||||
name: '/admin/reports',
|
name: '/soapbox/admin/reports',
|
||||||
text: intl.formatMessage(messages.reports),
|
text: intl.formatMessage(messages.reports),
|
||||||
to: '/admin/reports',
|
to: '/soapbox/admin/reports',
|
||||||
count: reportsCount,
|
count: reportsCount,
|
||||||
}, {
|
}, {
|
||||||
name: '/admin/approval',
|
name: '/soapbox/admin/approval',
|
||||||
text: intl.formatMessage(messages.waitlist),
|
text: intl.formatMessage(messages.waitlist),
|
||||||
to: '/admin/approval',
|
to: '/soapbox/admin/approval',
|
||||||
count: approvalCount,
|
count: approvalCount,
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ const LatestAccountsPanel: React.FC<ILatestAccountsPanel> = ({ limit = 5 }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAction = () => {
|
const handleAction = () => {
|
||||||
history.push('/admin/users');
|
history.push('/soapbox/admin/users');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -26,9 +26,9 @@ const Admin: React.FC = () => {
|
||||||
<AdminTabs />
|
<AdminTabs />
|
||||||
|
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path='/admin' exact component={Dashboard} />
|
<Route path='/soapbox/admin' exact component={Dashboard} />
|
||||||
<Route path='/admin/reports' exact component={Reports} />
|
<Route path='/soapbox/admin/reports' exact component={Reports} />
|
||||||
<Route path='/admin/approval' exact component={Waitlist} />
|
<Route path='/soapbox/admin/approval' exact component={Waitlist} />
|
||||||
</Switch>
|
</Switch>
|
||||||
</Column>
|
</Column>
|
||||||
);
|
);
|
||||||
|
|
|
@ -77,7 +77,7 @@ const Dashboard: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{isNumber(userCount) && (
|
{isNumber(userCount) && (
|
||||||
<Link className='dashcounter' to='/admin/users'>
|
<Link className='dashcounter' to='/soapbox/admin/users'>
|
||||||
<Text align='center' size='2xl' weight='medium'>
|
<Text align='center' size='2xl' weight='medium'>
|
||||||
<FormattedNumber value={userCount} />
|
<FormattedNumber value={userCount} />
|
||||||
</Text>
|
</Text>
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { Card, CardBody } from '../../components/ui';
|
||||||
import LoginPage from '../auth_login/components/login_page';
|
import LoginPage from '../auth_login/components/login_page';
|
||||||
import PasswordReset from '../auth_login/components/password_reset';
|
import PasswordReset from '../auth_login/components/password_reset';
|
||||||
import PasswordResetConfirm from '../auth_login/components/password_reset_confirm';
|
import PasswordResetConfirm from '../auth_login/components/password_reset_confirm';
|
||||||
// import EmailConfirmation from '../email_confirmation';
|
import RegistrationForm from '../auth_login/components/registration_form';
|
||||||
import Verification from '../verification';
|
import Verification from '../verification';
|
||||||
import EmailPassthru from '../verification/email_passthru';
|
import EmailPassthru from '../verification/email_passthru';
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@ const AuthLayout = () => {
|
||||||
<Card variant='rounded' size='xl'>
|
<Card variant='rounded' size='xl'>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path='/auth/verify' component={Verification} />
|
<Route exact path='/verify' component={Verification} />
|
||||||
<Route exact path='/auth/verify/email/:token' component={EmailPassthru} />
|
<Route exact path='/verify/email/:token' component={EmailPassthru} />
|
||||||
<Route exact path='/login' component={LoginPage} />
|
<Route exact path='/login' component={LoginPage} />
|
||||||
|
<Route exact path='/signup' component={RegistrationForm} />
|
||||||
<Route exact path='/reset-password' component={PasswordReset} />
|
<Route exact path='/reset-password' component={PasswordReset} />
|
||||||
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
<Route exact path='/edit-password' component={PasswordResetConfirm} />
|
||||||
{/* <Route exact path='/auth/confirmation' component={EmailConfirmation} /> */}
|
|
||||||
|
|
||||||
<Redirect from='/auth/password/new' to='/reset-password' />
|
<Redirect from='/auth/password/new' to='/reset-password' />
|
||||||
<Redirect from='/auth/password/edit' to='/edit-password' />
|
<Redirect from='/auth/password/edit' to='/edit-password' />
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { directComposeById } from 'soapbox/actions/compose';
|
import { directComposeById } from 'soapbox/actions/compose';
|
||||||
|
import AccountSearch from 'soapbox/components/account_search';
|
||||||
|
|
||||||
import { mountConversations, unmountConversations, expandConversations } from '../../actions/conversations';
|
import { mountConversations, unmountConversations, expandConversations } from '../../actions/conversations';
|
||||||
import { connectDirectStream } from '../../actions/streaming';
|
import { connectDirectStream } from '../../actions/streaming';
|
||||||
import { Card, CardBody, Column, Stack, Text } from '../../components/ui';
|
import { Column } from '../../components/ui';
|
||||||
|
|
||||||
|
import ConversationsListContainer from './containers/conversations_list_container';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
title: { id: 'column.direct', defaultMessage: 'Direct messages' },
|
title: { id: 'column.direct', defaultMessage: 'Direct messages' },
|
||||||
searchPlaceholder: { id: 'direct.search_placeholder', defaultMessage: 'Send a message to…' },
|
searchPlaceholder: { id: 'direct.search_placeholder', defaultMessage: 'Send a message to…' },
|
||||||
body: { id: 'direct.body', defaultMessage: 'A new direct messaging experience will be available soon. Please stay tuned.' },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default @connect()
|
export default @connect()
|
||||||
|
@ -54,35 +56,20 @@ class ConversationsTimeline extends React.PureComponent {
|
||||||
const { intl } = this.props;
|
const { intl } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column label={intl.formatMessage(messages.title)} transparent>
|
<Column label={intl.formatMessage(messages.title)}>
|
||||||
<Card variant='rounded'>
|
<AccountSearch
|
||||||
<CardBody>
|
placeholder={intl.formatMessage(messages.searchPlaceholder)}
|
||||||
<Stack space={2}>
|
onSelected={this.handleSuggestion}
|
||||||
<Text size='lg' align='center' weight='bold'>{intl.formatMessage(messages.title)}</Text>
|
/>
|
||||||
<Text theme='muted' align='center'>{intl.formatMessage(messages.body)}</Text>
|
|
||||||
</Stack>
|
<ConversationsListContainer
|
||||||
</CardBody>
|
scrollKey='direct_timeline'
|
||||||
</Card>
|
timelineId='direct'
|
||||||
|
onLoadMore={this.handleLoadMore}
|
||||||
|
emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any direct messages yet. When you send or receive one, it will show up here." />}
|
||||||
|
/>
|
||||||
</Column>
|
</Column>
|
||||||
);
|
);
|
||||||
|
|
||||||
// return (
|
|
||||||
// <Column label={intl.formatMessage(messages.title)}>
|
|
||||||
// <ColumnHeader icon='envelope' active={hasUnread} title={intl.formatMessage(messages.title)} />
|
|
||||||
|
|
||||||
// <AccountSearch
|
|
||||||
// placeholder={intl.formatMessage(messages.searchPlaceholder)}
|
|
||||||
// onSelected={this.handleSuggestion}
|
|
||||||
// />
|
|
||||||
|
|
||||||
// <ConversationsListContainer
|
|
||||||
// scrollKey='direct_timeline'
|
|
||||||
// timelineId='direct'
|
|
||||||
// onLoadMore={this.handleLoadMore}
|
|
||||||
// emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any direct messages yet. When you send or receive one, it will show up here." />}
|
|
||||||
// />
|
|
||||||
// </Column>
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ const LandingPage = () => {
|
||||||
<Text theme='muted' align='center'>Social Media Without Discrimination</Text>
|
<Text theme='muted' align='center'>Social Media Without Discrimination</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Button to='/auth/verify' theme='primary' block>Create an account</Button>
|
<Button to='/verify' theme='primary' block>Create an account</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -96,7 +96,7 @@ const Header = () => {
|
||||||
|
|
||||||
{(isOpen || features.pepe && pepeOpen) && (
|
{(isOpen || features.pepe && pepeOpen) && (
|
||||||
<Button
|
<Button
|
||||||
to={features.pepe ? '/auth/verify' : '/signup'} // FIXME: actually route this somewhere
|
to={features.pepe ? '/verify' : '/signup'}
|
||||||
theme='primary'
|
theme='primary'
|
||||||
>
|
>
|
||||||
{intl.formatMessage(messages.register)}
|
{intl.formatMessage(messages.register)}
|
||||||
|
|
|
@ -39,7 +39,7 @@ const LandingPageModal = ({ onClose }) => {
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<Button to='/auth/verify' theme='primary' block>
|
<Button to='/verify' theme='primary' block>
|
||||||
{intl.formatMessage(messages.register)}
|
{intl.formatMessage(messages.register)}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -187,8 +187,12 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
|
||||||
{features.federating && <WrappedRoute path='/timeline/fediverse' exact page={HomePage} component={PublicTimeline} content={children} publicRoute />}
|
{features.federating && <WrappedRoute path='/timeline/fediverse' exact page={HomePage} component={PublicTimeline} content={children} publicRoute />}
|
||||||
{features.federating && <WrappedRoute path='/timeline/:instance' exact page={RemoteInstancePage} component={RemoteTimeline} content={children} />}
|
{features.federating && <WrappedRoute path='/timeline/:instance' exact page={RemoteInstancePage} component={RemoteTimeline} content={children} />}
|
||||||
|
|
||||||
<WrappedRoute path='/conversations' page={DefaultPage} component={Conversations} content={children} />
|
{features.conversations && <WrappedRoute path='/conversations' page={DefaultPage} component={Conversations} content={children} />}
|
||||||
<WrappedRoute path='/messages' page={DefaultPage} component={features.directTimeline ? DirectTimeline : Conversations} content={children} />
|
{features.directTimeline ? (
|
||||||
|
<WrappedRoute path='/messages' page={DefaultPage} component={DirectTimeline} content={children} />
|
||||||
|
) : (
|
||||||
|
<WrappedRoute path='/messages' page={DefaultPage} component={Conversations} content={children} />
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Gab groups */}
|
{/* Gab groups */}
|
||||||
{/*
|
{/*
|
||||||
|
@ -227,7 +231,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
|
||||||
<Redirect from='/home' to='/' />
|
<Redirect from='/home' to='/' />
|
||||||
|
|
||||||
{/* Mastodon rendered pages */}
|
{/* Mastodon rendered pages */}
|
||||||
<Redirect from='/admin/dashboard' to='/admin' exact />
|
<Redirect from='/admin' to='/soapbox/admin' />
|
||||||
<Redirect from='/terms' to='/about' />
|
<Redirect from='/terms' to='/about' />
|
||||||
<Redirect from='/settings/preferences' to='/settings' />
|
<Redirect from='/settings/preferences' to='/settings' />
|
||||||
<Redirect from='/settings/two_factor_authentication_methods' to='/settings/mfa' />
|
<Redirect from='/settings/two_factor_authentication_methods' to='/settings/mfa' />
|
||||||
|
@ -286,7 +290,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
|
||||||
<WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} />
|
<WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} />
|
||||||
{features.scheduledStatuses && <WrappedRoute path='/scheduled_statuses' page={DefaultPage} component={ScheduledStatuses} content={children} />}
|
{features.scheduledStatuses && <WrappedRoute path='/scheduled_statuses' page={DefaultPage} component={ScheduledStatuses} content={children} />}
|
||||||
|
|
||||||
<WrappedRoute path='/invite/:token' component={RegisterInvite} content={children} publicRoute />
|
<WrappedRoute path='/invite/:token' page={DefaultPage} component={RegisterInvite} content={children} publicRoute />
|
||||||
|
|
||||||
<WrappedRoute path='/settings/profile' page={DefaultPage} component={EditProfile} content={children} />
|
<WrappedRoute path='/settings/profile' page={DefaultPage} component={EditProfile} content={children} />
|
||||||
<WrappedRoute path='/settings/export' page={DefaultPage} component={ExportData} content={children} />
|
<WrappedRoute path='/settings/export' page={DefaultPage} component={ExportData} content={children} />
|
||||||
|
@ -302,11 +306,11 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
|
||||||
{/* <WrappedRoute path='/backups' page={DefaultPage} component={Backups} content={children} /> */}
|
{/* <WrappedRoute path='/backups' page={DefaultPage} component={Backups} content={children} /> */}
|
||||||
<WrappedRoute path='/soapbox/config' adminOnly page={DefaultPage} component={SoapboxConfig} content={children} />
|
<WrappedRoute path='/soapbox/config' adminOnly page={DefaultPage} component={SoapboxConfig} content={children} />
|
||||||
|
|
||||||
<WrappedRoute path='/admin' staffOnly page={AdminPage} component={Dashboard} content={children} exact />
|
<WrappedRoute path='/soapbox/admin' staffOnly page={AdminPage} component={Dashboard} content={children} exact />
|
||||||
<WrappedRoute path='/admin/approval' staffOnly page={AdminPage} component={Dashboard} content={children} exact />
|
<WrappedRoute path='/soapbox/admin/approval' staffOnly page={AdminPage} component={Dashboard} content={children} exact />
|
||||||
<WrappedRoute path='/admin/reports' staffOnly page={AdminPage} component={Dashboard} content={children} exact />
|
<WrappedRoute path='/soapbox/admin/reports' staffOnly page={AdminPage} component={Dashboard} content={children} exact />
|
||||||
<WrappedRoute path='/admin/log' staffOnly page={AdminPage} component={ModerationLog} content={children} exact />
|
<WrappedRoute path='/soapbox/admin/log' staffOnly page={AdminPage} component={ModerationLog} content={children} exact />
|
||||||
<WrappedRoute path='/admin/users' staffOnly page={AdminPage} component={UserIndex} content={children} exact />
|
<WrappedRoute path='/soapbox/admin/users' staffOnly page={AdminPage} component={UserIndex} content={children} exact />
|
||||||
<WrappedRoute path='/info' page={EmptyPage} component={ServerInfo} content={children} />
|
<WrappedRoute path='/info' page={EmptyPage} component={ServerInfo} content={children} />
|
||||||
|
|
||||||
<WrappedRoute path='/developers/apps/create' developerOnly page={DefaultPage} component={CreateApp} content={children} />
|
<WrappedRoute path='/developers/apps/create' developerOnly page={DefaultPage} component={CreateApp} content={children} />
|
||||||
|
|
|
@ -9,7 +9,7 @@ import Verification from '../index';
|
||||||
|
|
||||||
const TestableComponent = () => (
|
const TestableComponent = () => (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path='/auth/verify' exact><Verification /></Route>
|
<Route path='/verify' exact><Verification /></Route>
|
||||||
<Route path='/' exact><span data-testid='home'>Homepage</span></Route>
|
<Route path='/' exact><span data-testid='home'>Homepage</span></Route>
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
|
@ -18,7 +18,7 @@ const renderComponent = (store) => render(
|
||||||
<TestableComponent />,
|
<TestableComponent />,
|
||||||
{},
|
{},
|
||||||
store,
|
store,
|
||||||
{ initialEntries: ['/auth/verify'] },
|
{ initialEntries: ['/verify'] },
|
||||||
);
|
);
|
||||||
|
|
||||||
describe('<Verification />', () => {
|
describe('<Verification />', () => {
|
||||||
|
|
|
@ -71,6 +71,15 @@ const getInstanceFeatures = (instance: Instance) => {
|
||||||
*/
|
*/
|
||||||
accountByUsername: v.software === PLEROMA,
|
accountByUsername: v.software === PLEROMA,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ability to create accounts.
|
||||||
|
* @see POST /api/v1/accounts
|
||||||
|
*/
|
||||||
|
accountCreation: any([
|
||||||
|
v.software === MASTODON,
|
||||||
|
v.software === PLEROMA,
|
||||||
|
]),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ability to pin other accounts on one's profile.
|
* Ability to pin other accounts on one's profile.
|
||||||
* @see POST /api/v1/accounts/:id/pin
|
* @see POST /api/v1/accounts/:id/pin
|
||||||
|
|
Loading…
Reference in New Issue