diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue
index 7f9a05d0..cb22560f 100644
--- a/frontend/src/components/AppSidebar.vue
+++ b/frontend/src/components/AppSidebar.vue
@@ -10,7 +10,7 @@
{
+ socket.on('publish_lms_notifications', (data) => {
+ unreadNotifications.reload()
})
-}
+})
+
+const unreadNotifications = createResource({
+ cache: 'Unread Notifications Count',
+ url: 'frappe.client.get_count',
+ makeParams(values) {
+ return {
+ doctype: 'Notification Log',
+ filters: {
+ for_user: user,
+ read: 0,
+ },
+ }
+ },
+ onSuccess(data) {
+ unreadCount.value = data
+ },
+ auto: true,
+})
+
+const sidebarLinks = computed(() => {
+ const links = getSidebarLinks()
+ if (user) {
+ links.push({
+ label: 'Notifications',
+ icon: Bell,
+ to: 'Notifications',
+ activeFor: ['Notifications'],
+ count: unreadCount.value,
+ })
+ }
+ return links
+})
const getSidebarFromStorage = () => {
return useStorage('sidebar_is_collapsed', false)
diff --git a/frontend/src/components/DiscussionReplies.vue b/frontend/src/components/DiscussionReplies.vue
index b35b9620..4b77a937 100644
--- a/frontend/src/components/DiscussionReplies.vue
+++ b/frontend/src/components/DiscussionReplies.vue
@@ -151,7 +151,16 @@ const newReplyResource = createResource({
})
const mentionUsers = computed(() => {
- return allUsers.data /* [{
+ console.log(allUsers.data['jannat@frappe.io'])
+ let users = Object.values(allUsers.data).map((user) => {
+ return {
+ value: user.name,
+ label: user.full_name,
+ }
+ })
+ return users
+
+ /* [{
label: "jannat",
value: "jannat"
}, {
diff --git a/frontend/src/components/SidebarLink.vue b/frontend/src/components/SidebarLink.vue
index 74a70014..37432a78 100644
--- a/frontend/src/components/SidebarLink.vue
+++ b/frontend/src/components/SidebarLink.vue
@@ -6,7 +6,7 @@
@click="handleClick"
>
@@ -29,6 +29,9 @@
>
{{ link.label }}
+
+ {{ link.count }}
+
diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue
index cb3f323c..4f48e033 100644
--- a/frontend/src/pages/Courses.vue
+++ b/frontend/src/pages/Courses.vue
@@ -57,6 +57,14 @@
v-if="tab.courses && tab.courses.value.length"
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5 my-5 mx-5"
>
+
+
+
+
+
-
+
-
- {{ __('View') }}
-
+
+
+ {{ __('View') }}
+
+
+
+
+
+
+
+ {{ __('Nothing to see here.') }}