Merge branch 'migration-footer' into 'develop'

LinkFooter, SidebarMenu: link to /settings/migration, not /settings/aliases

See merge request soapbox-pub/soapbox-fe!1042
This commit is contained in:
Alex Gleason 2022-02-19 03:34:45 +00:00
commit 4e441a5d0f
2 changed files with 10 additions and 16 deletions

View file

@ -40,6 +40,7 @@ const messages = defineMessages({
soapbox_config: { id: 'navigation_bar.soapbox_config', defaultMessage: 'Soapbox config' },
import_data: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' },
account_aliases: { id: 'navigation_bar.account_aliases', defaultMessage: 'Account aliases' },
account_migration: { id: 'navigation_bar.account_migration', defaultMessage: 'Move account' },
security: { id: 'navigation_bar.security', defaultMessage: 'Security' },
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
lists: { id: 'column.lists', defaultMessage: 'Lists' },
@ -318,9 +319,9 @@ class SidebarMenu extends ImmutablePureComponent {
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.import_data)}</span>
</a>
)}
{(features.federating && features.accountAliasesAPI) && <NavLink className='sidebar-menu-item' to='/settings/aliases' onClick={this.handleClose}>
{(features.federating && features.accountMoving) && <NavLink className='sidebar-menu-item' to='/settings/migration' onClick={this.handleClose}>
<Icon src={require('feather-icons/dist/icons/briefcase.svg')} />
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.account_aliases)}</span>
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.account_migration)}</span>
</NavLink>}
{features.securityAPI ? (
<NavLink className='sidebar-menu-item' to='/auth/edit' onClick={this.handleClose}>

View file

@ -16,14 +16,10 @@ const mapStateToProps = state => {
const me = state.get('me');
const account = state.getIn(['accounts', me]);
const instance = state.get('instance');
const features = getFeatures(instance);
return {
account,
profileDirectory: features.profileDirectory,
federating: features.federating,
showAliases: features.accountAliasesAPI,
importAPI: features.importAPI,
features: getFeatures(instance),
baseURL: getBaseURL(account),
};
};
@ -39,25 +35,25 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
},
});
const LinkFooter = ({ onOpenHotkeys, account, profileDirectory, federating, showAliases, importAPI, onClickLogOut, baseURL }) => (
const LinkFooter = ({ onOpenHotkeys, account, features, onClickLogOut, baseURL }) => (
<div className='getting-started__footer'>
<ul>
{account && <>
{profileDirectory && <li><Link to='/directory'><FormattedMessage id='navigation_bar.profile_directory' defaultMessage='Profile directory' /></Link></li>}
{features.profileDirectory && <li><Link to='/directory'><FormattedMessage id='navigation_bar.profile_directory' defaultMessage='Profile directory' /></Link></li>}
<li><Link to='/blocks'><FormattedMessage id='navigation_bar.blocks' defaultMessage='Blocks' /></Link></li>
<li><Link to='/mutes'><FormattedMessage id='navigation_bar.mutes' defaultMessage='Mutes' /></Link></li>
<li><Link to='/filters'><FormattedMessage id='navigation_bar.filters' defaultMessage='Filters' /></Link></li>
{federating && <li><Link to='/domain_blocks'><FormattedMessage id='navigation_bar.domain_blocks' defaultMessage='Domain blocks' /></Link></li>}
{features.federating && <li><Link to='/domain_blocks'><FormattedMessage id='navigation_bar.domain_blocks' defaultMessage='Domain blocks' /></Link></li>}
<li><Link to='/follow_requests'><FormattedMessage id='navigation_bar.follow_requests' defaultMessage='Follow requests' /></Link></li>
{isAdmin(account) && <li><a href='/pleroma/admin'><FormattedMessage id='navigation_bar.admin_settings' defaultMessage='AdminFE' /></a></li>}
{isAdmin(account) && <li><Link to='/soapbox/config'><FormattedMessage id='navigation_bar.soapbox_config' defaultMessage='Soapbox config' /></Link></li>}
<li><Link to='/settings/export'><FormattedMessage id='navigation_bar.export_data' defaultMessage='Export data' /></Link></li>
<li>{importAPI ? (
<li>{features.importAPI ? (
<Link to='/settings/import'><FormattedMessage id='navigation_bar.import_data' defaultMessage='Import data' /></Link>
) : (
<a href={`${baseURL}/settings/import`}><FormattedMessage id='navigation_bar.import_data' defaultMessage='Import data' /></a>
)}</li>
{(federating && showAliases) && <li><Link to='/settings/aliases'><FormattedMessage id='navigation_bar.account_aliases' defaultMessage='Account aliases' /></Link></li>}
{(features.federating && features.accountMoving) && <li><Link to='/settings/migration'><FormattedMessage id='navigation_bar.account_migration' defaultMessage='Move account' /></Link></li>}
<li><a href='#' onClick={onOpenHotkeys}><FormattedMessage id='navigation_bar.keyboard_shortcuts' defaultMessage='Hotkeys' /></a></li>
</>}
<li><Link to='/about'><FormattedMessage id='navigation_bar.info' defaultMessage='About this server' /></Link></li>
@ -80,10 +76,7 @@ const LinkFooter = ({ onOpenHotkeys, account, profileDirectory, federating, show
LinkFooter.propTypes = {
account: ImmutablePropTypes.map,
profileDirectory: PropTypes.bool,
federating: PropTypes.bool,
showAliases: PropTypes.bool,
importAPI: PropTypes.bool,
features: PropTypes.object.isRequired,
onOpenHotkeys: PropTypes.func.isRequired,
onClickLogOut: PropTypes.func.isRequired,
baseURL: PropTypes.string,