diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-28 04:44:09 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-28 04:44:09 +0900 |
| commit | 4277e5343349c6000e626c490578d4e9bef71404 (patch) | |
| tree | 15a4a237810025e50fd5f2378744894357486e6b /src/client/app/common | |
| parent | Fix: リンクバリデーションリンクが一瞬表示されてしまう... (diff) | |
| download | misskey-4277e5343349c6000e626c490578d4e9bef71404.tar.gz misskey-4277e5343349c6000e626c490578d4e9bef71404.tar.bz2 misskey-4277e5343349c6000e626c490578d4e9bef71404.zip | |
通知のフィルタ (#5224)
* :v:
* Deck
Diffstat (limited to 'src/client/app/common')
3 files changed, 54 insertions, 3 deletions
diff --git a/src/client/app/common/views/components/dialog.vue b/src/client/app/common/views/components/dialog.vue index ed94fe5f35..d5906eb4c4 100644 --- a/src/client/app/common/views/components/dialog.vue +++ b/src/client/app/common/views/components/dialog.vue @@ -98,7 +98,7 @@ export default Vue.extend({ return { inputValue: this.input && this.input.default ? this.input.default : null, userInputValue: null, - selectedValue: this.select ? this.select.items ? this.select.items[0].value : this.select.groupedItems[0].items[0].value : null, + selectedValue: this.select ? this.select.default ? this.select.default : this.select.items ? this.select.items[0].value : this.select.groupedItems[0].items[0].value : null, canOk: true, faTimesCircle, faQuestionCircle }; diff --git a/src/client/app/common/views/deck/deck.notifications-column.vue b/src/client/app/common/views/deck/deck.notifications-column.vue index c81c8b7733..b4361b054a 100644 --- a/src/client/app/common/views/deck/deck.notifications-column.vue +++ b/src/client/app/common/views/deck/deck.notifications-column.vue @@ -1,8 +1,8 @@ <template> -<x-column :name="name" :column="column" :is-stacked="isStacked"> +<x-column :name="name" :column="column" :is-stacked="isStacked" :menu="menu"> <template #header><fa :icon="['far', 'bell']"/>{{ name }}</template> - <x-notifications/> + <x-notifications :type="column.notificationType === 'all' ? null : column.notificationType"/> </x-column> </template> @@ -30,11 +30,46 @@ export default Vue.extend({ } }, + data() { + return { + menu: null, + } + }, + computed: { name(): string { if (this.column.name) return this.column.name; return this.$t('@deck.notifications'); } }, + + created() { + if (this.column.notificationType == null) { + this.column.notificationType = 'all'; + this.$store.commit('updateDeckColumn', this.column); + } + + this.menu = [{ + icon: 'cog', + text: this.$t('@.notification-type'), + action: () => { + this.$root.dialog({ + title: this.$t('@.notification-type'), + type: null, + select: { + items: ['all', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest'].map(x => ({ + value: x, text: this.$t('@.notification-types.' + x) + })) + default: this.column.notificationType, + }, + showCancelButton: true + }).then(({ canceled, result: type }) => { + if (canceled) return; + this.column.notificationType = type; + this.$store.commit('updateDeckColumn', this.column); + }); + } + }]; + }, }); </script> diff --git a/src/client/app/common/views/deck/deck.notifications.vue b/src/client/app/common/views/deck/deck.notifications.vue index e01d0023f6..aed2af64e9 100644 --- a/src/client/app/common/views/deck/deck.notifications.vue +++ b/src/client/app/common/views/deck/deck.notifications.vue @@ -47,12 +47,22 @@ export default Vue.extend({ }), ], + props: { + type: { + type: String, + required: false + } + }, + data() { return { connection: null, pagination: { endpoint: 'i/notifications', limit: 20, + params: () => ({ + includeTypes: this.type ? [this.type] : undefined + }) } }; }, @@ -69,6 +79,12 @@ export default Vue.extend({ } }, + watch: { + type() { + this.reload(); + } + }, + mounted() { this.connection = this.$root.stream.useSharedConnection('main'); this.connection.on('notification', this.onNotification); |