From 34c0d16411d1beff6ae673f60f19e5ac188c12c6 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 6 Oct 2025 10:33:50 +0530 Subject: [PATCH] refactor: changed Certified Members to Certifications --- frontend/src/components/Settings/Settings.vue | 4 ++-- frontend/src/utils/index.js | 2 +- lms/lms/api.py | 2 +- lms/lms/doctype/lms_settings/lms_settings.json | 18 +++++++++--------- lms/patches.txt | 1 + .../certified_members_to_certifications.py | 8 ++++++++ 6 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 lms/patches/v2_0/certified_members_to_certifications.py diff --git a/frontend/src/components/Settings/Settings.vue b/frontend/src/components/Settings/Settings.vue index 8c0feabe..57c40f3e 100644 --- a/frontend/src/components/Settings/Settings.vue +++ b/frontend/src/components/Settings/Settings.vue @@ -336,8 +336,8 @@ const tabsStructure = computed(() => { type: 'checkbox', }, { - label: 'Certified Members', - name: 'certified_members', + label: 'Certifications', + name: 'certifications', type: 'checkbox', }, { diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 56ef3a59..fb24c9f7 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -422,7 +422,7 @@ export function getSidebarLinks() { activeFor: ['Batches', 'BatchDetail', 'Batch', 'BatchForm'], }, { - label: 'Certified Members', + label: 'Certifications', icon: 'GraduationCap', to: 'CertifiedParticipants', activeFor: ['CertifiedParticipants'], diff --git a/lms/lms/api.py b/lms/lms/api.py index 1fc45fbf..11f025a9 100644 --- a/lms/lms/api.py +++ b/lms/lms/api.py @@ -507,7 +507,7 @@ def get_sidebar_settings(): items = [ "courses", "batches", - "certified_members", + "certifications", "jobs", "statistics", "notifications", diff --git a/lms/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json index 36a94e5b..9f29a730 100644 --- a/lms/lms/doctype/lms_settings/lms_settings.json +++ b/lms/lms/doctype/lms_settings/lms_settings.json @@ -35,8 +35,8 @@ "items_in_sidebar_section", "courses", "batches", - "certified_participants", "certified_members", + "certifications", "programming_exercises", "column_break_exdz", "jobs", @@ -279,13 +279,6 @@ "fieldtype": "Check", "label": "Batches" }, - { - "default": "1", - "fieldname": "certified_participants", - "fieldtype": "Check", - "hidden": 1, - "label": "Certified Participants" - }, { "default": "1", "fieldname": "jobs", @@ -403,6 +396,7 @@ "default": "0", "fieldname": "certified_members", "fieldtype": "Check", + "hidden": 1, "label": "Certified Members" }, { @@ -439,13 +433,19 @@ "fieldname": "contact_us_url", "fieldtype": "Data", "label": "Contact Us URL" + }, + { + "default": "0", + "fieldname": "certifications", + "fieldtype": "Check", + "label": "Certifications" } ], "grid_page_length": 50, "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2025-10-03 17:41:30.904723", + "modified": "2025-10-06 10:27:41.117864", "modified_by": "sayali@frappe.io", "module": "LMS", "name": "LMS Settings", diff --git a/lms/patches.txt b/lms/patches.txt index 2a028ad0..0426a4d9 100644 --- a/lms/patches.txt +++ b/lms/patches.txt @@ -112,3 +112,4 @@ lms.patches.v2_0.move_batch_instructors_to_evaluators lms.patches.v2_0.enable_programming_exercises_in_sidebar lms.patches.v2_0.count_in_program lms.patches.v2_0.fix_scorm_lesson_reference_idx #02-09-2025 +lms.patches.v2_0.certified_members_to_certifications #05-10-2025 \ No newline at end of file diff --git a/lms/patches/v2_0/certified_members_to_certifications.py b/lms/patches/v2_0/certified_members_to_certifications.py new file mode 100644 index 00000000..fdfb1b85 --- /dev/null +++ b/lms/patches/v2_0/certified_members_to_certifications.py @@ -0,0 +1,8 @@ +import frappe + + +def execute(): + show_certifications = frappe.db.get_single_value("LMS Settings", "certified_members") + + if show_certifications: + frappe.db.set_single_value("LMS Settings", "certifications", 1)