From 589337116ad3cfd68c71f8fd9a77d9d611a8ceaa Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 26 May 2025 09:59:05 +0530 Subject: [PATCH 1/3] fix: added dependencies for onboarding steps --- frontend/src/components/AppSidebar.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index 2d1508b6..682a4447 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -434,6 +434,7 @@ const steps = reactive([ title: __('Add your first chapter'), icon: markRaw(h(FolderTree, iconProps)), completed: false, + dependsOn: 'create_first_course', onClick: async () => { minimize.value = true let course = await getFirstCourse() @@ -449,6 +450,7 @@ const steps = reactive([ title: __('Add your first lesson'), icon: markRaw(h(FileText, iconProps)), completed: false, + dependsOn: 'create_first_chapter', onClick: async () => { minimize.value = true let course = await getFirstCourse() @@ -467,6 +469,7 @@ const steps = reactive([ title: __('Create your first quiz'), icon: markRaw(h(CircleHelp, iconProps)), completed: false, + dependsOn: 'create_first_course', onClick: () => { minimize.value = true router.push({ name: 'Quizzes' }) @@ -498,6 +501,7 @@ const steps = reactive([ title: __('Add students to your batch'), icon: markRaw(h(UserPlus, iconProps)), completed: false, + dependsOn: 'create_first_batch', onClick: async () => { minimize.value = true let batch = await getFirstBatch() @@ -518,6 +522,7 @@ const steps = reactive([ title: __('Add courses to your batch'), icon: markRaw(h(BookText, iconProps)), completed: false, + dependsOn: 'create_first_batch', onClick: async () => { minimize.value = true let batch = await getFirstBatch() From 80ceb49358fdbc13b13e2b54dbddd9ae1cdacfb5 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 26 May 2025 10:58:17 +0530 Subject: [PATCH 2/3] fix: login menu now works on all browsers and devices --- frontend/src/components/MobileLayout.vue | 140 ++++++++++++++--------- 1 file changed, 84 insertions(+), 56 deletions(-) diff --git a/frontend/src/components/MobileLayout.vue b/frontend/src/components/MobileLayout.vue index e7846452..2bf061c4 100644 --- a/frontend/src/components/MobileLayout.vue +++ b/frontend/src/components/MobileLayout.vue @@ -1,60 +1,55 @@ @@ -64,7 +59,6 @@ import { useRouter } from 'vue-router' import { watch, ref, onMounted } from 'vue' import { sessionStore } from '@/stores/session' import { usersStore } from '@/stores/user' -import { Popover } from 'frappe-ui' import * as icons from 'lucide-vue-next' const { logout, user, sidebarSettings } = sessionStore() @@ -73,26 +67,47 @@ const router = useRouter() let { userResource } = usersStore() const sidebarLinks = ref(getSidebarLinks()) const otherLinks = ref([]) +const showMenu = ref(false) +const menu = ref(null) onMounted(() => { sidebarSettings.reload( {}, { onSuccess(data) { - Object.keys(data).forEach((key) => { - if (!parseInt(data[key])) { - sidebarLinks.value = sidebarLinks.value.filter( - (link) => link.label.toLowerCase().split(' ').join('_') !== key - ) - } - }) - + filterLinksToShow(data) addOtherLinks() }, } ) }) +const handleOutsideClick = (e) => { + if (menu.value && !menu.value.contains(e.target)) { + showMenu.value = false + } +} + +watch(showMenu, (val) => { + if (val) { + setTimeout(() => { + document.addEventListener('click', handleOutsideClick) + }, 0) + } else { + document.removeEventListener('click', handleOutsideClick) + } +}) + +const filterLinksToShow = (data) => { + Object.keys(data).forEach((key) => { + if (!parseInt(data[key])) { + sidebarLinks.value = sidebarLinks.value.filter( + (link) => link.label.toLowerCase().split(' ').join('_') !== key + ) + } + }) +} + const addOtherLinks = () => { if (user) { otherLinks.value.push({ @@ -122,6 +137,7 @@ watch(userResource, () => { (userResource.data.is_moderator || userResource.data.is_instructor) ) { addQuizzes() + addAssignments() } }) @@ -133,6 +149,14 @@ const addQuizzes = () => { }) } +const addAssignments = () => { + otherLinks.value.push({ + label: 'Assignments', + icon: 'Pencil', + to: 'Assignments', + }) +} + let isActive = (tab) => { return tab.activeFor?.includes(router.currentRoute.value.name) } @@ -158,4 +182,8 @@ const isVisible = (tab) => { else if (tab.label == 'Log out') return isLoggedIn else return true } + +const toggleMenu = () => { + showMenu.value = !showMenu.value +} From 4ea07a95e737ba8792ccd93f7ae043d875439048 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 26 May 2025 11:04:00 +0530 Subject: [PATCH 3/3] fix: show batch CTA's on mobile --- frontend/src/pages/BatchDetail.vue | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/frontend/src/pages/BatchDetail.vue b/frontend/src/pages/BatchDetail.vue index ecf28a9e..eaeeb482 100644 --- a/frontend/src/pages/BatchDetail.vue +++ b/frontend/src/pages/BatchDetail.vue @@ -37,14 +37,7 @@ - +