ImportData: rename some stuff
This commit is contained in:
parent
ba6f6b2aa4
commit
2d29d69f50
6 changed files with 19 additions and 24 deletions
|
@ -11,7 +11,7 @@ export function importFollows(params) {
|
|||
return api(getState)
|
||||
.post('/api/pleroma/follow_import', params)
|
||||
.then(response => {
|
||||
dispatch(showAlert('', 'Successful import'));
|
||||
dispatch(showAlert('', 'Followers imported successfully'));
|
||||
dispatch({ type: IMPORT_FOLLOWS_SUCCESS, config: response.data });
|
||||
}).catch(error => {
|
||||
dispatch({ type: IMPORT_FOLLOWS_FAIL, error });
|
|
@ -29,7 +29,7 @@ const messages = defineMessages({
|
|||
filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },
|
||||
admin_settings: { id: 'navigation_bar.admin_settings', defaultMessage: 'Admin settings' },
|
||||
soapbox_config: { id: 'navigation_bar.soapbox_config', defaultMessage: 'Soapbox config' },
|
||||
import_follows: { id: 'navigation_bar.import_follows', defaultMessage: 'Import follows' },
|
||||
import_data: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' },
|
||||
security: { id: 'navigation_bar.security', defaultMessage: 'Security' },
|
||||
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
|
||||
lists: { id: 'column.lists', defaultMessage: 'Lists' },
|
||||
|
@ -181,14 +181,14 @@ class SidebarMenu extends ImmutablePureComponent {
|
|||
<Icon id='cog' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.preferences)}</span>
|
||||
</NavLink>
|
||||
<NavLink className='sidebar-menu-item' to='/settings/import' onClick={onClose}>
|
||||
<Icon id='cloud-upload' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.import_data)}</span>
|
||||
</NavLink>
|
||||
<NavLink className='sidebar-menu-item' to='/auth/edit' onClick={onClose}>
|
||||
<Icon id='lock' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.security)}</span>
|
||||
</NavLink>
|
||||
<NavLink className='sidebar-menu-item' to='/settings/import' onClick={onClose}>
|
||||
<Icon id='community' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.import_follows)}</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div className='sidebar-menu__section'>
|
||||
|
|
|
@ -20,7 +20,7 @@ const messages = defineMessages({
|
|||
filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },
|
||||
admin_settings: { id: 'navigation_bar.admin_settings', defaultMessage: 'Admin settings' },
|
||||
soapbox_config: { id: 'navigation_bar.soapbox_config', defaultMessage: 'Soapbox config' },
|
||||
import_follows: { id: 'navigation_bar.import_follows', defaultMessage: 'Import follows' },
|
||||
import_data: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' },
|
||||
security: { id: 'navigation_bar.security', defaultMessage: 'Security' },
|
||||
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
|
||||
keyboard_shortcuts: { id: 'navigation_bar.keyboard_shortcuts', defaultMessage: 'Hotkeys' },
|
||||
|
@ -85,8 +85,8 @@ class ActionBar extends React.PureComponent {
|
|||
menu.push({ text: intl.formatMessage(messages.soapbox_config), to: '/soapbox/config' });
|
||||
}
|
||||
menu.push({ text: intl.formatMessage(messages.preferences), to: '/settings/preferences' });
|
||||
menu.push({ text: intl.formatMessage(messages.import_data), to: '/settings/import' });
|
||||
menu.push({ text: intl.formatMessage(messages.security), to: '/auth/edit' });
|
||||
menu.push({ text: intl.formatMessage(messages.import_follows), to: '/settings/import' });
|
||||
menu.push({ text: intl.formatMessage(messages.logout), to: '/auth/sign_out', action: onClickLogOut });
|
||||
|
||||
return (
|
||||
|
|
|
@ -9,19 +9,14 @@ import {
|
|||
FieldsGroup,
|
||||
FileChooserCSV,
|
||||
} from 'soapbox/features/forms';
|
||||
import { importFollows } from 'soapbox/actions/import_follows';
|
||||
import { importFollows } from 'soapbox/actions/import_data';
|
||||
|
||||
const messages = defineMessages({
|
||||
heading: { id: 'column.import_follows', defaultMessage: 'Import follows' },
|
||||
heading: { id: 'column.import_data', defaultMessage: 'Import data' },
|
||||
});
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
follows: state.get('follows'),
|
||||
});
|
||||
|
||||
export default @connect(mapStateToProps)
|
||||
@injectIntl
|
||||
class ImportFollows extends ImmutablePureComponent {
|
||||
export default @injectIntl
|
||||
class ImportData extends ImmutablePureComponent {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -71,16 +66,16 @@ class ImportFollows extends ImmutablePureComponent {
|
|||
const { intl } = this.props;
|
||||
|
||||
return (
|
||||
<Column icon='cog' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='cloud-upload' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<SimpleForm onSubmit={this.handleSubmit}>
|
||||
<fieldset disabled={this.state.isLoading}>
|
||||
<FieldsGroup>
|
||||
<div className='fields-row file-picker'>
|
||||
<div className='fields-row__column fields-group fields-row__column-6'>
|
||||
<FileChooserCSV
|
||||
label={<FormattedMessage id='import_follows.follows_label' defaultMessage='Follows' />}
|
||||
label={<FormattedMessage id='import_data.follows_label' defaultMessage='Follows' />}
|
||||
name='follows'
|
||||
hint={<FormattedMessage id='import_follows.hints.follows' defaultMessage='CSV file containing a list of followed accounts' />}
|
||||
hint={<FormattedMessage id='import_data.hints.follows' defaultMessage='CSV file containing a list of followed accounts' />}
|
||||
onChange={this.handleFileChange('follows')}
|
||||
/>
|
||||
</div>
|
|
@ -78,7 +78,7 @@ import {
|
|||
Preferences,
|
||||
EditProfile,
|
||||
SoapboxConfig,
|
||||
ImportFollows,
|
||||
ImportData,
|
||||
PasswordReset,
|
||||
SecurityForm,
|
||||
MfaForm,
|
||||
|
@ -264,8 +264,8 @@ class SwitchingColumnsArea extends React.PureComponent {
|
|||
<Redirect exact from='/settings' to='/settings/preferences' />
|
||||
<WrappedRoute path='/settings/preferences' layout={LAYOUT.DEFAULT} component={Preferences} content={children} />
|
||||
<WrappedRoute path='/settings/profile' layout={LAYOUT.DEFAULT} component={EditProfile} content={children} />
|
||||
<WrappedRoute path='/settings/import' layout={LAYOUT.DEFAULT} component={ImportData} content={children} />
|
||||
<WrappedRoute path='/soapbox/config' layout={LAYOUT.DEFAULT} component={SoapboxConfig} content={children} />
|
||||
<WrappedRoute path='/settings/import' layout={LAYOUT.DEFAULT} component={ImportFollows} content={children} />
|
||||
|
||||
<WrappedRoute layout={LAYOUT.EMPTY} component={GenericNotFound} content={children} />
|
||||
</Switch>
|
||||
|
|
|
@ -186,8 +186,8 @@ export function SoapboxConfig() {
|
|||
return import(/* webpackChunkName: "features/soapbox_config" */'../../soapbox_config');
|
||||
}
|
||||
|
||||
export function ImportFollows() {
|
||||
return import(/* webpackChunkName: "features/import_follows" */'../../import_follows');
|
||||
export function ImportData() {
|
||||
return import(/* webpackChunkName: "features/import_follows" */'../../import_data');
|
||||
}
|
||||
|
||||
export function PasswordReset() {
|
||||
|
|
Loading…
Reference in a new issue