logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: d096962b054a49fb4971da30a801738838d08ca0
parent f0f323b49c40ac48fe175afcffe69b633eb362a3
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Sun, 21 Jul 2024 19:44:05 +0000

Merge branch 'status-notification-type' into 'develop'

Support `status` notification type

See merge request pleroma/pleroma-fe!1916

Diffstat:

Achangelog.d/status-notification-type.add2++
Msrc/components/interactions/interactions.js1+
Msrc/components/interactions/interactions.vue6+++++-
Msrc/components/notification/notification.vue2+-
Msrc/components/notifications/notification_filters.vue9+++++++++
Msrc/components/notifications/notifications.js2+-
Msrc/components/settings_modal/tabs/notifications_tab.vue15+++++++++++++++
Msrc/i18n/en.json7+++++--
Msrc/modules/config.js2++
Msrc/services/notification_utils/notification_utils.js6+++++-
Msrc/services/notifications_fetcher/notifications_fetcher.service.js1+
Msrc/sw.js2++
12 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/changelog.d/status-notification-type.add b/changelog.d/status-notification-type.add @@ -0,0 +1 @@ +Support `status` notification type +\ No newline at end of file diff --git a/src/components/interactions/interactions.js b/src/components/interactions/interactions.js @@ -3,6 +3,7 @@ import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' const tabModeDict = { mentions: ['mention'], + statuses: ['status'], 'likes+repeats': ['repeat', 'like'], follows: ['follow'], reactions: ['pleroma:emoji_reaction'], diff --git a/src/components/interactions/interactions.vue b/src/components/interactions/interactions.vue @@ -10,10 +10,14 @@ :on-switch="onModeSwitch" > <span - key="mentions" + key="statuses" :label="$t('nav.mentions')" /> <span + key="statuses" + :label="$t('interactions.statuses')" + /> + <span key="likes+repeats" :label="$t('interactions.favs_repeats')" /> diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue @@ -1,6 +1,6 @@ <template> <article - v-if="notification.type === 'mention'" + v-if="notification.type === 'mention' || notification.type === 'status'" > <Status class="Notification" diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue @@ -45,6 +45,15 @@ </button> <button class="menu-item dropdown-item" + @click="toggleNotificationFilter('statuses')" + > + <span + class="input menu-checkbox" + :class="{ 'menu-checkbox-checked': filters.statuses }" + />{{ $t('settings.notification_visibility_statuses') }} + </button> + <button + class="menu-item dropdown-item" @click="toggleNotificationFilter('emojiReactions')" > <span diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js @@ -33,7 +33,7 @@ const Notifications = { // Disables panel styles, unread mark, potentially other notification-related actions // meant for "Interactions" timeline minimalMode: Boolean, - // Custom filter mode, an array of strings, possible values 'mention', 'repeat', 'like', 'follow', used to override global filter for use in "Interactions" timeline + // Custom filter mode, an array of strings, possible values 'mention', 'status', 'repeat', 'like', 'follow', used to override global filter for use in "Interactions" timeline filterMode: Array, // Do not show extra notifications noExtra: { diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue @@ -61,6 +61,21 @@ </ul> </li> <li> + <h4> {{ $t('settings.notification_visibility_statuses') }}</h4> + <ul class="setting-list"> + <li> + <BooleanSetting path="notificationVisibility.statuses"> + {{ $t('settings.notification_visibility_in_column') }} + </BooleanSetting> + </li> + <li> + <BooleanSetting path="notificationNative.statuses"> + {{ $t('settings.notification_visibility_native_notifications') }} + </BooleanSetting> + </li> + </ul> + </li> + <li> <h4> {{ $t('settings.notification_visibility_likes') }}</h4> <ul class="setting-list"> <li> diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -212,7 +212,8 @@ "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" + "configuration_tip_dismiss": "Do not show again", + "subscribed_status": "posted" }, "polls": { "add_poll": "Add poll", @@ -264,7 +265,8 @@ "emoji_reactions": "Emoji Reactions", "reports": "Reports", "moves": "User migrates", - "load_older": "Load older interactions" + "load_older": "Load older interactions", + "statuses": "Subscriptions" }, "post_status": { "edit_status": "Edit status", @@ -588,6 +590,7 @@ "notification_visibility_moves": "User Migrates", "notification_visibility_emoji_reactions": "Reactions", "notification_visibility_polls": "Ends of polls you voted in", + "notification_visibility_statuses": "Subscriptions", "notification_show_extra": "Show extra notifications in the notifications column", "notification_extra_chats": "Show unread chats", "notification_extra_announcements": "Show unread announcements", diff --git a/src/modules/config.js b/src/modules/config.js @@ -60,6 +60,7 @@ export const defaultState = { notificationVisibility: { follows: true, mentions: true, + statuses: true, likes: true, repeats: true, moves: true, @@ -72,6 +73,7 @@ export const defaultState = { notificationNative: { follows: true, mentions: true, + statuses: true, likes: false, repeats: false, moves: false, diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js @@ -18,6 +18,7 @@ export const visibleTypes = store => { return ([ notificationVisibility.likes && 'like', notificationVisibility.mentions && 'mention', + notificationVisibility.statuses && 'status', notificationVisibility.repeats && 'repeat', notificationVisibility.follows && 'follow', notificationVisibility.followRequest && 'follow_request', @@ -28,7 +29,7 @@ export const visibleTypes = store => { ].filter(_ => _)) } -const statusNotifications = new Set(['like', 'mention', 'repeat', 'pleroma:emoji_reaction', 'poll']) +const statusNotifications = new Set(['like', 'mention', 'status', 'repeat', 'pleroma:emoji_reaction', 'poll']) export const isStatusNotification = (type) => statusNotifications.has(type) @@ -118,6 +119,9 @@ export const prepareNotificationObject = (notification, i18n) => { case 'like': i18nString = 'favorited_you' break + case 'status': + i18nString = 'subscribed_status' + break case 'repeat': i18nString = 'repeated_you' break diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -5,6 +5,7 @@ import { promiseInterval } from '../promise_interval/promise_interval.js' // Note: chat_mention excluded as pleroma-fe polls them separately const mastoApiNotificationTypes = [ 'mention', + 'status', 'favourite', 'reblog', 'follow', diff --git a/src/sw.js b/src/sw.js @@ -38,6 +38,8 @@ const setSettings = async () => { switch (k) { case 'mentions': return 'mention' + case 'statuses': + return 'status' case 'likes': return 'like' case 'repeats':