From 0d6a9e8a647be860b10506aecaafb4ff0f10150f Mon Sep 17 00:00:00 2001 From: tusooa Date: Sun, 13 Aug 2023 23:57:34 -0400 Subject: Display extra notifications on notifications column --- src/components/extra_notifications/extra_notifications.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/components/extra_notifications/extra_notifications.js (limited to 'src/components/extra_notifications/extra_notifications.js') diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js new file mode 100644 index 00000000..0bf904ba --- /dev/null +++ b/src/components/extra_notifications/extra_notifications.js @@ -0,0 +1,9 @@ +import { mapGetters } from 'vuex' + +const ExtraNotifications = { + computed: { + ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount']) + } +} + +export default ExtraNotifications -- cgit v1.2.3-70-g09d2 From c4549f0993dd2e176f6619694cfaa632d166f002 Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 18 Aug 2023 20:02:58 -0400 Subject: Display follow requests in extra notifications --- src/components/extra_notifications/extra_notifications.js | 11 ++++++++++- src/components/extra_notifications/extra_notifications.vue | 11 +++++++++-- src/i18n/en.json | 3 ++- 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src/components/extra_notifications/extra_notifications.js') diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js index 0bf904ba..1f3c6e6d 100644 --- a/src/components/extra_notifications/extra_notifications.js +++ b/src/components/extra_notifications/extra_notifications.js @@ -2,7 +2,16 @@ import { mapGetters } from 'vuex' const ExtraNotifications = { computed: { - ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount']) + shouldShowChats () { + return this.unreadChatCount + }, + shouldShowAnnouncements () { + return this.unreadAnnouncementCount + }, + shouldShowFollowRequests () { + return this.followRequestCount + }, + ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount']) } } diff --git a/src/components/extra_notifications/extra_notifications.vue b/src/components/extra_notifications/extra_notifications.vue index 11eeb937..f5cf1661 100644 --- a/src/components/extra_notifications/extra_notifications.vue +++ b/src/components/extra_notifications/extra_notifications.vue @@ -1,19 +1,26 @@ diff --git a/src/i18n/en.json b/src/i18n/en.json index d58fd2fa..62e80ce3 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -207,7 +207,8 @@ "submitted_report": "submitted a report", "poll_ended": "poll has ended", "unread_announcements": "{num} unread announcement | {num} unread announcements", - "unread_chats": "{num} unread chat | {num} unread chats" + "unread_chats": "{num} unread chat | {num} unread chats", + "unread_follow_requests": "{num} new follow request | {num} new follow requests" }, "polls": { "add_poll": "Add poll", -- cgit v1.2.3-70-g09d2 From 7f51ea369eb4ae1252fcba9a82438fd00471e874 Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 18 Aug 2023 20:34:27 -0400 Subject: Make extra notification display customizable --- .../extra_notifications/extra_notifications.js | 22 +++++++++--- .../extra_notifications/extra_notifications.vue | 27 ++++++++++++++ .../settings_modal/tabs/notifications_tab.vue | 41 ++++++++++++++++++++++ src/i18n/en.json | 10 +++++- src/modules/config.js | 5 +++ src/modules/instance.js | 5 +++ 6 files changed, 105 insertions(+), 5 deletions(-) (limited to 'src/components/extra_notifications/extra_notifications.js') diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js index 1f3c6e6d..cd687eaf 100644 --- a/src/components/extra_notifications/extra_notifications.js +++ b/src/components/extra_notifications/extra_notifications.js @@ -3,15 +3,29 @@ import { mapGetters } from 'vuex' const ExtraNotifications = { computed: { shouldShowChats () { - return this.unreadChatCount + return this.mergedConfig.showExtraNotifications && this.mergedConfig.showChatsInExtraNotifications && this.unreadChatCount }, shouldShowAnnouncements () { - return this.unreadAnnouncementCount + return this.mergedConfig.showExtraNotifications && this.mergedConfig.showAnnouncementsInExtraNotifications && this.unreadAnnouncementCount }, shouldShowFollowRequests () { - return this.followRequestCount + return this.mergedConfig.showExtraNotifications && this.mergedConfig.showFollowRequestsInExtraNotifications && this.followRequestCount }, - ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount']) + hasAnythingToShow () { + return this.shouldShowChats || this.shouldShowAnnouncements || this.shouldShowFollowRequests + }, + shouldShowCustomizationTip () { + return this.mergedConfig.showExtraNotificationsTip && this.hasAnythingToShow + }, + ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount', 'mergedConfig']) + }, + methods: { + openNotificationSettings () { + return this.$store.dispatch('openSettingsModalTab', 'notifications') + }, + dismissConfigurationTip () { + return this.$store.dispatch('setOption', { name: 'showExtraNotificationsTip', value: false }) + } } } diff --git a/src/components/extra_notifications/extra_notifications.vue b/src/components/extra_notifications/extra_notifications.vue index f5cf1661..d5edf399 100644 --- a/src/components/extra_notifications/extra_notifications.vue +++ b/src/components/extra_notifications/extra_notifications.vue @@ -21,6 +21,29 @@ > {{ $tc('notifications.unread_follow_requests', followRequestCount, { num: followRequestCount }) }} + + + + @@ -45,5 +68,9 @@ border-color: $fallback--border; border-color: var(--border, $fallback--border); } + + .tip { + display: inline; + } } diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue index fcb92135..4dfba444 100644 --- a/src/components/settings_modal/tabs/notifications_tab.vue +++ b/src/components/settings_modal/tabs/notifications_tab.vue @@ -51,6 +51,47 @@ +
  • + + {{ $t('settings.notification_show_extra') }} + +
  • +
  • +
      +
    • + + {{ $t('settings.notification_extra_chats') }} + +
    • +
    • + + {{ $t('settings.notification_extra_announcements') }} + +
    • +
    • + + {{ $t('settings.notification_extra_follow_requests') }} + +
    • +
    • + + {{ $t('settings.notification_extra_tip') }} + +
    • +
    +
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index 62e80ce3..90e33648 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -208,7 +208,10 @@ "poll_ended": "poll has ended", "unread_announcements": "{num} unread announcement | {num} unread announcements", "unread_chats": "{num} unread chat | {num} unread chats", - "unread_follow_requests": "{num} new follow request | {num} new follow requests" + "unread_follow_requests": "{num} new follow request | {num} new follow requests", + "configuration_tip": "You can customize what to display here in {theSettings}. {dismiss}", + "configuration_tip_settings": "the settings", + "configuration_tip_dismiss": "Do not show again" }, "polls": { "add_poll": "Add poll", @@ -562,6 +565,11 @@ "notification_visibility_moves": "User Migrates", "notification_visibility_emoji_reactions": "Reactions", "notification_visibility_polls": "Ends of polls you voted in", + "notification_show_extra": "Show extra notifications in the notifications column", + "notification_extra_chats": "Show unread chats", + "notification_extra_announcements": "Show unread announcements", + "notification_extra_follow_requests": "Show new follow requests", + "notification_extra_tip": "Show the customization tip for extra notifications", "no_rich_text_description": "Strip rich text formatting from all posts", "no_blocks": "No blocks", "no_mutes": "No mutes", diff --git a/src/modules/config.js b/src/modules/config.js index 56f8cba5..dda3d221 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -117,6 +117,11 @@ export const defaultState = { conversationTreeAdvanced: undefined, // instance default conversationOtherRepliesButton: undefined, // instance default conversationTreeFadeAncestors: undefined, // instance default + showExtraNotifications: undefined, // instance default + showExtraNotificationsTip: undefined, // instance default + showChatsInExtraNotifications: undefined, // instance default + showAnnouncementsInExtraNotifications: undefined, // instance default + showFollowRequestsInExtraNotifications: undefined, // instance default maxDepthInThread: undefined, // instance default autocompleteSelect: undefined // instance default } diff --git a/src/modules/instance.js b/src/modules/instance.js index bb0292da..3972bd29 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -103,6 +103,11 @@ const defaultState = { conversationTreeAdvanced: false, conversationOtherRepliesButton: 'below', conversationTreeFadeAncestors: false, + showExtraNotifications: true, + showExtraNotificationsTip: true, + showChatsInExtraNotifications: true, + showAnnouncementsInExtraNotifications: true, + showFollowRequestsInExtraNotifications: true, maxDepthInThread: 6, autocompleteSelect: false, -- cgit v1.2.3-70-g09d2 From 1c180ace0b12ff85cb6cfe34bfc022b0f82b1c85 Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 18 Aug 2023 20:39:14 -0400 Subject: Fix router links to use route objects --- src/components/extra_notifications/extra_notifications.js | 3 +++ src/components/extra_notifications/extra_notifications.vue | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components/extra_notifications/extra_notifications.js') diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js index cd687eaf..01df12a3 100644 --- a/src/components/extra_notifications/extra_notifications.js +++ b/src/components/extra_notifications/extra_notifications.js @@ -17,6 +17,9 @@ const ExtraNotifications = { shouldShowCustomizationTip () { return this.mergedConfig.showExtraNotificationsTip && this.hasAnythingToShow }, + currentUser () { + return this.$store.state.users.currentUser + }, ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount', 'mergedConfig']) }, methods: { diff --git a/src/components/extra_notifications/extra_notifications.vue b/src/components/extra_notifications/extra_notifications.vue index d5edf399..7e09e5cc 100644 --- a/src/components/extra_notifications/extra_notifications.vue +++ b/src/components/extra_notifications/extra_notifications.vue @@ -3,21 +3,21 @@ {{ $tc('notifications.unread_chats', unreadChatCount, { num: unreadChatCount }) }} {{ $tc('notifications.unread_announcements', unreadAnnouncementCount, { num: unreadAnnouncementCount }) }} {{ $tc('notifications.unread_follow_requests', followRequestCount, { num: followRequestCount }) }} -- cgit v1.2.3-70-g09d2 From ebee2bda639988b3bfa29e0cfc9c6a76bfda5b07 Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 18 Aug 2023 21:35:56 -0400 Subject: Add icons to extra notifications --- .../extra_notifications/extra_notifications.js | 13 +++++++++++++ .../extra_notifications/extra_notifications.vue | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'src/components/extra_notifications/extra_notifications.js') diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js index 01df12a3..1bb0f837 100644 --- a/src/components/extra_notifications/extra_notifications.js +++ b/src/components/extra_notifications/extra_notifications.js @@ -1,5 +1,18 @@ import { mapGetters } from 'vuex' +import { library } from '@fortawesome/fontawesome-svg-core' +import { + faUserPlus, + faComments, + faBullhorn +} from '@fortawesome/free-solid-svg-icons' + +library.add( + faUserPlus, + faComments, + faBullhorn +) + const ExtraNotifications = { computed: { shouldShowChats () { diff --git a/src/components/extra_notifications/extra_notifications.vue b/src/components/extra_notifications/extra_notifications.vue index 308c79d1..512f515c 100644 --- a/src/components/extra_notifications/extra_notifications.vue +++ b/src/components/extra_notifications/extra_notifications.vue @@ -7,6 +7,11 @@ class="button-unstyled -link extra-notification" :to="{ name: 'chats', params: { username: currentUser.screen_name } }" > + {{ $tc('notifications.unread_chats', unreadChatCount, { num: unreadChatCount }) }} @@ -17,6 +22,11 @@ class="button-unstyled -link extra-notification" :to="{ name: 'announcements' }" > + {{ $tc('notifications.unread_announcements', unreadAnnouncementCount, { num: unreadAnnouncementCount }) }} @@ -27,6 +37,11 @@ class="button-unstyled -link extra-notification" :to="{ name: 'friend-requests' }" > + {{ $tc('notifications.unread_follow_requests', followRequestCount, { num: followRequestCount }) }} @@ -81,6 +96,10 @@ padding: 1em; } + .icon { + margin-right: 0.5em; + } + .tip { display: inline; } -- cgit v1.2.3-70-g09d2