Merge pull request #2416 from h3poteto/remove-old-filter

refs #2258 Delete old filter form
This commit is contained in:
AkiraFukushima 2021-05-17 21:27:24 +09:00 committed by GitHub
commit a51e6ac8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 95 additions and 330 deletions

View File

@ -134,8 +134,7 @@ let state = (): DirectMessagesState => {
lazyLoading: false,
heading: true,
timeline: [],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
@ -199,7 +198,6 @@ describe('Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}

View File

@ -132,7 +132,6 @@ let state = (): FavouritesState => {
return {
favourites: [],
lazyLoading: false,
filter: '',
maxId: null
}
}
@ -234,7 +233,6 @@ describe('Favourites', () => {
return {
favourites: [],
lazyLoading: true,
filter: '',
maxId: null
}
}
@ -251,7 +249,6 @@ describe('Favourites', () => {
return {
favourites: [],
lazyLoading: false,
filter: '',
maxId: null
}
}
@ -268,7 +265,6 @@ describe('Favourites', () => {
return {
favourites: [status1],
lazyLoading: false,
filter: '',
maxId: '2'
}
}

View File

@ -119,8 +119,7 @@ let state = (): TagState => {
lazyLoading: false,
heading: true,
timeline: [],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
@ -182,8 +181,7 @@ describe('Home', () => {
lazyLoading: false,
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
})

View File

@ -119,7 +119,6 @@ let state = (): HomeState => {
heading: true,
timeline: [],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -184,7 +183,6 @@ describe('Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}

View File

@ -121,8 +121,7 @@ let state = (): ShowState => {
lazyLoading: false,
heading: true,
timeline: [],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
@ -182,8 +181,7 @@ describe('Lists/Show', () => {
lazyLoading: false,
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
})

View File

@ -118,8 +118,7 @@ let state = (): LocalState => {
lazyLoading: false,
heading: true,
timeline: [],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
@ -182,7 +181,6 @@ describe('Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}

View File

@ -116,8 +116,7 @@ let state: Function = () => {
lazyLoading: false,
heading: true,
mentions: [],
unreadMentions: [],
filter: ''
unreadMentions: []
}
}
@ -178,8 +177,7 @@ describe('Mentions', () => {
lazyLoading: true,
heading: true,
mentions: [],
unreadMentions: [],
filter: ''
unreadMentions: []
}
}
})
@ -196,8 +194,7 @@ describe('Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [mention, reblog],
unreadMentions: [],
filter: ''
unreadMentions: []
}
}
})
@ -228,8 +225,7 @@ describe('Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [mention, favourite, reblog, follow],
unreadMentions: [],
filter: ''
unreadMentions: []
}
}
})

View File

@ -193,8 +193,7 @@ let state = (): NotificationsState => {
lazyLoading: false,
heading: true,
notifications: [],
unreadNotifications: [],
filter: ''
unreadNotifications: []
}
}
@ -255,8 +254,7 @@ describe('Notifications', () => {
lazyLoading: false,
heading: true,
notifications: [notification1],
unreadNotifications: [],
filter: ''
unreadNotifications: []
}
}
})

View File

@ -118,8 +118,7 @@ let state = (): PublicState => {
lazyLoading: false,
heading: true,
timeline: [],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
}
@ -182,7 +181,6 @@ describe('Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false,
heading: true,
timeline: [status2, rebloggedStatus],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false,
heading: true,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false,
heading: false,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/DirectMessages', () => {
lazyLoading: false,
heading: false,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false,
heading: true,
timeline: [status2, rebloggedStatus],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false,
heading: true,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false,
heading: false,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/Hashtag/Tag', () => {
lazyLoading: false,
heading: false,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {

View File

@ -100,7 +100,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -129,7 +128,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -148,7 +146,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -169,7 +166,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: false,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -187,7 +183,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: false,
timeline: [],
unreadTimeline: [status2, status1],
filter: '',
showReblogs: true,
showReplies: true
}
@ -208,7 +203,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [status2],
filter: '',
showReblogs: true,
showReplies: true
}
@ -227,7 +221,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [status1],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -246,7 +239,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [status1, status2],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -303,7 +295,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [rebloggedStatus, status2],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -324,7 +315,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [status1, status2],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}
@ -376,7 +366,6 @@ describe('TimelineSpace/Contents/Home', () => {
heading: true,
timeline: [rebloggedStatus, status2],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
}

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false,
heading: true,
timeline: [status2, rebloggedStatus],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false,
heading: true,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false,
heading: false,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/Lists/Show', () => {
lazyLoading: false,
heading: false,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [status2, rebloggedStatus],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -171,8 +169,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -188,8 +185,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {
@ -207,8 +203,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: false,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -224,8 +219,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: false,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {

View File

@ -174,8 +174,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
@ -187,8 +186,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [notification1],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should update mentions', () => {
@ -204,8 +202,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [notification2, notification1],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should not be updated mentions', () => {
@ -223,8 +220,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: false,
mentions: [notification1],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should update mentions', () => {
@ -240,8 +236,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: false,
mentions: [notification1],
unreadMentions: [notification2],
filter: ''
unreadMentions: [notification2]
}
})
it('should not be updated mentions', () => {
@ -259,8 +254,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: false,
mentions: [notification1],
unreadMentions: [notification2],
filter: ''
unreadMentions: [notification2]
}
})
it('should be merged', () => {
@ -276,8 +270,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: false,
mentions: [notification2],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should be inserted', () => {
@ -292,8 +285,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: false,
mentions: [notification2, notification1],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should be updated', () => {
@ -313,8 +305,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [notification2, notification1],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should be deleted', () => {
@ -328,8 +319,7 @@ describe('TimelineSpace/Contents/Mentions', () => {
lazyLoading: false,
heading: true,
mentions: [notification2, notification1],
unreadMentions: [],
filter: ''
unreadMentions: []
}
})
it('should be deleted', () => {

View File

@ -176,8 +176,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false,
heading: true,
notifications: [notification2, notification1],
unreadNotifications: [],
filter: ''
unreadNotifications: []
}
})
describe('message is not reblogged', () => {
@ -202,8 +201,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false,
heading: true,
notifications: [notification1],
unreadNotifications: [],
filter: ''
unreadNotifications: []
}
})
it('should update timeline', () => {
@ -219,8 +217,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false,
heading: true,
notifications: [notification2, notification1],
unreadNotifications: [],
filter: ''
unreadNotifications: []
}
})
it('should not update timeline', () => {
@ -238,8 +235,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false,
heading: false,
notifications: [notification1],
unreadNotifications: [],
filter: ''
unreadNotifications: []
}
})
it('should update unreadTimeline', () => {
@ -254,8 +250,7 @@ describe('TimelineSpace/Contents/Notifications', () => {
lazyLoading: false,
heading: false,
notifications: [notification1],
unreadNotifications: [notification2],
filter: ''
unreadNotifications: [notification2]
}
})
it('should not update unreadTimeline', () => {

View File

@ -137,8 +137,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -153,8 +152,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [status2, rebloggedStatus],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be deleted', () => {
@ -172,8 +170,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -189,8 +186,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: true,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {
@ -208,8 +204,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: false,
timeline: [status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should be updated timeline', () => {
@ -225,8 +220,7 @@ describe('TimelineSpace/Contents/Local', () => {
lazyLoading: false,
heading: false,
timeline: [rebloggedStatus, status2, status1],
unreadTimeline: [],
filter: ''
unreadTimeline: []
}
})
it('should not be updated timeline', () => {

View File

@ -74,10 +74,8 @@
"search": "Search",
"lists": "Lists",
"members": "Members",
"filter": {
"title": "Filter",
"placeholder": "Filter out by regular expressions",
"show_dms": "Show direct messages",
"option": {
"title": "Option",
"show_reblogs": "Show reblogs",
"show_replies": "Show replies",
"apply": "Apply"

View File

@ -57,8 +57,7 @@ export default {
}),
...mapState('TimelineSpace/Contents/Bookmarks', {
bookmarks: state => state.bookmarks,
lazyLoading: state => state.lazyLoading,
filter: state => state.filter
lazyLoading: state => state.lazyLoading
}),
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -49,8 +48,7 @@ export default {
timeline: state => state.timeline,
lazyLoading: state => state.lazyLoading,
heading: state => state.heading,
unread: state => state.unreadTimeline,
filter: state => state.filter
unread: state => state.unreadTimeline
}),
...mapState({
openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar,

View File

@ -6,7 +6,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -51,8 +50,7 @@ export default {
startReload: state => state.TimelineSpace.HeaderMenu.reload,
account: state => state.TimelineSpace.account,
favourites: state => state.TimelineSpace.Contents.Favourites.favourites,
lazyLoading: state => state.TimelineSpace.Contents.Favourites.lazyLoading,
filter: state => state.TimelineSpace.Contents.Favourites.filter
lazyLoading: state => state.TimelineSpace.Contents.Favourites.lazyLoading
}),
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -53,8 +52,7 @@ export default {
timeline: state => state.TimelineSpace.Contents.Hashtag.Tag.timeline,
lazyLoading: state => state.TimelineSpace.Contents.Hashtag.Tag.lazyLoading,
heading: state => state.TimelineSpace.Contents.Hashtag.Tag.heading,
unread: state => state.TimelineSpace.Contents.Hashtag.Tag.unreadTimeline,
filter: state => state.TimelineSpace.Contents.Hashtag.Tag.filter
unread: state => state.TimelineSpace.Contents.Hashtag.Tag.unreadTimeline
}),
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -53,7 +52,6 @@ export default {
lazyLoading: state => state.TimelineSpace.Contents.Home.lazyLoading,
heading: state => state.TimelineSpace.Contents.Home.heading,
unread: state => state.TimelineSpace.Contents.Home.unreadTimeline,
filter: state => state.TimelineSpace.Contents.Home.filter,
showReblogs: state => state.TimelineSpace.Contents.Home.showReblogs,
showReplies: state => state.TimelineSpace.Contents.Home.showReplies
}),

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -53,8 +52,7 @@ export default {
timeline: state => state.TimelineSpace.Contents.Lists.Show.timeline,
lazyLoading: state => state.TimelineSpace.Contents.Lists.Show.lazyLoading,
heading: state => state.TimelineSpace.Contents.Lists.Show.heading,
unread: state => state.TimelineSpace.Contents.Lists.Show.unreadTimeline,
filter: state => state.TimelineSpace.Contents.Lists.Show.filter
unread: state => state.TimelineSpace.Contents.Lists.Show.unreadTimeline
}),
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
shortcutEnabled: function () {

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -49,8 +48,7 @@ export default {
timeline: state => state.timeline,
lazyLoading: state => state.lazyLoading,
heading: state => state.heading,
unread: state => state.unreadTimeline,
filter: state => state.filter
unread: state => state.unreadTimeline
}),
...mapState({
openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar,

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.url]" :data-index="index" :watchData="true">
<notification
:message="item"
:filter="filter"
:focused="item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -56,8 +55,7 @@ export default {
...mapState('TimelineSpace/Contents/Mentions', {
lazyLoading: state => state.lazyLoading,
heading: state => state.heading,
unread: state => state.unreadMentions,
filter: state => state.filter
unread: state => state.unreadMentions
}),
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
...mapGetters('TimelineSpace/Contents/Mentions', ['mentions']),

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.url]" :data-index="index" :watchData="true">
<notification
:message="item"
:filter="filter"
:focused="item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -50,8 +49,7 @@ export default {
backgroundColor: state => state.App.theme.background_color,
lazyLoading: state => state.TimelineSpace.Contents.Notifications.lazyLoading,
heading: state => state.TimelineSpace.Contents.Notifications.heading,
unread: state => state.TimelineSpace.Contents.Notifications.unreadNotifications,
filter: state => state.TimelineSpace.Contents.Notifications.filter
unread: state => state.TimelineSpace.Contents.Notifications.unreadNotifications
}),
...mapGetters('TimelineSpace/Contents/Notifications', ['handledNotifications']),
...mapGetters('TimelineSpace/Modals', ['modalOpened']),

View File

@ -7,7 +7,6 @@
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.uri]" :data-index="index" :watchData="true">
<toot
:message="item"
:filter="filter"
:focused="item.uri + item.id === focusedId"
:overlaid="modalOpened"
v-on:update="updateToot"
@ -49,8 +48,7 @@ export default {
timeline: state => state.timeline,
lazyLoading: state => state.lazyLoading,
heading: state => state.heading,
unread: state => state.unreadTimeline,
filter: state => state.filter
unread: state => state.unreadTimeline
}),
...mapState({
openSideBar: state => state.TimelineSpace.Contents.SideBar.openSideBar,

View File

@ -11,34 +11,19 @@
<el-button v-show="reloadable()" type="text" class="action" @click="reload" :title="$t('header_menu.reload')">
<icon name="sync-alt"></icon>
</el-button>
<el-popover placement="left-start" width="320" popper-class="theme-popover" trigger="click" v-model="filterVisible">
<el-popover placement="left-start" width="180" popper-class="theme-popover" trigger="click" v-model="TLOptionVisible">
<div>
<el-form role="form" label-position="left" label-width="125px" size="medium">
<el-form-item for="filter" :label="$t('header_menu.filter.title')">
<div class="el-input">
<input
id="filter"
class="el-input__inner"
v-model="filter"
:placeholder="$t('header_menu.filter.placeholder')"
v-shortkey.avoid
:aria-label="$t('header_menu.filter.placeholder')"
:title="$t('header_menu.filter.placeholder')"
/>
</div>
</el-form-item>
<el-form-item for="show-reblogs" :label="$t('header_menu.filter.show_reblogs')" v-if="extrasFilterable()">
<el-form-item for="show-reblogs" :label="$t('header_menu.option.show_reblogs')">
<el-checkbox id="show-reblogs" v-model="showReblogs"></el-checkbox>
</el-form-item>
<el-form-item for="show-replies" :label="$t('header_menu.filter.show_replies')" v-if="extrasFilterable()">
<el-form-item for="show-replies" :label="$t('header_menu.option.show_replies')">
<el-checkbox id="show-replies" v-model="showReplies"></el-checkbox>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="applyFilter(filter)">{{ $t('header_menu.filter.apply') }}</el-button>
</el-form-item>
<el-button type="primary" @click="applyTLOption">{{ $t('header_menu.option.apply') }}</el-button>
</el-form>
</div>
<el-button v-show="filterable()" slot="reference" type="text" class="action" :title="$t('header_menu.filter.title')">
<el-button v-show="TLOption()" slot="reference" type="text" class="action" :title="$t('header_menu.option.title')">
<icon name="sliders-h"></icon>
</el-button>
</el-popover>
@ -56,8 +41,7 @@ export default {
name: 'header-menu',
data() {
return {
filter: '',
filterVisible: false,
TLOptionVisible: false,
showReblogs: true,
showReplies: true
}
@ -70,13 +54,13 @@ export default {
},
created() {
this.channelName()
this.loadFilter()
this.loadTLOption()
this.$store.dispatch('TimelineSpace/HeaderMenu/setupLoading')
},
watch: {
$route: function () {
this.channelName()
this.loadFilter()
this.loadTLOption()
}
},
methods: {
@ -174,94 +158,28 @@ export default {
return false
}
},
loadFilter() {
loadTLOption() {
switch (this.$route.name) {
case 'home':
this.filter = this.$store.state.TimelineSpace.Contents.Home.filter
this.showReblogs = this.$store.state.TimelineSpace.Contents.Home.showReblogs
this.showReplies = this.$store.state.TimelineSpace.Contents.Home.showReplies
break
case 'notifications':
this.filter = this.$store.state.TimelineSpace.Contents.Notifications.filter
break
case 'mentions':
this.filter = this.$store.state.TimelineSpace.Contents.Mentions.filter
break
case 'favourites':
this.filter = this.$store.state.TimelineSpace.Contents.Favourites.filter
break
case 'local':
this.filter = this.$store.state.TimelineSpace.Contents.Local.filter
break
case 'public':
this.filter = this.$store.state.TimelineSpace.Contents.Public.filter
break
case 'tag':
this.filter = this.$store.state.TimelineSpace.Contents.Hashtag.Tag.filter
break
case 'list':
this.filter = this.$store.state.TimelineSpace.Contents.Lists.Show.filter
break
case 'direct-messages':
this.filter = this.$store.state.TimelineSpace.Contents.DirectMessages.filter
break
default:
console.log('Not implemented')
}
},
applyFilter(filter) {
applyTLOption() {
switch (this.$route.name) {
case 'home':
this.$store.commit('TimelineSpace/Contents/Home/changeFilter', filter)
this.$store.commit('TimelineSpace/Contents/Home/showReblogs', this.showReblogs)
this.$store.commit('TimelineSpace/Contents/Home/showReplies', this.showReplies)
break
case 'notifications':
this.$store.commit('TimelineSpace/Contents/Notifications/changeFilter', filter)
break
case 'mentions':
this.$store.commit('TimelineSpace/Contents/Mentions/changeFilter', filter)
break
case 'favourites':
this.$store.commit('TimelineSpace/Contents/Favourites/changeFilter', filter)
break
case 'local':
this.$store.commit('TimelineSpace/Contents/Local/changeFilter', filter)
break
case 'public':
this.$store.commit('TimelineSpace/Contents/Public/changeFilter', filter)
break
case 'tag':
this.$store.commit('TimelineSpace/Contents/Hashtag/Tag/changeFilter', filter)
break
case 'list':
this.$store.commit('TimelineSpace/Contents/Lists/Show/changeFilter', filter)
break
case 'direct-messages':
this.$store.commit('TimelineSpace/Contents/DirectMessages/changeFilter', filter)
break
default:
console.log('Not implemented')
}
this.filterVisible = false
this.TLOptionVisible = false
},
filterable() {
switch (this.$route.name) {
case 'home':
case 'notifications':
case 'mentions':
case 'favourites':
case 'local':
case 'public':
case 'tag':
case 'list':
case 'direct-messages':
return true
default:
return false
}
},
extrasFilterable() {
TLOption() {
switch (this.$route.name) {
case 'home':
return true

View File

@ -7,15 +7,13 @@ export type DirectMessagesState = {
heading: boolean
timeline: Array<Entity.Status>
unreadTimeline: Array<Entity.Status>
filter: string
}
const state = (): DirectMessagesState => ({
lazyLoading: false,
heading: true,
timeline: [],
unreadTimeline: [],
filter: ''
unreadTimeline: []
})
export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
ARCHIVE_TIMELINE: 'archiveTimeline',
CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_FILTER: 'changeFilter'
DELETE_TOOT: 'deleteToot'
}
const mutations: MutationTree<DirectMessagesState> = {
@ -91,9 +88,6 @@ const mutations: MutationTree<DirectMessagesState> = {
return toot.id !== id
}
})
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}

View File

@ -7,14 +7,12 @@ import { LocalAccount } from '~/src/types/localAccount'
export type FavouritesState = {
favourites: Array<Entity.Status>
lazyLoading: boolean
filter: string
maxId: string | null
}
const state = (): FavouritesState => ({
favourites: [],
lazyLoading: false,
filter: '',
maxId: null
})
@ -24,7 +22,6 @@ export const MUTATION_TYPES = {
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading',
CHANGE_FILTER: 'changeFilter',
CHANGE_MAX_ID: 'changeMaxId'
}
@ -63,9 +60,6 @@ const mutations: MutationTree<FavouritesState> = {
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
},
[MUTATION_TYPES.CHANGE_MAX_ID]: (state, id: string | null) => {
state.maxId = id
}

View File

@ -11,15 +11,13 @@ export type TagState = {
unreadTimeline: Array<Entity.Status>
lazyLoading: boolean
heading: boolean
filter: string
}
const state = (): TagState => ({
timeline: [],
unreadTimeline: [],
lazyLoading: false,
heading: true,
filter: ''
heading: true
})
export const MUTATION_TYPES = {
@ -32,8 +30,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading',
CHANGE_FILTER: 'changeFilter'
CHANGE_LAZY_LOADING: 'changeLazyLoading'
}
const mutations: MutationTree<TagState> = {
@ -94,9 +91,6 @@ const mutations: MutationTree<TagState> = {
},
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}

View File

@ -9,7 +9,6 @@ export type HomeState = {
showReplies: boolean
timeline: Array<Entity.Status>
unreadTimeline: Array<Entity.Status>
filter: string
}
const state = (): HomeState => ({
@ -17,7 +16,6 @@ const state = (): HomeState => ({
heading: true,
timeline: [],
unreadTimeline: [],
filter: '',
showReblogs: true,
showReplies: true
})
@ -33,7 +31,6 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_FILTER: 'changeFilter',
SHOW_REBLOGS: 'showReblogs',
SHOW_REPLIES: 'showReplies'
}
@ -98,9 +95,6 @@ const mutations: MutationTree<HomeState> = {
}
})
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
},
[MUTATION_TYPES.SHOW_REBLOGS]: (state, visible: boolean) => {
state.showReblogs = visible
},

View File

@ -11,15 +11,13 @@ export type ShowState = {
unreadTimeline: Array<Entity.Status>
lazyLoading: boolean
heading: boolean
filter: string
}
const state = (): ShowState => ({
timeline: [],
unreadTimeline: [],
lazyLoading: false,
heading: true,
filter: ''
heading: true
})
export const MUTATION_TYPES = {
@ -32,8 +30,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading',
CHANGE_FILTER: 'changeFilter'
CHANGE_LAZY_LOADING: 'changeLazyLoading'
}
const mutations: MutationTree<ShowState> = {
@ -94,9 +91,6 @@ const mutations: MutationTree<ShowState> = {
},
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}

View File

@ -7,15 +7,13 @@ export type LocalState = {
unreadTimeline: Array<Entity.Status>
lazyLoading: boolean
heading: boolean
filter: string
}
const state = (): LocalState => ({
timeline: [],
unreadTimeline: [],
lazyLoading: false,
heading: true,
filter: ''
heading: true
})
export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading',
CHANGE_FILTER: 'changeFilter'
CHANGE_LAZY_LOADING: 'changeLazyLoading'
}
const mutations: MutationTree<LocalState> = {
@ -90,9 +87,6 @@ const mutations: MutationTree<LocalState> = {
},
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}

View File

@ -7,15 +7,13 @@ export type MentionsState = {
heading: boolean
mentions: Array<Entity.Notification>
unreadMentions: Array<Entity.Notification>
filter: string
}
const state = (): MentionsState => ({
lazyLoading: false,
heading: true,
mentions: [],
unreadMentions: [],
filter: ''
unreadMentions: []
})
export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
ARCHIVE_MENTIONS: 'archiveMentions',
CLEAR_MENTIONS: 'clearMentions',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_FILTER: 'changeFilter'
DELETE_TOOT: 'deleteToot'
}
const mutations: MutationTree<MentionsState> = {
@ -90,9 +87,6 @@ const mutations: MutationTree<MentionsState> = {
return true
}
})
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}

View File

@ -10,15 +10,13 @@ export type NotificationsState = {
heading: boolean
notifications: Array<Entity.Notification>
unreadNotifications: Array<Entity.Notification>
filter: string
}
const state = (): NotificationsState => ({
lazyLoading: false,
heading: true,
notifications: [],
unreadNotifications: [],
filter: ''
unreadNotifications: []
})
export const MUTATION_TYPES = {
@ -31,8 +29,7 @@ export const MUTATION_TYPES = {
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CLEAR_NOTIFICATIONS: 'clearNotifications',
ARCHIVE_NOTIFICATIONS: 'archiveNotifications',
CHANGE_FILTER: 'changeFilter'
ARCHIVE_NOTIFICATIONS: 'archiveNotifications'
}
const mutations: MutationTree<NotificationsState> = {
@ -97,9 +94,6 @@ const mutations: MutationTree<NotificationsState> = {
},
[MUTATION_TYPES.ARCHIVE_NOTIFICATIONS]: state => {
state.notifications = state.notifications.slice(0, 30)
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}

View File

@ -7,15 +7,13 @@ export type PublicState = {
unreadTimeline: Array<Entity.Status>
lazyLoading: boolean
heading: boolean
filter: string
}
const state = (): PublicState => ({
timeline: [],
unreadTimeline: [],
lazyLoading: false,
heading: true,
filter: ''
heading: true
})
export const MUTATION_TYPES = {
@ -28,8 +26,7 @@ export const MUTATION_TYPES = {
CLEAR_TIMELINE: 'clearTimeline',
UPDATE_TOOT: 'updateToot',
DELETE_TOOT: 'deleteToot',
CHANGE_LAZY_LOADING: 'changeLazyLoading',
CHANGE_FILTER: 'changeFilter'
CHANGE_LAZY_LOADING: 'changeLazyLoading'
}
const mutations: MutationTree<PublicState> = {
@ -90,9 +87,6 @@ const mutations: MutationTree<PublicState> = {
},
[MUTATION_TYPES.CHANGE_LAZY_LOADING]: (state, value: boolean) => {
state.lazyLoading = value
},
[MUTATION_TYPES.CHANGE_FILTER]: (state, filter: string) => {
state.filter = filter
}
}