diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue
index c4d5d87e9..857b52ef2 100644
--- a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue
+++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue
@@ -4,7 +4,7 @@
:class="isOnExpandedLayout ? '' : 'min-w-[360px] max-w-[360px]'"
>
@@ -19,8 +19,9 @@
@mark-notification-as-read="markNotificationAsRead"
@mark-notification-as-unread="markNotificationAsUnRead"
@delete-notification="deleteNotification"
- @context-menu-open="isContextMenuOpen = true"
- @context-menu-close="isContextMenuOpen = false"
+ @snooze-notification="openSnoozeNotificationModal"
+ @context-menu-open="isInboxContextMenuOpen = true"
+ @context-menu-close="isInboxContextMenuOpen = false"
/>
@@ -76,7 +77,7 @@ export default {
status: '',
type: '',
sortOrder: wootConstants.INBOX_SORT_BY.NEWEST,
- isContextMenuOpen: false,
+ isInboxContextMenuOpen: false,
};
},
computed: {
@@ -191,6 +192,10 @@ export default {
this.type = type;
this.sortOrder = sortBy || wootConstants.INBOX_SORT_BY.NEWEST;
},
+ openSnoozeNotificationModal() {
+ const ninja = document.querySelector('ninja-keys');
+ ninja.open({ parent: 'snooze_notification' });
+ },
},
};
diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue
index cbc473ac4..7926c2540 100644
--- a/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue
+++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue
@@ -17,7 +17,11 @@
@next="onClickNext"
@prev="onClickPrev"
/>
+
+
+
{
diff --git a/app/javascript/dashboard/routes/dashboard/inbox/components/InboxCard.vue b/app/javascript/dashboard/routes/dashboard/inbox/components/InboxCard.vue
index f61e8680d..65f5ed4c9 100644
--- a/app/javascript/dashboard/routes/dashboard/inbox/components/InboxCard.vue
+++ b/app/javascript/dashboard/routes/dashboard/inbox/components/InboxCard.vue
@@ -89,6 +89,7 @@ export default {
return {
isContextMenuOpen: false,
contextMenuPosition: { x: null, y: null },
+ activeNotificationId: null,
};
},
computed: {
@@ -96,7 +97,9 @@ export default {
return this.notificationItem?.primary_actor;
},
isInboxCardActive() {
- return this.$route.params.conversation_id === this.primaryActor?.id;
+ return (
+ Number(this.activeNotificationId) === Number(this.notificationItem?.id)
+ );
},
inbox() {
return this.$store.getters['inboxes/getInbox'](
@@ -109,6 +112,12 @@ export default {
meta() {
return this.primaryActor?.meta;
},
+ isNotSnoozed() {
+ return (
+ !this.notificationItem?.snoozed_until &&
+ this.$route.params.notification_id
+ );
+ },
assigneeMeta() {
return this.meta?.assignee;
},
@@ -131,6 +140,12 @@ export default {
},
];
+ if (this.isNotSnoozed) {
+ items.push({
+ key: 'snooze',
+ label: this.$t('INBOX.MENU_ITEM.SNOOZE'),
+ });
+ }
if (!this.isUnread) {
items.push({
key: 'mark_as_unread',
@@ -157,6 +172,14 @@ export default {
return '';
},
},
+ watch: {
+ '$route.params.notification_id': {
+ immediate: true,
+ handler(newVal) {
+ this.activeNotificationId = newVal;
+ },
+ },
+ },
unmounted() {
this.closeContextMenu();
},
@@ -214,6 +237,9 @@ export default {
case 'delete':
this.$emit('delete-notification', this.notificationItem);
break;
+ case 'snooze':
+ this.$emit('snooze-notification', this.notificationItem);
+ break;
default:
}
},