diff --git a/frontend/src/components/Layouts/AppSidebar.vue b/frontend/src/components/Layouts/AppSidebar.vue index 86e12133..28e84987 100644 --- a/frontend/src/components/Layouts/AppSidebar.vue +++ b/frontend/src/components/Layouts/AppSidebar.vue @@ -14,8 +14,23 @@ :icon="NotificationsIcon" :isCollapsed="isSidebarCollapsed" @click="() => toggleNotificationPanel()" - class="mx-2 my-0.5" - /> + class="relative mx-2 my-0.5" + > + +
- - - - - - - - - {{ label }} - +
+ + + + + + + + + {{ label }} + +
+
diff --git a/frontend/src/stores/notifications.js b/frontend/src/stores/notifications.js index 933bd32d..bb7e92ea 100644 --- a/frontend/src/stores/notifications.js +++ b/frontend/src/stores/notifications.js @@ -22,6 +22,9 @@ export const notificationsStore = defineStore('crm-notifications', () => { } const allNotifications = computed(() => notifications.data || []) + const unreadNotificationsCount = computed( + () => notifications.data?.filter((n) => !n.read).length || 0 + ) function mark_comment_as_read(comment) { mark_as_read.params = { comment: comment } @@ -32,6 +35,7 @@ export const notificationsStore = defineStore('crm-notifications', () => { return { visible, allNotifications, + unreadNotificationsCount, mark_as_read, mark_comment_as_read, toggle,