From cd9a7dd48802fff8942ae607a23677cfb43a7b14 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 12 Mar 2019 17:16:57 -0400 Subject: #436: integrate mastoAPI notifications --- src/components/notification/notification.js | 3 + src/components/notification/notification.vue | 83 +++++++++++++++----------- src/components/notifications/notifications.js | 5 +- src/components/notifications/notifications.vue | 3 +- 4 files changed, 57 insertions(+), 37 deletions(-) (limited to 'src/components') diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index fe5b7018..c86f22bb 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -21,6 +21,9 @@ const Notification = { }, userProfileLink (user) { return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) + }, + dismiss () { + this.$store.dispatch('dismissNotifications', { id: this.notification.id }) } }, computed: { diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 5e9cef97..b281c7cf 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,44 +1,57 @@ + + \ No newline at end of file diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 9fc5e38a..68004d54 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -53,7 +53,10 @@ const Notifications = { }, methods: { markAsSeen () { - this.$store.dispatch('markNotificationsAsSeen', this.visibleNotifications) + this.$store.dispatch('markNotificationsAsSeen') + }, + clear () { + this.$store.dispatch('clearNotifications') }, fetchOlderNotifications () { const store = this.$store diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 6f162b62..6438361d 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -9,7 +9,8 @@
{{$t('timeline.error_fetching')}}
- + +
-- cgit v1.2.3-70-g09d2 From 2f7d890ad228a2aeb8643373c9c9a6d925c6ff7f Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 13 Mar 2019 14:08:03 -0400 Subject: #436: add dismiss button, disable is_seen part --- src/components/notification/notification.vue | 93 +++++++++++----------- src/components/status/status.js | 6 +- src/components/status/status.vue | 3 + .../entity_normalizer/entity_normalizer.service.js | 6 +- .../notifications_fetcher.service.js | 22 ++--- 5 files changed, 68 insertions(+), 62 deletions(-) (limited to 'src/components') diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index b281c7cf..87b0fde2 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,57 +1,54 @@ - - \ No newline at end of file diff --git a/src/components/status/status.js b/src/components/status/status.js index 9e18fe15..4cd26be3 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -25,7 +25,8 @@ const Status = { 'replies', 'isPreview', 'noHeading', - 'inlineExpanded' + 'inlineExpanded', + 'isNotification' ], data () { return { @@ -365,6 +366,9 @@ const Status = { setMedia () { const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments return () => this.$store.dispatch('setMedia', attachments) + }, + dismissNotification () { + this.$emit('dismissNotification') } }, watch: { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 1f6d0325..28a44346 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -52,6 +52,9 @@ + + +