logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 3287ce94539973018fac7cf4bed2f2c4643f838e
parent c93adf2e9a8ac6bfbe1e6cebde1d189475b3cb58
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Sun, 22 May 2022 16:25:22 +0000

Merge branch 'from/develop/tusooa/poll-notif' into 'develop'

Poll-end notifications

See merge request pleroma/pleroma-fe!1524

Diffstat:

Msrc/components/notification/notification.vue8++++++++
Msrc/components/notifications/notification_filters.vue9+++++++++
Msrc/components/settings_modal/tabs/notifications_tab.vue5+++++
Msrc/i18n/en.json4+++-
Msrc/modules/config.js3++-
Msrc/services/notification_utils/notification_utils.js8++++++--
6 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue @@ -120,6 +120,14 @@ </i18n-t> </small> </span> + <span v-if="notification.type === 'poll'"> + <FAIcon + class="type-icon" + icon="poll-h" + /> + {{ ' ' }} + <small>{{ $t('notifications.poll_ended') }}</small> + </span> </div> <div v-if="isStatusNotification" diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue @@ -61,6 +61,15 @@ :class="{ 'menu-checkbox-checked': filters.moves }" />{{ $t('settings.notification_visibility_moves') }} </button> + <button + class="button-default dropdown-item" + @click="toggleNotificationFilter('polls')" + > + <span + class="menu-checkbox" + :class="{ 'menu-checkbox-checked': filters.polls }" + />{{ $t('settings.notification_visibility_polls') }} + </button> </div> </template> <template v-slot:trigger> diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue @@ -41,6 +41,11 @@ {{ $t('settings.notification_visibility_emoji_reactions') }} </BooleanSetting> </li> + <li> + <BooleanSetting path="notificationVisibility.polls"> + {{ $t('settings.notification_visibility_polls') }} + </BooleanSetting> + </li> </ul> </li> </ul> diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -160,7 +160,8 @@ "repeated_you": "repeated your status", "no_more_notifications": "No more notifications", "migrated_to": "migrated to", - "reacted_with": "reacted with {0}" + "reacted_with": "reacted with {0}", + "poll_ended": "poll has ended" }, "polls": { "add_poll": "Add poll", @@ -427,6 +428,7 @@ "notification_visibility_repeats": "Repeats", "notification_visibility_moves": "User Migrates", "notification_visibility_emoji_reactions": "Reactions", + "notification_visibility_polls": "Ends of polls you voted in", "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 @@ -54,7 +54,8 @@ export const defaultState = { moves: true, emojiReactions: true, followRequest: true, - chatMention: true + chatMention: true, + polls: true }, webPushNotifications: false, muteWords: [], diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js @@ -14,11 +14,12 @@ export const visibleTypes = store => { rootState.config.notificationVisibility.follows && 'follow', rootState.config.notificationVisibility.followRequest && 'follow_request', rootState.config.notificationVisibility.moves && 'move', - rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction' + rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction', + rootState.config.notificationVisibility.polls && 'poll' ].filter(_ => _)) } -const statusNotifications = ['like', 'mention', 'repeat', 'pleroma:emoji_reaction'] +const statusNotifications = ['like', 'mention', 'repeat', 'pleroma:emoji_reaction', 'poll'] export const isStatusNotification = (type) => includes(statusNotifications, type) @@ -98,6 +99,9 @@ export const prepareNotificationObject = (notification, i18n) => { case 'follow_request': i18nString = 'follow_request' break + case 'poll': + i18nString = 'poll_ended' + break } if (notification.type === 'pleroma:emoji_reaction') {