diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 28b97041..2530b3db 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -1,12 +1,15 @@ describe("Course Creation", () => { it("creates a new course", () => { cy.login(); - cy.wait(1000); + cy.wait(500); cy.visit("/lms/courses"); + // Close onboarding modal + cy.closeOnboardingModal(); + // Create a course cy.get("button").contains("New").click(); - cy.wait(1000); + cy.wait(500); cy.url().should("include", "/courses/new/edit"); cy.get("label").contains("Title").type("Test Course"); @@ -96,7 +99,8 @@ describe("Course Creation", () => { // View Course cy.wait(1000); cy.visit("/lms"); - cy.wait(500); + cy.closeOnboardingModal(); + cy.url().should("include", "/lms/courses"); cy.get(".grid a:first").within(() => { cy.get("div").contains("Test Course"); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c8dd5cd5..d32be479 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -25,6 +25,7 @@ // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) import "cypress-file-upload"; +import "cypress-real-events"; Cypress.Commands.add("login", (email, password) => { if (!email) { @@ -68,3 +69,11 @@ Cypress.Commands.add("paste", { prevSubject: true }, (subject, text) => { element.dispatchEvent(event); }); }); + +Cypress.Commands.add("closeOnboardingModal", () => { + cy.wait(500); + cy.get('[class*="z-50"]') + .find('button:has(svg[class*="feather-x"])') + .realClick(); + cy.wait(1000); +}); diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 7bdb98c6..585aa545 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -47,11 +47,14 @@ declare module 'vue' { Discussions: typeof import('./src/components/Discussions.vue')['default'] EditCoverImage: typeof import('./src/components/Modals/EditCoverImage.vue')['default'] EditProfile: typeof import('./src/components/Modals/EditProfile.vue')['default'] + EmailTemplateModal: typeof import('./src/components/Modals/EmailTemplateModal.vue')['default'] + EmailTemplates: typeof import('./src/components/EmailTemplates.vue')['default'] EmptyState: typeof import('./src/components/EmptyState.vue')['default'] EvaluationModal: typeof import('./src/components/Modals/EvaluationModal.vue')['default'] Evaluators: typeof import('./src/components/Evaluators.vue')['default'] Event: typeof import('./src/components/Modals/Event.vue')['default'] ExplanationVideos: typeof import('./src/components/Modals/ExplanationVideos.vue')['default'] + FeedbackModal: typeof import('./src/components/Modals/FeedbackModal.vue')['default'] FrappeCloudIcon: typeof import('./src/components/Icons/FrappeCloudIcon.vue')['default'] IconPicker: typeof import('./src/components/Controls/IconPicker.vue')['default'] IndicatorIcon: typeof import('./src/components/Icons/IndicatorIcon.vue')['default'] diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6097fe09..5e4e4fb9 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -39,9 +39,9 @@ const Layout = computed(() => { } if (screenSize.width < 640) { return MobileLayout - } else { - return DesktopLayout } + + return DesktopLayout }) onMounted(async () => { diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index 94a5b8f6..682a4447 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -181,7 +181,6 @@ import UserDropdown from '@/components/UserDropdown.vue' import CollapseSidebar from '@/components/Icons/CollapseSidebar.vue' import SidebarLink from '@/components/SidebarLink.vue' -import { useStorage } from '@vueuse/core' import { ref, onMounted, inject, watch, reactive, markRaw, h } from 'vue' import { getSidebarLinks } from '../utils' import { usersStore } from '@/stores/user' @@ -244,6 +243,7 @@ const iconProps = { onMounted(() => { addNotifications() setSidebarLinks() + setUpOnboarding() socket.on('publish_lms_notifications', (data) => { unreadNotifications.reload() }) @@ -388,10 +388,6 @@ const deletePage = (link) => { ) } -const getSidebarFromStorage = () => { - return useStorage('sidebar_is_collapsed', false) -} - const toggleSidebar = () => { sidebarStore.isSidebarCollapsed = !sidebarStore.isSidebarCollapsed localStorage.setItem( @@ -438,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() @@ -453,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() @@ -471,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' }) @@ -502,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() @@ -522,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() diff --git a/frontend/src/components/BatchFeedback.vue b/frontend/src/components/BatchFeedback.vue index 0ea90014..1ee5a7f3 100644 --- a/frontend/src/components/BatchFeedback.vue +++ b/frontend/src/components/BatchFeedback.vue @@ -1,44 +1,49 @@