.circleci
.dependabot
.github
app
chewy
controllers
helpers
javascript
fonts
images
mastodon
actions
components
containers
features
account
account_gallery
account_timeline
audio
blocks
community_timeline
compose
direct_timeline
directory
domain_blocks
emoji
favourited_statuses
favourites
follow_requests
followers
following
generic_not_found
getting_started
hashtag_timeline
home_timeline
introduction
keyboard_shortcuts
list_adder
list_editor
list_timeline
lists
mutes
notifications
components
containers
column_settings_container.js
filter_bar_container.js
notification_container.js
index.js
pinned_statuses
public_timeline
reblogs
report
search
standalone
status
ui
video
locales
middleware
reducers
selectors
service_worker
storage
store
utils
api.js
base_polyfills.js
common.js
compare_id.js
extra_polyfills.js
initial_state.js
is_mobile.js
load_polyfills.js
main.js
performance.js
ready.js
rtl.js
scroll.js
settings.js
stream.js
test_setup.js
uuid.js
packs
styles
lib
mailers
models
policies
presenters
serializers
services
validators
views
workers
bin
config
db
dist
lib
log
nanobox
public
spec
streaming
vendor
.buildpacks
.codeclimate.yml
.dockerignore
.editorconfig
.env.nanobox
.env.production.sample
.env.test
.env.vagrant
.eslintignore
.eslintrc.js
.foreman
.gitattributes
.gitignore
.haml-lint.yml
.nanoignore
.nvmrc
.profile
.rspec
.rubocop.yml
.ruby-version
.sass-lint.yml
.slugignore
.yarnclean
AUTHORS.md
Aptfile
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Capfile
Dockerfile
Gemfile
Gemfile.lock
LICENSE
Procfile
Procfile.dev
README.md
Rakefile
Vagrantfile
app.json
babel.config.js
boxfile.yml
config.ru
crowdin.yml
docker-compose.yml
package.json
postcss.config.js
priv-config
scalingo.json
yarn.lock
* create FilterBar componer and its container, unstyled * introduce basic styling for FilterBar * add selection css * allow FilterBar to display active CSS with js * connect the FilterBar to the Redux state * change getNotifications to use filter * remove temporary comments * add an option to turn the FilterBar off in settings * fix showFilterBar data type to boolean * fix eslint errors * add English and Polish translations * allowed filter bar overflow to accomodate for longer languages * fix mispelled translation key * add unified CSS look * replace text in FilterBar with icons * add tooltips * replace text @ with an icon * introduce simple and advanced filtering view * add ability to toggle the advanced view * add Polish translations * change Advanced View description to be more clear * make each filter flush notifications and load new ones, fixing pagination * simplify getNotifications once frontend filtering is not needed for FilterBar * add a semicolon * Revert "simplify getNotifications once frontend filtering is not needed for FilterBar" This reverts commit 9f4be7857135b0327814bd22a3e8a4e7b546f7cc. * reset filter to 'all' when turning off FilterBar
44 lines
1.6 KiB
JavaScript
44 lines
1.6 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
import ColumnSettings from '../components/column_settings';
|
|
import { changeSetting } from '../../../actions/settings';
|
|
import { setFilter } from '../../../actions/notifications';
|
|
import { clearNotifications } from '../../../actions/notifications';
|
|
import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
|
|
import { openModal } from '../../../actions/modal';
|
|
|
|
const messages = defineMessages({
|
|
clearMessage: { id: 'notifications.clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all your notifications?' },
|
|
clearConfirm: { id: 'notifications.clear', defaultMessage: 'Clear notifications' },
|
|
});
|
|
|
|
const mapStateToProps = state => ({
|
|
settings: state.getIn(['settings', 'notifications']),
|
|
pushSettings: state.get('push_notifications'),
|
|
});
|
|
|
|
const mapDispatchToProps = (dispatch, { intl }) => ({
|
|
|
|
onChange (path, checked) {
|
|
if (path[0] === 'push') {
|
|
dispatch(changePushNotifications(path.slice(1), checked));
|
|
} else if (path[0] === 'quickFilter') {
|
|
dispatch(changeSetting(['notifications', ...path], checked));
|
|
dispatch(setFilter('all'));
|
|
} else {
|
|
dispatch(changeSetting(['notifications', ...path], checked));
|
|
}
|
|
},
|
|
|
|
onClear () {
|
|
dispatch(openModal('CONFIRM', {
|
|
message: intl.formatMessage(messages.clearMessage),
|
|
confirm: intl.formatMessage(messages.clearConfirm),
|
|
onConfirm: () => dispatch(clearNotifications()),
|
|
}));
|
|
},
|
|
|
|
});
|
|
|
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ColumnSettings));
|