From 78ec4663ccd5cf5e1432c728a6ad91e150702c16 Mon Sep 17 00:00:00 2001 From: Pujit Mehrotra Date: Mon, 9 Dec 2024 10:22:51 -0500 Subject: [PATCH] feat(web): add count labels to notification tabs --- justfile | 3 +++ web/components/Loading/Error.vue | 1 - web/components/Notifications/Indicator.vue | 4 ++-- web/components/Notifications/Sidebar.vue | 5 +--- web/components/Notifications/TabList.vue | 24 +++++++++++++++++++ .../graphql/notification.query.ts | 6 ++++- web/composables/gql/gql.ts | 4 ++-- web/composables/gql/graphql.ts | 4 ++-- 8 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 web/components/Notifications/TabList.vue diff --git a/justfile b/justfile index 33a2b726a..e1be9d01d 100644 --- a/justfile +++ b/justfile @@ -16,6 +16,9 @@ setup: just api/setup just web/setup +# restore notification files under api/dev +restore-notifications: + git checkout ./api/dev/notifications # starts ignoring a file already tracked by git. (gitignore will not apply to these files) [group('git')] diff --git a/web/components/Loading/Error.vue b/web/components/Loading/Error.vue index ff79ab312..3e83face4 100644 --- a/web/components/Loading/Error.vue +++ b/web/components/Loading/Error.vue @@ -22,7 +22,6 @@ import { cn } from '~/components/shadcn/utils'; const props = withDefaults( defineProps<{ class?: string; - /** hasdfsa */ loading: boolean; error: Error | null | undefined; }>(), diff --git a/web/components/Notifications/Indicator.vue b/web/components/Notifications/Indicator.vue index dc5cbce37..623191a3a 100644 --- a/web/components/Notifications/Indicator.vue +++ b/web/components/Notifications/Indicator.vue @@ -4,9 +4,9 @@ import { useQuery } from '@vue/apollo-composable'; import { cn } from '~/components/shadcn/utils'; import { Importance } from '~/composables/gql/graphql'; import { onWatcherCleanup } from 'vue'; -import { unreadOverview } from './graphql/notification.query'; +import { notificationsOverview } from './graphql/notification.query'; -const { result } = useQuery(unreadOverview, null, { +const { result } = useQuery(notificationsOverview, null, { pollInterval: 2_000, // 2 seconds }); diff --git a/web/components/Notifications/Sidebar.vue b/web/components/Notifications/Sidebar.vue index 29ad5d538..3e2c0c0b0 100644 --- a/web/components/Notifications/Sidebar.vue +++ b/web/components/Notifications/Sidebar.vue @@ -50,10 +50,7 @@ const confirmAndDeleteAll = async () => {
- - Unread - Archived - +