From 5b3c0685acdf73ca71bad6c8ce88d0ec34f1d23b Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Wed, 12 Mar 2025 14:08:25 +0530 Subject: [PATCH 01/35] feat: track current tab in batches and courses page --- frontend/src/pages/Batches.vue | 3 ++- frontend/src/pages/Courses.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Batches.vue b/frontend/src/pages/Batches.vue index dd46a7bf..dc897072 100644 --- a/frontend/src/pages/Batches.vue +++ b/frontend/src/pages/Batches.vue @@ -105,6 +105,7 @@ import { Select, TabButtons, } from 'frappe-ui' +import { useRouteQuery } from '@vueuse/router' import { computed, inject, onMounted, ref, watch } from 'vue' import { BookOpen, Plus } from 'lucide-vue-next' import { updateDocumentTitle } from '@/utils' @@ -119,7 +120,7 @@ const currentCategory = ref(null) const title = ref('') const certification = ref(false) const filters = ref({}) -const currentTab = ref(user.data?.is_student ? 'All' : 'Upcoming') +const currentTab = useRouteQuery('tab', user.data?.is_student ? 'All' : 'Upcoming') const orderBy = ref('start_date') onMounted(() => { diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index 769b0121..935b4186 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -105,6 +105,7 @@ import { Select, TabButtons, } from 'frappe-ui' +import { useRouteQuery } from '@vueuse/router' import { computed, inject, onMounted, ref, watch } from 'vue' import { BookOpen, Plus } from 'lucide-vue-next' import { updateDocumentTitle } from '@/utils' @@ -119,7 +120,7 @@ const currentCategory = ref(null) const title = ref('') const certification = ref(false) const filters = ref({}) -const currentTab = ref('Live') +const currentTab = useRouteQuery('tab', 'Live') onMounted(() => { setFiltersFromQuery() From abd14aa33caf77197b9d33d8e81f6d72a52d5d56 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Wed, 12 Mar 2025 14:31:53 +0530 Subject: [PATCH 02/35] chore: remove dead code --- frontend/src/pages/Courses.vue | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index 935b4186..634eeb6e 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -276,21 +276,6 @@ watch(currentTab, () => { updateCourses() }) -const courseType = computed(() => { - let types = [ - { label: __(''), value: null }, - { label: __('New'), value: 'New' }, - { label: __('Upcoming'), value: 'Upcoming' }, - ] - if (user.data?.is_student) { - types.push({ label: __('Enrolled'), value: 'Enrolled' }) - } - if (user.data?.is_moderator || user.data?.is_instructor) { - types.push({ label: __('Created'), value: 'Created' }) - } - return types -}) - const courseTabs = computed(() => { let tabs = [ { From a24afad641f130a22ec1ce90214574e56c9a526f Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Wed, 12 Mar 2025 14:36:07 +0530 Subject: [PATCH 03/35] chore: more dead code --- frontend/src/pages/Batches.vue | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/frontend/src/pages/Batches.vue b/frontend/src/pages/Batches.vue index dc897072..788f1f4f 100644 --- a/frontend/src/pages/Batches.vue +++ b/frontend/src/pages/Batches.vue @@ -271,18 +271,6 @@ watch(currentTab, () => { updateBatches() }) -const batchType = computed(() => { - let types = [ - { label: __(''), value: null }, - { label: __('Upcoming'), value: 'Upcoming' }, - { label: __('Archived'), value: 'Archived' }, - ] - if (user.data?.is_moderator) { - types.push({ label: __('Unpublished'), value: 'Unpublished' }) - } - return types -}) - const batchTabs = computed(() => { let tabs = [ { From be9525dbf2fb6bfbb5898a2ba244e7e3f4bd34da Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Wed, 12 Mar 2025 14:37:50 +0530 Subject: [PATCH 04/35] fix: empty query string with trailing ? Fixes #1376 --- frontend/src/pages/Batches.vue | 7 ++++++- frontend/src/pages/Courses.vue | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Batches.vue b/frontend/src/pages/Batches.vue index 788f1f4f..4a3a05b9 100644 --- a/frontend/src/pages/Batches.vue +++ b/frontend/src/pages/Batches.vue @@ -251,7 +251,12 @@ const setQueryParams = () => { } }) - history.replaceState({}, '', `${location.pathname}?${queries.toString()}`) + let queryString = ''; + if (queries.toString()) { + queryString = `?${queries.toString()}` + } + + history.replaceState({}, '', `${location.pathname}${queryString}`) } const updateCategories = (data) => { diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index 634eeb6e..51cf56aa 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -256,7 +256,13 @@ const setQueryParams = () => { } }) - history.replaceState({}, '', `${location.pathname}?${queries.toString()}`) + + let queryString = ''; + if (queries.toString()) { + queryString = `?${queries.toString()}` + } + + history.replaceState({}, '', `${location.pathname}${queryString}`) } const updateCategories = (data) => { From 1dbe2f31d068dc99dce2b15e4fe069fe75945c85 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Wed, 12 Mar 2025 14:40:45 +0530 Subject: [PATCH 05/35] fix: linter --- frontend/src/pages/Batches.vue | 7 +++++-- frontend/src/pages/Courses.vue | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Batches.vue b/frontend/src/pages/Batches.vue index 4a3a05b9..c7db7079 100644 --- a/frontend/src/pages/Batches.vue +++ b/frontend/src/pages/Batches.vue @@ -120,7 +120,10 @@ const currentCategory = ref(null) const title = ref('') const certification = ref(false) const filters = ref({}) -const currentTab = useRouteQuery('tab', user.data?.is_student ? 'All' : 'Upcoming') +const currentTab = useRouteQuery( + 'tab', + user.data?.is_student ? 'All' : 'Upcoming' +) const orderBy = ref('start_date') onMounted(() => { @@ -251,7 +254,7 @@ const setQueryParams = () => { } }) - let queryString = ''; + let queryString = '' if (queries.toString()) { queryString = `?${queries.toString()}` } diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index 51cf56aa..c43ad88a 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -256,8 +256,7 @@ const setQueryParams = () => { } }) - - let queryString = ''; + let queryString = '' if (queries.toString()) { queryString = `?${queries.toString()}` } From 4a0812dfe9c52e2061bc2ae5c118e4f91f6df7da Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 13 Mar 2025 06:08:00 +0530 Subject: [PATCH 06/35] fix: batch reminder email subject and content --- frontend/src/components/CertificationLinks.vue | 18 ++++++++++++++++-- lms/lms/api.py | 5 +++-- lms/lms/doctype/lms_batch/lms_batch.py | 4 ++-- .../doctype/lms_live_class/lms_live_class.py | 2 +- lms/templates/emails/batch_start_reminder.html | 9 +++------ lms/templates/emails/live_class_reminder.html | 8 +++----- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/CertificationLinks.vue b/frontend/src/components/CertificationLinks.vue index 1ddc22f4..2b68e56a 100644 --- a/frontend/src/components/CertificationLinks.vue +++ b/frontend/src/components/CertificationLinks.vue @@ -1,6 +1,12 @@