From 45e630fc60b06692c3529ee546e13b2debfce919 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:23:16 +0530 Subject: [PATCH] feat: Inbox list display menu (#8847) * feat: Inbox list display menu * chore: Fix alignment --- .../dashboard/i18n/locale/en/inbox.json | 15 ++ .../routes/dashboard/inbox/InboxView.vue | 2 + .../inbox/components/InboxDisplayMenu.vue | 169 ++++++++++++++++++ .../inbox/components/InboxListHeader.vue | 38 ++-- 4 files changed, 210 insertions(+), 14 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/inbox/components/InboxDisplayMenu.vue diff --git a/app/javascript/dashboard/i18n/locale/en/inbox.json b/app/javascript/dashboard/i18n/locale/en/inbox.json index c87f5163f..ce176d7cb 100644 --- a/app/javascript/dashboard/i18n/locale/en/inbox.json +++ b/app/javascript/dashboard/i18n/locale/en/inbox.json @@ -27,6 +27,21 @@ "MARK_ALL_READ": "Mark all as read", "DELETE_ALL": "Delete all", "DELETE_ALL_READ": "Delete all read" + }, + "DISPLAY_MENU": { + "SORT": "Sort", + "DISPLAY": "Display :", + "SORT_OPTIONS": { + "NEWEST": "Newest", + "OLDEST": "Oldest", + "PRIORITY": "Priority" + }, + "DISPLAY_OPTIONS": { + "SNOOZED": "Snoozed", + "READ": "Read", + "LABELS": "Labels", + "CONVERSATION_ID": "Conversation ID" + } } } } diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue index 4867a28b1..5e6ee481b 100644 --- a/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue +++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxView.vue @@ -166,6 +166,7 @@ export default { const targetNotification = this.notifications[activeIndex + indexOffset]; if (targetNotification) { const { + id, primary_actor_id: primaryActorId, primary_actor_type: primaryActorType, primary_actor: { id: conversationId, meta: { unreadCount } = {} }, @@ -177,6 +178,7 @@ export default { }); this.$store.dispatch('notifications/read', { + id, primaryActorId, primaryActorType, unreadCount, diff --git a/app/javascript/dashboard/routes/dashboard/inbox/components/InboxDisplayMenu.vue b/app/javascript/dashboard/routes/dashboard/inbox/components/InboxDisplayMenu.vue new file mode 100644 index 000000000..24316270c --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/inbox/components/InboxDisplayMenu.vue @@ -0,0 +1,169 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/inbox/components/InboxListHeader.vue b/app/javascript/dashboard/routes/dashboard/inbox/components/InboxListHeader.vue index e674b693a..d58e89230 100644 --- a/app/javascript/dashboard/routes/dashboard/inbox/components/InboxListHeader.vue +++ b/app/javascript/dashboard/routes/dashboard/inbox/components/InboxListHeader.vue @@ -6,20 +6,27 @@

{{ $t('INBOX.LIST.TITLE') }}

-
- +
- {{ $t('INBOX.LIST.DISPLAY_DROPDOWN') }} - - + {{ $t('INBOX.LIST.DISPLAY_DROPDOWN') }} + + +
+
@@ -50,19 +57,22 @@