From 876eebe15d82a988892586747d1926988071a6a3 Mon Sep 17 00:00:00 2001 From: Raizaaa <89463672+raizasafeel@users.noreply.github.com> Date: Mon, 16 Nov 2026 02:35:53 +0530 Subject: [PATCH 01/19] fix: let the page choose the discussions heading size (cherry picked from commit d791cea0a71b1f3b4c01e8e0b38e73ca8c6aaa86) --- frontend/src/components/Discussions.vue | 10 ++++++--- frontend/src/pages/Batches/BatchDetail.vue | 1 + frontend/src/tests/Discussions.test.ts | 26 ++++++++++++++++++---- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Discussions.vue b/frontend/src/components/Discussions.vue index 707b2a87af..447d450d30 100644 --- a/frontend/src/components/Discussions.vue +++ b/frontend/src/components/Discussions.vue @@ -12,9 +12,7 @@
{{ __(title) }}
@@ -174,6 +172,12 @@ const props = defineProps({ type: Boolean, default: false, }, + // The page that places this decides how prominent its heading is. + headingSize: { + type: String, + default: '2xl', + validator: (size) => ['lg', '2xl'].includes(size), + }, }) onMounted(() => { diff --git a/frontend/src/pages/Batches/BatchDetail.vue b/frontend/src/pages/Batches/BatchDetail.vue index e018740d8e..bba69ca3e0 100644 --- a/frontend/src/pages/Batches/BatchDetail.vue +++ b/frontend/src/pages/Batches/BatchDetail.vue @@ -86,6 +86,7 @@ doctype="LMS Batch" :docname="batch.data.name" :title="__('Discussions')" + heading-size="lg" :key="batch.data.name" :singleThread="true" :scrollToBottom="false" diff --git a/frontend/src/tests/Discussions.test.ts b/frontend/src/tests/Discussions.test.ts index 91f3652917..5b318a4087 100644 --- a/frontend/src/tests/Discussions.test.ts +++ b/frontend/src/tests/Discussions.test.ts @@ -34,7 +34,11 @@ const TOPICS = [ // pieces Discussions uses. // Each mount gets this resource; a test can swap it for one that loads later. let resource: { data?: typeof TOPICS; reload: () => void; refresh: () => void } -const loadedResource = () => ({ data: TOPICS, reload: vi.fn(), refresh: vi.fn() }) +const loadedResource = () => ({ + data: TOPICS, + reload: vi.fn(), + refresh: vi.fn(), +}) vi.mock('frappe-ui', () => ({ Button: { template: '' }, createResource: () => resource, @@ -66,9 +70,14 @@ String.prototype.format = function (...args: unknown[]) { return this.replace(/\{(\d+)\}/g, (_: string, i: number) => String(args[i])) } -const mountDiscussions = () => +const mountDiscussions = (props: Record = {}) => mount(Discussions, { - props: { title: 'Questions', doctype: 'Course Lesson', docname: 'L1' }, + props: { + title: 'Questions', + doctype: 'Course Lesson', + docname: 'L1', + ...props, + }, global: { provide: { $socket: { on: vi.fn(), off: vi.fn() }, @@ -80,7 +89,9 @@ const mountDiscussions = () => // jsdom has no matchMedia, so each test that needs one adds it and it is removed after. const setWideScreen = (wide: boolean) => { - window.matchMedia = (() => ({ matches: wide })) as unknown as typeof window.matchMedia + window.matchMedia = (() => ({ + matches: wide, + })) as unknown as typeof window.matchMedia } describe('Discussions master-detail', () => { @@ -141,4 +152,11 @@ describe('Discussions master-detail', () => { expect(rows[0].classes()).toContain('bg-surface-gray-2') expect(rows[1].classes()).not.toContain('bg-surface-gray-2') }) + + it('takes its heading size from the page, not from the doctype', async () => { + const heading = (props: Record) => + mountDiscussions(props).find('.text-ink-gray-9').classes() + expect(heading({ doctype: 'LMS Batch' })).toContain('text-2xl-semibold') + expect(heading({ headingSize: 'lg' })).toContain('text-lg-semibold') + }) }) From f364b132330494b16d6cd0f46fa402c66cbde050 Mon Sep 17 00:00:00 2001 From: Raizaaa <89463672+raizasafeel@users.noreply.github.com> Date: Mon, 16 Nov 2026 02:35:53 +0530 Subject: [PATCH 02/19] fix: show every form's refusal and loading state through FormShell (cherry picked from commit 4dbf303219c1e5e0c623918ae506fa5eac1f18f8) # Conflicts: # frontend/src/pages/Programs/ProgramEnrollment.vue --- .../Enrollment/EnrollStudentsForm.vue | 19 +++---- frontend/src/components/FormShell.vue | 47 +++++++++++++--- frontend/src/components/FormShellStatus.vue | 18 +++++++ .../src/components/Quiz/QuestionDialog.vue | 31 ++++------- frontend/src/pages/Forms/AnnouncementForm.vue | 35 ++++++------ frontend/src/pages/Forms/AssessmentForm.vue | 13 ++--- frontend/src/pages/Forms/AssignmentForm.vue | 51 +++++++++--------- frontend/src/pages/Forms/BatchCourseForm.vue | 13 ++--- .../src/pages/Forms/BulkCertificatesForm.vue | 35 ++++++------ frontend/src/pages/Forms/ChapterForm.vue | 34 ++++++------ frontend/src/pages/Forms/CourseImportForm.vue | 30 ++++++----- .../src/pages/Forms/EmailTemplateForm.vue | 13 ++--- frontend/src/pages/Forms/LiveClassForm.vue | 31 ++++------- frontend/src/pages/Forms/MemberForm.vue | 24 ++++----- frontend/src/pages/Forms/NewBatchForm.vue | 32 ++++++----- frontend/src/pages/Forms/NewCourseForm.vue | 32 ++++++----- frontend/src/pages/Forms/ProfileEditForm.vue | 30 +++++------ frontend/src/pages/Forms/ProgramForm.vue | 44 +++++++-------- .../src/pages/Programs/ProgramEnrollment.vue | 43 +++++++-------- frontend/src/tests/FormShell.test.ts | 53 ++++++++++++++++++- frontend/src/tests/enrollStudentsForm.test.ts | 1 + 21 files changed, 350 insertions(+), 279 deletions(-) create mode 100644 frontend/src/components/FormShellStatus.vue diff --git a/frontend/src/components/Enrollment/EnrollStudentsForm.vue b/frontend/src/components/Enrollment/EnrollStudentsForm.vue index 4ef170298a..de295dd305 100644 --- a/frontend/src/components/Enrollment/EnrollStudentsForm.vue +++ b/frontend/src/components/Enrollment/EnrollStudentsForm.vue @@ -3,6 +3,9 @@ :title="__('Enroll Students')" size="4xl" position="top" + :loading + :message="refusal" + :statusClass="bodyHeight" @close="onClose" > @@ -25,16 +28,10 @@
-
- {{ __('Loading...') }} -
-
- {{ refusal }} -
-