diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-08-28 22:21:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-28 22:21:55 +0200 |
commit | 7a02c1d9bab8ba004eea54a907782a949ecb3493 (patch) | |
tree | 8bfa0862cb0ef69e452a12d3a4dfb2134b2b574f /app/javascript/flavours/glitch/features/public_timeline | |
parent | 215738bb3cba4951e84174b461da5f1004b0649e (diff) |
Add regexp filter field to public timeline column settings (#1834)
* Add regexp filter field to public timeline column settings This has accidentally been removed while porting an upstream change years ago. * Remove dead code * Fix regexp filter not working for local and public TLs when using non-default settings
Diffstat (limited to 'app/javascript/flavours/glitch/features/public_timeline')
-rw-r--r-- | app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js index e92681065..cfe821cfc 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js @@ -1,8 +1,13 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { injectIntl, FormattedMessage } from 'react-intl'; -import SettingToggle from '../../notifications/components/setting_toggle'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import SettingText from 'flavours/glitch/components/setting_text'; +import SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle'; + +const messages = defineMessages({ + filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }, +}); export default @injectIntl class ColumnSettings extends React.PureComponent { @@ -15,7 +20,7 @@ class ColumnSettings extends React.PureComponent { }; render () { - const { settings, onChange } = this.props; + const { settings, onChange, intl } = this.props; return ( <div> @@ -24,6 +29,12 @@ class ColumnSettings extends React.PureComponent { <SettingToggle settings={settings} settingPath={['other', 'onlyRemote']} onChange={onChange} label={<FormattedMessage id='community.column_settings.remote_only' defaultMessage='Remote only' />} /> {!settings.getIn(['other', 'onlyRemote']) && <SettingToggle settings={settings} settingPath={['other', 'allowLocalOnly']} onChange={onChange} label={<FormattedMessage id='community.column_settings.allow_local_only' defaultMessage='Show local-only toots' />} />} </div> + + <span className='column-settings__section'><FormattedMessage id='home.column_settings.advanced' defaultMessage='Advanced' /></span> + + <div className='column-settings__row'> + <SettingText settings={settings} settingPath={['regex', 'body']} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} /> + </div> </div> ); } |