From 49f4c878d67f29c277ac690a504b772879979562 Mon Sep 17 00:00:00 2001 From: raizasafeel <89463672+raizasafeel@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:30:22 +0530 Subject: [PATCH 1/5] fix(persona): moved to homepage from courses page --- frontend/src/pages/Courses/Courses.vue | 21 --------------------- frontend/src/pages/Home/Home.vue | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/frontend/src/pages/Courses/Courses.vue b/frontend/src/pages/Courses/Courses.vue index e871cbd0..733a448d 100644 --- a/frontend/src/pages/Courses/Courses.vue +++ b/frontend/src/pages/Courses/Courses.vue @@ -187,26 +187,6 @@ const setCategories = (data) => { } } -const isPersonaCaptured = async () => { - let persona = await call('frappe.client.get_single_value', { - doctype: 'LMS Settings', - field: 'persona_captured', - }) - return persona -} - -const identifyUserPersona = async () => { - if (user.data?.is_system_manager && !user.data?.developer_mode) { - let personaCaptured = await isPersonaCaptured() - if (personaCaptured) return - if (!courseCount.value) { - router.push({ - name: 'PersonaForm', - }) - } - } -} - const getCourseCount = () => { if (!user.data) return if (!user.data.is_moderator) return @@ -214,7 +194,6 @@ const getCourseCount = () => { doctype: 'LMS Course', }).then((data) => { courseCount.value = data - identifyUserPersona() }) } diff --git a/frontend/src/pages/Home/Home.vue b/frontend/src/pages/Home/Home.vue index ee742be5..eb2b6d2d 100644 --- a/frontend/src/pages/Home/Home.vue +++ b/frontend/src/pages/Home/Home.vue @@ -40,12 +40,14 @@ import { computed, inject, onMounted, ref } from 'vue' import { call, createResource, usePageMeta } from 'frappe-ui' import { sessionStore } from '@/stores/session' +import { useRouter } from 'vue-router' import StudentHome from '@/pages/Home/StudentHome.vue' import AdminHome from '@/pages/Home/AdminHome.vue' import Streak from '@/pages/Home/Streak.vue' const user = inject('$user') const { brand } = sessionStore() +const router = useRouter() const evalCount = ref(0) const currentTab = ref<'student' | 'instructor'>('student') const showStreakModal = ref(false) @@ -71,7 +73,29 @@ const isAdmin = computed(() => { ) }) +const isPersonaCaptured = async () => { + let persona = await call('frappe.client.get_single_value', { + doctype: 'LMS Settings', + field: 'persona_captured', + }) + return persona +} + +const identifyUserPersona = async () => { + if (user.data?.is_system_manager && !user.data?.developer_mode) { + let personaCaptured = await isPersonaCaptured() + if (personaCaptured) return + let courseCount = await call('frappe.client.get_count', { + doctype: 'LMS Course', + }) + if (!courseCount) { + router.push({ name: 'PersonaForm' }) + } + } +} + onMounted(() => { + identifyUserPersona() if (isAdmin.value) { currentTab.value = 'instructor' } else { From 9923b702e0aa7b2e61dc39bf6e8876cd3d58d5de Mon Sep 17 00:00:00 2001 From: raizasafeel <89463672+raizasafeel@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:37:54 +0530 Subject: [PATCH 2/5] refactor(persona): made persona labels/options smaller and simpler --- frontend/src/pages/PersonaForm.vue | 38 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/frontend/src/pages/PersonaForm.vue b/frontend/src/pages/PersonaForm.vue index 762be4e8..bec69473 100644 --- a/frontend/src/pages/PersonaForm.vue +++ b/frontend/src/pages/PersonaForm.vue @@ -17,30 +17,31 @@
-
- {{ __('What is your use case for Frappe Learning?') }} -
-
- {{ __('What best describes your role?') }} -
-
@@ -99,13 +100,13 @@ const skipPersonaForm = () => { const roleOptions = computed(() => { const options = [ - 'Trainer / Instructor', - 'Freelancer / Consultant', - 'HR / L&D Professional', - 'School / University Admin', - 'Software Developer', + 'Instructor', + 'Freelancer', + 'HR / L&D', + 'School Admin', + 'Developer', 'Community Manager', - 'Business Owner / Team Lead', + 'Business Owner', 'Other', ] @@ -132,10 +133,11 @@ const noOfStudentsOptions = computed(() => { const useCaseOptions = computed(() => { const options = [ - 'Teaching students in a school/university', - 'Training employees in my company', - 'Onboarding and educating my users/community', - 'Selling courses and earning income', + 'Teach students', + 'Train employees', + 'Onboard users or community', + 'Sell courses', + 'Share learning content', 'Other', ] From 865634ce821c018beab3cf8aad6d7a6571ab60e1 Mon Sep 17 00:00:00 2001 From: raizasafeel <89463672+raizasafeel@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:38:47 +0530 Subject: [PATCH 3/5] fix(persona): skip button now successfully redirects to courses --- frontend/src/pages/PersonaForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/PersonaForm.vue b/frontend/src/pages/PersonaForm.vue index bec69473..14bd277c 100644 --- a/frontend/src/pages/PersonaForm.vue +++ b/frontend/src/pages/PersonaForm.vue @@ -88,7 +88,7 @@ const submitPersona = () => { const skipPersonaForm = () => { call('frappe.client.set_value', { doctype: 'LMS Settings', - name: null, + name: 'LMS Settings', fieldname: 'persona_captured', value: 1, }).then(() => { From f24b0fd22b30facd2982ddf649edc3d583dcf683 Mon Sep 17 00:00:00 2001 From: raizasafeel <89463672+raizasafeel@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:20:00 +0530 Subject: [PATCH 4/5] fix(persona): skip/continue button redirects to Home page --- frontend/src/pages/PersonaForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/PersonaForm.vue b/frontend/src/pages/PersonaForm.vue index 14bd277c..f397e4e0 100644 --- a/frontend/src/pages/PersonaForm.vue +++ b/frontend/src/pages/PersonaForm.vue @@ -80,7 +80,7 @@ const submitPersona = () => { responses: JSON.stringify(responses), }).then(() => { router.push({ - name: 'Courses', + name: 'Home', }) }) } @@ -93,7 +93,7 @@ const skipPersonaForm = () => { value: 1, }).then(() => { router.push({ - name: 'Courses', + name: 'Home', }) }) } From 8d3485742b26ce50cbfc24547f7a3cb32cc3e5eb Mon Sep 17 00:00:00 2001 From: raizasafeel <89463672+raizasafeel@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:27:02 +0530 Subject: [PATCH 5/5] revert: 'refactor(persona): made persona labels/options smaller and simpler' --- frontend/src/pages/PersonaForm.vue | 38 ++++++++++++++---------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/frontend/src/pages/PersonaForm.vue b/frontend/src/pages/PersonaForm.vue index f397e4e0..015db21b 100644 --- a/frontend/src/pages/PersonaForm.vue +++ b/frontend/src/pages/PersonaForm.vue @@ -17,31 +17,30 @@
+
+ {{ __('What is your use case for Frappe Learning?') }} +
+
+ {{ __('What best describes your role?') }} +
-
@@ -100,13 +99,13 @@ const skipPersonaForm = () => { const roleOptions = computed(() => { const options = [ - 'Instructor', - 'Freelancer', - 'HR / L&D', - 'School Admin', - 'Developer', + 'Trainer / Instructor', + 'Freelancer / Consultant', + 'HR / L&D Professional', + 'School / University Admin', + 'Software Developer', 'Community Manager', - 'Business Owner', + 'Business Owner / Team Lead', 'Other', ] @@ -133,11 +132,10 @@ const noOfStudentsOptions = computed(() => { const useCaseOptions = computed(() => { const options = [ - 'Teach students', - 'Train employees', - 'Onboard users or community', - 'Sell courses', - 'Share learning content', + 'Teaching students in a school/university', + 'Training employees in my company', + 'Onboarding and educating my users/community', + 'Selling courses and earning income', 'Other', ]